VEX dictionaries cannot have vector[] as an item value?

   1865   1   0
User Avatar
Member
52 posts
Joined: 4月 2011
オフライン
Ok, so I am trying to figure out a good way of collecting information from various voxels inside of a Gas Field Wrangle and I was going to load everything into lists attached to each voxel address in a dictionary, so something like this:
dict collect;
collect["attribute"] = dict();
for(int x=0; x<4; x++){
    for(int y=0; y<4; y++) {
        for(int z=0; z<4; z++) {
            if(find(keys(collect["attribute"]),sprintf("%d",set(@ix,@iy,@iz)) < 0){
                vector a[];
                collect["attribute"][sprintf("%d",set(@ix,@iy,@iz))] = a;
            }
            append(collect["attribute"][sprintf("%d",set(@ix,@iy,@iz))], volumeindexv(0, "attribute", set(x,y,z));
        }
    }
}

This code should work, except for when I try to set the initial empty vector array to the value in the dictionary it gives me the error: Invalid assignment from vector to float.

The documentation on dictionaries says that it supports vector, but not vector as a value, though it has for just about every other type. Is this something like VEX not supporting nested arrays? If that is the case, why is vector a valid type at all? I can make a list of points anywhere else in vex, just not as a value in a dictionary.
User Avatar
Member
50 posts
Joined: 9月 2014
オフライン
do use "serialize" and "unserialize" vex functions.
  • Quick Links