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
This commit is contained in:
2009-01-01 08:08:55 +00:00
parent c0621a1b7e
commit a1c4d1c735
9 changed files with 68 additions and 26 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;
}
}