Greetings,
I have this annoying problem when building a SOP (with the HDK) that does a sort of “simulation” thingy, more specifically, it reads the incoming geometry at an “init” frame and then performs some sort of processing on the data for each subsequent frames.
The problem is that for some reason, the geometry doesn't update in the viewport unless I append another SOP to the output of my “sim” SOP.
The data in the spreadsheet is being updated correctly but for some reason not in the viewport; this must be something super simple that I'm missing.
Here's a boiled down cookMySop() function that reads the incoming geometry at some frame then simple adds 0.1 to the point's Y axis.
OP_ERROR SOP_DEBUG::cookMySop(OP_Context &context)
{
float now;
long frame;
int initframe;
GEO_Point *pt;
UT_Interrupt *boss;
now = context.myTime;
frame = context.getFrame();
if (lockInputs(context) >= UT_ERROR_ABORT)
return error();
OP_Node::flags().timeDep = 1;
initframe = INITFRAME();
if (error() < UT_ERROR_ABORT)
{
if(frame == initframe)
{
boss = UTgetInterrupt();
boss->opStart(“Initializing”);
gdp->clearAndDestroy();
duplicateSource(0, context);
boss->opEnd();
}
else
{
boss = UTgetInterrupt();
boss->opStart(“Setting new grid positions”);
FOR_ALL_GPOINTS(gdp, pt)
{
if (boss->opInterrupt())
break;
pt->getPos() += 0.1;
}
boss->opEnd();
}
}
unlockInputs();
myCurrPoint = -1;
return error();
}
I can upload the code and a hip file if needed.
As always, thanks in advance!!!
–Mark