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.

pre Multiplied Alpha script

pre Multiplied Alpha script

Anonymous
Not applicable
492 Views
6 Replies
Message 1 of 7

pre Multiplied Alpha script

Anonymous
Not applicable
I'm currently writing a script to identify if any objects in the scene with a standard material that has a diffuse (or opacity map) that have the preMultAlpha switched set to on and if so report it (so I know what material was changed) and then switch it off. Simple enough, only I can't seem to set the switches for preMultAlpha to off and I can't get the opacity map part to work either. (Which is most of the script actually...ahem) Can anyone please help me out. Thank you.
0 Likes
493 Views
6 Replies
Replies (6)
Message 2 of 7

PiXeL_MoNKeY
Collaborator
Collaborator
This will disable the preMultAlpha switch for all bitmaps in the scene:
for preMult in (getClassInstances BitmapTexture) do (
preMult.preMultAlpha = false
)
Personally I wouldn't dig through the materials, I would use what I did and change the BitMapTexture Objects. Without seeing your code (and possibly a sample scene) it is going to be hard to pinpoint what the problem is.

-Eric
0 Likes
Message 3 of 7

Anonymous
Not applicable
Thank you PiXeL_MoNKeY, I see the reason why I was going wrong now:
if dif_map.preMultAlpha == true do dif_map.preMultAlpha = false
0 Likes
Message 4 of 7

Steve_Curley
Mentor
Mentor

$.material.diffuseMap.preMultAlpha
$.material.opacityMap.preMultAlpha

Look up "StandardMaterial - Material" in the Maxscript Help Index.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 7

Steve_Curley
Mentor
Mentor
Eric beat me to it again 😞

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 6 of 7

PiXeL_MoNKeY
Collaborator
Collaborator
Just don't hold it against me Steve. 😉

-Eric
0 Likes
Message 7 of 7

Steve_Curley
Mentor
Mentor
As if I'd do a thing like that 😛

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes