Jump to content

Attaching wires to surface


evanrudefx

Recommended Posts

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 by ejr32123
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by ejr32123
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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 by adrianr
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

  • Thanks 1
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...