Has anyone else noticed a discrepancy between the file command in mel and in
python in relation to importing file references?
*pm.cmds.file(referenceNode=ref.refNode, importReference=True)  #Where ref
is derived from pm.listReferences()*


# Traceback (most recent call last):

# File
"/tmp/TOOLS_INSTALL/cent5_x86_64_py26/MayaAssets-Project/MayaAssets/library/maya/python/importComponentReference.py",
line 127, in importComponentReferences

# pm.cmds.file(importReference=True,referenceNode=ref.refNode)

# TypeError: Flag 'referenceNode' must be passed a boolean argument


Is Pymel a bit stricter now?  I could of sworn this used to work. I have to
resort to the following mel

 *pm.mel.eval("file -importReference -referenceNode " + ref.refNode)*


The docs say it takes a boolean, but the mel code for importing a reference
within the reference editor uses a reference node name *
scripts/others/referenceEditorPanel.mel*


*if ( $numNodes >= $numFiles ) {
        int $i = 0;
        for ( $i = 0; $i < $numNodes; $i++ ) {
            if ( size($selRefNode[$i]) > 0 ) {
                file -importReference -referenceNode $selRefNode[$i];
            }
        }
    } else {
        int $i = 0;
        for ( $i = 0; $i < $numFiles; $i++ ) {
            if ( size($selFileReal[$i]) > 0 ) {
                file -importReference $selFileReal[$i];
            }
        }
    }
*
Justin

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to