POP wrangle to detect impacts ?
2885 5 0- MagnusL3D
- Member
- 1104 posts
- Joined: Aug. 2008
- Offline
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
- MagnusL3D
- Member
- 1104 posts
- Joined: Aug. 2008
- Offline
bonsakAh 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..
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
- MagnusL3D
- Member
- 1104 posts
- Joined: Aug. 2008
- Offline
- bonsak
- 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:
This gets you an detail array attribute containing vectors that looks like this: ( recordnum, primnum, impulse value ).
-b
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
- MagnusL3D
- Member
- 1104 posts
- Joined: Aug. 2008
- Offline
-
- Quick Links