evanrudefx Posted May 30, 2017 Share Posted May 30, 2017 (edited) Hey, How do you attach wires to a surface? Quite obvious, there is the attach wire to surface node. However, you have to choose the points on the wire to constrain. I have over 1000 curves, so that method would never work. I see in the manual this: "The Wire Solver will constrain certain points if it finds a point attribute called pintoanimation or gluetoanimation on the Geometry subdata. This can be used to release point constraints on a per-point basis." Is that what i need? if so, how exactly can I get it to work? How can I create a group that contains the root points of the curve. Thanks Edited May 30, 2017 by ejr32123 Quote Link to comment Share on other sites More sharing options...
adrianr Posted May 31, 2017 Share Posted May 31, 2017 Can you post a hip? There are numerous ways to sort point numbers or transfer attributes, so it should just be a case of finding which one works for your set up and then wrangling those points with the correct attribute. Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 31, 2017 Author Share Posted May 31, 2017 Hey! I attached the scene. The model and curves should load fine. Thanks, EJ hair_herbert.hipnc Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 31, 2017 Author Share Posted May 31, 2017 (edited) I found out I can make a group of the base of the curves like this: i@vtx = @ptnum % n, and n = the amount of points that the curves have. This only works if the curves all have the same amount of points. Is there a better way of writing this? I know xgen from maya always gives the same number of points per curve, so this works atm. edit, i make a attribute wrangle with code i@vtx = @ptnum % n; in the group node, then I set base group to = @vtxno==0, which gives me the the first point on each curve. Edited May 31, 2017 by ejr32123 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 31, 2017 Author Share Posted May 31, 2017 Here is my updated scene. Not sure why the hair is going wild and not following geometry. hair_herbert2.hipnc Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 31, 2017 Author Share Posted May 31, 2017 it seems glue to animation only works if you are generating the curves at points on the geometry, like making a curve and using copy stamp. Now I am not sure what to do. Quote Link to comment Share on other sites More sharing options...
fencer Posted May 31, 2017 Share Posted May 31, 2017 Check this approach (Wire solver) http://www.tokeru.com/cgwiki/index.php?title=HoudiniDops Quote Link to comment Share on other sites More sharing options...
fencer Posted May 31, 2017 Share Posted May 31, 2017 >> it seems glue to animation only works if you are generating the curves at points on the geometry Sorry) 1 Quote Link to comment Share on other sites More sharing options...
fencer Posted May 31, 2017 Share Posted May 31, 2017 Ok, but what about ordinary constrain? wires_to_surface.hip Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 31, 2017 Author Share Posted May 31, 2017 24 minutes ago, fencer said: Ok, but what about ordinary constrain? wires_to_surface.hip Can you get that to work on my scene? It seems to work with curves generated at points..... but not mine Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 1, 2017 Author Share Posted June 1, 2017 Not sure why it is so hard to attach wires to surface when the wire were not generated in houdini... Quote Link to comment Share on other sites More sharing options...
Jordan Walsh Posted June 2, 2017 Share Posted June 2, 2017 Sorry, havent looked at your file but... Cant you just select the base points of all the curves and point deform them to your surface and set the pintoanimation in sops before you send to the wire solver? That way you are feeding in a goal position to the base points on the curves and not relying on matching it up with other geo. For selecting the base point you can always use a for each loop and loop over each curve and pick the first point of the single curve Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 2, 2017 Author Share Posted June 2, 2017 1 hour ago, Jordan Walsh said: Sorry, havent looked at your file but... Cant you just select the base points of all the curves and point deform them to your surface and set the pintoanimation in sops before you send to the wire solver? That way you are feeding in a goal position to the base points on the curves and not relying on matching it up with other geo. For selecting the base point you can always use a for each loop and loop over each curve and pick the first point of the single curve After reading about point deform, it seems point deform you need similar topology-Transferring animation from proxy to high res. How would I use it here? Quote Link to comment Share on other sites More sharing options...
Jordan Walsh Posted June 2, 2017 Share Posted June 2, 2017 Point deform is pretty good at interpolating, id just give it a go! I would have to have a look at your scene if thats not a good option, which I cant do at the moment... Quote Link to comment Share on other sites More sharing options...
adrianr Posted June 2, 2017 Share Posted June 2, 2017 1 hour ago, Jordan Walsh said: Sorry, havent looked at your file but... Cant you just select the base points of all the curves and point deform them to your surface and set the pintoanimation in sops before you send to the wire solver? That way you are feeding in a goal position to the base points on the curves and not relying on matching it up with other geo. For selecting the base point you can always use a for each loop and loop over each curve and pick the first point of the single curve Haven't had a chance to finish fixing it but this is pretty much where I got to last time I had a look. Looping through the wires and assigning the base points is the easy bit, but then getting that working nicely with SBD constraints in dops was proving very difficult. When I last closed the file I think I had concluded that something using a point deform pre-dops would be the way to go but didn't have time to try it. The SBD constraints seem really unintuitive to be honest - I'm guessing it uses point number to match constraints which unless you're making the wires from the same points as the example file above just leads into a world of hurt. Quote Link to comment Share on other sites More sharing options...
adrianr Posted June 4, 2017 Share Posted June 4, 2017 (edited) Hey ejr, sorry this took a while. Was right in the middle of something when I first took a look and then left everything on my work machine. I just rebuild it at home quickly as it's pretty simple. I haven't delved into getting the SBD constraints to work as I'd need to look into more about how it matches up constraints - I'll try and get round to it as having multiple techniques in your bag is never a bad thing. Here is a version using the pintoanim that Jordan and I are talking about above. I've put in a couple of ways to select the base points of the curves. It's assuming the base point is the lowest ptnum but there's a visualizer in there to easily see what either method has selected for you. Knowing that you can use an integer attribute called pintoanimation, which is an attribute recognised by the solver to constrain that point to its position in the target animation. I use point deform to match the animation to the model. At this stage you will see all the wires moving as one, but it's only the motion of the pintoanimation points we care about. Once in dops the animation on the rest of the curve will be ignored and the wires will move as per the sim. Something I did, which may or may not be what you want, is set the 2 base points as pintoanimation, so the curve still stays pointing in the general direction of its rest state. This was just a quick fix to stop it essentially pivoting around just the one base point constraint. I haven't set up any collisions etc so if you had those maybe that wouldn't matter, but hopefully this helps if you had no joy with the regular SBD constraints. hair_herbert_pintoanim.hipnc Edited June 4, 2017 by adrianr 1 1 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 5, 2017 Author Share Posted June 5, 2017 On 6/2/2017 at 0:28 PM, adrianr said: Haven't had a chance to finish fixing it but this is pretty much where I got to last time I had a look. Looping through the wires and assigning the base points is the easy bit, but then getting that working nicely with SBD constraints in dops was proving very difficult. When I last closed the file I think I had concluded that something using a point deform pre-dops would be the way to go but didn't have time to try it. The SBD constraints seem really unintuitive to be honest - I'm guessing it uses point number to match constraints which unless you're making the wires from the same points as the example file above just leads into a world of hurt. Clearly you are a magician!! Thanks so much. I have never seen some of these nodes before so I will have to study the scene a bit. Again, Thanks. Quote Link to comment Share on other sites More sharing options...
trzanko Posted June 10, 2017 Share Posted June 10, 2017 No matter the orient or resolution of the wires you can determine the point nearest the surface. You can use the vertex prim index function to determine which points are the 0 point on the primitive. http://www.sidefx.com/docs/houdini/vex/functions/vertexprimindex Then if the points that equal vertex zero are actually the furthest from the surface you can determine how many points are on the primitive by the prim vertex count function and then the point that has that corresponding vert number is the nearest point. http://www.sidefx.com/docs/houdini/vex/functions/primvertexcount Furthermore if you have varying wires where the nearest point is sometimes the zero point and sometimes the end point then you can determine which one is closest to the skin by measuring the length to the nearest point on the nearest primitive. Hope this helps, -Tighe 1 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.