|
Hello.
I have wrote my own script for baking textures. I have a problem, because when i use RTT dialog the texture looks good. But when I use my script the texture haven’t got the same edges. I Attach photos where I zoom the problem. What should i add to my script to have the same effects.
I search all maxscript help file but nothing find. I hope there is a solution. Thanks for help.
here is my code
fn renderLightmap obj fileName factor virtualFrameBufferState save_path= (
DeleteAutoFlatten obj -- clear unwrapers
unwrap obj -- automatic flatern uvs
addname=obj.name
factor = factor as string
fPath=save_path as string
--diferent name for all renders
-- char _ is a separator beetwen render name common with object and name common with factor
--ex. BOX01_3 Object name BOX01, render number 3
fName=addname +"_"+ factor
fType=getFilenameType fileName
--type of bake
currentMapType = CompleteMap()
--size of texture AUTO
--currentMapType.autoSzOn = true
--lines below, when size of texture defined by user
currentMapType.outputSzX = 512
currentMapType.outputSzY = 512
currentMapType.filename=fName
currentMapType.fileType=fType
bi = obj.INodeBakeProperties
bi.bakeEnabled = true
bi.bakeChannel = 1
currentMapType.shadowsOn = false
bi.addBakeElement currentMapType
undisplay(render rendertype:#bakeSelected renderelements:true outputwidth:512 outputheight:512 vfb:false outputfile:(fPath+"\\"+fName+fType) progressbar: true )
bi.removeAllBakeElements()
bi.bakeEnabled = false
format "rendering node:% channel:%\n DYLATACJA:%\n" obj.name bi.bakeChannel xx
)
It looks like the texture from RTT have additional line of pixels, which is a copy of the last one line.
Max 2008 32bit.
Black computer with some cables :P
Mouse, keyboard additional
Beer - for new ideas in work :P
| Attachment
|
|
| Attachment
|
|
|
|
|