listAttr -locked??

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2005   #1
listAttr -locked??

hi guys its pretty late and odnt know what to do with that
i want my script to constraint a skeleton to another and if there is some attr who are lock to pass over so
for the listing and constraint its fine but its to get the list of all the atr who are lock is a little problem i dont know why but it doenst work

string $sel[] = `ls -sl`;

string $first[] = `ls -sl -dag -type joint $sel[0]`;

string $last[] = `ls -sl -dag -type joint $sel[1]`;

string $attrs[]={".tx",".ty",".tz",".rx",".ry",".rz",".sx",".sy",".sz",".v"};



for ($j = 0; $j < size($last); $j++)

{

string $GetLock = ` listAttr -locked ($last[$j] + $attrs) `;

}
thx for help
__________________

 
Old 01 January 2005   #2
for ($j = 0; $j < size($last); $j++)


...Should be:

for ($j = 0; $j < `size $last`; $j++)

...Off the top of my head, that's one error, I'd think.

Edit: Also, your for loop should be based off the size of your $attr variable, instead of your $last variable.

Last edited by seven6ty : 01 January 2005 at 10:21 AM.
 
Old 01 January 2005   #3
Originally Posted by JFFORTIN: hi guys its pretty late and odnt know what to do with that
i want my script to constraint a skeleton to another and if there is some attr who are lock to pass over so
for the listing and constraint its fine but its to get the list of all the atr who are lock is a little problem i dont know why but it doenst work

string $sel[] = `ls -sl`;

string $first[] = `ls -sl -dag -type joint $sel[0]`;

string $last[] = `ls -sl -dag -type joint $sel[1]`;

string $attrs[]={".tx",".ty",".tz",".rx",".ry",".rz",".sx",".sy",".sz",".v"};



for ($j = 0; $j < size($last); $j++)

{

string $GetLock = ` listAttr -locked ($last[$j] + $attrs) `;

}
thx for help
listAttr returns an array, not a string. so change the line in the loop to:

string $GetLock[] = ` listAttr -locked ($last[$j] + $attrs) `;

seven6ty: his syntax is fine. you can use either
for ($j = 0; $j < size($last); $j++)

OR

for ($j = 0; $j < `size $last`; $j++)

they're just two different ways of calling a function.
__________________
-:macaroniKazoo:-
 
Old 01 January 2005   #4
ok now i can get my attr who are lock but the thing is my script doenst understand whick joint is lock or not it only show me those attribute who are lock
so i need to get who is lock and if he is lock only orientConstraint and if he is not lock point and OrientConstraint





global proc connectSkeleton()
		 {
	string $sel[] = `ls -sl`;
	string $first[] = `ls -sl -dag -type joint $sel[0]`;
	string $last[] = `ls -sl -dag -type joint $sel[1]`;
	string $attrs[]={".tx",".ty",".tz",".rx",".ry",".rz",".sx",".sy",".sz",".v"};
	string $GetLock[] = ` listAttr -locked $last`;
				  if (`size $GetLock` > 0)
					 {
					   for ($i = 0; $i < size($first); $i++)
					{
	 for ($x = 0; $x < size($last); $x++)
				  {
							  orientConstraint $first[$i] $last[$i];
							   pointConstraint $first[$i] $last[$i];
			}
						   }
					   }
					 else
						  {
					   for ($i = 0; $i < size($first); $i++)
					{
	 for ($x = 0; $x < size($last); $x++)
				  {
							  orientConstraint $first[$i] $last[$i];
			}
						   }
						 }
		  }
			  
__________________


Last edited by JFFORTIN : 01 January 2005 at 04:06 AM.
 
Old 01 January 2006   #5
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:13 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.