Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made a metadata for rotateOrder #343

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading