From 1e49b7c87c4d8adad4c6b468ee9adbb8c391af4a Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 30 Dec 2021 14:45:51 +0100 Subject: [PATCH] Do not keep fixed geometry vertices selected/active after repair --- .../hosts/maya/plugins/publish/validate_shape_zero.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/validate_shape_zero.py b/openpype/hosts/maya/plugins/publish/validate_shape_zero.py index 2c594ef5f3..acc42f073a 100644 --- a/openpype/hosts/maya/plugins/publish/validate_shape_zero.py +++ b/openpype/hosts/maya/plugins/publish/validate_shape_zero.py @@ -4,6 +4,8 @@ import pyblish.api import openpype.api import openpype.hosts.maya.api.action +from avalon.maya import maintained_selection + class ValidateShapeZero(pyblish.api.Validator): """shape can't have any values @@ -47,8 +49,12 @@ class ValidateShapeZero(pyblish.api.Validator): @classmethod def repair(cls, instance): invalid_shapes = cls.get_invalid(instance) - for shape in invalid_shapes: - cmds.polyCollapseTweaks(shape) + if not invalid_shapes: + return + + with maintained_selection(): + for shape in invalid_shapes: + cmds.polyCollapseTweaks(shape) def process(self, instance): """Process all the nodes in the instance "objectSet"""