Message 1 of 1
rendermap doesn't use alpha in script

Not applicable
06-27-2016
11:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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 ?