From ac4626dfd6551c9915654fd44aabb289ed70c815 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 12 Dec 2017 16:44:28 +0100 Subject: [PATCH] Speed up polyConstraint context by not re-evaluating at the end of the context --- colorbleed/maya/lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/colorbleed/maya/lib.py b/colorbleed/maya/lib.py index 28cc393da7..82ab58e5f4 100644 --- a/colorbleed/maya/lib.py +++ b/colorbleed/maya/lib.py @@ -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