This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 127
[QUAD] Maya Playblast Render: Fix capture when image plane sequence is used #6290
Open
BenSouchet
wants to merge
1
commit into
ynput:develop
Choose a base branch
from
quadproduction:bugfix/fix-review-video
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
|
||
from maya import cmds, mel | ||
from maya.api import OpenMaya | ||
from maya.plugin.evaluator.cache_preferences import CachePreferenceEnabled | ||
|
||
from openpype.client import ( | ||
get_project, | ||
|
@@ -180,10 +181,26 @@ def render_capture_preset(preset): | |
str: Output path of `capture.capture` | ||
""" | ||
|
||
# Bugfix: to avoid playblast generation issues with sequence image plane, | ||
# cached playblack need to be enabled | ||
# Firstly, save and switch the anim evaluation mode to parallel | ||
# (needed for the cached playback option) | ||
prev_evaluation_mode_info = cmds.evaluationManager(query=True, mode=True) | ||
# Switch to parallel | ||
cmds.evaluationManager(mode="parallel") | ||
# Then, save the current cachedPlayback value to be able to apply it again after playblast capture | ||
prev_cached_playblast_status = cmds.optionVar(query="cachedPlaybackEnable") | ||
# Force the value cachedPlayback value to ON | ||
cmds.optionVar(intValue=("cachedPlaybackEnable", 1)) | ||
|
||
# Force a refresh at the start of the timeline | ||
# TODO (Question): Why do we need to do this? What bug does it solve? | ||
# Is this for simulations? | ||
cmds.refresh(force=True) | ||
|
||
# Update the engine with the set value | ||
CachePreferenceEnabled().set_state_from_preference() | ||
|
||
refresh_frame_int = int(cmds.playbackOptions(query=True, minTime=True)) | ||
cmds.currentTime(refresh_frame_int - 1, edit=True) | ||
cmds.currentTime(refresh_frame_int, edit=True) | ||
|
@@ -208,6 +225,16 @@ def render_capture_preset(preset): | |
reload_all_udim_tile_previews() | ||
path = capture.capture(log=self.log, **preset) | ||
|
||
# Restoring the cached playback option value | ||
cmds.optionVar(intValue=("cachedPlaybackEnable", int(prev_cached_playblast_status))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line too long (88 > 79 characters) |
||
|
||
# Restore anim evaluation mode | ||
# (directly access index 0 sice it should be a list with a least one value) | ||
cmds.evaluationManager(mode=prev_evaluation_mode_info[0]) | ||
|
||
# Update the engine internal value for the cached playback option | ||
CachePreferenceEnabled().set_state_from_preference() | ||
|
||
return path | ||
|
||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (102 > 79 characters)