open maya scene with "load no references"

850 views
Skip to first unread message

gnn

unread,
May 29, 2018, 3:07:44 PM5/29/18
to Python Programming for Autodesk Maya
Hello all,
i don't know why maya open a scene in python with this part of a script:

# open maya scene:
cmds.file( sceneNameToOpen, open=True, force=True, prompt=False ) 
# result:"D:\scenePath\SceneName.ma"

and didn't open it when i test without references and selective preload (it seems to delete slashes?!):

# open maya scene without references: 
cmds.file( sceneNameToOpen, lrd = 'none' , buildLoadSettings=True ,open=True , force=True, prompt=False )
cmds.optionVar(stringValue=('preloadRefEdTopLevelFile', sceneNameToOpen))
mel.eval('PreloadReferenceEditor;')
# Error: line 1: File not found: "D:scenePath SceneName.ma" // 

any idea is welcome :)

Justin Israel

unread,
May 29, 2018, 3:35:10 PM5/29/18
to python_in...@googlegroups.com
Whay is the value of sceneNameToOpen? Have you tried it with forward slashes? 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ab927de3-813a-4abd-852d-9c170dfc287a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gnn

unread,
May 29, 2018, 5:21:55 PM5/29/18
to Python Programming for Autodesk Maya
Hello Justin,
sceneNameToOpen is a variable like this:
root = '{0}{1}\\shots\\sh{2}\\lit\\work\\maya\\' .format(SBpath,SceneEpisodeField,ScenePlanField).replace('/','\\')
...after founded the last maya scene by date, the path of the scene to open give me that:
D:\SBpath\ep000\shots\sh000\lit\work\maya\ep000_sh000_lit_000.ma
so the path is ok i think as it open it with the simple command: 
cmds.file( sceneNameToOpen, open=True, force=True, prompt=False ) 
it doesn't find the same scene if i try to open it with the option load no references....
Reply all
Reply to author
Forward
0 new messages