Jump to content

get dop hitpath data in vex


majinpu

Recommended Posts

Hi guys.

I am trying to set some attributes based on my hitpath id's.
The original scene was using a flip fluid and a gas collision detect,... by the way I'm uploading a scene file with a pop net set up for speed reasons.

In the file scene I have uploaded I have created a pop network with a collision detect and a sopsolver to fetch the attribute data from the dop geometry.

I do not understand how to get the right data from the hitpath attribute to set my "colliderid" attribute. It seems to be a group as well and I am wrapping my head around it!

Another thing I noticed, it is that the geometry spreadsheet doesn't seem to show the correct feedback of the hitted points...they seem to be not enough...I am doing something wrong?
 

cheers

paolo

 

hitpath.hipnc

Edited by majinpu
Link to comment
Share on other sites

Here is how I handle this. Inside the popsolver you need to turn on Add Hit Attributes and Add Impact Data. Then you can fetch the impact points, as they occur, inside another piece of GEO, via the dopimportrecords node.

So there are really three uses for the impact data, momentary impacts, accumulated impacts and total impacts over time. In this image I show each case.

Untitled-1.jpg

ap_hitpath.hipnc

Edited by Atom
Link to comment
Share on other sites

Hi atom thanks for your answer. But I think I exposed my problem in a wrong way....!

 

The set up I have needs to remain inside the dop net. 

So far I could get the data in the dop net (using a solver inside it) but I can't understand how to get the data from the "Geometry" attributes inside dops.

In particular using the "hitpath" attribute since it is a string containing a group number.

 

Link to comment
Share on other sites

  • 6 months later...

Hey Guys very Old topic still digging it....I am facing same issue.I have multiple static objects inside my dop and I want to control the behaviour of my particles after collision with each object differently,so far only option I can find is hitpath attribute which gives me collision data for each object,but I am not able to use it.Don`t know where I am going wrong...below is a small expression that I am trying to use to just change the color of my particles whic\le colling\ding with different objects which gives me error....

if(@hitpath == op:/obj/geo1/popnet:0)

    @Cd = {0,1,0};

else

    @Cd = {1,0,0};

 

I am getting error that says unexpected ":" expecting ")",I really am stuck

 

Edited by MarXindia
Link to comment
Share on other sites

if(s@hitpath == "op:/obj/geo1/popnet:0"){
	@Cd = {0,1,0};
}
else{
	@Cd = {1,0,0};
}

Use s@hitpath to make sure the if statement is testing against a string attribute. And use quotes to define your path.

I've included a file of my own that has particles changing color depending on their collider object.

collision_behaviour.hip

  • Like 2
Link to comment
Share on other sites

  • 3 years later...

Hi guys, resurrecting this old thread,

thanks for the great piece of code markinglevfx,

now lets say instead of changing the colour i wanted to add each hit group to its own group and affect it with different wind etc forces, how would I go about doing that?

I'm looking at adding the particles (points to a group) via vex.

Does that sound right?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...