Problem with using`$variable` i procedure!?

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
  10 October 2005
Problem with using`$variable` i procedure!?

Hi. I have a small problem!

I want to make an array that contains the names of objects, whose .message attribute is connected to a multiMessageAttribute. These names MUST be full path names(long), since multiple nodes in the scene have the same name.

I can do this with the following code and that works just fine:

string $charName = "biped_charNode.bindJointsMM";
   string $listConnections = "ls -l `listConnections -destination false -source true $charName`";
   string $ctrlJointsName[] = `eval $listConnections`;


The problem comes when want to use the code inside a global proc eg:

global proc skListConnections(string $charName){
   
 		 string $listConnections = "ls -l `listConnections -destination false -source true $charName`";
   		  string $ctrlJointsName[] = `eval $listConnections`;
   }


This does not work! I get the error: $charNAme is an undefined variable..

It does however work, if I allready defined $charName in the maya script editor, prior to running the proc. (Outside the proc). But I need to call the proc from another proc, so this is not an option. :-)

Any surgestions??

:-) Sune
__________________
--- rigging blog ---
www.sunekempf.com/blog

Last edited by Nenox : 10 October 2005 at 02:33 PM.
 
  10 October 2005
slight mod

 global proc skListConnections(string $charName){
    
 	   string $listConnections = "ls -l `listConnections -destination false -source true " + $charName + "`";
 			 string $ctrlJointsName[] = `eval $listConnections`;
    }
 


The variable has to be outside the qoutes.
 
  10 October 2005
Nice.

That was a little too obvious.. :-|

The actual script line now reads:

string $listConnections = "ls -l `listConnections -destination false -source true " + $charName + "_characterNode.ctrlSkeleton`";


Thanks a lot!
__________________
--- rigging blog ---
www.sunekempf.com/blog
 
  10 October 2005
Sure thing.
 
  10 October 2005
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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 05:57 PM.


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