Speed up polyConstraint context by not re-evaluating at the end of the context

This commit is contained in:
Roy Nieterau 2017-12-12 16:44:28 +01:00
parent 7e6b558410
commit ac4626dfd6

View file

@ -338,9 +338,10 @@ def polyConstraint(components, *args, **kwargs):
# it applies to the selection made before it; because just
# a `maya.cmds.select()` call will not trigger the constraint.
with reset_polySelectConstraint():
cmds.select(components, r=1)
cmds.select(components, r=1, noExpand=True)
cmds.polySelectConstraint(*args, mode=2, **kwargs)
result = cmds.ls(selection=True)
cmds.select(clear=True)
return result