Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-11-16 01:39:20 +0300
committerTon Roosendaal <ton@blender.org>2005-11-16 01:39:20 +0300
commitb474f95c84a91399ec28ebaaf05bbde88aa73c69 (patch)
treeb6aeae105d2573cb8ac7e89fc86724daede91dbe /source/blender/src/drawnla.c
parenta8df21833545d43128a0f56a03042294fbc77c85 (diff)
Revision of NLA stride option.
Previously, using the "Stride Bone" tried to get that Bone motionless on the path by correcting the internal time of the Action. This however caused too many problems, especially with irregular walks. The new system also tries to keep the Stride Bone motionless, but this by moving the entire armature, and not changing the timing of the Action. Give much nicer results. :) To make editing Strides easier, I've added a new option in the NLA panel to disable the path. This way you can quickly switch to editing the action itself (keying the stride bone) and viewing the result.
Diffstat (limited to 'source/blender/src/drawnla.c')
-rw-r--r--source/blender/src/drawnla.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c
index 007238224de..2b0ba1a7ad3 100644
--- a/source/blender/src/drawnla.c
+++ b/source/blender/src/drawnla.c
@@ -398,15 +398,17 @@ static void draw_nla_strips_keys(SpaceNla *snla)
#define B_NLA_LOCK 122
/* For now just returns the first selected strip */
-bActionStrip *get_active_nlastrip(void)
+bActionStrip *get_active_nlastrip(Object **obpp)
{
Base *base;
bActionStrip *strip;
for (base=G.scene->base.first; base; base=base->next){
for (strip=base->object->nlastrips.first; strip; strip=strip->next){
- if (strip->flag & ACTSTRIP_SELECT)
+ if (strip->flag & ACTSTRIP_SELECT) {
+ *obpp= base->object;
return strip;
+ }
}
}
@@ -415,10 +417,11 @@ bActionStrip *get_active_nlastrip(void)
void do_nlabuts(unsigned short event)
{
+ Object *ob;
bActionStrip *strip;
/* Determine if an nla strip has been selected */
- strip = get_active_nlastrip();
+ strip = get_active_nlastrip(&ob);
if (!strip) return;
switch(event) {
@@ -427,8 +430,7 @@ void do_nlabuts(unsigned short event)
allqueue(REDRAWNLA, 0);
break;
case B_NLA_PANEL:
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB|OB_RECALC_DATA);
+ DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
allqueue (REDRAWNLA, 0);
allqueue (REDRAWVIEW3D, 0);
break;
@@ -443,6 +445,7 @@ void do_nlabuts(unsigned short event)
static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES
{
+ Object *ob;
bActionStrip *strip;
uiBlock *block;
@@ -452,7 +455,7 @@ static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES
if(uiNewPanel(curarea, block, "Transform Properties", "NLA", 10, 230, 318, 204)==0) return;
/* Determine if an nla strip has been selected */
- strip = get_active_nlastrip();
+ strip = get_active_nlastrip(&ob);
if (!strip) return;
/* first labels, for simpler align code :) */
@@ -488,8 +491,9 @@ static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES
uiDefButS(block, TOG, B_NLA_PANEL, "Add", 230,60,75,19, &strip->mode, 0, 0, 0, 0, "Toggles additive blending mode");
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ACTSTRIP_USESTRIDE, B_NLA_PANEL, "Use Path", 10,20,100,19, &strip->flag, 0, 0, 0, 0, "Plays action based on path position & stride");
- uiDefButF(block, NUM, B_NLA_PANEL, "Stride:", 110,20,200,19, &strip->stridelen, 0.0001, 1000.0, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range");
+ uiDefButBitS(block, TOG, ACTSTRIP_USESTRIDE, B_NLA_PANEL, "Stride Path", 10,20,100,19, &strip->flag, 0, 0, 0, 0, "Plays action based on path position & stride");
+ uiDefButBitS(block, TOG, OB_DISABLE_PATH, B_NLA_PANEL, "Disable Path", 110,20,100,19, &ob->ipoflag, 0, 0, 0, 0, "Plays action based on path position & stride");
+ uiDefButF(block, NUM, B_NLA_PANEL, "Stride:", 210,20,100,19, &strip->stridelen, 0.0001, 1000.0, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range");
uiDefButS(block, ROW, B_NLA_PANEL, "X", 10, 0, 33, 19, &strip->stride_axis, 1, 0, 0, 0, "Dominant axis for Stride Bone");
uiDefButS(block, ROW, B_NLA_PANEL, "Y", 43, 0, 33, 19, &strip->stride_axis, 1, 1, 0, 0, "Dominant axis for Stride Bone");