diff options
author | Ton Roosendaal <ton@blender.org> | 2006-10-31 18:51:57 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-10-31 18:51:57 +0300 |
commit | 35d6c6e695351051febf7d6aa84761db1d733295 (patch) | |
tree | a23a19bcff44113fe830c92b9c71fa9539cbef76 /source/blender/src/editnla.c | |
parent | 52c20fecba07fecb4964d1ef310eb944bccd68ea (diff) |
Two wonderful new NLA & Armature editing features!
- FORWARD CYCLING & MATCHING
Up to no now, adding multiple actions in NLA with walkcycles required to
animate them standing still, as if walking on a conveyor belt. The stride
option then makes the object itself move forward, trying to keep the foot
stuck on the floor (with poor results!).
This option now allows to make walk cycles moving forward. By
indicating a reference Offset Bone, the NLA system will use that bone to
detect the correct offset for the Armature Pose to make it seamlessly going
forward.
Best of all, this option works as for cyclic Action Strips as well as for
individual Action Strips. Note that for individual strips, you have to set
the strip on "Hold". (Might become automatic detected later).
Here's an example edit image for NLA:
http://www.blender.org/bf/nla_match-cycle.jpg
And the animation for it:
http://download.blender.org/demo/test/2.43/0001_0150_match.avi
Blender file:
http://download.blender.org/demo/test/2.43/mancandy_matching.blend
Using this kind of cycling works pretty straightforward, and is a lot
easier to setup than Stride Bones.
To be further tested:
- Blending cycles
- matching rotation for the bones as well.
- ACTION MODIFIERS (motion deformors)
The above option was actually required for this feature. Typically walk
cycles are constructed with certain Bones to be the handles, controlling
for example the torso or feet.
An Action Modifier allows you to use a Curve Path to deform the motion of
these controlling bones. This uses the existing Curve Deformation option.
Modifiers can be added per Action Strip, each controlling a channel (bone)
by choice, and even allows to layer multiple modifiers on top of each other
(several paths deforming motion). This option is using the dependency graph,
so editing the Curve will give realtime changes in the Armature.
The previous walkcycle, controlled by two curves:
http://download.blender.org/demo/test/2.43/0001_0150_deform.avi
Blender file:
http://download.blender.org/demo/test/2.43/mancandy_actiondeform.blend
Action Modifiers can be added in the NLA Properties Panel. Per Modifier you
have to indicate the channel and a Curve Object. You can copy modifiers from
one strip to another using CTRL+C (only copies to active Object strips).
Setting up a correct Curve Path has to be carefully done:
- Use SHIFT+A "Curve Path" in top view, or ensure the path is not rotated.
- make sure the center point of the Curve Object is at the center of the
Armature (or above)
- move the first point of the curve to the center point as well.
- check if the path starts from this first point, you can change it using
(in Curve EditMode) the option Wkey -> "Switch Direction"
- Make sure alignment uses the correct axis; if the Armature walks into
the negative Y direction, you have to set in Object Buttons, "Anim settings"
Panel, the correct Track option. (Note; option will probably move to the
Modifier later).
This is a good reason to make such paths automatic (on a command). Is on the
todo list.
Also note this:
- the Curve Path extends in beginning and ending, that's (for now) the default,
and allows to use multiple paths. Make sure paths begin and end horizontal.
- Moving the Curve in Object Mode will change the "mapping" (as if the landscape
a character walks over moves). Moving the Curve in Edit Mode will change the
actual position of the deformation.
- Speed (Ipos) on paths is not supported yet, will be done.
- The Curve "Stretch" deform option doesn't work.
- Modifiers are executed *after* all actions in NLA are evaluated, there's no
support yet for blending multiple strips with Modifiers.
- This doesn't work yet for time-mapping...
This commit is mostly for review by character animators... some details or
working methods might change.
This feature can also be used for other modifiers, such as noise (Perlin) or
the mythical "Oomph" (frequency control) and of course Python.
Special thanks to Bassam & Matt for research & design help. Have fun!
Diffstat (limited to 'source/blender/src/editnla.c')
-rw-r--r-- | source/blender/src/editnla.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c index ac415cbed53..6bb42502f5a 100644 --- a/source/blender/src/editnla.c +++ b/source/blender/src/editnla.c @@ -54,6 +54,7 @@ #include "DNA_userdef_types.h" #include "BKE_action.h" +#include "BKE_blender.h" #include "BKE_depsgraph.h" #include "BKE_group.h" #include "BKE_global.h" @@ -1647,7 +1648,11 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt) break; case CKEY: - convert_nla(mval); + if(G.qual==LR_CTRLKEY) { + if(okee("Copy Modifiers")) + copy_action_modifiers(); + } + else convert_nla(mval); break; case DKEY: @@ -1848,3 +1853,36 @@ void bake_all_to_action(void) } } } + +void copy_action_modifiers(void) +{ + bActionStrip *strip, *actstrip; + Object *ob= OBACT; + + if(ob==NULL) + return; + + /* active strip */ + for (actstrip=ob->nlastrips.first; actstrip; actstrip=actstrip->next) + if(actstrip->flag & ACTSTRIP_ACTIVE) + break; + if(actstrip==NULL) + return; + + /* copy to selected items */ + for (strip=ob->nlastrips.first; strip; strip=strip->next){ + if (strip->flag & ACTSTRIP_SELECT) { + if(strip!=actstrip) { + if (strip->modifiers.first) + BLI_freelistN(&strip->modifiers); + if (actstrip->modifiers.first) + duplicatelist (&strip->modifiers, &actstrip->modifiers); + } + } + } + + BIF_undo_push("Copy Action Modifiers"); + allqueue(REDRAWNLA, 0); + DAG_scene_flush_update(G.scene, screen_view3d_layers()); +} + |