Skip to content

Commit

Permalink
Merge pull request #343 from joji2468ng/rotateOrderMetaData
Browse files Browse the repository at this point in the history
Made a metadata for rotateOrder
  • Loading branch information
miquelcampos committed Nov 20, 2023
2 parents a49c6ec + 1f0ce6b commit 20c829f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions release/scripts/mgear/core/anim_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,13 @@ def reset_all_keyable_attributes(dagnodes, *args): # @unusedVariable
keyable_attrs = cmds.listAttr(node, keyable=True)
reset_selected_channels_value([node], keyable_attrs)

rotOrder = "rotate_order"
if cmds.attributeQuery(rotOrder, node=node, exists=True):
intNum = cmds.getAttr("{}.{}".format(node, rotOrder))
if cmds.getAttr("{}.rotateOrder".format(node), lock=True):
continue
cmds.setAttr("{}.rotateOrder".format(node), intNum)


##################################################
# Transfer space
Expand Down
3 changes: 3 additions & 0 deletions release/scripts/mgear/core/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ def setRotOrder(node, s="XYZ"):
)
er.reorderIt(s)

if node.hasAttr("rotate_order"):
change_default_value(node.rotate_order, a.index(s))

node.setAttr("ro", a.index(s))
node.setAttr("rotate", er.x, er.y, er.z)

Expand Down
8 changes: 8 additions & 0 deletions release/scripts/mgear/shifter/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,14 @@ def addCtl(
value=self.options["side_center_name"],
)

attribute.addEnumAttribute(
ctl,
"rotate_order",
0,
("xyz", "yzx", "zxy", "xzy", "yxz", "zyx"),
keyable=False
)

# create the attributes to handlde mirror and symetrical pose
attribute.add_mirror_config_channels(ctl, mirrorConf)
if add_2_grp:
Expand Down

0 comments on commit 20c829f

Please sign in to comment.