Why does the Render to Texture window overwrite my settings?

Hello everyone!

If I create a bake element using MaxScript, the Render to Texture window somehow overwrites my settings. Why? What could be the problem?

Example:
-- Gets the box
myBox = getNodeByName "box01"

-- Adds a lightmap
bakeProp = myBox.INodeBakeProperties
lmp = LightingMap()
bakeProp.addBakeElement lmp

-- Sets the file name and type
lmap = bakeProp.getBakeElement 1 -- (no other bake elements)
lmap.filename = "myFileName.tga"

The commands work fine, if I query the filename with "lmap.filename" it is "myFileName.tga".

But, now if I start the RTT window with "0", the filename changes to "Box01LightingMap.tga". Why?? It basicly ruins my work, since I wanted to use a script to generate proper filenames, and the RTT window to actually render the elements.

Any help is appreciated,

Thanks!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
RicardoTeixeira's picture

This is an old thread but it

This is an old thread but it might help someone with the same issue.

Just make myElement.filenameUnique = true

Technical Artist @amplifycreates

Graph's picture

new idea: open the rtt

new idea:

open the rtt dialog, select the object (a single one) and change the name

macros.run "Render" "BakeDialog" --to open the dialog
try ( destroyDialog gTextureBakeDialog)catch() --to close it

glahf

Raphael Steves

Graph's picture

that always happens, must be

that always happens, must be an internal function of the rtt stuff
you can render it yourself with the correct name tho and leave the rtt window out of it completely. have a look here: http://www.scriptspot.com/forums/3ds-max/general-scripting/render-output...

you can render them at any time, means you can make you settings, open on another pc and then render with your own render function.

or you could rewrite the rtt scripts wich id suggest not to do :P

Raphael Steves

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.