PDA

View Full Version : vectorArray Problem


jesusquintana
09-25-2006, 08:58 PM
Hallo everybody,

i want to create a custom attribute on a geometry node. in this attribute i want to store four vectors. i'm able to add the attribute, but just can't figure out how to store the values.

here's the example code:

$selection =`ls -sl`;
vector $a1 = <<0, 1, 1>>;
vector $b1 = <<9, 9, 9>>;
vector $ab1[2] = {$a1,$b};

addAttr -ln test -dt vectorArray $selection[0];
setAttr ($selection[0]+".test") -type vectorArray $ab1;

Could someone please be so kind to point out what i'm doing wrong.
thanks in advance.

--david

artifish
09-26-2006, 12:17 AM
check out the docs on the setAttr command, first argument has to be the number of elements you are about to set, followed by the individual elements. So this should work:

setAttr ($selection[0]+".test") -type vectorArray 2 $ab1[0] $ab1[1];

problem is now that when you
getAttr ($selection[0]+".test")
you will get a float[] and not a vector[], which is not nice, but afaik you can't do anything about it (other that writing a wrapper function which reconverts the result int a vector array)

Hope it helps,
Carsten

jesusquintana
09-26-2006, 04:55 PM
Vielen Dank für die Antwort und viele Grüsse nach Down Under.

CGTalk Moderation
09-26-2006, 04:55 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.