putting strings into expressions?
I'm currently playing with some MEL-scripting, but there is something I just can't figure out..
Is there a way to insert an "arglist" after a "curve" command? For instance: "curve $arglist;" where $arglist is a string containing as an example "-p 1 0 0 -p 1 1 0 -p 2 1 0 -p 1 1 1" The $arglist string is created dynamically in the script, one "-p x y z" sequence at the time. I think I could calculate the first four points and then execute "curve -p $x1 $y1 $z1 -p ......." and then use the "-a" flag to append points to the curve, but it's not very neat, and I haven't tried it yet. Not sure if it would work anyway... [Edit] By the way... I've tested the arglist by using the "print ($arglist);" command and then copying the result and paste it after a "curve" command in the command line. [/Edit] |
You'll need to use an eval command to combine multiple strings into a command like this:
Code:
$points = "-p 1 0 0 -p 1 1 0 -p 2 1 0 -p 1 1 1"; |
Yeeha!
Thanks alot man. It works! (I'm using the script to create spirals..) |
All times are GMT. The time now is 08:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018