Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope Attachment on dynamic rope length and Stitching questions
#11
(06-11-2023, 04:01 AM)Balou Wrote: I know it's an old thread but the issue is back and the images are still relevant. 
I updated the plugin recently and I've got the exact same issue about the renderablePositions doing these weird things. I can still see the rope switching between 2 positions if I'm using rope.solver.OnInterpolate, and doing nothing if I'm using rope.OnInterpolate.

Hi,

ObiBones update rendering by write particle data to the bone transforms in their Interpolate() method, right before calling the actor's OnInterpolate() event. So there's a slight difference between using solver.OnInterpolate and rope.OnInterpolate, and that is that the solver's one takes place before rendering is updated in each actor's Interpolate() by copying particle positions over to the skeleton bones.

Quoting the documentation:
http://obi.virtualmethodstudio.com/manua...olver.html
Quote:OnInterpolate: Called at the start of the updater's Interpolate(), after all simulation for the current frame has been performed and particle positions have been interpolated, but before updating rendering components.

So if your code modifies the solver's renderablePositions, it must be done in solver.OnInterpolate. If you do it in rope.OnInterpolate it will be executed after rendering has been updated, so any changes you make to rendering data such as renderablePositions will be completely ignored.

As to why the rope is switching between 2 positions, I'm not entirely sure. The code I shared in this thread still works fine and haven't been able to reproduce anything similar myself, so there must be something else going on in your project. Would it be possible for you to share it with us (by sending it to support(at)virtualmethodstudio.com) so that I can take a closer look?

kind regards,
Reply
#12
Thanks for your answer, you can see it in the project I sent you a couple of weeks ago. (13th of October)
Now if I hit pause when I swinging the rod I can see there is a gap between the rod model and the bone visualization, like they are not at the same position, which is what is causing the gap between the end of the 3d model and the beginning of the rope. Still no idea about the flickering. 
Note that I'm constructing the rope at runtime, it starts close to 0 and I can expand it. But the first particle should not be affected.

On the attachment you can see the gizmos of the bones on the left, and the rod model on the right, the audio source is attached to the last bone on the rod, to which I'm also attaching the rope using renderablePositions. So I guess something is wrong here?
   
Reply
#13
(07-11-2023, 12:26 AM)Balou Wrote: Thanks for your answer, you can see it in the project I sent you a couple of weeks ago. (13th of October)

Hi,

Searched our support inbox for emails from you (zabka.jo*****) but didn't find the project. Would it be possible for you to resend it?

(07-11-2023, 12:26 AM)Balou Wrote: Now if I hit pause when I swinging the rod I can see there is a gap between the rod model and the bone visualization, like they are not at the same position, which is what is causing the gap between the end of the 3d model and the beginning of the rope.

The bone visualization simply draws renderable particle positions, so bone visualization and mesh they should be in the exact same position (ofc assuming bone weights for each mesh vertex sum up to 1). Something weird is definitely going on.
Reply
#14
Hi again,

Took a look at the project you sent and answered your email. In few words, there's three main problems:

- Your animator is improperly set up, its update mode is set to "Normal" instead of "Animate Physics", which introduces a 1-frame delay: animation is being updated after simulation. See the manual for details on how to properly set this up:
http://obi.virtualmethodstudio.com/manua...setup.html

- Your ObiBone has "stretch bones" disabled, which means particle stretch/shear is not transferred to the bones, only rotation is. This causes the mesh bones to not match particle positions exactly.

- Your rod model has missing bone influences, in particular the vertices at the tip of the rod are not weighted to the last bone. This causes the mesh to ignore the position of the last bone in the hierarchy.

See my email response for in-depth details.

kind regards,
Reply