4.2-beta status update
When Deterministic
is checked, the pose you see in the editor is the result of applying the animation and physics many times from frame 0 to the current frame. This gives you a consistent pose for any given frame. Since posing physics always starts at the first frame of the animation, you can scrub back and forth on the timeline and see the physics rewind. Also you can animate more easily, without physics floating your bones all around, but while still having effects from physics.
It will cause a jump at the end of looping animations. For loops you may want to leave Deterministic
unchecked.
The downside to checking Deterministic
is that Spine has to do a lot of work to pose each frame, and the work increases the higher the frame is on the timeline. On my quite powerful computer, my Spine editor starts to drop below 60 FPS at about frame 1100 (~37 seconds of animation) on a skeleton with 52 physics constraints, all set to 60 FPS. At runtime or when Deterministic
is off, physics are very efficient. I have never see a framerate drop from physics alone, even with 100 physics constraints. Deterministic
causes a frame rate drop because it's both applying the animation and physics many hundreds or thousands of times for every editor frame.
Deterministic
only affects the editor. At runtime your code can "fast forward" physics like this, if you want. Your code can also control when physics are reset, or you can reset physics by keying the reset with the Reset
and Reset All
buttons in the Spine editor.
Nate The parameter names in physical constraints are a bit confusing to me. For example, inertia and mass are equivalent in the real world, but the inertia here seems to be used to control vibration amplitude. Mass and Strength have the same effect in controlling vibration frequency. Wind and Gravity are the same thing but in different directions, why not use the same name and separate X and Y? And they seem to be just external forces that cause the spring oscillator to deviate from its initial position, so I don't know how to set the parameters if I want to simulate free falling motion.You may update the tutorial soon, could you please briefly explain it if you have time?Thank you very much.(This paragraph uses machine translation)
- Edited
habahu inertia and mass are equivalent in the real world
In the real world they are related and inversely proportional, but aren't equivalent. Our physics constraint has to fudge a whole lot of things so real world accuracy isn't the goal, but the names should make some sense. We are open to improving the names.
For physics constraint, inertia is not used when applying forces, instead it is used when a bone moves and the physics controlled properties (x/y/rotation/scaleX/shearX) need to be adjusted to simulate lagging behind the action. The constrained pose from physics constraint is achieved by "offsetting" the properties from the unconstrained pose based on bone movement. Inertia controls how much bone movement is transferred to the properties' physics offset. 100% inertia means the property's offset is affected maximally by the bone movement, 0% means it is not affected at all.
Spring forces are applied over time to reduce the physics offset to zero, effectively causing the constrained pose to (try to) return to the unconstrained pose. Mass (1 / mass
actually) is use to scale those forces (Newton's second law: force = mass * acceleration
). Given the same amount of force, a larger mass is affected less and a smaller mass is affected more.
habahu Mass and Strength have the same effect in controlling vibration frequency
All of the properties are interconnected, so changing one affects the others. You can achieve a reduction in oscillation multiple ways. Damping is most straightforward, but you can also use less strength, making the forces returning the offset to zero weaker and therefore less likely to overshoot zero. Mass is a multiplier for the forces, so it can also make them weaker to reduce oscillation.
Tuning physics is a bit of an art. Many different behaviors can be achieved with various slider configurations. Some of them give similar results but there can be subtle and not so subtle differences.
habahu Wind and Gravity are the same thing but in different directions, why not use the same name and separate X and Y?
By the same name do you mean windX
and windY
? I prefer the names wind
and gravity
. People don't often think about wind in the up/down directions. The 2 sliders could be placed in the UI on the same row to reduce vertical space, but would be the only sliders placed that way and would require the tree to be wider to make them usable.
habahu they seem to be just external forces that cause the spring oscillator to deviate from its initial position, so I don't know how to set the parameters if I want to simulate free falling motion.
Enable translate Y and set gravity so you have a downward force. Strength is what returns the property to the unconstrained pose, so set strength to zero and your bone will fall downward forever. Set damping to zero (or near zero) so gravity's constant acceleration results in a continuous linear increase in velocity (ie it falls faster and faster over time).
Nate Tuning physics is a bit of an art.
Agree
One note from me. While Gravity is fine I think wind is misleading When I see wind I expect cool stuff to be simulated with wind but in reality I should do the heavy work animating the strength of the wind to make it seem like a wind. So in general without collision maybe gravity is also sounds big. we could strip those 2 properties. It would simplify the view. Anyway I mostly did not use them so far. We can add a force with its direction if we wish, by just hitting Add Button
oh nice let me see sure you know better what to keep or remove, I trust you.
Where are my axes? happens when create new project after dragging they appear
Weird. What interface scale are you using?
150
they flicker a bit when I zoom or drag
OK, we see it and we'll get it fixed!
EsotericSoftware/spine-editor768
Hi Nate, are you considering providing grouping functionality for multiple constraints? One hair needs to add multiple physical constraints, and if multiple hairs are placed together, the number of constraints will become much larger. It is basically difficult to find multiple corresponding constraints in the first place solely based on color and bone name. Is it possible to group several constraints and select them all to select multiple constraints for. By controlling the parameters of the group, the percentage of the self values of wind, inertia, and other constraints within the group can be controlled.
Yes, we hope to add folders for constraints to 4.2. The challenge is that the constraint order is important and drag and drops still needs to work for that. Giving the properties for the folder contents as if they were multi-selected would be nice, we'll see how it goes!
habahu Disable Simulate
or set physics constraint mix to 0. We've discussed uniform scaling. I'm not sure if it should be part of physics constraint or a future constraint that ties together transform properties.
zakaroff You can post videos on YouTube/etc. The sequence FPS keying should be fixed in 4.2.04-beta. Please say the version number you are using, not just "latest one", as we release often. When the checkbox you circled is unchecked, the last frame is omitted.
OK, but I have no idea what I should be looking for.