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:
authorJoshua Leung <aligorith@gmail.com>2009-01-01 11:08:55 +0300
committerJoshua Leung <aligorith@gmail.com>2009-01-01 11:08:55 +0300
commita1c4d1c735c59b5911dbd0d8557b8f2b32263fe5 (patch)
tree85dc942ac6f1d2754d2066a6a70dfaf422f21f03
parentc0621a1b7eca3310320e2df02094e828eda2cd37 (diff)
2.5 - Assorted bugfixes
* Dopesheet - clicking on keyframes in Object channels (if they came from Object-Data such as Lamps, etc.) would crash. I noticed this error in AnimSys2 yesterday * Action Editor - do versions code now totally reinitialises the Action Editor View2D data (for the timespace), since I found a few files where there appeared to be some weird settings set. * RNA Browser (Outliner->Datablocks) would crash when the Area was ripped (using Alt-R hotkey) as seen in mfoxdogg's 2.5 Tour 2
-rw-r--r--source/blender/blenloader/intern/readfile.c22
-rw-r--r--source/blender/editors/animation/anim_channels.c12
-rw-r--r--source/blender/editors/animation/keyframes_draw.c10
-rw-r--r--source/blender/editors/animation/keyframes_edit.c16
-rw-r--r--source/blender/editors/space_action/action_draw.c2
-rw-r--r--source/blender/editors/space_action/action_intern.h4
-rw-r--r--source/blender/editors/space_action/action_select.c15
-rw-r--r--source/blender/editors/space_action/space_action.c11
-rw-r--r--source/blender/editors/space_outliner/outliner.c2
9 files changed, 68 insertions, 26 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f79625094c8..902f4f1dfd6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5266,10 +5266,26 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
SpaceAction *saction= (SpaceAction *)sl;
memcpy(&ar->v2d, &saction->v2d, sizeof(View2D));
- ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
+ ar->v2d.tot.xmin= -10.0f;
+ ar->v2d.tot.ymin= (float)(-sa->winy);
+ ar->v2d.tot.xmax= (float)(sa->winx);
+ ar->v2d.tot.ymax= 0.0f;
+
+ ar->v2d.cur= ar->v2d.tot;
+
+ ar->v2d.min[0]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
+
+ ar->v2d.max[0]= MAXFRAMEF;
+ ar->v2d.max[1]= 10000.0f;
+
+ ar->v2d.minzoom= 0.01f;
+ ar->v2d.maxzoom= 50;
+ ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
- ar->v2d.align = V2D_ALIGN_NO_POS_Y;
- ar->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
+ ar->v2d.keepzoom= V2D_LOCKZOOM_Y;
+ ar->v2d.align= V2D_ALIGN_NO_POS_Y;
+ ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
//ar->v2d.flag |= V2D_IS_INITIALISED;
break;
}
diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c
index d60394d720f..2564068a0c5 100644
--- a/source/blender/editors/animation/anim_channels.c
+++ b/source/blender/editors/animation/anim_channels.c
@@ -84,14 +84,19 @@
#include "WM_types.h"
/* ************************************************************************** */
-/* Channels API */
+/* CHANNELS API */
/* -------------------------- Internal Tools -------------------------------- */
+
+
/* -------------------------- Exposed API ----------------------------------- */
/* ************************************************************************** */
-/* Operators */
+/* OPERATORS */
+
+/* ********************** Select All Operator *********************** */
+
/* ******************** Mouse-Click Operator *********************** */
@@ -117,6 +122,7 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s
if (ale == NULL) {
/* channel not found */
printf("Error: animation channel not found in mouse_anim_channels() \n");
+ // XXX remove me..
printf("\t channel index = %d, channels = %d\n", channel_index, filter);
BLI_freelistN(&anim_data);
@@ -139,7 +145,7 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s
else {
/* set selection status */
// FIXME: this needs to use the new stuff...
- if (selectmode) {
+ if (selectmode == SELECT_INVERT) {
/* swap select */
base->flag ^= SELECT;
ob->flag= base->flag;
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 449bf001e8f..30689b8724f 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -470,21 +470,21 @@ void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki
case OB_CAMERA: /* ------- Camera ------------ */
{
Camera *ca= (Camera *)ob->data;
- if ((ca->ipo) && !(ads->filterflag & ADS_FILTER_NOCAM))
+ if ((ca->ipo) && !(filterflag & ADS_FILTER_NOCAM))
ipo_to_keylist(ca->ipo, keys, blocks, aki);
}
break;
case OB_LAMP: /* ---------- Lamp ----------- */
{
Lamp *la= (Lamp *)ob->data;
- if ((la->ipo) && !(ads->filterflag & ADS_FILTER_NOLAM))
+ if ((la->ipo) && !(filterflag & ADS_FILTER_NOLAM))
ipo_to_keylist(la->ipo, keys, blocks, aki);
}
break;
case OB_CURVE: /* ------- Curve ---------- */
{
Curve *cu= (Curve *)ob->data;
- if ((cu->ipo) && !(ads->filterflag & ADS_FILTER_NOCUR))
+ if ((cu->ipo) && !(filterflag & ADS_FILTER_NOCUR))
ipo_to_keylist(cu->ipo, keys, blocks, aki);
}
break;
@@ -666,9 +666,9 @@ void action_nlascaled_to_keylist(Object *ob, bAction *act, ListBase *keys, ListB
*/
for (conchan= achan->constraintChannels.first; conchan; conchan= conchan->next) {
if (conchan->ipo) {
- //actstrip_map_ipo_keys(ob, conchan->ipo, 0, 1); // XXX
+ ANIM_nla_mapping_apply(ob, conchan->ipo, 0, 1);
ipo_to_keylist(conchan->ipo, keys, blocks, aki);
- //actstrip_map_ipo_keys(ob, conchan->ipo, 1, 1); // XXX
+ ANIM_nla_mapping_apply(ob, conchan->ipo, 1, 1);
}
}
}
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 8a7a7582ee3..e6ccc7b9105 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -139,6 +139,22 @@ short ipo_keys_bezier_loop(BeztEditData *bed, Ipo *ipo, BeztEditFunc bezt_ok, Be
/* This function is used to apply operation to all keyframes, regardless of the type */
short animchannel_keys_bezier_loop(BeztEditData *bed, bAnimListElem *ale, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, IcuEditFunc icu_cb)
{
+ /* sanity checks */
+ if (ale == NULL)
+ return 0;
+
+ /* method to use depends on the type of keyframe data */
+ switch (ale->datatype) {
+ case ALE_ICU: /* ipo-curve */
+ return icu_keys_bezier_loop(bed, ale->key_data, bezt_ok, bezt_cb, icu_cb);
+ case ALE_IPO: /* ipo */
+ return ipo_keys_bezier_loop(bed, ale->key_data, bezt_ok, bezt_cb, icu_cb);
+
+ case ALE_GROUP: /* action group */
+ //return group_keys_bezier_loop(bed, ale->data, bezt_ok, bezt_cb, icu_cb);
+ break;
+ }
+
return 0;
}
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index cb392a14eb7..8db623c7267 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -1062,7 +1062,7 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
/* ************************************************************************* */
/* Keyframes */
-static ActKeysInc *init_aki_data(bAnimContext *ac, bAnimListElem *ale)
+ActKeysInc *init_aki_data(bAnimContext *ac, bAnimListElem *ale)
{
static ActKeysInc aki;
diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h
index d78e34416f0..14cf6f82f76 100644
--- a/source/blender/editors/space_action/action_intern.h
+++ b/source/blender/editors/space_action/action_intern.h
@@ -34,6 +34,8 @@ struct SpaceAction;
struct ARegion;
struct wmWindowManager;
struct wmOperatorType;
+struct ActKeysInc;
+struct bAnimListElem;
/* internal exports only */
@@ -42,6 +44,8 @@ struct wmOperatorType;
void draw_channel_names(struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar);
void draw_channel_strips(struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar);
+struct ActKeysInc *init_aki_data(struct bAnimContext *ac, struct bAnimListElem *ale);
+
/* ***************************************** */
/* action_header.c */
void action_header_buttons(const struct bContext *C, struct ARegion *ar);
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 652d19c3ebf..c571a847188 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -133,6 +133,7 @@ static void *get_nearest_action_key (bAnimContext *ac, int mval[2], float *selx,
if (clickmin <= 0) {
/* found match - must return here... */
Object *nob= ANIM_nla_mapping_get(ac, ale);
+ ActKeysInc *aki= init_aki_data(ac, ale);
/* apply NLA-scaling correction? */
if (nob) {
@@ -150,32 +151,32 @@ static void *get_nearest_action_key (bAnimContext *ac, int mval[2], float *selx,
case ALE_OB:
{
Object *ob= (Object *)ale->key_data;
- ob_to_keylist(ob, &anim_keys, NULL, NULL);
+ ob_to_keylist(ob, &anim_keys, NULL, aki);
}
break;
case ALE_ACT:
{
bAction *act= (bAction *)ale->key_data;
- action_to_keylist(act, &anim_keys, NULL, NULL);
+ action_to_keylist(act, &anim_keys, NULL, aki);
}
break;
case ALE_IPO:
{
Ipo *ipo= (Ipo *)ale->key_data;
- ipo_to_keylist(ipo, &anim_keys, NULL, NULL);
+ ipo_to_keylist(ipo, &anim_keys, NULL, aki);
}
break;
case ALE_ICU:
{
IpoCurve *icu= (IpoCurve *)ale->key_data;
- icu_to_keylist(icu, &anim_keys, NULL, NULL);
+ icu_to_keylist(icu, &anim_keys, NULL, aki);
}
break;
}
}
else if (ale->type == ANIMTYPE_GROUP) {
bActionGroup *agrp= (bActionGroup *)ale->data;
- agroup_to_keylist(agrp, &anim_keys, NULL, NULL);
+ agroup_to_keylist(agrp, &anim_keys, NULL, aki);
}
else if (ale->type == ANIMTYPE_GPDATABLOCK) {
/* cleanup */
@@ -187,7 +188,7 @@ static void *get_nearest_action_key (bAnimContext *ac, int mval[2], float *selx,
}
else if (ale->type == ANIMTYPE_GPLAYER) {
bGPDlayer *gpl= (bGPDlayer *)ale->data;
- gpl_to_keylist(gpl, &anim_keys, NULL, NULL);
+ gpl_to_keylist(gpl, &anim_keys, NULL, aki);
}
/* loop through keyframes, finding one that was clicked on */
@@ -934,6 +935,8 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode)
for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next)
ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL);
}
+
+ // FIXME: add data ipos too...
}
//else if (gpl)
// select_gpencil_frame(gpl, (int)selx, selectmode);
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index f304367724b..4134b6da1d3 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -100,21 +100,18 @@ static SpaceLink *action_new(const bContext *C)
BLI_addtail(&saction->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= -2.0f;
+ ar->v2d.tot.xmin= -10.0f;
ar->v2d.tot.ymin= (float)(-sa->winy);
- ar->v2d.tot.xmax= 100.0f;
+ ar->v2d.tot.xmax= (float)(sa->winx);
ar->v2d.tot.ymax= 0.0f;
- ar->v2d.cur.xmin= -2.0f;
- ar->v2d.cur.ymin= (float)(-sa->winy);
- ar->v2d.cur.xmax= 100.0f;
- ar->v2d.cur.ymax= 0.0f;
+ ar->v2d.cur = ar->v2d.tot;
ar->v2d.min[0]= 0.0f;
ar->v2d.min[1]= 0.0f;
ar->v2d.max[0]= MAXFRAMEF;
- ar->v2d.max[1]= 2000.0f;
+ ar->v2d.max[1]= 10000.0f;
ar->v2d.minzoom= 0.01f;
ar->v2d.maxzoom= 50;
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 536f49db82d..1e2035906a4 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -1338,7 +1338,7 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
ten= outliner_add_element(soops, &soops->tree, (void*)&mainptr, NULL, TSE_RNA_STRUCT, -1);
if(show_opened) {
- tselem= TREESTORE(te);
+ tselem= TREESTORE(ten);
tselem->flag &= ~TSE_CLOSED;
}
}