Strange error in Rtt Script I am working on.

I am getting some errors in a RTT Script I am working on. I have pinged alot of my buddies and co workers who write max script and no one knows.

Issue 1: When I render a texture whos height and width dimensions are the same it works great.
When I render a texture whos Height is greater than its width it works as expected and streteches the image(or rendering it correctly if it is setup for 1:2 ect...)
However if I render a texture whos width dimension is greater than its hieght dimension it is acting like it is rendering out a square texture then it just crops off the bottom.
512x512 fine
512x1024 fine
1024x512 it gives me the top half of a 1024x1024 rendered image.

Issue 2: The array that the renderer is supposed to store my bitmaps for my rendered elements is not getting populated.

bitz = #()
render rendertype:#bakeselected frame:sliderTime renderelements:true renderelementbitmaps:&bitz vfb:off quiet:true

bitz[1] is showing up as undefined

Issue 3: The renderer is overwriting my bitmaps in render elements with whichever render element I added last.


add diffusemap
add normalmap
add specmap
add lightmap

display diffuze.bitmap -- this displayed the rendered lightmap instead of hte diffuse map

Any help would be greatly appreciated

here is a version of the script.

TexHeight = 512
TexWidth = 1024
BakeObj = $
BakeElements = BakeObj.INodeBakeProperties
BakeElements.bakeChannel = 1
BakeObjs = #()
makedir (maxfilepath + "\\BakedTextures\\")
BakeObjpath = (maxfilepath + "\\BakedTextures\\")
TexPath = (maxfilepath + "\\BakedTextures\\")

maptype = "Normal"
BakeObjNormal = normalsMap()
BakeObjNormal.outputszx =TexWidth
BakeObjNormal.outputszy =TexHeight
BakeObjNormal.enabled = true
BakeObjNormal.filename = ($.name + "_" + maptype)
BakeObjNormal.filetype = ".png"
BakeElements.addBakeElement BakeObjNormal
NormalFile = (TexPath + BakeObjNormal.filename + BakeObjNormal.filetype)

maptype = "Diffuse"
BakeObjDiffuse = diffuseMap()
BakeObjDiffuse.lightingon = true
BakeObjDiffuse.shadowson = true
BakeObjDiffuse.outputszx =TexWidth
BakeObjDiffuse.outputszy =TexHeight
BakeObjDiffuse.enabled = true
BakeObjDiffuse.filename = ($.name + "_" + maptype)
BakeObjDiffuse.filetype = ".png"
BakeElements.addBakeElement BakeObjDiffuse
DiffuseFile = (TexPath + BakeObjDiffuse.filename + BakeObjDiffuse.filetype)

maptype = "Specular"
BakeObjSpecular = SpecularMap()
BakeObjSpecular.outputszx =TexWidth
BakeObjSpecular.outputszy =TexHeight
BakeObjSpecular.enabled = true
BakeObjSpecular.filename = ($.name + "_" + maptype)
BakeObjSpecular.filetype = ".png"
BakeElements.addBakeElement BakeObjSpecular
SpecularFile = (TexPath + BakeObjSpecular.filename + BakeObjSpecular.filetype)

maptype = "Light"
BakeObjLight = LightingMap()
BakeObjLight.directOn = true
BakeObjLight.indirectOn = true
BakeObjLight.shadowson = true
BakeObjLight.outputszx =TexWidth
BakeObjLight.outputszy =TexHeight
BakeObjLight.enabled = true
BakeObjLight.filename = ($.name + "_" + maptype)
BakeObjLight.filetype = ".png"
BakeElements.addBakeElement BakeObjLight
LightFile = (TexPath + BakeObjLight.filename + BakeObjLight.filetype)

render rendertype:#bakeselected frame:sliderTime outputwidth:TexWidth outputheight:TexHeight outputfile:BakeObjPath renderelements:true renderelementbitmaps:&BakeObjs vfb:on quiet:true
BakeObjBM = BakeObjnormal.bitmap
BakeObjBM.Filename = normalfile
save BakeObjBM quiet:true


Comment viewing options

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

strangely i took these out

strangely i took these out and my cropping problem went away
renderelements:true renderelementbitmaps:&BakeObjs

but I still have the other issue of hte renderelements bitmaps getting overridded anyone have any ideas?

Ratmaster3d's picture

Shameless Bump Because there

Shameless Bump Because there is little to no RTT documentation.

Comment viewing options

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