• Editor
  • Keying Physics Determinate ?

Hello,
I looked on the forum but couldn't find anything, I was just wondering if it was possible to capture the “determined” position, rotation and all from a physical constraint.
To be clear (it's a tail movement), I have the movement I want with physics, when the body doesn't move, unfortunately the movement is modified if the body moves and the result is not what I want.
So I wanted to copy/paste the tail dopesheet, so I could remove the physics but keep the dopesheet, if you know what I mean.

I tried to redo the position, but the result isn't natural, fluid, like the physics, it's a bit... jerky, unnatural.
Thanks for the help 🙂

Related Discussions
...

To capture the "determined" position and rotation from a physical constraint in Spine, you can manually key the positions and rotations at specific frames. While Spine does not currently support baking physics into keys directly, you can manually add keys to the dopesheet to match the physics-driven movement. This involves playing the animation with physics, observing the desired positions and rotations, and then manually keying these values in the dopesheet. This approach allows you to remove the physics while retaining the movement captured in the keys. Although this process can be time-consuming, it provides a way to achieve the desired animation without the physics constraints affecting the movement when the body moves.

Hey, I'm back
Right after sending the message, I set about redoing the animation frame by frame, to get it exactly right (well, as close as possible at least).

Fortunately, my animation was “only” 20 frames long. It took me about 1H20.
The result is ok. Here's my method for those who'd like to know:
1) I made a duplicate of my character, superposed them and copied the animation frame by frame (65% of the time) manually.
2) Once I'd copied the animation, I first arranged the start/end so that it could loop nicely (5% of the time).
3) Then I removed the physical constraints and did another shift, in the opposite direction.
Using the dopesheet, I looked at the highest and lowest points, which I copied, as well as the start and end frames, of course.
Using the dopesheet, I tried to redo the curve so that they were identical (30% of the time).

In the end, I've got an animation with around 6 keys per bone, which means I can slow it down or speed it up easily, whereas the frame-by-frame animation wasn't great, at least for this.
The 3) is optionnal though, it can be skipped. The animation is still not as great as the physics, but since I couldn't make the movement with the offset, we'll just have to deal with it (It's more a rope moving than a simple tail, there's multiple wave at the same time, it looked off every time I tryed to make it with offset)

It took a while, though, and I'd have appreciated a tool to do it automatically.
I used an automatic translator, so I'm sorry if some sentences are weird or a bit mean.

Have a nice day

  • Изменено

No need to translate, unless you want to. You can post in any language and the forum has a translate button so anyone else can read your post in their own language.

Usually physics baking isn't great, especially if automated: it requires many keys and even then can be choppy, and you lose all the dynamic benefits of physics. However, your use case is better than most and it could be done reasonably in some cases.

We support baking other constraints manually, but more easily than duplicating the skeleton and matching the pose. When rotate, translate, scale, or shear is keyed, if a constraint is applied to that property with 100% mix (meaning the local property value is not used at all) then keying the property will key the applied local transform (recently explained here) instead of the local transform, meaning the constrained value is keyed. Setting the key won't change anything because the constraint is applied fully and overrides the key, but if you delete the constraint, then the keys will be used.

So, what you can do eg for an IK constraint: go to frame 0 and key the rotation of the constrained bones. Press R to move to frame 1. Key rotation again. R, key, R, key, etc until you've keyed every frame. Now delete the IK constraint and voila, you have baked the movement.

This doesn't work with physics constraints though! The reason is that physics is an offset from the local transform. Changing the local transform affects physics, which are always added to the local transform. Keying the local transform would change the physics movement, unless you key from the end of the animation backward. For example, you could click the last frame, key, press F to move back a frame, key, F, key, F, etc. That would work IF we keyed the applied transform values, but we currently don't. The reason we don't is keying the local values is useful to control the bone's behavior + physics. We can't know if you want to key the local or applied values, as both actions are useful in some situations.

Consider this animation with physics:

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

These are the only keys:

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

This is what it would look like if we allowed keying the applied values and you key backward, starting at the last frame, with Simulate enabled and Determinate checked:

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

Here's just those rotate keys, so the movement is easier to see:

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

And here's that animation with physics deleted:

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

Here's the physics driven animation again, for easier comparison:

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

It looks good enough, though it has a lot of keys. I'd hate to see people doing this with thousands of keys. I know you guys are going to do that! 😧

Anyway, that baking is only possible if we allow you to key the applied values from physics. For other constraints we know 100% when the local values won't be used, so keying applied values in that case makes sense. I wish there was a clear way to know when the user wants to key applied values for physics, but there isn't, so we'd likely need a hotkey. We'll consider this for 4.3!

In 4.3 we've added a hotkey Key Constrained. When enabled, all keying uses the applied values, allowing you to manually bake physics more easily.

  • Pentacles ответили на это сообщение.
  • Misaki оценил это.

    Nate
    J'oublie toujours pour la traduction du site : 😅

    La physique auras toujours un meilleurs rendu pour les animations, ça je suis bien d'accords.
    Mais elle peut aussi servir de guide sur certaine animations je pense. Particulièrement grâce aux mouvements naturels de vague du coup, parce que sur des vagues "simple" c'est très facile avec l'offset, mais des mouvements plus complexe, avec plusieurs vagues sur la même ligne ça commence a être le bordel à animer 😅 Et du coup ça peut aider a visualiser les mouvements

    J'ai hâte de voir la 4.3 alors ! Même si il seras difficile de faire mieux que la 4.2 😉

    • Nate оценил это.