It's really fast than not using “Multithread When Compiled”.
For example, “connect adjacent pieces node” is not-Compileable.
In the adjacent piece node, “compute_point_normals” cause not-Compileable.
So I exchange this to “attribute_expression” like same function which do “compute_point_normals”.
It looks fine when I check “Single Pass” in ForEach Sop block one by one.
But it cause error when I disable “Single Pass” in Foreach Sop block.
So, I debug “connect adjacent pieces node”.
In “connect adjacent pieces node”, “connect_nearby_points” has some code like below.
I debug “connect_nearby_points”'s code. So, I find pcimport function causes error.
Is there anyway to fix this? or replace to attribute vop sop?
I think it's houdini 16.0's program error. It cause segmentation fault.
I test this Houdini 16.0.671 in Ubuntu 14.04, and Houdini 16.504.20 in Windows10.
Both of them cause Error and shut down Houdini program.
I attach file, too.
/// Creates a new line between the given point numbers.
void createline(int pt_a; int pt_b)
{
int prim = addprim(0, "polyline");
addvertex(0, prim, pt_a);
addvertex(0, prim, pt_b);
}
/// Returns true if the item is contained in the list.
int contains(string list[]; string item)
{
foreach(string str; list)
{
if (item == str)
return 1;
}
return 0;
}
int handle = pcopen(0, "P", @P, ch("../searchradius"),
chi("../maxsearchpoints"));
int max_connections = chi("../maxconnections");
string other_name;
string known_pieces[];
int num_connections = 0;
string my_name = s@name;
while (pciterate(handle) && num_connections < max_connections)
{
pcimport(handle, "name", other_name); // this line cause error
// Don't create connections to multiple points on the same piece, or
// to other points on our piece.
if ((my_name != other_name) &&
(num_connections == 0 || !contains(known_pieces, other_name)))
{
vector other_P;
pcimport(handle, "P", other_P); // this line cause error
// Only search in the direction of the point normal.
if (dot(other_P - @P, @N) >= 0)
{
int other_ptnum;
pcimport(handle, "point:number", other_ptnum);
createline(@ptnum, other_ptnum);
++num_connections;
if (num_connections < max_connections)
push(known_pieces, other_name);
}
}
}
pcclose(handle);