mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #4201 from tokejepsen/enhancement/maya_pointcache
This commit is contained in:
commit
ebc5eda1ae
2 changed files with 11 additions and 5 deletions
|
|
@ -128,13 +128,18 @@ def get_main_window():
|
|||
|
||||
@contextlib.contextmanager
|
||||
def suspended_refresh(suspend=True):
|
||||
"""Suspend viewport refreshes"""
|
||||
original_state = cmds.refresh(query=True, suspend=True)
|
||||
"""Suspend viewport refreshes
|
||||
|
||||
cmds.ogs(pause=True) is a toggle so we cant pass False.
|
||||
"""
|
||||
original_state = cmds.ogs(query=True, pause=True)
|
||||
try:
|
||||
cmds.refresh(suspend=suspend)
|
||||
if suspend and not original_state:
|
||||
cmds.ogs(pause=True)
|
||||
yield
|
||||
finally:
|
||||
cmds.refresh(suspend=original_state)
|
||||
if suspend and not original_state:
|
||||
cmds.ogs(pause=True)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ class ExtractAlembic(publish.Extractor):
|
|||
start=start,
|
||||
end=end))
|
||||
|
||||
with suspended_refresh(suspend=instance.data.get("refresh", False)):
|
||||
suspend = not instance.data.get("refresh", False)
|
||||
with suspended_refresh(suspend=suspend):
|
||||
with maintained_selection():
|
||||
cmds.select(nodes, noExpand=True)
|
||||
extract_alembic(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue