# vray scripts

**URL:** <https://forums.chaos.com/t/vray-scripts/18747>\
**Category:** General\
**Created:** [September 5, 2008, 1:20pm UTC](https://forums.chaos.com/t/vray-scripts/18747 "2008-09-05T13:20:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![QuakeMarine1](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/quakemarine1/32/65698_2.png) [@QuakeMarine1](https://forums.chaos.com/u/QuakeMarine1)\
**Post date:** [September 5, 2008, 1:20pm UTC](https://forums.chaos.com/t/vray-scripts/18747/1 "2008-09-05T13:20:42Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![MoonDoggie](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/moondoggie/32/68517_2.png) [@MoonDoggie](https://forums.chaos.com/u/MoonDoggie)\
**Post date:** [September 5, 2008, 3:48pm UTC](https://forums.chaos.com/t/vray-scripts/18747/2 "2008-09-05T15:48:13Z")

</div>

Very easy, 2m script. incoming

---

<div class="post-metadata">

**Author:** ![MoonDoggie](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/moondoggie/32/68517_2.png) [@MoonDoggie](https://forums.chaos.com/u/MoonDoggie)\
**Post date:** [September 5, 2008, 6:10pm UTC](https://forums.chaos.com/t/vray-scripts/18747/3 "2008-09-05T18:10:40Z")

</div>

```auto

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

```

---

<div class="post-metadata">

**Author:** ![QuakeMarine1](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/quakemarine1/32/65698_2.png) [@QuakeMarine1](https://forums.chaos.com/u/QuakeMarine1)\
**Post date:** [September 5, 2008, 7:20pm UTC](https://forums.chaos.com/t/vray-scripts/18747/4 "2008-09-05T19:20:29Z")

</div>

thanks a bunch but by far too much script 🙂  
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)
