Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 24-07-2004, 01: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 02:04 AM.
DukerX is offline   Reply With Quote
Old 24-07-2004, 02: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, 02: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

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.