Notifications
Clear all

[Closed] render bakeSelected makes 3dsmax crash

My 3dsmax is crashing when trying to bake textures through code in geometries that have not been exported prior with the in editor render to texture tool.


bakeMap = vrayrawglobalillumination()
bakeMap.enabled = true 
bakeMap.enabled = true
bakeMap.filterOn = true
bakeMap.atmosphereOn = true
bakeMap.shadowOn = true
bakeMap.bitmap = tempBitmap
bakeMap.vrayVFB = false
bakeMap.color_mapping = false
bakeMap.multiplier = 1.0f

select obj
obj.INodeBakeProperties.addBakeElement bakeMap 
obj.INodeBakeProperties.bakeEnabled = on
obj.INodeBakeProperties.flags = 1
obj.INodeBakeProperties.bakeChannel = 1
obj.INodeBakeProperties.nDilations = 1
				
render rendertype:#bakeSelected vfb:off disableBitmapProxies:true outputSize:[Rsize,Rsize] to:tempBitmap	

That is the code that I’m using to render to texture and it only works when I have rendered to texture before through the editor. If I were to create a new object and try to render to texture using this code 3dsmax will crash.

My first thought was that 3dsmax creates UVs to geometries that don’t have them. And in the documentation it states the following.

“The Render To Texture script shipping with 3ds Max provides controls over the automatic application and setup of Unwrap_UVW Modifiers to ensure the texture coordinates are usable for baking. You might have to ensure the same in your own script, unless your object has good UV coordinates to work with.”

But when creating the UVs myself through the editor and then exporting using my code it crashes too. And the documentation statement it’s to vague to figure out what exactly it’s doing.

Is there anything that the in editor render to texture tool is doing that my code is missing?

Thanks

1 Reply

This issue was resolved when using a licensed version of Vray.