ScriptSpot home

Forum topic · General Scripting

Loading renderpresets via Maxscript

By Alex Szabados · 2016-02-08

Description

Hi! This may be an easy one, but I'm stuck.

I try to load a renderpreset via maxscript. So I checked the reference and cam up with this:

renderPresets.LoadAll 0 "X:\\projects\presets\turntable_preset.rps"

Unfortunatly it doesn't do nothing, it is only replying "false". It is a preset for Vray settings, working on max 2014. Somebody has an idea why it doesn't work?

Thanks!

Comments (10)
Xkontod

Working perfectly in thisway!

on Lrps_1 pressed do
renderPresets.LoadAll 0 (GetDir #maxroot + "\\scripts\\Studios\\Renderpr\\Render1.rps")

Just needs to be a "renderPresets.LoadAll" Not "renderPresets.Load"

Thank you miauu!

Now how can i make that message box to confirm like "Render presets 1 loaded" or displayng status, of a active render name somewhere in dialog?:)

Reply to Xkontod
miauu

rpsFilePath =



rpsFilePath = "X:\\projects\presets\turntable_preset.rps"
 
if doesFileExist rpsFilePath then
(
	renderPresets.LoadAll 0 rpsFilePath
        messagebox "Render presets 1 loaded" title:""
-- but you will have to close the messagebox, so you an add a label contorl and when the rps is loaded you can update its text property like this:
        lab_rpsLoadingStatus.text = "Render presets 1 loaded"
-- if you don't like the label you can use a textbox control and upadte its text property:
        et_rpsLoadingStatus.text = "Render presets 1 loaded"
)
else
	messagebox "The RPS file can't be located" title:""
Reply to Xkontod
Xkontod

Sorry, i comment wrong post.:(
But i get help... thank you!

Xkontod

How is possible that load output file size to?
If i load manually *.rps file then loads output size, but if i load via script, then not..

Reply to Xkontod
Panteleev Sergey

.

try this


preset_path  = @"C:\Users\User\Documents\3dsmax\renderpresets\test.rps"
preset_categories = renderpresets.LoadCategories preset_path
renderpresets.Load 0 preset_path preset_categories
Alex Szabados

Hi thanks for your answer. I tried it, but it seems like max doesnt find the file. First I thought it might be a problem of the server but it also doesnt work locally... reallly strange. When I call on of the default scanline presets it works ^^

Alex Szabados

I already tried if that could be the reason, but unfortunatly it doesnt change if I select vray first

.

The path to the .rps file is correct, right? And the .rps file exist?

When renderPresets.LoadAll is used the FALSE is returned when the rps file can't be located(not exist or the pat is not correct).

Try this:


rpsFilePath = "X:\\projects\presets\turntable_preset.rps"

if doesFileExist rpsFilePath then
	renderPresets.LoadAll 0 rpsFilePath
else
	messagebox "The RPS file can't be located" title:""
Reply to miauu
Aleksey

rpsFilePath = (GetDir #renderPresets +"\\turntable_preset.rps") if doesFileExist rpsFilePath then renderPresets.LoadAll 0 rpsFilePath else messagebox "The RPS file can't be located" title:""

miauu

.

Is the Vray currently active render?