vray scripts

hiho

if i have to render an extern scene I must open and edit the save path for GI and some other setting
if loading need 5min i waste ages of livetime

how whould look a script wich run before render start to enable disable “dont render final image”
or “if GI enabled and GI = IRRmode set GI mode multiframe incremental and save path to X”

I wonder why Vray can not be accessed by render comandline directly
comparing to Maya and Final Render I can modifiy all importend FR settings directly via cmd
is there no way for Max n Vray but script ?

Very easy, 2m script. incoming


global VRayEnabled
global rlt_QuickRenderSetup
global isDontRenderFinalImage

fn VRayEnabled = ( if (matchPattern (renderers.current as string) pattern:"*V_Ray*" ignoreCase:true) then true else false )

try (destroyDialog rlt_QuickRenderSetup) catch ()

rollout rlt_QuickRenderSetup "Quick Render Setup" (
    checkBox chk_dontRenderFinalImage "Don't Render Final Image" checked:false
    button btn_Execute "Execute"

    on rlt_QuickRenderSetup open do (
        if VRayEnabled() then isDontRenderFinalImage = renderers.current.options_dontRenderImage

        chk_dontRenderFinalImage.checked = isDontRenderFinalImage
    )

    on chk_dontRenderFinalImage changed state do (
        isDontRenderFinalImage = state
    )

    on btn_Execute pressed do (
        if VRayEnabled() then (
            local vr = renderers.current
            renderSceneDialog.close()
            vr.options_dontRenderImage = isDontRenderFinalImage

            if vr.gi_on == false then (
                if (queryBox "Turn on GI?" title:"GI is currently off") then vr.gi_on = true
            )

            if vr.adv_irradmap_mode != 1 then (
                if (queryBox "Turn on Multiframe Incremental?" title:"Multiframe Incremental is current not on") then vr.adv_irradmap_mode = 1
            )

            if vr.gi_on and vr.adv_irradmap_mode == 1 then (
                -- GI is on and Irradiance map is set to "Multiframe Incremental"    
                if (local saveFilename = getSaveFileName caption:"Select where to save the Irradiance Map" types:"vrimg(*.vrimg)|*.vrimg") != undefined then (
                    vr.adv_irradmap_autoSave = true
                    vr.adv_irradmap_autoSaveFileName = saveFilename
                ) else messageBox "IMAP Save not set" beep:false
            )

        ) else messageBox "VRay not the current Renderer!" beep:false
    )
)
createDialog rlt_QuickRenderSetup 200 55

thanks a bunch but by far too much script :slight_smile:
i just like to run it via cmdline before render starts so

“renderers.current.options_dontRenderImage=true”
and
“renderers.current.options_dontRenderImage=false”

is enough to switch that

lets see if i can decrypt ur script to switch the GI modes and save path/name (will be passed from backburner to script before render starts)