Fix handling of hydra updates in batch renders #2155
Merged
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.
Changes proposed in this pull request
The changes introduced in #2079 were actually pretty wrong, and caused by a miss-understanding of what the function was doing. This PR reverts most of it, and adds the explanations and comments that were missing in the original code.
In the function I had renamed as
UpdateSceneChanges, some hydra primitives are marked as dirty. I thought the Sync function would be called immediately, thus updating the arnold scene, but it's actually called later on. So for clarity I'm renaming it asHasPendingChangeswhich tells us that a Sync call is going to happen shortly. In this case, we don't want to start the render just yet, cause we know the scene might change. For interactive renders it's not so bad because we can interrupt and restart the render to process the changes, but since we recently changes the arnold session to be "batch" in husk, this is preventing us from receiving some hydra notifications.Issues fixed in this pull request
Fixes #2154