diff options
| author | MobileMachine\jeremy <[email protected]> | 2017-06-06 22:59:03 -0400 |
|---|---|---|
| committer | MobileMachine\jeremy <[email protected]> | 2017-06-06 22:59:03 -0400 |
| commit | 24725fa8681f906ab44d80687c09fecc171a2896 (patch) | |
| tree | 312a601df29aca7f8db9f44082d96ebc7a679138 /Core/Scripts/System/ART_StripFbxNamespace.py | |
| parent | Initial commit (diff) | |
| download | artv2-24725fa8681f906ab44d80687c09fecc171a2896.tar.xz artv2-24725fa8681f906ab44d80687c09fecc171a2896.zip | |
Initial Submission
First submission of current state of ARTv2. Currently considered to be in Alpha. There are a couple of animation tools not implemented yet, and one module not implemented yet, as well as incomplete documentation.
Diffstat (limited to 'Core/Scripts/System/ART_StripFbxNamespace.py')
| -rw-r--r-- | Core/Scripts/System/ART_StripFbxNamespace.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Core/Scripts/System/ART_StripFbxNamespace.py b/Core/Scripts/System/ART_StripFbxNamespace.py new file mode 100644 index 0000000..f223c58 --- /dev/null +++ b/Core/Scripts/System/ART_StripFbxNamespace.py @@ -0,0 +1,40 @@ +import sys +import maya.standalone as std +std.initialize(name = 'python') +import maya.cmds as cmds +import maya.mel as mel +filename = sys.argv[1] + +def stripNamespace(filename): + + try: + #open the file + cmds.loadPlugin("fbxmaya.mll") + string = "FBXImportMode -v \"add\";" + string += "FBXImport -file \"" + filename + "\"" + string += "FBXImportFillTimeline -v true" + mel.eval(string) + + + #remove the namespace + cmds.namespace(setNamespace = "::") + currentNamespaces = cmds.namespaceInfo(listOnlyNamespaces = True) + + restricted = ['UI', 'shared'] + + for namespace in currentNamespaces: + if namespace not in restricted: + cmds.namespace(mv = (':' + namespace, ':'), force = True) + cmds.namespace(removeNamespace = namespace) + + #re-export the file + mel.eval("FBXExport -f \""+ filename +"\"") + + #exit + std.uninitialize() + + except Exception, e: + sys.stderr.write(str(e)) + sys.exit(-1) + +stripNamespace(filename)
\ No newline at end of file |