From db58316748ecc405fe8b4ad6255b0a1bbb61add4 Mon Sep 17 00:00:00 2001 From: Guillaume Babin Date: Tue, 13 Feb 2024 08:34:21 -0800 Subject: [PATCH] freeze rotation when duplicating shape and reapplying shape --- scripts/blurdeform/blurdeform.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/blurdeform/blurdeform.py b/scripts/blurdeform/blurdeform.py index 89eb068..6b9bc92 100644 --- a/scripts/blurdeform/blurdeform.py +++ b/scripts/blurdeform/blurdeform.py @@ -631,6 +631,11 @@ def addNewFrame(self): self.refresh(selectTime=True, selTime=cmds.currentTime(q=True)) def doAddNewFrame(self, blurNode, currentGeom, targetMesh): + prt ,= cmds.listRelatives(targetMesh, parent=True, path=True) + cmds.parent(targetMesh, currentGeom) + cmds.makeIdentity(targetMesh, apply=True, translate=False, rotate=True, scale=False, normal=0, preserveNormals=True) + cmds.parent(targetMesh, prt) + poseName = cmds.getAttr(self.currentPose + ".poseName") listDeformationsFrame = self.getListDeformationFrames() @@ -1227,6 +1232,7 @@ def enterEditMode(self): nameSpaceSplit = geo.split(":") dupName = "EDIT_" + nameSpaceSplit[-1] dup = cmds.duplicate(geo, name=dupName)[0] + cmds.makeIdentity(dup, apply=True, translate=False, rotate=True, scale=False, normal=0, preserveNormals=True) cmds.addAttr(dup, longName="blurSculptNode", dataType="string") cmds.setAttr(dup + ".blurSculptNode", edit=True, keyable=True) cmds.setAttr(dup + ".blurSculptNode", self.currentBlurNode, type="string")