Skip to content

Commit c81a4c8

Browse files
committed
Documented the 'extra keyframes' feature. Close #122.
1 parent 3e8ff65 commit c81a4c8

10 files changed

+63
-22
lines changed

docs/animations/exporting_animations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The `Optimize Animation` checkbox allows you to apply **lossy** optimization to
1616

1717
Exporting a single animation is similar to exporting a model, as explained in the {ref}`Creating animations from scratch<creating-animations-from-scratch>` documentation page. Go to `File > Export > Export Bedrock Animation` and select the export path. If the file already exists and is a valid animation file, the exported animation will be appended/updated.
1818

19+
(batch-exporting-multiple-animations)=
1920
## Batch exporting multiple animations
2021

2122
If your armature contains several animations you can export **all of them at once** using the *Batch Export Bedrock Animations* operator:

docs/animations/extra_keyframes.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(extra-keyframes)=
2+
# Extra Keyframes
3+
4+
The Extra Keyframes feature in Mcblend allows you to add additional keyframes to your exported animations. This is especially valuable when your model's animation is driven by constraints, physics simulations, or other procedural methods that don't place keyframes on the armature's timeline. Mcblend can then capture these dynamic poses at specified frames without requiring you to manually keyframe them. This feature deosn't replace explicitly set timeline keyframes; instead, it supplements them
5+
6+
Extra Keyframes complement the {ref}`Animation Optimization<optimizing-animations>` feature; they add extra detail to exported animations, while the optimization removes redundant keyframes.
7+
8+
![](/img/animations/object_properties_animations_extra_frames.png)
9+
10+
## How it Works
11+
12+
In the `Mcblend: Animations` panel (found in `Object Properties` when an Armature is selected), you'll find an "Extra frames" field. This field accepts a pattern string that defines individual frames or ranges of frames to be added to the animation during export.
13+
14+
### Frame Range Patterns
15+
16+
The patterns use a colon-separated and comma-separated format, based on the following rules:
17+
18+
- `START:END` - Includes all integer frames from `START` to `END` (inclusive).
19+
- `START:STEP:END` - Includes frames from `START` to `END`, incrementing by `STEP`.
20+
- `FRAME` - Includes a single, specific frame.
21+
- `START:` - Includes all frames from `START` to the end of the animation (as defined by the "Frame end" property of the animation).
22+
- `START:STEP:` - Includes all frames from `START` to the end of the animation, incrementing by `STEP`.
23+
- You can combine multiple patterns by separating them with commas.
24+
25+
Examples:
26+
- `1:10` adds frames 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
27+
- `1:2:10` adds frames 1, 3, 5, 7, 9.
28+
- `15` adds frame 15.
29+
- `50:` adds all frames from 50 to the animation's end.
30+
- `1:2:` adds frames 1, 3, 5, ... up to the animation's end.
31+
- `1:5, 10:2:20, 25, 27:` would include frames 1 through 5, then 10, 12, 14, 16, 18, 20, then frame 25, and finally frames 27, 28, 29... up to the animation's end.
32+
33+
## Interpolation
34+
35+
It's important to note that all keyframes added via the "Extra frames" feature will use **linear interpolation** in the exported Minecraft animation.

docs/animations/physics_simulation.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,21 @@ The `Bone Parents` group never needs to be adjusted.
5454
![](/img/animations/physics_simulation_bake_menu.png)
5555
![](/img/animations/physics_simulation_bake_settings.png)
5656

57-
7. The keyframes added by the `Bake to Keyframes` operation are not sufficient to properly export the animation. Mcblend requires keyframes to be added to the armature of the model, but the keyframes from the simulation are added to the rigid bodies.
57+
7. The keyframes generated by the `Bake to Keyframes` operation are insufficient for proper animation export. Mcblend requires keyframes to be applied to the model's armature, whereas the simulation applies them to rigid bodies.
5858

59-
To successfully export the animation, you will need to manually add keyframes to the armature of the model. The movements of the simulation are complex, so you will need to add one keyframe for each frame of the simulation, approximately 50 frames in total. Mcblend does not currently have an automatic method for adding these keyframes, so you will need to do it manually. It doesn't matter what kind of keyframe you add - Mcblend uses the keyframes as points in the timeline that mark an important event in the animation, and then analyzes the pose of the model to compare it to the previous point in the animation.
59+
Fortunately, you do not need to manually add all 50 keyframes. Mcblend can automate this process during animation export. Simply {ref}`create a new empty Mcblend animation<creating-animations-from-scratch>` and utilize the {ref}`Extra Keyframes<extra-keyframes>` feature to add keyframes starting from frame 1 (define the range as `1:`).
6060

61-
We can simply add the `Scale` keyframes to the root bone. It doesn't matter that the scale is the same on every frame, the important thing is that the keyframes are there.
62-
63-
![](/img/animations/physics_simulation_ravager_scale_keyframes.png)
61+
```{warning}
62+
If a warning prompts you to "Stash or push down" before adding a new animation when pressing the `New Animation` button, select `Push down` in the `Action Editor` tab. This action moves the current animation to the `Nonlinear Animation` editor while keeping it active.
63+
```
6464

65-
8. For better results, before exporting select all the keyframes and change the interpolation mode to `Linear`. You can access the interpolation mode menu by right clicking in the `Dope Sheet` editor.
65+
Before exporting, make sure that frame 0 is a rest pose and that all bone transformations at that frame are keyframed.
6666

67-
9. [Export the animation](/animations/exporting_animations) using the knowledge from previous tutorials.
67+
To reduce animation size with a minimal impact on quality, consider using the `{ref}Animation Optimization<optimizing-animations>` feature.
6868

6969
![](/img/animations/physics_simulation_export_animation.png)
7070

71+
9. [Export the animation](/animations/exporting_animations) using the knowledge from previous tutorials.
72+
73+
Result:
7174
![](/img/animations/physics_simulation_ravager.gif)

docs/gui/object_properties.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,22 @@ Once you've set up your render controller, you can use the `Apply materials` but
5454

5555
The `Mcblend: Animations panel` allows you to easily switch between animations in your project. These animations are represented as NLA tracks on the armature, with additional data attached to them. Selecting a different animation in the panel will also switch the active NLA track.
5656

57-
- The `New animation` button creates a new animation. You can't use this operator while editing an action of the armature. If you want to create a new action, you need to stash the other action first.
58-
- The `Remove animation` button removes the currently active animation.
59-
- The `Select animation` dropdown list lets you select the animation to edit.
60-
- The `Name` field sets the name of the animation.
61-
- The `Skip rest poses` checkbox enables animation export optimization. If enabled, the keyframes that don't affect the armature (because they are the rest poses) are skipped in the exported file. In most cases, it's recommended to enable this option.
62-
- The `Export as pose` checkbox, if enabled, causes the exported animation to contain only one looped frame.
63-
- The `Exclude from batch exports` checkbox, if enabled, causes the animation to be skipped when using the `Batch Export Bedrock Animations` operator. Alternatively, you can select which animations to export during the export process.
64-
- The `Override previous animation` field directly translates to the override_previous_animation property of the Minecraft animation. It doesn't affect how the animation is rendered in Blender.
65-
- The `Loop` field directly translates to the loop property of the Minecraft animation file. There are three options: `true`, `false`, and `hold_on_last_frame`.
66-
- The `Anim Time Update` field directly translates to the anim_time_update property of the Minecraft animation file. You should either leave it empty (if you don't want to have anim_time_update in your animation) or put a Molang expression in it. It doesn't affect the animation in Mcblend because Mcblend doesn't support Molang.
67-
- The `Interpolation mode` field directly translates to the interpolation mode of the Minecraft animation file. There are four options: `linear`, `smooth`, `step`, and `auto`.
68-
- The `Frame start` field indicates the first frame of the animation. It tells Mcblend where the animation starts.
69-
- The `Frame end` field indicates the last frame of the animation. It tells Mcblend where the animation ends.
70-
- The `Optimize Animation` checkbox enables {ref}`animation export optimization<optimizing-animations>`.
71-
- The `Error margin` field defines how much error is allowed when optimizing the exported animation.
57+
- `New animation` - Creates a new animation. This operator cannot be used while editing an action of the armature; you must stash the current action first.
58+
- `Remove animation` - Deletes the currently active animation.
59+
- `Select animation` - A dropdown list to choose which animation to edit.
60+
- `Name` - Sets the name of the animation.
61+
- `Skip rest poses` - Enables animation export optimization. When enabled, keyframes that represent rest poses (and thus don't affect the armature) are skipped in the exported file. Enabling this option is generally recommended.
62+
- `Export as pose` - If enabled, the exported animation will contain only a single looped frame.
63+
- `Exclude from batch exports` - If enabled, this animation will be skipped when using the {ref}`Batch Export Bedrock Animations<batch-exporting-multiple-animations>` operator. Alternatively, you can select animations to export during the export process.
64+
- `Override previous animation` - Directly translates to the `override_previous_animation` property in the Minecraft animation file. This setting does not affect how the animation is rendered in Blender.
65+
- `Loop` - Directly translates to the `loop` property of the Minecraft animation file, with options: `true`, `false`, and `hold_on_last_frame`.
66+
- `Anim Time Update` - Directly translates to the `anim_time_update` property of the Minecraft animation file. Leave this empty if not needed, or provide a Molang expression. Note that Mcblend does not support Molang, so this setting does not affect the animation within Mcblend.
67+
- `Interpolation mode` - Directly translates to the interpolation mode of the Minecraft animation file, with options: `linear`, `smooth`, `step`, and `auto`. The `auto` option uses the interpolation based on the interpolation modes used for each keyframe.
68+
- `Extra frames` - Allows you to specify additional frames or frame ranges to be included in the exported animation. Refer to the dedicated {ref}`Extra Keyframes<extra-keyframes>` page for details on patterns and usage.
69+
- `Frame start` - Indicates the first frame of the animation, defining its starting point in Mcblend.
70+
- `Frame end` - Indicates the last frame of the animation, defining its end point in Mcblend.
71+
- `Optimize Animation` - Enables {ref}`animation optimization<optimizing-animations>` during export.
72+
- `Error margin` - Defines how much error is allowed when optimizing the exported animation.
7273

7374
## Object properties (bone of armature)
7475

46.1 KB
Loading
189 KB
Loading
-312 KB
Loading
Binary file not shown.
2.81 KB
Loading

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Essential concepts for creating animations in Mcblend <animations/essential_conc
4040
Creating animations from scratch <animations/creating_animations_from_scratch>
4141
Exporting animations <animations/exporting_animations>
4242
Optimizing animations <animations/optimizing_animations>
43+
Extra keyframes <animations/extra_keyframes>
4344
Animating sound and particle effects <animations/animating_sound_and_particle_effects>
4445
Physics simluation <animations/physics_simulation>
4546
```

0 commit comments

Comments
 (0)