PDA

View Full Version : connecting a slider to a value in mel ?


stickyblue
11-27-2003, 10:24 PM
hey i dont know much about mel yet , im building a rig and im trying to write a small expression so when i move my feet my root moves down so the exp i wrote basically is

Root.ty = 0 - average distance inbetween the feet / n

so the question is is there any way i can create a slider and hook it up to the N value in the expression so i can adjust how much my root moves down whenever i want

thanks

Jhavna
11-28-2003, 08:58 AM
Originally posted by sticky blue

Root.ty = 0 - average distance inbetween the feet / n

so the question is is there any way i can create a slider and hook it up to the N value in the expression so i can adjust how much my root moves down whenever i want

thanks

Ok, try this

float $N;
connectControl $slider ( $N );
Root.ty = 0 - average distance inbetween the feet / $N;

Obviously you have to create the window with the slider beforehand

string $slider = `floatSlider -min 0.0 -max 360.0`;

Hope that's what your after

stickyblue
12-01-2003, 12:57 AM
ah thank you very much

mark_wilkins
12-01-2003, 08:35 AM
For this I'd use a plusMinusAverage node and a multiplyDivide node, along with a custom attribute for N. Then, you can connect a slider to the custom attribute.

It's usually a lot better to use utility nodes instead of expressions whenever you can, particularly in character rigs, for better performance.

-- Mark

stickyblue
12-03-2003, 03:37 AM
you are right , but i am trying to teach myself some mel so i was trying to do it with expressions :)

thank you very much tho

mark_wilkins
12-03-2003, 03:42 AM
The most important thing to learn in learning expressions is when not to use them! :D

-- Mark

stickyblue
12-03-2003, 03:43 AM
:-D
i just learned the most important thing then . thanks alot again :)

CGTalk Moderation
01-16-2006, 08:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.