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® Maya® / MEL / Expressions through MEL .. need help
  RSS 2.0 ATOM  

Expressions through MEL .. need help
Rate this thread
 
63693
 
Permlink of this thread  
avatar
  • Location: Pune
  • Total Posts: 57
  • Joined: 11 July 2007 03:45 AM

Im working on simple script in which I want to connect some attributes with sine of Time through MEL

there are 20-40 grass planes. each has “RandValue” attributes in them. There is Main control where I want to Control all plane’s speed by its speed attributes.

...here is the script

string $sel []=`ls -sl`;

for (
$eachObj in $sel)
{

expression 
-o $eachObj -s  "rx =  sin (frame)  * $eachObj.RandValue * ctrl.Speed;";

//--- Here the ctrl is control for speed.

but something is wrong and getting errors.



Replies: 0
avatar
  • ldunham1
  • Posted: 20 January 2012 02:10 AM

There were a couple of problems with your string and the expression.
this seems to work.

string $sel []=`ls -sl`;
for(
$eachObj in $sel)
     
expression -($eachObj+".rx=sin(time*"+$eachObj+".RandValue)*ctrl.speed;") ;


Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 1
/userdata/avatar/s67rsr6uz_hj.jpg

Ohh.. thanks. Its working now..

Author: Nilesh Jadhav

Replied: 20 January 2012 04:05 PM