Skip to content

[BUG] Rig not deleted when using confirmPop=False in delete_rig_keep_joints()Β #527

@Yuri-BP

Description

@Yuri-BP

🐞 Bug Report

Description

The function delete_rig_keep_joints() does not execute when confirmPop=False is passed β€” the rig is not deleted.

Steps to Reproduce

  1. Ensure a rig exists in the scene.
  2. Run the following code:
from mgear.shifter import game_tools_disconnect
game_tools_disconnect.delete_rig_keep_joints(confirmPop=False)

Expected Behavior

Even when calling delete_rig_keep_joints(confirmPop=False), I expected the process to proceed without a popup and still delete the rig while preserving the joints.

Actual Behavior

The Script Editor outputs:

# Cancelled

The function seems to exit early, and the rig is not deleted.

Maya Version

  • Maya Version: 2025.3
  • OS: Windows 10

mGear Version

  • mGear Version: 5.0.7

Additional Context

I believe the function could be improved by ensuring confirm = True when confirmPop=False, like in the following logic:

def delete_rig_keep_joints(confirmPop=True):
    confirm = False
    if confirmPop:
        # Should pop up confirmation dialog
        button_pressed = QtWidgets.QMessageBox.question(
            pyqt.maya_main_window(), "Warning", "Delete Rigs in the scene?"
        )
        if button_pressed == QtWidgets.QMessageBox.Yes:
            confirm = True
        else:
            pm.displayInfo("Cancelled")
            return
    else:
        confirm = True

Apologies if any parts of this report are unclear β€” it was originally written in Japanese and translated into English.
If this behavior is actually intentional, please feel free to disregard this report.
Thank you as always for your great work on mGear!

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