Skip to content

Commit

Permalink
Shifter: addBlade new arg to set a custom worldup
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcampos committed Jun 26, 2024
1 parent 894a320 commit 442de07
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions release/scripts/mgear/shifter/component/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def addLocMulti(self, name, parent, updateParent=True):
i += 1
return locs

def addBlade(self, name, parentPos, parentDir):
def addBlade(self, name, parentPos, parentDir, wUp=None):
"""Add a blade object to the guide.
This mehod can initialize the object or draw it.
Expand All @@ -792,9 +792,10 @@ def addBlade(self, name, parentPos, parentDir):
name (str): Local name of the element.
parentPos (dagNode): The parent of the element.
parentDir (dagNode): The direction constraint of the element.
wUp (dagNode, optional): world up node. If None will be self.root
Returns:
dagNode: The created blade curve.
dagNode: The created blade curve.
"""
if name not in self.blades.keys():
Expand All @@ -805,6 +806,9 @@ def addBlade(self, name, parentPos, parentDir):
else:
offset = True

if not wUp:
wUp = self.root

blade = icon.guideBladeIcon(
parent=parentPos,
name=self.getName(name),
Expand All @@ -818,7 +822,7 @@ def addBlade(self, name, parentPos, parentDir):
axis="xy",
wupType=2,
wupVector=[0, 1, 0],
wupObject=self.root,
wupObject=wUp,
maintainOffset=offset,
)
pnt_cns = pm.pointConstraint(parentPos, blade)
Expand Down

0 comments on commit 442de07

Please sign in to comment.