Hello there!
I’m using mGear 5.2.1 - just recently updated.
We are calling a few functions from mGear-rigbits from within our custom Maya tools (Python code) directly, to help us customizing rigs to our special needs - for example “replaceShape()”. This worked before the update, but now it is throwing an exception in Maya - for example this:
File “D:\p4\ArtTools\Maya\Modules\External\mGear\scripts\mgear\rigbits_init_.py”, line 426, in replaceShape
source2 = pm.duplicate(source)[0]
File “D:\p4\ArtTools\Maya\Modules\External\mGear\scripts\mgear\pymaya\cmd.py”, line 266, in wrapper > raise RuntimeError(
RuntimeError: Error occurred while calling wrapped function ‘maya.cmds.duplicate’: Object is invalid
Arguments: (nt.Transform(‘BreakFlap_R_Ctl_temp’),)
Keyword Arguments: {}
Command for debugging: maya.cmds.duplicate(nt.Transform(‘BreakFlap_R_Ctl_temp’), )
I tracked it down to the fact, that - as I believe - many commands (not only “duplicate”, but also “connectAttr”, “disconnectAttr” and a few more) in the new “mgear.pymaya” implementation require strings instead of PyNodes as input, now. However, even when I try to fix all the different places where this occurs by changing them to something like this “pm.duplicate(source.name())[0]”, I only get to the point, where I get an API error at the end - without any callstack, unfortunately.
For now I worked around that issue by changing the module import back to “import pymel.core as pm”. This works for us, because lots of other tools are still using pymel and we got it installed anyway.
Is this a known issue? Is there any other way to fix it, maybe?
Thanks for any feedback and your support!
Cheers
René