Skip to content
Open
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
14 changes: 12 additions & 2 deletions release/scripts/mgear/core/dagmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ def _get_switch_node_attrs(node, end_string):
"{}.{}".format(node, attr), query=True, usedAsProxy=True
):
continue
# Skip string attributes — switch/blend attrs are enum or numeric
attr_type = cmds.attributeQuery(
attr, node=node, attributeType=True
)
if attr_type in ("string", "typed"):
continue
attrs.append(attr)
return attrs

Expand Down Expand Up @@ -1136,9 +1142,13 @@ def add_menu_items(attrs, attr_extension="_blend"):
image="dynamicConstraint.svg",
)
cmds.radioMenuItemCollection(parent=_p_switch_menu)
k_values = cmds.addAttr(
enum_name = cmds.addAttr(
"{}.{}".format(uih, attr), query=True, enumName=True
).split(":")
)
if not enum_name:
cmds.deleteUI(_p_switch_menu)
continue
k_values = enum_name.split(":")
current_state = cmds.getAttr("{}.{}".format(uih, attr))

combo_box = QtWidgets.QComboBox()
Expand Down
46 changes: 32 additions & 14 deletions release/scripts/mgear/core/pickWalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,47 @@
def get_all_tag_children(node):
"""Gets all child tag controls from the given tag node

Traverses controller tag hierarchy using listConnections instead of
cmds.controller, which can segfault in Maya 2025 on certain
controller tag nodes.

Args:
node (str): Name of controller object with tag

Returns:
list: List of child controls (Maya transform nodes)
"""

# store child nodes
children = []

# gets first child control
child = cmds.controller(node, query=True, children=True)

# loop on child controller nodes to get all children
while child is not None:
children.extend(child)
tags = []
for c in child:
tag = cmds.ls(cmds.listConnections(c, type="controller"))
tags.extend(tag)
if cmds.listConnections("{}.parent".format(tag[0])) == node:
return children
child = cmds.controller(tags, query=True, children=True)
tags = cmds.ls(cmds.listConnections(node, type="controller"))
if not tags:
return children

current_tags = tags
seen_tags = set()
while current_tags:
next_tags = []
for tag in current_tags:
if tag in seen_tags:
continue
seen_tags.add(tag)
child_tags = cmds.listConnections(
"{}.children".format(tag), type="controller"
)
if not child_tags:
continue
for ct in child_tags:
if ct in seen_tags:
continue
seen_tags.add(ct)
ctl = cmds.listConnections(
"{}.controllerObject".format(ct)
)
if ctl:
children.extend(ctl)
next_tags.append(ct)
current_tags = next_tags

return children

Expand Down