PDA

View Full Version : help please


meldu
01-16-2013, 12:49 AM
Hi, good night.

There is a maya MEL command that get the object`s name and store it in a variable?
i cant use string $objName []= `ls -sl`;, it donst work for me in this case, because i want the name of the object, and the later can acces to that specific object later

and, how can i acces to all the bojects in a array? i mean:

-i have 4 objects selected.
-i execute : string $myObjs[] = `ls -sl`;
-then, i want to select all those objects: select $myObjs[];
this give this error:
// Error: Syntax error //

so, how can i select all the objects in my array?

thanks.

gmask
01-16-2013, 01:34 AM
try this:

select $myObjs;

this will select all the items in the array

after you've declared an array variable you do not need the brackets unless you are specifying an index value such as:

select $myObjs[0];

this would select only the first item in the array.

meldu
01-16-2013, 01:36 AM
try this:

select $myObjs;

this will select all the items in the array

after you've declared an array variable you do not need the brackets unless you are specifying an index value such as:

select $myObjs[0];

this would select only the first item in the array.

ohhhhh. Thanks dude

CGTalk Moderation
01-16-2013, 01:36 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.