fix: SG-40934: Defer -eval/-pyeval until display groups exist - #1384
Open
cedrik-fuoco-adsk wants to merge 1 commit into
Open
Conversation
cedrik-fuoco-adsk
requested review from
bernie-laberge and
eloisebrosseau
as code owners
August 20, 2026 14:22
The -eval and -pyeval command line expressions were evaluated from RvSession::postInitialize(), which runs while the RvDocument is still being constructed. The RVDisplayGroup nodes are only created later, in RvApplication::newSessionFromFiles(), so any source added by those expressions had no display group for the source setup packages to configure and its view settings were silently left unset. Split the evaluation out of postInitialize() into RvSession::evalCommandLineScripts() and call it at the end of newSessionFromFiles(), once the display groups exist and the session is initialized. The headless rvio and MovieRV paths call it right after postInitialize(), preserving their current timing. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
cedrik-fuoco-adsk
force-pushed
the
SG-40934-media-cli-bad-view-setting
branch
from
August 20, 2026 14:31
5c109e0 to
a35bb91
Compare
bernie-laberge
approved these changes
Aug 20, 2026
bernie-laberge
left a comment
Contributor
There was a problem hiding this comment.
Nice !
Thank you @cedrik-fuoco-adsk !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SG-40934: Defer -eval/-pyeval evaluation until display groups exist
Linked issues
SG-40934
Summarize your change.
The
-eval(Mu) and-pyeval(Python) command line expressions are no longer evaluated fromRvSession::postInitialize(). They are split out into a newRvSession::evalCommandLineScripts()method, which the interactive path calls at the end ofRvApplication::newSessionFromFiles(). AftersetPhysicalDevices()has created the display groups and the session is initialized.Describe the reason for the change.
postInitialize()runs while theRvDocumentis still being constructed, well beforeRVDisplayGroupnodes exist. Only the defaultRVOutputGroupis present at that point. When media is loaded via-pyeval,source_setup.py'ssetDisplayFromProfile()looks for anRVDisplayGroup, finds none, and silently applies nothing — so the Display Transfer Function stays "None" instead of "sRGB".This is why enabling
RV_PROGRESSIVE_SOURCE_LOADING=1works around the bug: it defers the real media load to an async job, by which time the display groups exist. It also explains the regression window — progressive source loading was on by default before RV 2022.0.0.Fixing the ordering addresses the root cause, so no workaround is needed in
source_setup.py. It also fixes the same problem for-eval, and for the reported case of applyingflopto a source from the command line.Describe what you have tested and on which operating system.
rv -pyeval "from rv import commands;commands.addSourceVerbose(['some.mov'])"→ Display Transfer Function is "sRGB", with
RV_PROGRESSIVE_SOURCE_LOADINGunsetAdd a list of changes, and note any that might need special attention during the review.
RvApp/RvSession.h,RvApp/RvSession.cpp: newevalCommandLineScripts(); the-eval/-pyevallogic is moved verbatim out ofpostInitialize().RvCommon/RvDocument.cpp: no longer evaluates the expressions during sessionconstruction.
RvCommon/RvApplication.cpp: callsevalCommandLineScripts()at the end ofnewSessionFromFiles().rvio/main.cpp,MovieRV/MovieRV.cpp: call it immediately afterpostInitialize(). These are headless, have no display groups to wait for, andkeep their current timing.
Needs attention:
rv pyeval "addSourceVerbose(['a.mov'])" b.mov. Previously the expression ran first and its source was then wiped by theclear()inrebuildSessionFromFiles(), leaving onlyb.mov. Now both sources are loaded. Affects-evaland-pyevalequally.after-progressive-loadingblock rather than immediately aftersetPhysicalDevices(). That block is gated ons->loadTotal() == 0 && !files.empty(); evaluating earlier could changeloadTotal()and suppress an event that must close a previously emittedbefore-progressive-loading.rebuildSessionFromFiles()viasessionFromUrl) never calledpostInitialize(), so it already did not run-pyeval. That is unchanged here.m_initEvalclears itself after running whilem_pyInitEvaldoes not, so-evalis effectively once-per-process and-pyevalis per-session, despite both being documented as "at every session start".