Marta Feriani

demiaster

About Me

EXPERTISE
Technical Director
INDUSTRY
Film/TV

Connect

LOCATION
Canada
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

VEX array of structs Aug. 7, 2017, 12:12 p.m.

Hello,

I'm a newbie with vex and I'm trying to create an array of structs in a wrangle node. I defined the struct in the outer code section as suggested here [forums.odforce.net].

my struct looks like this

struct node {
int pt;
int nbrs[];
}

After defining the struct, I have the following as VEX expression

node nd;
node array[];

// let's say we initialized the nd fields to some values

int pt = nd.pt; //works fine
int nbrs[] = nd.nbrs; //works fine

array[0] = nd; //seems to work fine
pt = array[0].pt; //nope
nd = array[0]; //nope

How do I handle situation like this one? Am I missing something on how to use struct in VEX?
Basically I cannot access the content of my array.

When I say it doesn't work I mean that the node turns red and throws an error

Error

The sub-network output operator failed to cook: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1

Warning: Errors or warnings encountered during VEX compile:

/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1).

Errors or warnings encountered during VEX compile:

/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1).

Error: Vex error: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1)

Failed to resolve VEX code op: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1

Unable to load shader ‘op: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1’.

Warning

Errors or warnings encountered during VEX compile:

/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1).

Warning

Errors or warnings encountered during VEX compile:

/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1).

Warning

Vex error: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1)

Failed to resolve VEX code op: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1

Unable to load shader ‘op: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1’

Any ideas?

Thank you!