View Full Version : I want to extrude objects from Array using the first part of their names!
pigbelly 07-07-2003, 11:58 AM I have a array and I want to extrude some objects using the first part of their names!
The problem is that I just want their transform nodes.
The code I have know dont extrude transform node I don't know why but please take a look..
string $allObjects[] = `ls `;
for ( $obj in $allObjects )
{
print ( $obj + "\n" );
if ( `nodeType $obj` == "mesh" )
{
$gunMesh[$a] = $obj;
$a = $a + 1;
}
}
/Tommie
|
|
misterdi
07-07-2003, 12:52 PM
In case you got a shape node and want to query it's transform, you could use :
listRelatives -p $gunMesh[$a];
which will return its parent (-p)
BTW: Just curious, why do you want to get transform node for extrusion?, isn't it working with the face instead of transform?
Best regards,
pigbelly
07-07-2003, 01:09 PM
thanks for your help!!
sorry it's my english that made you missunderstand me .-/
I want to collect transformNodes out of an array!!
Do you by the way know how to use wildcards in MEL..
The nodeType command only give me shapeNode not the transform nodes??
so when I use "ls -type transform" the array fills up with tranformNodes which is correct but I cant collect any objects called mesh using the typeNode command?
and I should say, MEL and me are not friends (yet) :-))
/Tommie
pigbelly
07-07-2003, 01:16 PM
if I write this is works:
if ( $mesh == "mesh_clip" )
but if I write this I get nothing in the array:
if ( $mesh == "*mesh*" )
misterdi
07-07-2003, 01:22 PM
That's should be no problems.
Do query like:
ls -tr "*mesh*";
What it do, it will list all transform that have name like myMesh01, yourMesh02, etc.
Best regards,
misterdi
07-07-2003, 01:26 PM
if ( $mesh == "*mesh*" )
This doesn't give result what you want since "*mesh*" will be treated as literal.
unless you got routine to expand wild card, or you do substring match, then you got result.
Best regards,
pigbelly
07-07-2003, 01:54 PM
YEEESSS!!
Thank you big time man!!!
/Tommie
CGTalk Moderation
01-15-2006, 11:00 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.