Jump to content

RBD Constraints Stuck and Objects Drift Apart


Recommended Posts

Hi,

I'm trying to attach non-simulated curves, to simulated curves via an RBD network. I have a wire sim with the main tree, but it's super slow when adding all the tiny twigs...so I decided to post-deform those (with an RBD sim).

Problem is, when I constrain the twigs to the simulated branches, part of the constraints stay in one location and the twigs begin to drift from the branches.

I have included a super basic set-up that illustrates the issue.

Any help would be appreciated.

Thanks!

image.thumb.png.7281ae2cfce4140d3bbb6971adc32769.png

RBD_Constraints_Issue_v001.hip

Link to comment
Share on other sites

Actually, the RBDdeformingtoanimated SOP works really well in this case.

IN MY ORIGINAL SCENE: Just need to plug it in after the color2 SOP and before the ANIM GEO null (and remove the assemble...the rbddeformingtoanimated packs the geo for you).

Edited by TheDude123
  • Like 1
Link to comment
Share on other sites

Thanks for the additional scene file B).

Hmmmm, I tried these methods with my actual geo and it does not work...not sure what's going on.

I have uploaded 24 frames from my simulate tree, as well as the twigs I need to attach.

Any idea what's going on here?

Files:

https://www.dropbox.com/scl/fo/jfndsoyo4rhnod2kbaiz7/h?rlkey=4fmo4shzf46pid93rohzsdewj&dl=0

 

Edited by TheDude123
Link to comment
Share on other sites

14 hours ago, TheDude123 said:

Thanks for the additional scene file B).

Hmmmm, I tried these methods with my actual geo and it does not work...not sure what's going on.

I have uploaded 24 frames from my simulate tree, as well as the twigs I need to attach.

Any idea what's going on here?

Files:

https://www.dropbox.com/scl/fo/jfndsoyo4rhnod2kbaiz7/h?rlkey=4fmo4shzf46pid93rohzsdewj&dl=0

 

You have name and orient attrs on animated geo, use transform pieces sop.

 

transform_pieces.hipnc

  • Like 2
Link to comment
Share on other sites

4 hours ago, vicvvsh said:

You have name and orient attrs on animated geo, use transform pieces sop.

 

transform_pieces.hipnc 128.77 kB · 4 downloads

Thanks! That does seem to work...however, I tried to duplicate that workflow onto the last level of twigs, and it breaks. They won't attach properly (BLUE curves in image bleow). Is that because the level before does not have an orient attribute (the level that was previously transformed in your scene above (YELLOW curves in image below)?

Here is the geo for the smallest twigs I need to deform with sim. Any ideas on how to get that working?

Thanks, again.

https://www.dropbox.com/scl/fi/p08xn00qod8l3znvln7bt/TINY_TWIGS.bgeo.sc?rlkey=3j8nfesu29swkn7tyff2gtyhq&dl=0

PROBLEM:

Capture.JPG

Edited by TheDude123
Link to comment
Share on other sites

On 12/13/2023 at 12:35 PM, vicvvsh said:

First merge all static twigs. Then transform them. For the first and second stage you can use the same technique.

transform_pieces_02.hipnc 178.86 kB · 3 downloads

Hi Victor, 

Ok, I'm trying to apply this workflow to the actual tree geometry. I'm finding that point deforming the entire tree with the wire sim is pretty slow (16 seconds a frame).

So, I'd like to sim the larger parts of the tree and just use your workflow for the last 3 levels of smaller twigs.

However, I can't seem to get the twig geometry to line-up with the rest of the deforming geo sim. I added a connectivity (in place of the enumerate) to get the primid attribute onto the whole twig and changed the grouprange Start and End parameters...that helped, but still not quite there.

I have included a file with my progress, as well as the relevant geometry and simulations (a wire sim and a deforming version of the tree geometry for comparison/checking alignment of twigs).

Any additional help would be appreciate!

Thanks!

Files:

https://www.dropbox.com/scl/fo/38a4x7o0cdnutuxd6nexu/h?rlkey=qtjsijctidvc8cxyizjw2vz26&dl=0

Edited by TheDude123
Link to comment
Share on other sites

In case with geos instead of curves there is offset between v@pivot and new v@P.

Plug in timeshift9 to third input of attribwrangle40 and past this code to that attribute wrangle sop:

// get orient from sim
@orient = primuv(1, "orient", i@prim, v@primuv);
// find offset
vector pos = primuv(2, "P", i@prim, v@primuv);
vector offset = v@P - pos;
// set pivot
v@pivot = v@P;
// set position
v@P = primuv(1, "P", i@prim, v@primuv)+ offset;

 

Edited by vicvvsh
Link to comment
Share on other sites

3 hours ago, vicvvsh said:

In case with geos instead of curves there is offset between v@pivot and new v@P.

Plug in timeshift9 to third input of attribwrangle40 and past this code to that attribute wrangle sop:

// get orient from sim
@orient = primuv(1, "orient", i@prim, v@primuv);
// find offset
vector pos = primuv(2, "P", i@prim, v@primuv);
vector offset = v@P - pos;
// set pivot
v@pivot = v@P;
// set position
v@P = primuv(1, "P", i@prim, v@primuv)+ offset;

 

Hi Victor,

Thanks for the help!

Hmmm, that almost works. It still looks like the twigs are not aligned properly (see image). File is (Deform_Geo_v003)

I tried another approach to creating root point (creating a new point at base of each twig). However, it still wont align properly. In this case, I think it has something to do with how the extract centroid is creating the point. I've included this file if you are interested in checking it out (Deform_Geo_v004_My_Test)

Thanks.

Updated Files:

https://www.dropbox.com/scl/fi/giywk33pkt8v7n5vj3gkz/Deform_Geo_v003.hip?rlkey=ab41c48zuecslanlhdm8hhxt4&dl=0

https://www.dropbox.com/scl/fi/ehwjs5ndwagzu6ttr63hl/Deform_Geo_v004_My_Test.hip?rlkey=7kn0hf443i1vxveek3ai3jebl&dl=0

IMAGE:

image.thumb.jpeg.6d384fee37fff1ed994a0f7acd385553.jpeg

Link to comment
Share on other sites

I see here two problems:

1. Curve’s primitive consists of several segments and this primitive bends, squeezes and stretches while simulation. We define pivot and P on start frame then we take P each frame with primuv() but as primitive changes his form through simulation there is inconsistency between pivot and P. It can be avoiding by using copy to point instead of transform pieces, or using transform peaces but simulate curves where each segment is a primitive. But anyway these solutions help partly because it is not rbd simulation.

2. When you use curve for point deforming geometry in some places it deforms not accurately (see frame 24, camera 3) and it leads to others deviations.

I doubt it helps achieve accuracy totally but I hope it improve a lot.

Deform_Geo_v004_My_Test_02.hipnc

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