i am still learning python so bear with me.
i need to import an fbx file into an existing scene.
i´ve tried multiply ways of importing, tho nothing worked so far.
what i`ve tried:
import maya.cmds as cmds
def setImport():
setImportPath = 'X:\Path_To_File.fbx'
cmds.file(setImportPath, i=True, mergeNamespacesOnClash=True, namespace=':');
setImport()
The error i get is:
# Error: RuntimeError: file <maya console> line 5: File not found. #
Next thing i tried was:
import maya.cmds as cmds
cmds.file( 'X:\Path_To_File.fbx', o = True )
The error i get is:
# Error: RuntimeError: file <maya console> line 4: File not found: "X: ath_to_File.fbx" #
Notice the space between the "X:" and the first letter? As well as the missing "P" of "path" ? Why is that? What am i missing here?
The first methode is working perfectly on ma/mb files, tho not with fbx.
Does anyone have an idea on how to solve this?
SOLVED:
I copied the file path from the windows explorer, but windows displays the path with backslashes. I changed the backslashes to slashes and now the fbx import works. silly me!