Normal map Baking
I have been trying to write something which will bake the Normal map from a high_poly model to a Low_poly model....but the problem is nothing is getting rendered. Although all the parameters are applied as i can see in the max file....the projection modifier, cage settings, Highpoly picked....also I can see that it is rendering the normal map.....only thing is it is coming blank!! Can anyone find the problem please??
( global thehighSS = "select the highpoly mesh" global thelowSS = "select the low poly mesh" global thePathSS = "C:\\" rollout nm "Normal_Map" width:194 height:424 ( pickbutton btn_high "High_Poly" pos:[60,24] width:68 height:20 label lbl_high "select the highpoly mesh" pos:[26,50] width:135 height:17 pickbutton btn_low "Low_Poly" pos:[59,76] width:72 height:21 label lbl_low "select the low poly mesh" pos:[25,103] width:144 height:20 GroupBox grp1 "Select Meshes" pos:[8,8] width:176 height:119 button btn_path "Select Path" pos:[56,165] width:80 height:32 label lbl_path "C:\\" pos:[16,203] width:160 height:16 GroupBox grp2 "Path" pos:[8,153] width:176 height:72 dropdownList ddl_dimension "Dimension" pos:[13,235] width:171 height:40 items:#("32", "64", "128", "256", "512", "1024", "2048", "4096") radiobuttons qualrad "" pos:[29,305] width:118 height:32 labels:#("low", "medium", "high", "best") columns:2 GroupBox grp3 "Quality" pos:[9,283] width:175 height:64 checkbox chk_auto " Auto Unwrap" pos:[37,133] width:120 height:16 button btn_render "Render" pos:[44,383] width:101 height:29 spinner spn_cagedist "" pos:[110,355] width:52 height:16 range:[-100,100,2] label lbl_cagedist "Cage Distance:" pos:[28,355] width:78 height:22 on btn_high picked o do ( if superclassof o == geometryclass and classof o != bonegeometry then ( lbl_high.text = o.name select o global highpoly = o ) else ( messagebox "Select a mesh" title: "Wrong Selection" beep:true ) ) on btn_low picked obj do ( if superclassof obj == geometryclass and classof obj != bonegeometry then ( lbl_low.text = obj.name select obj global lowpoly = obj ) else ( messagebox "Select a mesh" title: "Wrong Selection" beep:true ) ) on btn_path pressed do ( thePathSS = getSavepath() if thePathSS != undefined then ( lbl_path.text = thePathSS ) else ( messagebox "No path defined" title: "Path Not Defined" beep:true ) ) on btn_render pressed do ( size = ddl_dimension.selected as integer cagedistance = spn_cagedist.value for o in geometry do ( if classof o != bonegeometry do ( o.material = undefined o.material = standardMaterial showInViewport:true ) ) converttopoly lowpoly theProj = ProjectionMod() addModifier lowpoly theProj theProj.addObjectNode highpoly theProj.autowrapCage() theProj.resetCage() theProj.pushCage cagedistance theProj.addRegisteredProjectionType 1 theProj.projectProjectionType 1 theProj.ignoreBackfacing = true lowpoly.iNodeBakeProperties.removeAllBakeElements() lowpoly.INodeBakeProperties.bakeEnabled = true lowpoly.INodeBakeProperties.bakeChannel = 1 lowpoly.INodeBakeProperties.nDilations = 4 be1 = NormalsMap() be1.outputSzX = be1.outputSzY = size be1.fileType = (thePathSS+"\\"+$.name+"_normal.png") be1.fileName = filenameFromPath be1.fileType be1.enabled = true be1.useNormalBump = true be1.targetMapSlotName = "diffuse" lowpoly.INodeBakeProperties.addBakeElement be1 NormDiff = bitmaptexture filename:be1.fileType lowpoly.material = standardmaterial diffuseMap:NormDiff showInViewport:true render rendertype:#bakeSelected outputwidth:size outputheight:size completeRedraw() ) ) createDialog nm )

Comments
Op, Sory! No Googlt_T, my
Op, Sory!
No Googlt_T, my bad.
I still wonder why all roman(latin) languages sometimes uses C as K.
Tools and Scripts for Autodesk 3dsMax
I don't know why, but
I don't know why, but certainly not because Goonda lookig the best solution for Normal map Baking. :)
Anyway, "K" is better then "C" for our neighborhood.
Are you thinking about how to change your fitst(capital) name letter to "C", or i miss the point?
:)
bga
Hi, Branco! Actually the
Hi, Branco!
Actually the RTTAssist uses the baking code from ToTex2. Just changed to work with othre tools in RTTAssist.
Google translate or you practice bulgarian langiage?
Tools and Scripts for Autodesk 3dsMax
Hi neighbor,Google
Hi neighbor,
Google translate, of course. Both are the best tools for solving topic problem. You're the author of first one. Right?
Because of that RTTAssist is my #1 choice for sure.
By the way, when i change my name you'll first know but for now
is Branko :) I think that Google-T is to blame :)
Cheers friend!
bga
Check the code of RTTAssist
Check the code of RTTAssist or ToTex
Tools and Scripts for Autodesk 3dsMax
Working Now
Thanks Miauu......Your script is too complex for me to understand.....still I just added one line from it, and it started working!! :)
macros.run "Render" "BakeDialog"
Здрасти Костадин, Мисля, че
Здрасти Костадин,
Мисля, че няма по-добър избор на две mxs-a. :)
поздрав!
Бранко
bga