PDA

View Full Version : tags in function syntax


D3CK
10-28-2005, 11:44 AM
Hi!

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:
"someFunction(someparam,moreparam);"
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" ;

?
thanx

D3CK

tweeeker
10-28-2005, 06: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

T

D3CK
10-28-2005, 09: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.

D3CK

wrend
10-29-2005, 02:15 AM
pass the flags as strings too ..

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

D3CK
10-29-2005, 12:35 PM
ahh. Thank you wrend!

CGTalk Moderation
10-29-2005, 12:35 PM
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.