View Full Version : vector array Error

01 January 2006, 03: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 ?

01 January 2006, 04: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...


01 January 2006, 05: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.

01 January 2006, 01: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]).


01 January 2006, 03: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 January 2006, 03: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.