Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / pre Multiplied Alpha script
  RSS 2.0 ATOM  

pre Multiplied Alpha script
Rate this thread
 
51430
 
Permlink of this thread  
avatar
  • Location: South Hampshire, UK
  • Total Posts: 49
  • Joined: 10 January 2011 11:17 AM

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.



From 3d Studio R4 through to 3ds Max 2008
Windows XP (SP3)
Pentium 4 CPU 2.8 GHz, 3.0 GB RAM
ATI Radeon X300 series, DX 9.0c
Coffee: Almost empty

Replies: 0
avatar

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



Eric Craft
“The Evil Monkey hiding in your closet.”

Replies: 1
/userdata/avatar/4dhce3704.png

Thank you PiXeL_MoNKeY, I see the reason why I was going wrong now:
if dif_map.preMultAlpha == true do dif_map.preMultAlpha = false

Author: ghoul fool

Replied: 18 January 2011 03:51 AM  
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

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

Look up “StandardMaterial - Material” in the Maxscript Help Index.



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 3
/img/forum/dark/default_avatar.png

Eric beat me to it again :(

Author: Steve_Curley

Replied: 18 January 2011 03:53 AM  
/userdata/avatar/avatar_14884.gif

Just don’t hold it against me Steve. ;)

-Eric

Author: PiXeL_MoNKeY

Replied: 18 January 2011 04:06 AM  
/img/forum/dark/default_avatar.png

As if I’d do a thing like that :P

Author: Steve_Curley

Replied: 18 January 2011 07:36 AM