How to get the swapNamespace flag to work with cmds file import in Maya

399 Views Asked by At

According to the documentation - https://download.autodesk.com/us/maya/2011help/CommandsPython/file.html#flagswapNamespace

..The command should look something like this,

cmds.file('E:\Stuff\ASSET.FBX', i=True, swapNamespace=['ASSET','Taco'])

It successfully imports ASSET.FBX as ASSET to my Outliner. But I'm always given this error:

Error: The -swapNamespace flag could not find the specified namespace to swap to: "Taco"

Does anyone see where I'm making my mistake? Or perhaps have a working example? I need this object renamed. Thanks you.

1

There are 1 best solutions below

0
Ben Souchet On

This error only means that there isn't elements in you set with namespace Taco.

If you goal is only to import your ASSET.FBX file with namespace ASSET then simply use the namespace parameter:

cmds.file('E:\Stuff\ASSET.FBX', import=True, namespace='ASSET')