Saving Rendered UV Template


#1

I’ve started a script that will render the UV template, but I’m not sure how to get it to save the rendered template as a TGA. Here’s what I have so far:


modPanel.addModToSelection (Unwrap_UVW ()) ui:on
actionMan.executeAction 2077580866 "40194"
$.modifiers[#Unwrap_UVW].renderuv_width = 4096
$.modifiers[#Unwrap_UVW].renderuv_height = 4096
$.modifiers[#Unwrap_UVW].renderuv_seamedges = off
$.modifiers[#unwrap_uvw].unwrap5.renderUV ""
deleteModifier $ 1
rendOutputFilename = maxfilepath + "foo.tga"
targa.setColorDepth 24
targa.setCompressed = true
targa.setAlphaSplit = false
targa.setPreMultAlpha = true


#2

This is the code, which I use in RTTAssist to bake UV template.

(
	bakedObject = selection[1]
	max modify mode
	--	define Unwrap_UVW modifier
	defUnwrapMod = Unwrap_UVW()
	--	set map chanel to 1
	defUnwrapMod.setMapChannel 1
	--	add Unwrap_UVW modifier to baked object
	addModifier bakedObject defUnwrapMod
	--	define the size of UV template map
	defUnwrapMod.renderuv_width = 4096
	defUnwrapMod.renderuv_height = 4096
	
	defUnwrapMod.renderuv_fillmode = 0
	defUnwrapMod.renderuv_seamColor = green
	defUnwrapMod.renderuv_showframebuffer = on
	defUnwrapMod.renderuv_force2sided = false
	defUnwrapMod.renderuv_fillColor = black
	defUnwrapMod.renderuv_showoverlap = false
	defUnwrapMod.renderuv_overlapColor = red
	defUnwrapMod.renderuv_edgeColor = white
	defUnwrapMod.renderuv_visibleedges = true
	defUnwrapMod.renderuv_invisibleedges = false
	defUnwrapMod.renderuv_seamedges = false				
	
	--	define the path where to store UV template map
	uvSavePath = maxfilepath + "foo.tga"
	uvRenderPath = uvSavePath
	--	render UV template
	defUnwrapMod.renderUV uvRenderPath	
	--	delete Unwrap_UVW modifier
	deleteModifier bakedObject 1				
)

There is no need to open the Render UV’s dialog.


#3

Very helpful, thank you!


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.