Jump to content

Resampling Stretched Grain Chain


DeeLan

Recommended Posts

Hey Everyone,

I've a got a scene where I need to stretch out and resample a cable made out of POP Grains. I've managed to get the stretching part going, but the resampling is causing issues. As you can see when the cable gets stretched the stretched parts essentially becomes really low res, so I need to resample it to keep the deformations smooth. As you may have guessed, a resample node inside a SOP Solver did not work. I tried a few different things, including transferring attributes from the old (lowres) cable to the newly resampled one based on uv's, copying some VEX code from inside the POP Grains node itself into a Point Wrangle to generate the needed attributes, and deleting all attributes/groups, recreating the targetP/weight/stiffness attributes and groups, and then letting the solver take care of the rest. None of these really worked.

Does anyone have any suggestions for how to do this? I have included my scene file with and alembic file so you guys have a look if you want. Its not the most elegant or pretty thing (still very much in the early stages) but if you follow the bright red nodes you will get to the SOP Solver where I want to do the resampling.

grainResampleIssue.gif

Grain_Resample_Help.hipnc

shot_0120_maya_export_v004.abc

Link to comment
Share on other sites

I already did something like that using a SOP Solver and POP Grain, adding geometry on the fly and building constraints on the fly as well (it was for a kind of cloth simulation : a carpet unwinding over stairs).

Anyway, what you can do inside the DOP network is : add a SOP Solver, and for each iteration, measure the length of each primitive (the "constraints"), and if it exceeds a certain threshold (a variable to play with), delete the primitve (in a Primitive Wrangle, with removeprim()), but keep the points (the last parameter of removeprim() must be 0); add a new point at the center of the two remaining points, and create 2 new primitives (using addprim(), of type "polyline"), with a restlength attribute and all the other necessary ones : stiffness etc...

It means that each time your constraint / primitive exceed the threshold, it dissappears and creates new geo, more detailed, that is added to the sim.

Maybe you'll have to play with the newly created restlength attribute of your new constraints, to create tension in your rope (by multiplying the restlength of newly created prims by some factor < 1). The factor should depend on how the rope was stretched at first. It should depend on your threshold as well : if you create geometry once the length is twice the restlength, then use 0.5 on the restlentgh of the newly created constraints...

I can upload an example tonight but you have the main directions.

 

Edited by StepbyStepVFX
  • Like 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...