Optional viewport refresh on pointcache extraction

This commit is contained in:
Toke Stuart Jepsen 2022-11-28 09:32:14 +00:00
parent f0ece4b778
commit a2abcd2524
2 changed files with 10 additions and 1 deletions

View file

@ -28,6 +28,7 @@ class CreatePointCache(plugin.Creator):
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"] = ""

View file

@ -86,13 +86,21 @@ class ExtractAlembic(publish.Extractor):
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"] = []