majinpu Posted October 20, 2017 Share Posted October 20, 2017 (edited) 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 October 20, 2017 by majinpu Quote Link to comment Share on other sites More sharing options...
Atom Posted October 20, 2017 Share Posted October 20, 2017 (edited) 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. ap_hitpath.hipnc Edited October 20, 2017 by Atom Quote Link to comment Share on other sites More sharing options...
majinpu Posted October 20, 2017 Author Share Posted October 20, 2017 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. Quote Link to comment Share on other sites More sharing options...
majinpu Posted October 20, 2017 Author Share Posted October 20, 2017 by the way you solved half of the problem! I forgot to merge the dop_import node with the object merge to keep the data! but stiil wrapping my head around on how to get the number of the group from a string attribute... Quote Link to comment Share on other sites More sharing options...
Atom Posted October 20, 2017 Share Posted October 20, 2017 Wouldn't you just use an atoi() funtction in a wrangle? http://www.sidefx.com/docs/houdini/vex/functions/atoi Quote Link to comment Share on other sites More sharing options...
majinpu Posted October 20, 2017 Author Share Posted October 20, 2017 sorry but I am really a vex noob...! how do you think I can use it? Quote Link to comment Share on other sites More sharing options...
majinpu Posted October 20, 2017 Author Share Posted October 20, 2017 I can't get it... Quote Link to comment Share on other sites More sharing options...
MarXindia Posted May 7, 2018 Share Posted May 7, 2018 (edited) 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 May 7, 2018 by MarXindia Quote Link to comment Share on other sites More sharing options...
markinglevfx Posted May 7, 2018 Share Posted May 7, 2018 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 2 Quote Link to comment Share on other sites More sharing options...
MarXindia Posted May 8, 2018 Share Posted May 8, 2018 @markingleukc ,thanks alot dude you saved my day. Quote Link to comment Share on other sites More sharing options...
Cihandro Posted July 26, 2021 Share Posted July 26, 2021 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.