PDA

View Full Version : vector array Error


wood_blue
01-24-2006, 02:54 PM
I tried this command ,then error occur in line2

vector $a[] = {<<0,0,0>>,<<5,0,0>>};
float $b = $a[0].x;

single vector work fine like this

vector $c = <<0,0,0>>;
float $d = $c.x;

is there some fault ?

pascal
01-24-2006, 03:57 PM
I believe this is a mel limitation.
You cannot access $a[0].x directly, but have to pass trough another variable:

{
vector $a[] = {<<0,0,0>>,<<5,0,0>>};
vector $dummy = $a[0];
float $b = $dummy.x;
}

I'll try to look in the help to be sure there's no other way...

Regards,
Pascal.

seven6ty
01-24-2006, 04:40 PM
Ummm, yeah, there are a number of faults. Mainly, you can't declare vecotrs inside of array, and arrays inside of vectors. The two are seperate, if you need to make a multi-column, multi-row variable like that, just use a matrix instead.

EigenPuff
01-25-2006, 12:39 AM
Yeah, this particular mel limitation is a real bummer (;_;). I wrote my own matrix / vector plugin because Mel's types bothered me so much. I can't speak for expressions, since I've never used them, but most other Mel things that require a vector can also work with float arrays of size 3 (i.e. float [3]).

*sigh*

wood_blue
01-25-2006, 02:17 AM
I'll try using both temporary nonarray vector and matrix as the situation demand.

Thank you for all replys!:wavey:

CGTalk Moderation
01-25-2006, 02:17 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.