Custom POP Attribute Issue

   3304   1   1
User Avatar
Member
21 posts
Joined: April 2008
Offline
I'm encountering a strange issue when using a VOP > POP Type. The code below was compiled successfully to a Digital Asset, then attached to a network.

#define VOP_OP
#define VOP_POP

#pragma opname avoidNeighbor
#pragma oplabel avoidNeighbor
#pragma opmininputs 1
#pragma opmaxinputs 1

#pragma label pointcloud “Point Cloud”
#pragma label radius “Radius”


pop
avoidNeighbor(string pointcloud=“”; float radius=1 )
{
float evac = 0 ;
int handle = pcopen(pointcloud, “P”, P, radius, 100);
while (pciterate(handle))
{
evac += 1 ;
}
addattribute(“evac”, evac) ;
}

The network reads as follows:
A Geometry node exists in /Obj .
Inside the Geometry is a Grid with default settings.
The Grid is plugged into the first input of a POP Network.
Inside the POP Network is a Source node, using Grid as input.
The Source node plugs into the custom operator defined by the code above.

The problem comes when trying to use the attribute generated at that node. It reads in “Details View”, but results in an error when used in a parameter of a downstream node. All my resources say that this setup should work, functioning when ‘$EVAC’ is used in expressions of downstream nodes. But, it does not.

Any ideas?
I could have been a Rescue Ranger.
User Avatar
Member
4344 posts
Joined: July 2005
Offline
Try adding

addvariablename(“evac”, “EVAC”);
if(coffees<2,round(float),float)
  • Quick Links