SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / putting strings into expressions?
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 24-07-2004, 12:58 AM   #1
DukerX
Subscriber
 
DukerX's Avatar
 
Join Date: Nov 2002
Location: Sandnes, Norway
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Angry 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]
__________________
-DX-

Last edited by DukerX : 24-07-2004 at 01:04 AM.
DukerX is offline   Reply With Quote
Old 24-07-2004, 01:29 AM   #2
dannyngan
Registered User
 
dannyngan's Avatar
 
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
Thanks: 0
Thanked 1 Time in 1 Post
Default

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";
eval("curve " + $points);
__________________
Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job
dannyngan is offline   Reply With Quote
Old 24-07-2004, 01:39 AM   #3
DukerX
Subscriber
 
DukerX's Avatar
 
Join Date: Nov 2002
Location: Sandnes, Norway
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeeha!
Thanks alot man. It works!
(I'm using the script to create spirals..)
__________________
-DX-
DukerX is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.