Home Youtube GitHub

channelWrangler apply config from script fails due to attributeError


mgear 2.6.1

import mgear.maya.rigbits.channelWrangler as channelWrangler   

results in:

Error: AttributeError: file D:\Dropbox\maya\modules\mgear\scripts\mgear\maya\attribute.py line 292: 'unicode' object has no attribute 'name'` 

This should not happen? I could not find a reason why exactly this goes wrong. The cwc file seems to be valid.


Hi @fleity Thanks for the feedback, I will check this ASAP:

I have log it here: https://github.com/mgear-dev/rigbits/issues/8



Hi Miguel,
as always thanks for the support :slight_smile:

The error occurs because isinstance(sourceNode, str) does only check if it’s type string but the sourceNode is stored as unicode therefore the pynode conversion never takes place.

mgear.maya.attribute line 279 - 285

if isinstance(sourceNode, str):
    sourceNode = pm.PyNode(sourceNode)
if isinstance(targetNode, str):
    targetNode = pm.PyNode(targetNode)

    at = sourceNode.attr(attr)
    if pm.addAttr(at, q=True, usedAsProxy=True):
        pm.displayWarning("{} is a proxy channel and move operation is "
                          "not yet supported.".format(attr))

I changed

if isinstance(sourceNode, str):


if isinstance(sourceNode, str) or isinstance(sourceNode, unicode):

and everything works



Thanks also for this one!
I don’t know if you feel comfortable with git and github, but if you want to send a pull request with the fix. It will be super cool and very welcome! We need more contributors :wink:

Just let me know!