anticz
08-22-2007, 07:36 PM
I'm wondering if anyone here has any clue on how to invoke the renderer to do a render to texture. I'd like to be able to quickly render UV channel 2 into UV channel 1. I can easily get at the iNodeBakeProperties and set them up to fill in the blanks for the render to texture dialog but I'd like to be able to invoke the render directly and have it save the image to a supplied path. I've hunted high and low through the Macro_BakeTextures.mcr script to try to find out how exactly to invoke a render of the bake properties but it's a bit convoluted it seems (one function points to the next and so on) and I can't find any documentation in the help files. Any help would be greatly appreciated!! Here's what I've got so far. Thanks again.
fn _renderCamProjectionMap =
(
projectMap = DiffuseMap()
--use the currntly selected mesh in the scene. Need to make this an argument
projectSurface = $.INodeBakeProperties
projectSurface.addBakeElement projectMap
projectSurface.numElementParams projectMap
projectSurface.setParamValue projectMap 1 0
projectSurface.setParamValue projectMap 2 0
projectMap.fileName = "FrontProjection"
--projectMap.fileType = ".tga"
projectMap.outputSzX = 128
projectMap.outputSzY = 128
projectSurface.bakeChannel = 1
)
fn _renderCamProjectionMap =
(
projectMap = DiffuseMap()
--use the currntly selected mesh in the scene. Need to make this an argument
projectSurface = $.INodeBakeProperties
projectSurface.addBakeElement projectMap
projectSurface.numElementParams projectMap
projectSurface.setParamValue projectMap 1 0
projectSurface.setParamValue projectMap 2 0
projectMap.fileName = "FrontProjection"
--projectMap.fileType = ".tga"
projectMap.outputSzX = 128
projectMap.outputSzY = 128
projectSurface.bakeChannel = 1
)
