Wierdest VEX struct issue

   824   0   1
User Avatar
Member
2 posts
Joined: Feb. 2016
Offline
I have a couple of structs declared in a .h header file. My problem started that whenever I include the header file in an AttribWrangle node and then use a specific function from one of the structs, it seems like Houdini can recognize the array kind of another struct I have in the same file.

I narrowed down the bug and here's a shortened header file which reproduces the error (I know the code is nonsense and won't do anything in the shortened state but my problem is the iritating error the wrangle node produces):

This is the header file (Test.h):



struct StructManager
{
string mTags;
int mIds;
string mAllTags; // workaround: there is a bug with string arrays on detail with my version of houdini 15.0.274

int mGeometry; //after a manager is opened or gotten, it'll know the geometry who owns it

void close()
{

string tagList;
int count = len(tagList);
for (int i=0; i<count; i++){
}
}

void open(int aGeometry)
{
mGeometry = aGeometry;
mIds = attrib(mGeometry, “detail”, “mIds”, 0);
mTags = attrib(mGeometry, “detail”, “mTags”, 0);
mAllTags = attrib(mGeometry, “detail”, “mAllTags”, 0);
}

}

struct Point
{
int mNumber;
vector mPos;
}

struct EndPoint
{
int mNumber;
vector mPos;
int mOppositePoint;
}


now if I write this in a wrangle node:

#include <Test.h>

StructManager manager;

Point points;

int count = len(points);
manager -> close();


The error is "No matching function for int len(Point)“ . Now If I replace this line from the ”close“ method of the ”StructManager" no error is produced!!!!

int count = len(tagList); ——> int count = 10;


It seems the problem lies with calling len() inside close()
Can anyone reproduce it ? Any ideas why this is happening?
  • Quick Links