CinnamonMetal Posted February 25, 2018 Share Posted February 25, 2018 I want a point per primitive and have that point centered per primitive. The addpoint sop is adding nine points, instead of only three points as there are only three primitives ? addpoint_perprim.hipnc Quote Link to comment Share on other sites More sharing options...
Sean-R Posted February 25, 2018 Share Posted February 25, 2018 This code should work in a Primitive Wrangle: // Adds a point at the position of each prim addpoint(0, @P); // Remove primitive and all points connected to it removeprim(0, @primnum, 1); 1 1 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 25, 2018 Author Share Posted February 25, 2018 Yes, I didn't mention one thing; I want to attach prims to points. Then using a POPNet have those points which will control the prims by simulating the points, why I'm using the setup in the scene file and trying to debug what is wrong with the scene file. Quote Link to comment Share on other sites More sharing options...
Noobini Posted February 25, 2018 Share Posted February 25, 2018 just beware of the flaw of getting the 'center' with this method...it's just 'average pos' rather than actual center of mass. So in the fig attached, the 'center' point is nearer to the pointy end which is simply wrong if you go by center of mass idea. More in this thread: Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 25, 2018 Author Share Posted February 25, 2018 15 minutes ago, Noobini said: just beware of the flaw of getting the 'center' with this method...it's just 'average pos' rather than actual center of mass. So in the fig attached, the 'center' point is nearer to the pointy end which is simply wrong if you go by center of mass idea. More in this thread: I understand what you mean; therefore without it being accurate, what is wrong with my setup as to why I'm not getting a point per primitive ? Would you be able to convert your scene files from that thread to an older version of Houdini, as I'm getting errors upon loading ? I'd prefer not to group all my primitives as mentioned in the thread if that choice is available when being accurate. Quote Link to comment Share on other sites More sharing options...
goldleaf Posted February 25, 2018 Share Posted February 25, 2018 This might help get you where you want to go (probably much more clever ways to do this), but this is how I'd approach the problem. There are a few things happening here (uses some ideas mentioned on other point-to-prim-center threads too): Point Generate SOP to add the points, avoiding the creation and deletion of geometry in a wrangle (to create/delete geometry, at some point VEX has to stop threading to do those operations), which probably only matters on larger geometry, but good to be aware of In a Point Wrangle, move the points to their corresponding primitive position Split apart primitives using Facet SOP, with the Unique Points toggle on After the particle sim, use Primitive SOP to transform the primitives using the particle network Group and delete primitives whose corresponding particle is dead You probably would be safer to setup an attribute dedicated to the particle-primitive relationship, but hopefully this helps a bit! addpoint_perprim_modified.hipnc 2 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted February 25, 2018 Author Share Posted February 25, 2018 (edited) Yes, this is what I'm after; except could you make it pre-H16 compatible ? Now I have a direction Where did you create the attribute @elemnum ? Edited February 25, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
goldleaf Posted March 1, 2018 Share Posted March 1, 2018 Here is a version using 15.5, which is as far back as I have installed. Often times, these warnings can be ignored (you know if the scene works, hehe). In this case, a fair bit didn't work. @elemnum is a pseudo-variable, which will refer to the point or primitive, depending on the type of wrangle it's running in. Hopefully you can get 16.0/16.5 as soon as possible, there are lots of excellent quality-of-life improvements (i.e. Group Expression). addpoint_perprim_modified_15_5.hipnc 1 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 1, 2018 Author Share Posted March 1, 2018 It sounds as if @elenum is sorta like geoself(); in current point or primitive; or as your note mentions alternative to @primnum / @ptnum, if I'm understanding correctly ? The scene is great; kudos nice and organized 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.