Skip to content

Fix dagmenu right-click crash on Maya 2025#625

Open
BramVR wants to merge 3 commits intomgear-dev:masterfrom
BramVR:fix/dagmenu-crash-maya2025
Open

Fix dagmenu right-click crash on Maya 2025#625
BramVR wants to merge 3 commits intomgear-dev:masterfrom
BramVR:fix/dagmenu-crash-maya2025

Conversation

@BramVR
Copy link

@BramVR BramVR commented Mar 12, 2026

Summary

Changes

pickWalk.py — get_all_tag_children

Replace cmds.controller(query=True, children=True) with direct cmds.listConnections traversal of controller tag .children and .controllerObject attributes. cmds.controller has a C++ bug in Maya 2025 that segfaults on certain controller tag nodes. Also adds a seen_tags set to prevent infinite loops from circular tag references.

dagmenu.py — _get_switch_node_attrs

Add attribute type check to skip string/typed attributes, since space-switch attributes are always enum or numeric. String attributes like guide_loc_ref ending in "ref" were matching as false positives.

dagmenu.py — space-switch menu builder

Add null guard on cmds.addAttr(query=True, enumName=True) result before calling .split(":"). Non-enum attributes return None, causing an AttributeError.

Testing

Tested with Maya 2025 on a production rig with full controller tag hierarchy (body → spine → neck → arms → hands → fingers). Right-click menu works correctly on all control types (body, spine, arm, single and multi-selection).

BramVR added 2 commits March 12, 2026 20:52
cmds.controller(query=True, children=True) causes a C++ segfault in
Maya 2025 when traversing certain controller tag nodes. This crashes
Maya with no Python traceback, making it uncatchable by try/except.

Replace cmds.controller with direct cmds.listConnections traversal of
the controller tag .children and .controllerObject attributes. Also
adds a seen_tags set to prevent infinite loops from circular tag
references.
_get_switch_node_attrs matches any keyable user-defined attribute
ending with "ref" or "follow", but does not check attribute type.
String attributes like guide_loc_ref match and cause downstream
errors when the menu builder calls enumName on a non-enum attribute,
resulting in a NoneType.split(":") crash.

Add attribute type filter to skip string/typed attributes, and add a
null guard on the enumName query result before calling .split(":").
Copilot AI review requested due to automatic review settings March 12, 2026 19:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Maya 2025 right-click dagmenu crashes by avoiding a Maya 2025 cmds.controller segfault during controller tag traversal, and by preventing non-enum/string attributes from being treated as space-switch attributes when building the menu.

Changes:

  • Reworked get_all_tag_children() to traverse controller tags via cmds.listConnections() (with cycle protection) instead of cmds.controller().
  • Updated _get_switch_node_attrs() to skip string/typed attributes to avoid false-positive space-switch matches.
  • Added a guard for enumName being None before splitting, avoiding an AttributeError in the space-switch menu builder.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
release/scripts/mgear/core/pickWalk.py Replaces cmds.controller traversal with listConnections traversal + cycle protection to avoid Maya 2025 C++ segfault.
release/scripts/mgear/core/dagmenu.py Filters non-switch attribute types earlier and guards enum parsing to prevent incorrect menu items / runtime errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

If the same child tag is connected from multiple parent tags, it
could be queued and processed multiple times. Mark it as seen
immediately when encountered instead of only when processed.
@miquelcampos miquelcampos self-assigned this Mar 13, 2026
@github-project-automation github-project-automation bot moved this to To Do in mGear DEV Mar 13, 2026
@miquelcampos miquelcampos moved this from To Do to WIP in mGear DEV Mar 13, 2026
@miquelcampos miquelcampos moved this from WIP to To Do in mGear DEV Mar 13, 2026
@miquelcampos miquelcampos moved this from To Do to Pending Review in mGear DEV Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

dagmenu _get_switch_node_attrs matches string attributes as space-switch attrs cmds.controller segfault crashes Maya 2025 on dagmenu right-click

3 participants