Thomas Glässer

thomas_glaesser

About Me

Expertise
Freelancer
Location
Germany

Connect

Recent Forum Posts

Popnet bug in 19.0.455 April 19, 2022, 2:03 p.m.

Hi @inkbot,

check your error message - there you will find the path to the affected "popnet".
Dive into:
  1. popnet
  2. popsource (right click -> allow editing of contents)
  3. sopsolver
  4. attribwrangle1 (perhaps the opdigit will vary, check the error message for that)
  5. check lines 4 and 5 and follow @Enivob's instructions

Enivob
...

It looks like a little sloppy coding inside the source_first_input sopsolver.
Here is the problem code:
#include <voptype.h>
#include <voplib.h>

int npts = ch("npts");
int seed = ch("seed");
float frame = ch("frame");
int firstpointcount = npoints(0);
int firstprimcount = nprimitives(0);
The message box indicates it a problem with nprimitves, but the real problem is the assignment from the ch() function to the variable. My guess is when this HDA was authored, there was no strict vex type enforcement taking place. It looks like ch() defaults to returning a float, instead of returning the type of the parameter that it is referencing. "seed" is an integer, but ch("seed") returns a float. The simple fix is to explicitly fetch an integer to begin with.

This code change fixes the error message on load.
#include <voptype.h>
#include <voplib.h>

int npts = chi("npts");
int seed = chi("seed");
float frame = ch("frame");
int firstpointcount = npoints(0);
int firstprimcount = nprimitives(0);
Use chi() instead.