PDA

View Full Version : Baking Texture Issue


arcburn
10-15-2008, 01:19 AM
I am trying to bake materials and cant seem to get it to work.

In this instance I want a diffuse map only with no lighting or shadows and with padding of 20.

I get render with lighting and no padding. I have looked over all RTT posts here and cannot see if anyone has had this work succesfully.

Here is the script


fn mapbake obj Rsize outputDir =
(

bitm = bitmap Rsize Rsize
bakeMap = diffusemap()
bakeMap.outputSzX = Rsize
bakeMap.outputSzY = Rsize
bakeMap.fileType = ".tga"
bakeMap.shadowsOn =off
bakeMap.lightingon = off
bakeMap.targetMapSlotName = "Diffuse"
bakeMap.enabled = true

obj.INodeBakeProperties.addBakeElement bakeMap
obj.INodeBakeProperties.bakeEnabled = on
obj.INodeBakeProperties.flags = 1
obj.INodeBakeProperties.bakeChannel = 1
obj.INodeBakeProperties.nDilations = 20


render rendertype:#bakeSelected vfb:on outputFile:(outputDir+obj.name+".tga") outputSize:[Rsize,Rsize] to:bitm

obj.iNodeBakeProperties.removeAllBakeElements()
)

sp = Sphere radius:35 mapcoords:on transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0]) isSelected:on
sp.material = standardmaterial()

mapbake sp 512 "c:\\"

MoonDoggie
10-15-2008, 02:42 AM
when calling bakeMap, do you need to specify a filename as well instead of just C:\\?

arcburn
10-15-2008, 06:04 PM
That worked. Awesome. Thank You:beer:

MoonDoggie
10-15-2008, 07:17 PM
absolutely, I think we've all done this, good luck.

phoelix
10-20-2008, 11:24 PM
but with that method your saving a bitmap from the render buffer, which is not the difusse element made by the render to texture, that is like the All-element bitmap.

render rendertype:#bakeSelected vfb:on outputFile:(outputDir+obj.name+".tga") outputSize:[Rsize,Rsize] to:bitm

martinB
10-28-2008, 05:40 PM
but with that method your saving a bitmap from the render buffer, which is not the difusse element made by the render to texture, that is like the All-element bitmap.

Yes, indeed. This will save out something that is equivalent to a CompleteMap. :\

-- MartinB

CGTalk Moderation
10-28-2008, 05:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.