[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18675] branches/blender2.5/blender/source /blender: 2.5 DopeSheet/Action Editor
Joshua Leung
aligorith at gmail.com
Mon Jan 26 05:14:03 CET 2009
Revision: 18675
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18675
Author: aligorith
Date: 2009-01-26 05:13:38 +0100 (Mon, 26 Jan 2009)
Log Message:
-----------
2.5 DopeSheet/Action Editor
* Made the various datatypes in the DopeSheet get shown again (NOTE: some of the types that don't get conversions to Animato yet may need some further checking).
* Did some code cleanup to allow F-Curve channels to always show RNA-based names correctly
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c
branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c
branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h
branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
branches/blender2.5/blender/source/blender/editors/space_action/action_edit.c
branches/blender2.5/blender/source/blender/editors/space_action/action_header.c
branches/blender2.5/blender/source/blender/editors/space_action/action_select.c
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c 2009-01-26 02:42:17 UTC (rev 18674)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c 2009-01-26 04:13:38 UTC (rev 18675)
@@ -1065,6 +1065,8 @@
* are likely to be drivers, but it's hard to trace that from here, so move this to Ob loop?
*/
if (key->ipo) {
+ printf("\t\tconverting key->ipo %s -> %s \n", id->name+2, key->ipo->id.name+2);
+
/* Add AnimData block */
adt= BKE_id_add_animdata(id);
Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-01-26 02:42:17 UTC (rev 18674)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-01-26 04:13:38 UTC (rev 18675)
@@ -155,7 +155,7 @@
/* filter data */
filter= ANIMFILTER_VISIBLE;
- ANIM_animdata_filter(&anim_data, filter, data, datatype);
+ ANIM_animdata_filter(NULL, &anim_data, filter, data, datatype);
/* See if we should be selecting or deselecting */
if (test) {
@@ -646,7 +646,7 @@
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS | ANIMFILTER_SEL);
- ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype);
+ ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* affect selected channels */
for (ale= anim_data.first; ale; ale= ale->next) {
@@ -840,7 +840,7 @@
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS);
- ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype);
+ ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop over data, doing border select */
for (ale= anim_data.first; ale; ale= ale->next) {
@@ -963,7 +963,7 @@
/* get the channel that was clicked on */
/* filter channels */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS);
- filter= ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype);
+ filter= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get channel from index */
ale= BLI_findlink(&anim_data, channel_index);
Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c 2009-01-26 02:42:17 UTC (rev 18674)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c 2009-01-26 04:13:38 UTC (rev 18675)
@@ -278,7 +278,7 @@
/* this function allocates memory for a new bAnimListElem struct for the
* provided animation channel-data.
*/
-bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, short ownertype)
+bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, short ownertype, ID *owner_id)
{
bAnimListElem *ale= NULL;
@@ -293,6 +293,8 @@
ale->owner= owner;
ale->ownertype= ownertype;
+ ale->id= owner_id;
+
/* do specifics */
switch (datatype) {
case ANIMTYPE_OBJECT:
@@ -334,7 +336,7 @@
ale->flag= FILTER_MAT_OBJD(ma);
- ale->key_data= adt->action;
+ ale->key_data= (adt) ? adt->action : NULL;
ale->datatype= ALE_ACT;
}
break;
@@ -345,7 +347,7 @@
ale->flag= FILTER_LAM_OBJD(la);
- ale->key_data= adt->action;
+ ale->key_data= (adt) ? adt->action : NULL;
ale->datatype= ALE_ACT;
}
break;
@@ -356,7 +358,7 @@
ale->flag= FILTER_CAM_OBJD(ca);
- ale->key_data= adt->action;
+ ale->key_data= (adt) ? adt->action : NULL;
ale->datatype= ALE_ACT;
}
break;
@@ -367,7 +369,7 @@
ale->flag= FILTER_CUR_OBJD(cu);
- ale->key_data= adt->action;
+ ale->key_data= (adt) ? adt->action : NULL;
ale->datatype= ALE_ACT;
}
break;
@@ -378,7 +380,7 @@
ale->flag= FILTER_SKE_OBJD(key);
- ale->key_data= adt->action;
+ ale->key_data= (adt) ? adt->action : NULL;
ale->datatype= ALE_ACT;
}
break;
@@ -424,7 +426,7 @@
/* ----------------------------------------- */
-static int animdata_filter_fcurves (ListBase *anim_data, FCurve *first, bActionGroup *grp, int filter_mode, ID *owner_id)
+static int animdata_filter_fcurves (ListBase *anim_data, FCurve *first, bActionGroup *grp, void *owner, short ownertype, int filter_mode, ID *owner_id)
{
bAnimListElem *ale = NULL;
FCurve *fcu;
@@ -439,11 +441,9 @@
/* only include this curve if selected */
if (!(filter_mode & ANIMFILTER_SEL) || (SEL_FCU(fcu))) {
/* owner/ownertype will be either object or action-channel, depending if it was dopesheet or part of an action */
- ale= make_new_animlistelem(fcu, ANIMTYPE_FCURVE, fcu, ANIMTYPE_FCURVE);
+ ale= make_new_animlistelem(fcu, ANIMTYPE_FCURVE, owner, ownertype, owner_id);
if (ale) {
- /* ID will only be Object if data to write to directly belongs there, otherwise, another pointer will be used */
- ale->id= owner_id;
BLI_addtail(anim_data, ale);
items++;
}
@@ -455,12 +455,11 @@
return items;
}
-static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter_mode, void *owner, short ownertype)
+static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter_mode, void *owner, short ownertype, ID *owner_id)
{
bAnimListElem *ale=NULL;
bActionGroup *agrp;
FCurve *lastchan=NULL;
- short owned= (owner && ownertype) ? 1 : 0;
int items = 0;
/* loop over groups */
@@ -470,9 +469,8 @@
if ((filter_mode & ANIMFILTER_CHANNELS) || !(filter_mode & ANIMFILTER_CURVESONLY)) {
/* check if filtering by selection */
if ( !(filter_mode & ANIMFILTER_SEL) || SEL_AGRP(agrp) ) {
- ale= make_new_animlistelem(agrp, ANIMTYPE_GROUP, NULL, ANIMTYPE_NONE);
+ ale= make_new_animlistelem(agrp, ANIMTYPE_GROUP, NULL, ANIMTYPE_NONE, owner_id);
if (ale) {
- if (owned) ale->id= owner;
BLI_addtail(anim_data, ale);
items++;
}
@@ -501,7 +499,7 @@
{
if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) {
// XXX the 'owner' info here needs review...
- items += animdata_filter_fcurves(anim_data, agrp->channels.first, agrp, filter_mode, ((owned)?owner:NULL));
+ items += animdata_filter_fcurves(anim_data, agrp->channels.first, agrp, owner, ownertype, filter_mode, owner_id);
/* remove group from filtered list if last element is group
* (i.e. only if group had channels, which were all hidden)
@@ -521,19 +519,18 @@
/* loop over un-grouped F-Curves (only if we're not only considering those channels in the animive group) */
if (!(filter_mode & ANIMFILTER_ACTGROUPED)) {
// XXX the 'owner' info here needs review...
- items += animdata_filter_fcurves(anim_data, (lastchan)?(lastchan->next):(act->curves.first), NULL, filter_mode, ((owned)?owner:NULL));
+ items += animdata_filter_fcurves(anim_data, (lastchan)?(lastchan->next):(act->curves.first), NULL, owner, ownertype, filter_mode, owner_id);
}
/* return the number of items added to the list */
return items;
}
-static int animdata_filter_shapekey (ListBase *anim_data, Key *key, int filter_mode, void *owner, short ownertype)
+static int animdata_filter_shapekey (ListBase *anim_data, Key *key, int filter_mode, void *owner, short ownertype, ID *owner_id)
{
bAnimListElem *ale;
KeyBlock *kb;
//FCurve *fcu;
- short owned= (owner && ownertype)? 1 : 0;
int i, items=0;
/* are we filtering for display or editing */
@@ -565,7 +562,7 @@
}
#endif // XXX fixme... old system
- if (owned) ale->id= owner;
+ ale->id= owner_id;
BLI_addtail(anim_data, ale);
items++;
@@ -667,7 +664,7 @@
/* include materials-expand widget? */
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
- ale= make_new_animlistelem(ob, ANIMTYPE_FILLMATD, base, ANIMTYPE_OBJECT);
+ ale= make_new_animlistelem(ob, ANIMTYPE_FILLMATD, base, ANIMTYPE_OBJECT, (ID *)ob);
if (ale) {
BLI_addtail(anim_data, ale);
items++;
@@ -688,7 +685,7 @@
/* include material-expand widget? */
// hmm... do we need to store the index of this material in the array anywhere?
if (filter_mode & ANIMFILTER_CHANNELS) {
- ale= make_new_animlistelem(ma, ANIMTYPE_DSMAT, base, ANIMTYPE_OBJECT);
+ ale= make_new_animlistelem(ma, ANIMTYPE_DSMAT, base, ANIMTYPE_OBJECT, (ID *)ma);
if (ale) {
BLI_addtail(anim_data, ale);
items++;
@@ -698,112 +695,81 @@
/* add material's ipo-curve channels? */
if (FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) {
//items += animdata_filter_ipocurves(anim_data, ma->ipo, filter_mode, base, ANIMTYPE_OBJECT, (ID *)ma);
+ // XXX the 'owner' info here is still subject to improvement
+ items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);
}
}
-
}
/* return the number of items added to the list */
return items;
}
-#if 0 // XXX old anim sys
-
-static int animdata_filter_dopesheet_cam (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
+static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
{
bAnimListElem *ale=NULL;
Object *ob= base->object;
- Camera *ca= (Camera *)ob->data;
- int items = 0;
+ IdAdtTemplate *iat= ob->data;
+ short type=0, expanded=0;
+ int items= 0;
- /* include camera-expand widget? */
- if (filter_mode & (ANIMFILTER_CHANNELS|ANIMFILTER_IPOKEYS)) {
- ale= make_new_animlistelem(ca, ANIMTYPE_DSCAM, base, ANIMTYPE_OBJECT);
- if (ale) {
- BLI_addtail(anim_data, ale);
- items++;
+ /* get settings based on data type */
+ switch (ob->type) {
+ case OB_CAMERA: /* ------- Camera ------------ */
+ {
+ Camera *ca= (Camera *)ob->data;
+
+ type= ANIMTYPE_DSCAM;
+ expanded= FILTER_CAM_OBJD(ca);
}
- }
-
- /* add camera ipo-curve channels? */
- if ( (FILTER_CAM_OBJD(ca) || (filter_mode & ANIMFILTER_ONLYFCU)) &&
- !(filter_mode & ANIMFILTER_IPOKEYS) )
- {
- items += animdata_filter_ipocurves(anim_data, ca->ipo, filter_mode, base, ANIMTYPE_OBJECT, (ID *)ca);
- }
-
- /* return the number of items added to the list */
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list