PDA

View Full Version : Loading nodePresets


fallenrelics
12-14-2010, 05:19 PM
I am trying to load a mental ray preset for 'defaultRenderGlobals', [made from the render settings window-> presets ->save settings as preset] but if I have Maya Software selected as my renderer I get:

cmds.nodePreset(load=["defaultRenderGlobals", "ibltest"])
// Error: file: C:/Program Files/Autodesk/Maya2011/scripts/others/createMayaSoftwareCommonGlobalsTab.mel line 45: setParent: Object 'mentalRayTabLayout' not found. //

I still get an error if I try:
cmds.setAttr("defaultRenderGlobals.currentRenderer", "mentalRay", type="string")
cmds.nodePreset(load=["defaultRenderGlobals", "ibltest"])

However, if I run:
cmds.setAttr("defaultRenderGlobals.currentRenderer", "mentalRay", type="string")
followed by seperately:
cmds.nodePreset(load=["defaultRenderGlobals", "ibltest"])
Everything works. But I need to run them from one script.

Does anyone know of a way to run each line independently, or another way to load the preset without causing errors. I have also tried this with a refresh to no avail.

fallenrelics
12-29-2010, 04:52 PM
cmds.setAttr("defaultRenderGlobals.currentRenderer", "mentalRay", type="string") cmds.evalDeferred("cmds.nodePreset(load=[\"defaultRenderGlobals\", \"newPSTest\"])", lowestPriority=1)


Using evalDeffered works. Although it would still be nice know of a way to suspend errors since scriptEditorInfo no longer does so.

CGTalk Moderation
12-29-2010, 04:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.