Hey guys! I am pretty stuck. I am 95% there on my script and the padding is giving me an issue. Was hoping someone could help tell me why I am having this problem.
Problem: After my first render, if I change the padding, it doesn't render out the new padding amount. I am not really sure why. It seemed to update in the render after I updated at least the save location and padding... sometimes.
I am not clearing the bake elements because I would like to keep it there. Idea is to setup using predefined preset in the script, render, tweak some settings in it, and then render again.
global bp = $.INodeBakeProperties
global prjp = $.INodeBakeProjProperties
fn RTTBigleyCastTools Xsize Ysize channel padding fullfilename =
(
bp.bakeEnabled = true
bp.bakeChannel = channel
bp.ndilations = padding
fPath = getFilenamePath fullfilename
fName = getFilenameFile fullfilename
fType = getFilenameType fullfilename
be.outputSzX = Xsize
be.outputSzY = Ysize
be.filenameUnique = true
be.filename = fName
be.fileType = fType
render rendertype:#bakeSelected outputwidth: Xsize outputheight: Ysize outputfile:(fPath+fName+fType) vfb: false
)
-- Sets up a Test Normal Map RTT Element
bp.removeAllBakeElements()
bp.bakeEnabled = true
bp.bakeChannel = 1
bp.nDilations = 4
prjp = $.INodeBakeProjProperties
prjp.hitMatchMtlID = true
prjp.enabled = true
prjp.warnRayMiss = true
nmtest = Normalsmap()
nmtest.enabled = true
nmtest.outputSzX = nmtest.outputSzY = 512
nmtest.filenameUnique = true
nmtest.elementname = "Normal Map Test"
nmtest.filename = (maxfilepath + $.name + "_nmtest.tga")
bp.addBakeElement nmtest
-- Renders and Saves bitmap
be = bp.getBakeElement 1 -- Assigns the obj bake element to the variable be
RTTBigleyCastTools be.outputSzX be.outputSzY bp.bakeChannel bp.ndilations be.filename
if be.bitmap != undefined do
(
newbitmap = bitmap be.outputSzX be.outputSzY
copy be.bitmap newbitmap
newbitmap.filename = edtFilePath.text
display be.bitmap
save newbitmap
close newbitmap
close be.bitmap
)Any help would be very much appreciated.
By jeremiah_bigley · 2013-01-13
miauu · 2013-01-13