POP wrangle to detect impacts ?

   2884   5   0
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
Can I somehow digg out the “impulse” attribute from a RBDpacked object through a POP wrangle with VEX ?
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
If you add a Sop Solver before the POP Wrangle, you can get the impulse data from the “Impacts” node. Pass the values to the POP wrangle as a point array attribute or something.

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
bonsak
If you add a Sop Solver before the POP Wrangle, you can get the impulse data from the “Impacts” node. Pass the values to the POP wrangle as a point array attribute or something.

-b
Ah yes…but it is the “or something” im wondering with now because if I connect the SopSolver directly to the POP Wrangle i am not sure how to access the Impulse attribute, just a simple @impulse in the POP wrangle VEX snippets doesnt do it so I assume I have to connect something to the Impacts node inside the SOP Solver hmmhm..
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
Ah this solved it:

string myimpact_path = "op:/obj/geo1/dopnet1/sopsolver1/impacts";
float myimpact = point(myimpact_path,"impulse", @ptnum);

I couldnt just simply do point(“../sopsolver1/impacts”, “impuse”, @ptnum); which I was sort of hoping, owell learned something new
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Cool. Didn't know you had to reference it with absolute paths. But i think that will only give you the first impulse value for each packed primitive. Not all the impulse values for each packed primitive?

I thought maybe something like this would work in a wrangle in the SOP Solver but it's not updating the detail attribute on the Geometry data in the dopnet. Anyway here it is:
int npts = npoints(1); // Get the nuumber of points from input 2
vector impulse[]; // Declare the array to hold the values
for(int i = 0; i < npts; i++){
    int recordnum = point(1, "recordnum", i); // Get the pointnumber
    int primnum = point(1, "primnum", i); // Get the primnum / same as packed
    float imp = point(1, "impulse", i); // Get the impulse value
    
    impulse[i] = set(recordnum, primnum, imp); // Wrap all three into an array
}
v[]@_impulses = impulse; // Set the array as an attribute

This gets you an detail array attribute containing vectors that looks like this: ( recordnum, primnum, impulse value ).

-b

Attachments:
impulse.hiplc (232.1 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
Well I did make a printf on the impulse value from the VEX in the POP Wrangle and set @ptnum to 0 and back to @ptnum and from those results it does look like it works on all packed primitives. but I will investigate a bit further and look some at your code.
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
  • Quick Links