FORUMS: list search recent posts

How I can write this very very simple MEL script?

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Mostafa Talebi
How I can write this very very simple MEL script?
on Dec 10, 2011 at 5:16:13 pm

Hello everybody

I want a simple MEL script to do the following simple job:

add an expression in the attribute "x" of the selected object.
How shall I write this?

(the simulated code)

//
variable $expression = xyzxyz;
add $expression in the expression field of the attribute X of the selected object;
//


Return to posts index

Steve Sayer
Re: How I can write this very very simple MEL script?
on Dec 12, 2011 at 3:48:07 pm

Simply creating an expression which references an object's attribute(s) is enough to make the connection happen.

Use the 'expression' command to create an expression from a script. You can make the content of the expression a variable first, as you've done here, or you can just do it all in one line. For example:
expression -s "polyCube1.translateY = sin(time);";...will work, and you should get the same result with:
string $exp = "polyCube1.translateY = sin(time);";
expression -s $exp;
Hope that helps.

-Steve


Return to posts index

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