PDA

View Full Version : flipping a number using expressions



larkis
06-20-2009, 08:56 AM
I want to have a morph map drive the opacity of a texture, currently when i use a channel expression to link the two everything is fine and dandy accept when my morph map is at 100% my texture is at 100% opacity as well. I actually want the reverse behavior, when my morph is at 100% i want my texture to be at 0% and when the morph is at 0% the texture would be at 100%. I have very little experience with expressions.

jameswillmott
06-20-2009, 09:05 AM
I want to have a morph map drive the opacity of a texture, currently when i use a channel expression to link the two everything is fine and dandy accept when my morph map is at 100% my texture is at 100% opacity as well. I actually want the reverse behavior, when my morph is at 100% i want my texture to be at 0% and when the morph is at 0% the texture would be at 100%. I have very little experience with expressions.

The expression for the texture would be 1-MorphMap

larkis
06-20-2009, 09:50 AM
Cool, I will have to try this, it sounds a lot simpler than the solution I found. What i did is this: mapRange([object.MorphGroup.morphname],0.000,1.000,1.000,0.000) and attached that to the channel of the surface. Seems to be working.

Thanks for the reply.

Sekhar
06-20-2009, 09:56 AM
If you have 9.x, check out nodes too - they're so much easier.