please help to uprgade useful script
here i had useful script to set render output filename directly from toolbar, but it is working only for PSD files. could anyone correct this script in order to set *.exr - V-Ray raw image file
<code>rollout psdmRoll "" width:320 height:34
(
fn get_psdm_index = (
local eff_index
for eff_index = 1 to numEffects do(
eff = getEffect eff_index
if (classOf(eff) == psd_manager) then return eff_index
)
return undefined
)--fn get_psdm_index
fn get_psdm_filename = (
local psdm_index = get_psdm_index()
if (psdm_index!=undefined) then return (getEffect psdm_index).filename
else return ""
)--fn get_psdm_filename
fn Set_psdm_filename fname = (
local psdm_index = get_psdm_index()
if (psdm_index!=undefined) then (getEffect psdm_index).filename = fname
)--fn Set_psdm_filename
fn Update = (
--print "Update"
psdmRoll.edt1.text = get_psdm_filename()
)--fn Update
button btn1 "psd" pos:[0,2] width:32 height:30 across:2
edittext edt1 "" pos:[32,4] width:264 height:19
on psdmRoll open do(
Update()
callbacks.addScript #FilePostOpen "psdmRoll.Update()" id:#psdm_postOpen
)
on psdmRoll close do(
callbacks.removeScripts #FilePostOpen id:#psdm_postOpen
)
on btn1 pressed do(
local fname = getSaveFileName caption:"Save Photoshop Document As" filename:edt1.text types:"PSD(*.psd)|*.psd"
if (fname != undefined) then (
edt1.text = fname
Set_psdm_filename fname
)
)
on edt1 entered text do(
Set_psdm_filename text
)
)--rollout psdmRoll
CreateDialog psdmRoll
cui.RegisterDialogBar psdmRoll
cui.DockDialogBar psdmRoll #cui_dock_top
</code>
Comments
...
Who wrote this 'useful' script? Using
getSaveFileName()
is a bad idea in this case, useselectSaveBitMap()
instead.my recent MAXScripts RSS (archive here)
sets savepath..
I do not understand exactly what you want, but maybe this is usefull..
thank you very much! in
thank you very much! in general it is working now. just put it in scripts/startup folder
and i adopted it to bottom bar (borderless toolbar) and for V-Ray raw image file output in EXR file.
and simple code for harumscarum.ini
the only option i missing is Update. i mean when you load file SavePath script may show path from V-Ray raw image file output
thank you, Anubis
i will try to correct this script according your advice