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-10-28 12:11:15 +0400
committerTon Roosendaal <ton@blender.org>2005-10-28 12:11:15 +0400
commit595447a85ea2e388fa17b4a44dacf256ac97f343 (patch)
tree3461e1157f41cbe304f8e346cd2ac5c8333c395d /source/blender/src/header_ipo.c
parent0dde486eeae6c563059bfab408f1ed5bd239ad85 (diff)
Here's another milestone: Shape Keys now can be inserted in Actions and NLA
It works like for moving Object Ipos to the Action, press the Action icon in the header of the IpoWindow, to the left of the mode selection menu. It then creates an Action (if not existed) and moves the Shape Ipo to the Action, using custom channel "Shape". Main code change was that evaluating Ipo Curves for Relative Shapes had to be recoded, but that's pretty minor and even much cleaner. (added "curval" in the KeyBlock struct). That this feature can work is thanks to the full modifier/derivedmesh recode Daniel did, can't give him enough credits! :) Also; small fixes in Outliner, for clicking on the Ipo icon (sets the Ipo window to show that Ipo).
Diffstat (limited to 'source/blender/src/header_ipo.c')
-rw-r--r--source/blender/src/header_ipo.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c
index 73439ec22bf..1bfef7a6567 100644
--- a/source/blender/src/header_ipo.c
+++ b/source/blender/src/header_ipo.c
@@ -64,6 +64,7 @@
#include "BKE_action.h"
#include "BKE_constraint.h"
#include "BKE_global.h"
+#include "BKE_key.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_texture.h"
@@ -336,7 +337,7 @@ static void do_ipo_editmenu_keymenu(void *arg, int event)
Object *ob= OBACT;
if(G.sipo->blocktype==ID_KE && totipo_edit==0 && totipo_sel==0) {
- key= (Key *)G.sipo->from;
+ key= ob_get_key((Object *)G.sipo->from);
if(key==NULL) return;
kb= BLI_findlink(&key->block, ob->shapenr-1);
@@ -925,6 +926,8 @@ void do_ipo_buttons(short event)
set_exprap_ipo(IPO_CYCLX);
break;
case B_IPOMAIN:
+ /* pass 1 to enforce a refresh when there's no Ipo */
+ test_editipo(1);
scrarea_queue_winredraw(curarea);
scrarea_queue_headredraw(curarea);
if(ob) ob->ipowin= G.sipo->blocktype;
@@ -986,8 +989,38 @@ void do_ipo_buttons(short event)
allqueue(REDRAWNLA, 0);
}
break;
- case B_IPO_ACTION_KEY:
+ case B_IPO_ACTION_KEY:
+ if(ob && G.sipo->from && G.sipo->pin==0) {
+ Key *key= ob_get_key(ob);
+ if(key) {
+ if(ob->ipoflag & OB_ACTION_KEY) { /* check if channel exists, and flip ipo link */
+ bActionChannel *achan;
+
+ if(ob->action==NULL)
+ ob->action= add_empty_action(ID_KE);
+ achan= verify_action_channel(ob->action, "Shape");
+ if(achan->ipo==NULL && key->ipo) {
+ achan->ipo= key->ipo;
+ key->ipo= NULL;
+ }
+ }
+ else if(ob->action) {
+ bActionChannel *achan= get_action_channel(ob->action, "Shape");
+ if(achan) {
+ if(achan->ipo && key->ipo==NULL) {
+ key->ipo= achan->ipo;
+ achan->ipo= NULL;
+ }
+ }
+ }
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWIPO, 0);
+ allqueue(REDRAWACTION, 0);
+ allqueue(REDRAWOOPS, 0);
+ allqueue(REDRAWNLA, 0);
+ }
+ }
break;
}
}
@@ -1013,7 +1046,7 @@ void ipo_buttons(void)
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
xco+= XIC+14;
- test_editipo(); /* test if current editipo is OK, make_editipo sets v2d->cur */
+ test_editipo(0); /* test if current editipo is OK, make_editipo sets v2d->cur */
uiBlockSetEmboss(block, UI_EMBOSSN);
if(curarea->flag & HEADER_NO_PULLDOWN) {