PDA

View Full Version : Getting Parent Nodes


PlebianX
05-27-2003, 09:17 PM
ARGH! Computer ATE my original post!! :thumbsdow

Oh well, here in an abreviated form, is my question:

I have a list of nonLinear deforms, in this case ONLY bends:
$t = `ls -et nonLinear`;
Now, I want to change change the curvature attribute once I've gotten into a for loop and picked out a bend. How do I access with MEL the shapeNode of an object? And because I suspect they may not be the same question, how do you access an inputNode in general of any sort from a base node?
Sitting here typing makes me suspect you select the bend individually and then.... right, a command I don't know... Any help appreciated!!

//PlebianX

Buexe
05-27-2003, 09:57 PM
This method may be dirty but quick and easy:
get your object and use the pickWalk command

select -r pCube1 ;
pickWalk -d down;
// Result: pCubeShape1 //

But there are probably tons of slicker methods
I hope this helps
buexe

dstripinis
05-27-2003, 10:53 PM
The "nice" way to do it:

listRelatives -c -s

mark_wilkins
05-28-2003, 12:46 AM
This is a common question!!

http://sv1.3dbuzz.com/vbforum/showthread.php?threadid=33210

-- Mark

PlebianX
05-29-2003, 11:15 PM
First of all, THANK YOU! :) It's nice to have a place where you can ask questions and get ANSWERS.

SECONDLY: AAARGH! I was really hoping I was gonna get this on my own after that first bit of help, but Maya just ISN'T cooperating. pickWalk just doesn't seem to work... here's my code

$t = `ls -et nonLinear`;
for($c in $t)
{
select -r $c;
pickWalk -d down;
$s = `ls -sl`;
$s.curvature = $curve;
}

As far as I can tell, this should work, right? Grab the list, go through, select each component in the array, move down 1 node, put the now selected node in a variable, adjust to hearts content? I've put print() functions everywhere and it just doesn't seem to be moving down with pickwalk, tried with `` around it, tried $l = `pickWalk -d down`; and everything. I checked and made sure I wanted to go down, the pickWalk command is C&C from the script editor from when I did it by hand.
ANY help LOVED AND APPRECIATED!!

//PlebianX

ktpr
05-30-2003, 03:30 AM
try somethinig like (not sure about the legality of the syntax)
$s[0].curvature = $curve;

I think ls always returns a string[]
ktpr

dstripinis
05-30-2003, 03:37 AM
more like this: ( I kept your variables and the pickwalk, though this slows it down a little ) and I assume $curve is a value already declared

string $t[] = `ls -et nonLinear`;// you need an array

for ( $c in $t )
{
select -r $c;
pickWalk -d down;
string $tempStringArray[] = `ls -sl`;
$c = $tempStringArray[0];
setAttr ( $c + ".curvature" ) $curve;
}

Buexe
05-30-2003, 09:23 AM
I haven`t tested your code, but when I use "da good ol` dirty pickWalk style" I make a string that catches the result like:

select -r $obj;
string $shape = `pickWalk -d down`;

or:
string $shape = `pickWalk -d down $obj`;

The reason is that when you use it on a Mesh to get the shape, Maya doesn`t really select the shape node, like when you use the pickWalk to go through your Hierarchy.
Hope this helps
buexe

CGTalk Moderation
01-15-2006, 07: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.