FORUMS: list search recent posts

Using a linear function to drive an attribute.

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Brock Jolet
Using a linear function to drive an attribute.
on Jan 17, 2014 at 4:24:04 pm

I'm just recently getting back into Maya after many years of mainly working in Adobe After Effects.

I have created an attribute named "Color" that can have values from 0 to 1. I would like to control this attribute according to the Z translation of the same object (child1) which is moving from .7 to .07.

In After Effects, I would set up a linear function as such:


x=child1.translateZ;
linear(x,.7,.07,0,1)


This would be added to the "Color" attribute, so no association would be needed. In Maya, I want to create an expression using the expression editor, but I can't find the proper method of implementing a linear function.

Basically, I want "child1.translateZ" to control "child1.Color" via a linear function as they will have dissimilar values.


Return to posts index

Brock Jolet
Re: Using a linear function to drive an attribute.
on Jan 17, 2014 at 4:47:37 pm

I was able to figure out the linstep function.


child1.Color = linstep(.07,.7,child1.translateZ)


Return to posts index

Steve Sayer
Re: Using a linear function to drive an attribute.
on Jan 21, 2014 at 6:11:37 pm

Thanks for posting the solution, Brock.

Note that Maya's docs have a list of many functions useful in such cases:

http://download.autodesk.com/global/docs/maya2014/en_us/files/Useful_functi...


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]