PDA

View Full Version : Storing Array Data in scene


mrp86
09-15-2010, 10:50 AM
Ok, so basically I'm trying to store a list of object names into a physical node in maya so that when the object is imported into different scenes you just need to select the overall node and then apply the scripts, and it will already know the geometry, nurbs and groups that it needs to apply the script too are.

I hope this makes sence, I basically just want to say something like:

setAttr ($tCNode + ".grpList") $tGrpList;

that will handle a list of data.

Kind Regards,

Pete

mlefevre
09-15-2010, 12:09 PM
Not sure of an efficient way to do this.
I suppose you could store a string in a text attribute type on a null, each item seperated with whitespace.
Then whenever you need the list, query the attribute and use tokenizeList or something.

NaughtyNathan
09-15-2010, 02:13 PM
you can add a string array (multi) attribute to your node.

for example:
string $dataNode = "locator1";
addAttr -multi -ln "nodeName" -dt "string" $dataNode;
for ($n=0 ; $n<8 ; $n++)
setAttr ($dataNode+".nodeName["+$n+"]") -type "string" ("Entry number: "+$n);
:nathaN

CGTalk Moderation
09-15-2010, 02:13 PM
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.