PDA

View Full Version : Script Mental Ray Bake ?


SUNCHIRP
10-18-2010, 02:40 AM
Hi,

I have been looking at the script editor and 'echoing all commands' when utilising Mental Rays bake options, but so far, I haven't been able to figure out a way of scripting the process - rather than opening the window each time, I have a UI and I want to add a button that will essentially be a 1 click ambient occlusion bake to vertices, and another button which will be a 1 click button to bake light / colour to vertices - I will have a third button which will call mental rays bake options dialog also ( for setting up colour sets, etc / changing options, etc ).

I need some help figuring out how to do the first two buttons via script only with the options I want set in each instance ?

Thanks.

ewerybody
10-18-2010, 10:32 AM
he Steven!

I don't know if I can help. But I once mada a tool to use the Mental Ray batch baker on a remote pc. The command was:
convertLightmapSetup from the Mayatomr.mll plugin.
There is nothing about that in the docs. But in some mr scripts somewhere.

Pardon me that I don't have decent info on it. Well it was already some years ago that I wrote this. Maybe it helps: the whole line to start the process wasconvertLightmapSetup -camera persp -sh -bakeSetOverride $tempBakeSet -keepOrgSG -showcpv;and I created this bakeset in the scene before via:string $tempBakeSet = convertBakeSetOptionVarToNode();hope that helps:D

SUNCHIRP
10-18-2010, 05:45 PM
Thanks, that's where I was at with it, but I couldn't figure out how to implement specific values, such as the occlusion rays, falloff, scale, filters, etc.

I'm still looking into it though, I'm sure I'll figure it out ! :)

Regards.

ewerybody
10-18-2010, 07:24 PM
These settings exist at the bakeset or at the appropriate optionVars.
Maybe you look up what that convertBakeSetOptionVarToNode in mrBake.mel does. Here its located at: C:\Program Files (x86)\Autodesk\Maya2009\scripts\others\mrBake.mel

I think I just let the artist set all the stuff in the standard mr-dialog and then he hits start, the script writes the settings to the bakeset and off it goes. And this dialog is script stuff only as well. There should be really everything about it in these settings. But I'm too lazy now to dig it up for you ;P

CGTalk Moderation
10-18-2010, 07:24 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.