Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Optional viewport refresh on pointcache extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
tokejepsen committed Nov 28, 2022
1 parent f0ece4b commit a2abcd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions openpype/hosts/maya/plugins/create/create_pointcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self, *args, **kwargs):
self.data["visibleOnly"] = False # only nodes that are visible
self.data["includeParentHierarchy"] = False # Include parent groups
self.data["worldSpace"] = True # Default to exporting world-space
self.data["refresh"] = False # Default to suspend refresh.

# Add options for custom attributes
self.data["attr"] = ""
Expand Down
10 changes: 9 additions & 1 deletion openpype/hosts/maya/plugins/publish/extract_pointcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,21 @@ def process(self, instance):
start=start,
end=end))

with suspended_refresh():
if instance.data.get("refresh", False):
with maintained_selection():
cmds.select(nodes, noExpand=True)
extract_alembic(file=path,
startFrame=start,
endFrame=end,
**options)
else:
with suspended_refresh():
with maintained_selection():
cmds.select(nodes, noExpand=True)
extract_alembic(file=path,
startFrame=start,
endFrame=end,
**options)

if "representations" not in instance.data:
instance.data["representations"] = []
Expand Down

0 comments on commit a2abcd2

Please sign in to comment.