🐞 Bug Report
Description
When using the Game Tools -> Game Tool Disconnect + Assembly IO feature in Maya 2027, the disconnection pipeline crashes with a RuntimeError due to a connection mismatch.
Through deep debugging, we found that the root cause lies in how mgear.pymaya.attr.Attribute.__getPlug() resolves indexed string attributes. In Maya 2027, OpenMaya.MSelectionList.add() enforces much stricter parsing rules for custom array/multi attributes on transform nodes (e.g., rig.rigGroups[3]) compared to native array attributes on objectSet nodes (e.g., rig_sets_grp.dnSetMembers[2]). It silently truncates or fails to parse the logical index for these custom transform attributes, returning a root/non-indexed MPlug.
This index loss propagates through the tool and eventually corrupts the connection data fed into cmds.disconnectAttr, leading to the failure.
Steps to Reproduce
- Open Maya 2027 under Windows.
- Build a standard Shifter Rig, or manually add a custom message array attribute to a transform node (e.g.,
rigGroups).
- Open
Game Tools -> Game Tool Disconnect + Assembly IO -> Disconnect and Export.
- Trigger the disconnection pipeline.
Expected Behavior
The tool should successfully identify the active logical indices of the multi-attributes and cleanly disconnect the rig components without throwing any errors.
Actual Behavior
The tool crashes mid-process and throws a RuntimeError: There is no connection from ... to ... to disconnect.
Maya Version
- Maya Version: Maya 2027 (Python 3.11+, OpenMaya 2.0)
- OS: Windows 11 / Windows 10
mGear Version
Error Log Formatting
Traceback (most recent call last):
File "C:\Users\Mick\Documents\maya\modules\scripts\mgear\shifter\game_tools_disconnect.py", line 766, in disconnectExport
exportAssetAssembly(
~~~~~~~~~~~~~~~~~~~^
name, rigTopNode, meshTopNode, path, postScript
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
File "C:\Users\Mick\Documents\maya\modules\scripts\mgear\core\utils.py", line 265, in wrap
raise e
File "C:\Users\Mick\Documents\maya\modules\scripts\mgear\core\utils.py", line 262, in wrap
return func(*args, **kwargs)
File "C:\Users\Mick\Documents\maya\modules\scripts\mgear\shifter\game_tools_disconnect.py", line 527, in exportAssetAssembly
pm.disconnectAttr(deformersGrp.message, cnx)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Mick\Documents\maya\modules\scripts\mgear\pymaya\cmd.py", line 756, in disconnectAttr
cmds.disconnectAttr(*args, **kwargs)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
RuntimeError: There is no connection from 'rig_deformers_grp.message' to 'rig_sets_grp.dnSetMembers' to disconnect
Additional Context
Note: The following debugging analysis and suggested patch are the results of my deep local debugging in collaboration with an AI assistant, provided here for your engineering reference.
Root Cause Analysis
The traceback highlights that pm.disconnectAttr(deformersGrp.message, cnx) fails because the target connection string cnx was incorrectly resolved. It should have been an indexed string like rig_sets_grp.dnSetMembers[2], but it became rig_sets_grp.dnSetMembers (missing the specific logical index [2]).
Inside mgear.pymaya.attr.Attribute (typically in attr.py or its wrapped __getPlug logic):
@staticmethod
def __getPlug(attrname):
Attribute.__selectionlist.clear()
try:
Attribute.__selectionlist.add(attrname) # <--- Truncates logical index for custom attributes in Maya 2027
except RuntimeError as e:
return None
return Attribute.__selectionlist.getPlug(0)
Looks like in Maya 2027's API 2.0 implementation, MSelectionList.add() implicitly drops the [x] index when processing custom-added message array attributes on non-set nodes, returning a non-indexed root MPlug.
🐞 Bug Report
Description
When using the
Game Tools -> Game Tool Disconnect + Assembly IOfeature in Maya 2027, the disconnection pipeline crashes with aRuntimeErrordue to a connection mismatch.Through deep debugging, we found that the root cause lies in how
mgear.pymaya.attr.Attribute.__getPlug()resolves indexed string attributes. In Maya 2027,OpenMaya.MSelectionList.add()enforces much stricter parsing rules for custom array/multi attributes ontransformnodes (e.g.,rig.rigGroups[3]) compared to native array attributes onobjectSetnodes (e.g.,rig_sets_grp.dnSetMembers[2]). It silently truncates or fails to parse the logical index for these custom transform attributes, returning a root/non-indexedMPlug.This index loss propagates through the tool and eventually corrupts the connection data fed into
cmds.disconnectAttr, leading to the failure.Steps to Reproduce
rigGroups).Game Tools -> Game Tool Disconnect + Assembly IO -> Disconnect and Export.Expected Behavior
The tool should successfully identify the active logical indices of the multi-attributes and cleanly disconnect the rig components without throwing any errors.
Actual Behavior
The tool crashes mid-process and throws a
RuntimeError: There is no connection from ... to ... to disconnect.Maya Version
mGear Version
Error Log Formatting
Additional Context
Note: The following debugging analysis and suggested patch are the results of my deep local debugging in collaboration with an AI assistant, provided here for your engineering reference.
Root Cause Analysis
The traceback highlights that pm.disconnectAttr(deformersGrp.message, cnx) fails because the target connection string cnx was incorrectly resolved. It should have been an indexed string like rig_sets_grp.dnSetMembers[2], but it became rig_sets_grp.dnSetMembers (missing the specific logical index [2]).
Inside mgear.pymaya.attr.Attribute (typically in attr.py or its wrapped __getPlug logic):
Looks like in Maya 2027's API 2.0 implementation, MSelectionList.add() implicitly drops the [x] index when processing custom-added message array attributes on non-set nodes, returning a non-indexed root MPlug.