Merge pull request #214 from BigRoy/PLN-202

Suspend viewport during camera extraction (optimization)
This commit is contained in:
Roy Nieterau 2018-12-14 12:52:55 +01:00 committed by GitHub
commit eada832591
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 40 deletions

View file

@ -371,26 +371,6 @@ def evaluation(mode="off"):
cmds.evaluationManager(mode=original)
@contextlib.contextmanager
def no_refresh():
"""Temporarily disables Maya's UI updates
Note:
This only disabled the main pane and will sometimes still
trigger updates in torn off panels.
"""
pane = _get_mel_global('gMainPane')
state = cmds.paneLayout(pane, query=True, manage=True)
cmds.paneLayout(pane, edit=True, manage=False)
try:
yield
finally:
cmds.paneLayout(pane, edit=True, manage=state)
@contextlib.contextmanager
def empty_sets(sets, force=False):
"""Remove all members of the sets during the context"""

View file

@ -12,29 +12,14 @@ class CollectInstances(pyblish.api.ContextPlugin):
Identifier:
id (str): "pyblish.avalon.instance"
Supported Families:
avalon.model: Geometric representation of artwork
avalon.rig: An articulated model for animators.
A rig may contain a series of sets in which to identify
its contents.
- cache_SEL: Should contain cachable polygonal meshes
- controls_SEL: Should contain animatable controllers for animators
- resources_SEL: Should contain nodes that reference external files
Limitations:
- Only Maya is supported
- One (1) rig per scene file
- Unmanaged history, it is up to the TD to ensure
history is up to par.
avalon.animation: Pointcache of `avalon.rig`
Limitations:
- Does not take into account nodes connected to those
within an objectSet. Extractors are assumed to export
with history preserved, but this limits what they will
be able to achieve and the amount of data available
to validators.
to validators. An additional collector could also
append this input data into the instance, as we do
for `colorbleed.rig` with collect_history.
"""

View file

@ -67,7 +67,7 @@ class ExtractCameraAlembic(colorbleed.api.Extractor):
job_str += ' -file "{0}"'.format(path)
with lib.evaluation("off"):
with lib.no_refresh():
with avalon.maya.suspended_refresh():
cmds.AbcExport(j=job_str, verbose=False)
if "files" not in instance.data:

View file

@ -127,7 +127,7 @@ class ExtractCameraMayaAscii(colorbleed.api.Extractor):
self.log.info("Performing camera bakes for: {0}".format(transform))
with avalon.maya.maintained_selection():
with lib.evaluation("off"):
with lib.no_refresh():
with avalon.maya.suspended_refresh():
baked = lib.bake_to_world_space(
transform,
frame_range=range_with_handles,