View Full Version : tags in function syntax

10 October 2005, 10:44 AM

I just touched mel, and must say that i'm really impressed with the easyness of it.

I have just one quick question.
as i coded some thing befor in c++,PHP and else, i'm very used to the function synthax:
Waht i want to know is, how can i use the tags of the mel commands if i use function synthax?

how would for example this command look in function syntax:

attachCurve -rpo 0 "curve2" "curve1" ;



10 October 2005, 05:47 PM
assuming attachCurve is a mel command that returns a string it'd look like:

string $crv = `attachCurve -rpo 0 "curve2" "curve1" `;

thats slightly different to c++ due to the fact that mel commands can take flag arguments.

A mel procedure on the other hand has a couple of different syntax options:

global proc float myProc( float $var1, int $var 2)
float $result = $var1 + $var2;
return $result;

// to call you can do either of these
float $f1 = `myProc 5.5 6`;
float $f2 = myProc(5.5, 6); // more like c

hope that helps


10 October 2005, 08:44 PM
thanks, i knew that, this is what is written in the manual.
i meant somtehing else.
I want to use the c++ like syntax. it works, for example,

$curv1andcurv2 = attachCurve("curve2","curve1");

this is working, but where do i place the "-rpo 0"? i mean, how can i set those tags when i use the c++ like syntax?

i read something in the manual, but couldn't grasp it.


10 October 2005, 01:15 AM
pass the flags as strings too ..

> attachCurve("-rpo", 0, "curve2", "curve1")

10 October 2005, 11:35 AM
ahh. Thank you wrend!

CGTalk Moderation
10 October 2005, 11:35 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.