Animations - enimaroah-cubic/Sb3UGS GitHub Wiki

Animations are stored in AnimationClip assets and are usually found in files with AnimatorController and Animation assets.

AnimatorControllers are containers for clips and can blend between them. Sb3UGS has two editors for AnimatorControllers. The first editor opens with a double click. Wiki_-animations-_01

No track information can be shown in that state because it requires the skeleton to resolve the hashes stored in the AnimationClip. Open a file with that information. This is available in every piece of clothes, but incomplete. So for a complete resolution open the base body Animator. Then link the AnimatorController to that Animator with the drop down box.

wiki - animations - 02

Since the AnimationClip is still selected the animation track information can be displayed. Sb3UGS does not resolve directly from the skeleton in the Animator, but uses the Animator's Avatar for this. In case that tracks are unknown (scroll down to the end of the track list) the Avatar of that Animator needs to be corrected. With the tracks correctly shown Sb3UGS is prepared for further operations, like the preview in the Introduction, export and replacement of animations.

At the bottom of the image at the top the Controller button is shown. It opens the second editor for the same AnimatorController. In most cases the StateMachine tab is required to make required changes for modding. And even that tab does not allow to fully edit the controller.

Wiki_-animations-_03

Back to the first editor. After editing animations in a 3d editor, dragging the ImportedAnimation from the workspace onto a target AnimationClip shows the following dialog for replacement.

wiki - animations - 04

Editing track curves within Sb3UGS

The following editing functions were made for mass editing. Corresponding curves in all selected AnimationClips are modified at once. The curves can be scaled at median level, translated or deleted. Deleting one axis uses the value from its transform, because in Unity animation tracks always have all curves of a component. The component can be missing. So when all axis are deleted the component gets deleted.

AnimationTrack editor functions - Scale

Note the script statements in Script window. Those could also be used for the script version of Sb3UGS. If these editing function are sufficient, a script could be written and deployed so that every installation could be patched without need to transport any animation.

In the following example the body got an extra joint for the big toe on the left side. And so it doesn't get animated.

AnimationTrack editor functions - Create 01

So we would like to copy the animation track of the left toes to get the same rotation. The translation comes along while copying and needs to be corrected afterwards.

AnimationTrack editor functions - Create 02

The extra joint was created from a copy of the toes joint and then translated for X and Z. And the same would had to be done here for correction. The following screenshot shows the correction ONLY for X, not for Z. For this reason the big toe is shorter until Z would have been corrected.

AnimationTrack editor functions - Translate

Also possible would be to delete the two related curves, or even all three which would delete the translation component. All those actions would result in the same animation.

image

In all the operations above any parented transform inherits the change of the operation. But if the position of a child transform should not change then pressing the control key persists the position of all childs. E.i. a parent's rotation could be scaled and a child would still look unaffected.

Animated clothes, accessories, studio items with morphs

Clothes are deformed along with the body. So you can't add an animation so easily. But morphs can be used on top the body's animation. And the latter works for accessories and studio items as well. Hair is almost entirely animated from DynamicBones/MagicaBoneCloth which makes it less interesting to use that principle.

Required is a regular Animator and an AnimatorController with one AnimationClip. If you already have the clothes ready, but in a virtual Animator you can add an Animator asset by drag 'n drop in the root. This converts a virtual into a regular Animator. The deletion of the Animator asset would convert it back into a virtual Animator. image

image

And the mesh needs to have at least one blendshape, before an AnimationClip can be used for changing the morph strength. image

In this example the channel has 14 keyframes, which makes it an in-between blendshape. But this is not required. You can have a single keyframe there. Halloween1_animated