gpapaioa Posted February 26, 2016 Share Posted February 26, 2016 Hello everyone. I am doing a bullet sim with cone twist contstrains and my goal is to trigger some event when one piece is not connected to any other piece. I would like to save the number of connected pieces (of each piece) in one attribute so I can know when exactly this attribute turned to 0. Is this some value I can extract from DOP (number of connected primitives) or smth possible by using VEX and nearpoints() like functions after sim? Thank you. Quote Link to comment Share on other sites More sharing options...
Atom Posted February 26, 2016 Share Posted February 26, 2016 If you have a constraint system there should be a SOP Solver attached. Dive inside the sop solver and you will have access to the constraints as reference geometry You can place a wrangle inside that context to count them as you see fit. That is how I have done glue bonds breaking from an external proximity object such as particles. Do you have a simple example to test on? Quote Link to comment Share on other sites More sharing options...
gpapaioa Posted February 26, 2016 Author Share Posted February 26, 2016 Thank you very much Atom, I dont have a simple example but I will make one and play. I am in the solver now. So if I put a wrangle node and store some custom attributes their will be available outside the DOP? Quote Link to comment Share on other sites More sharing options...
Atom Posted February 26, 2016 Share Posted February 26, 2016 (edited) You should be able to so long as you have not removed the primitive by the time you get to run your analysis code. One of the fundamental flaws I have found in the Houdini API is that you can't set attributes information outside of the context you are in. This is because you can only pass geoself() to a setattrib. However, you can pass any arbitrary path to read point attributes from. So maybe you can think backwards. Store the information locally on the reference geometry and then fetch from outside of DOP to make your decision. // I can construct a path into a simulation string agent_path = "op:/obj/crowd_sim:crowdobject/Geometry"; vector agent_location = point(agent_path,"P",@id); // From within DOPs I can also reach out to another SOP network. string scatter_path = "op:/obj/geo_target/scatter1"; int scatter_count = npoints(scatter_path); // But I can only write to the context I am in. setpointattrib(geoself(), "P", @ptnum, some_location, "set"); Edited February 26, 2016 by Atom 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.