rendermap doesn't use alpha in script

rendermap doesn't use alpha in script

Anonymous
Not applicable
513 Views
0 Replies
Message 1 of 1

rendermap doesn't use alpha in script

Anonymous
Not applicable

I have a PSD file and I want to convert it in PNG directly in Max.

 

My approach was to use a CompositeTextureMap, with diffuse in first layer color, and PSD alpha output as mask, and render the map in PNG file.

 

This works well when I make it by hand, but not in my script :

 

for s in (getclassinstances Standard) do
(
	if (classof s.opacityMap == BitmapTexture) and (classof s.diffuseMap == BitmapTexture) and (s.opacityMap.filename == s.diffuseMap.filename) do
	(
		alphaMat = CompositeTextureMap()
		alphaMat.mapList[1] = s.diffuseMap
		alphaMat.mask[1] = s.opacityMap
		renderMap alphaMat size:[s.diffuseMap.bitmap.width,s.diffuseMap.bitmap.height] filename:(substitutestring s.diffuseMap.filename @".psd" @".png") display:true
	)
)

 The framebuffer is black, but the file image is well rendered, but without transparency. Any idea ?

 

 

0 Likes
514 Views
0 Replies
Replies (0)