Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

BakeToTexture setImageType and pngio

BakeToTexture setImageType and pngio

andres.hernandezB63FL
Advocate Advocate
1,179 Views
4 Replies
Message 1 of 5

BakeToTexture setImageType and pngio

andres.hernandezB63FL
Advocate
Advocate

Hi everyone!, 

I'm working on an script that uses BakeToTexture utility but I'm stucked when setting the file output options. 
In the documentation I found this part:

andreshernandezB63FL_0-1661472029652.png

So, lets say that I have my map created like this:

myNormalMap = BakeToTexture.addMapByTypeName myObject #Normal

 if I try to access to image size I have no problem:

myNormalMap.setImageSize()

but if I try to access to set image type I get this error:

myNormalMap.setImageType()
-- Unknown property: "setImageType" in <MixinInterface:BakeToTextureMap>

 Also, I tried to apply some of the pngio settings to my map but it doesn't seems to have any effect:

pngio.setType #true48
pngio.setAlpha true
myNormalMap.applyImageTypeSettings()

 I really hope someone could give me some help with this. 
Thanks a lot!

0 Likes
Accepted solutions (1)
1,180 Views
4 Replies
Replies (4)
Message 2 of 5

Swordslayer
Advisor
Advisor
Accepted solution

Probably outdated code sample, instead of

 

 

map1.setImageType "png"
map1.setFilename "Map1"

 

 

you should use

 

 

map1.fileType = "png"
map1.fileName = "Map1"

 

 

You can see all the interface methods/properties by calling showInterface on the map.

 

Message 3 of 5

andres.hernandezB63FL
Advocate
Advocate

Hi Vojtěch, thank you for your response. I guess I can report this as a documentation issue. 
About the pngio, do you know how to use that? because it doesn't update the map. I don't know how that works because when you set the pngio it doesn't make any reference to the map, only when you use the apply method. 
Thanks a lot 

0 Likes
Message 4 of 5

andres.hernandezB63FL
Advocate
Advocate

So I tried to set those before creating the map, so it seems that I can't update the map PNG settings after it was created

0 Likes
Message 5 of 5

jmdvella
Participant
Participant

When changing any of the png to Greyscale they all render greyscale. Same with 24bit RGB. Is this a Bake To Texture limitation?

 

0 Likes