Attempt to read from actively streamed attribute P?

   856   2   1
User Avatar
Member
2496 posts
Joined: June 2008
Offline
I opened an old Houdini file with a crowd simulation. It used to work fine, but now I get an error message inside my PopWrangle. Houdini no longer lets me set values using VEX on an agent?

Here's the code that generates the error.
string handle_path = "op:/obj/crowd_sim:crowdobject/Geometry";                      // Path to our database of attributes.
vector goal_location = point(handle_path,"P",i@relay_id);                           // Fetch the point location of the goal.
float relay_distance = length(goal_location - @P);                                  // Get distance between my location and the relay location.
setpointattrib(geoself(), "relay_point_distance", i@id, relay_distance, "set");     // Assign this location to an attribute on myself. 

The problem seems to be referencing @P inside a wrangle. How else am I suppose to calculate the distance between a goal and the current Agent being evaluated? If I substitute @P with a local constant vector, the error goes away.

I have tried altering the PopWrangle Inputs to reference Myself, but that didn't help.
Edited by Enivob - Jan. 29, 2023 09:19:47
Using Houdini Indie 20.0
Ubuntu 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
308 posts
Joined: Oct. 2016
Offline
Sorry, but I've recently started with VEX.

However, I tried to recreate parts of your case.

vector goal_location = {0,0,0};
float relay_distance = length(goal_location-@P);    
setpointattrib(geoself(),'relay_point_distance', @ptnum, relay_distance, 'set');

// having i@id in place of @ptnum will cause a failure when storing relay_distance in my simplified case
Edited by SWest - Jan. 29, 2023 11:48:36
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Staff
720 posts
Joined: Oct. 2012
Offline
In this case, if you're not actually needing to write to P you can remove it from the "Attributes to Create" list

If you did actually need to write to it, changing the POP wrangle inputs to "Myself" instead of "Myself (no reads of outputs)" would normally be the solution here, since you can't safely read from an attribute on other points in the geometry that is also being written to when multithreading is involved. But that doesn't work here because you're using a string path that happens to be the same as the geometry being modified ("op:/obj/crowd_sim:crowdobject/Geometry") rather than the 0/1/2/3 or @OpInput0 etc inputs
  • Quick Links