ScriptSpot

Forum topic · General Scripting

Loading renderpresets via Maxscript

By kernberg · 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 · 2018-10-23

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?:)

rpsFilePath =

miauu · 2018-10-23



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:""

Xkontod · 2018-10-24

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

Xkontod · 2018-10-14

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..

.

jahman · 2018-10-14

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

kernberg · 2016-02-10

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 ^^

kernberg · 2016-02-09

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

.

miauu · 2016-02-09

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:""

Atlex86 · 2017-07-18

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 · 2016-02-09

Is the Vray currently active render?