custom sop node don't work after cooked.

   1081   1   1
User Avatar
Member
25 posts
Joined: July 2018
Offline
My custom sop node is use c++, and the code is modified from the sample SOP_star.
cook mode is COOK_DUPLICATE.

it work correctly at first cook.
After a cook, it don't work.

GA_Offset startptoff = gdp->appendPointBlock(spline_point_count);
for (int i = 0; i < spline_point_count; i++)
{
    GA_Offset ptoff = startptoff + i;
    gdp->setPos3(ptoff, spline_pos);
}

GEO_PrimPoly * prim_poly = (GEO_PrimPoly *)gdp->appendPrimitive(GA_PRIMPOLY);
prim_poly->setSize(0);

for (int i = 0; i < spline_point_count; ++i)
{
	prim_poly->appendVertex(startptoff + i);
}

when second cook or later, the spline point don't change position, sometimes the houdini crash.
why, i need delete the added spline point and prim_poly?

any suggest will be appreciate.
Thanks.
User Avatar
Member
897 posts
Joined: July 2018
Offline
Bumping this. In a GA_FOR_ALL_POINTS loop I can get invalid ptoff value and a chrash. Problem sounds similar to this post.

Documention on what's stored between cooks and how to manage data during them would be appreciated.
B.Henriksson, DICE
  • Quick Links