Skip to content

Commit

Permalink
freeze rotation when duplicating shape and reapplying shape (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Babin <[email protected]>
  • Loading branch information
guibab and Guillaume Babin authored Feb 13, 2024
1 parent 5c77745 commit 9a1a0ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/blurdeform/blurdeform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 9a1a0ed

Please sign in to comment.