Skip to content

[BUG] The "Draw Component" in the right-click menu of the Shifter Guide Manager was incorrect when no component was selected. #528

@ordinc

Description

@ordinc

🐞 Bug Report

Description

The "Draw Component" in the right-click menu of the Shifter Guide Manager was incorrect when no component was selected.

Steps to Reproduce

  1. Deselect any component in the Maya scene, or deselect, or create a new scene.
  2. Select any component in the Shifter Guide Manager and right-click to select the "Draw Component" button.

Expected Behavior

The component selected in the manager should be created correctly in the scene.

Actual Behavior

The component is not created in the scene.

Maya Version

  • Maya Version: 2025
  • OS: Windows 11

mGear Version

  • mGear Version: mgear_5.0.7

Error Log Formatting

# Traceback (most recent call last):
#   File "\mgear_5.0.7\release\scripts\mgear\shifter\guide_manager_component.py", line 272, in draw_component
#     guide_manager.draw_comp(x.data(), parent, showUI)
#  \mgear_5.0.7\release\scripts\mgear\shifter\guide_manager.py", line 39, in draw_comp
#     guide.drawNewComponent(parent, comp_type, showUI)
#  \mgear_5.0.7\release\scripts\mgear\shifter\guide.py", line 824, in drawNewComponent
#     if parent_root.hasAttr("ismodel"):
#        ^^^^^^^^^^^^^^^^^^^
# AttributeError: 'bool' object has no attribute 'hasAttr'

Additional Context

After testing, the following adjustments can fix this error.

Rewrite

def draw_component(self, parent=None):

in guide_manager_component.py to

def draw_component(self, parent=None, *args):

or
rewrite

menu_item_01.triggered.connect(self.draw_component)

in _component_menu function to

menu_item_01.triggered.connect(lambda: self.draw_component())

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

5.1.0

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions