Animato: Various improvements

* Scene and World AnimDatas are now included in animation editors
 
* Keyframes for integer-value settings now get the FCURVE_INT_VALUES flag set for their F-Curves, which restricts those curves to only having integer-values. F-Curve displays have been altered accordingly, but some editing tools may still need tweaks to work with this.

* Fixed notifiers for Insert Keyframe -> Active Keying Set.
This commit is contained in:
2009-02-13 06:33:07 +00:00
parent cec4a29977
commit c8f04eba48
15 changed files with 420 additions and 51 deletions

View File

@@ -58,6 +58,7 @@
#include "DNA_userdef_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -164,6 +165,10 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short
break;
switch (ale->type) {
case ANIMTYPE_SCENE:
if (ale->flag & SCE_DS_SELECTED)
sel= ACHANNEL_SETFLAG_CLEAR;
break;
case ANIMTYPE_OBJECT:
if (ale->flag & SELECT)
sel= ACHANNEL_SETFLAG_CLEAR;
@@ -187,6 +192,13 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short
/* Now set the flags */
for (ale= anim_data.first; ale; ale= ale->next) {
switch (ale->type) {
case ANIMTYPE_SCENE:
{
Scene *scene= (Scene *)ale->data;
ACHANNEL_SET_FLAG(scene, sel, SCE_DS_SELECTED);
}
break;
case ANIMTYPE_OBJECT:
{
Base *base= (Base *)ale->data;
@@ -1046,6 +1058,26 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s
/* action to take depends on what channel we've got */
switch (ale->type) {
case ANIMTYPE_SCENE:
{
Scene *sce= (Scene *)ale->data;
if (x < 16) {
/* toggle expand */
sce->flag ^= SCE_DS_COLLAPSED;
}
else {
/* set selection status */
if (selectmode == SELECT_INVERT) {
/* swap select */
sce->flag ^= SCE_DS_SELECTED;
}
else {
sce->flag |= SCE_DS_SELECTED;
}
}
}
break;
case ANIMTYPE_OBJECT:
{
bDopeSheet *ads= (bDopeSheet *)ac->data;
@@ -1132,6 +1164,12 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s
key->flag ^= KEYBLOCK_DS_EXPAND;
}
break;
case ANIMTYPE_DSWOR:
{
World *wo= (World *)ale->data;
wo->flag ^= WO_DS_EXPAND;
}
break;
case ANIMTYPE_GROUP:
{

View File

@@ -66,6 +66,7 @@
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -333,6 +334,16 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
/* do specifics */
switch (datatype) {
case ANIMTYPE_SCENE:
{
Scene *sce= (Scene *)data;
ale->flag= sce->flag;
ale->key_data= sce;
ale->datatype= ALE_SCE;
}
break;
case ANIMTYPE_OBJECT:
{
Base *base= (Base *)data;
@@ -427,6 +438,17 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
ale->flag= FILTER_SKE_OBJD(key);
ale->key_data= (adt) ? adt->action : NULL;
ale->datatype= ALE_ACT;
}
break;
case ANIMTYPE_DSWOR:
{
World *wo= (World *)data;
AnimData *adt= wo->adt;
ale->flag= FILTER_WOR_SCED(wo);
ale->key_data= (adt) ? adt->action : NULL;
ale->datatype= ALE_ACT;
}
@@ -1007,6 +1029,117 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
return items;
}
static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
{
World *wo= sce->world;
bAnimListElem *ale;
int items = 0;
/* add scene as a channel first (even if we aren't showing scenes we still need to show the scene's sub-data */
if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) {
/* check if filtering by selection */
if ( !(filter_mode & ANIMFILTER_SEL) || (sce->flag & SCE_DS_SELECTED) ) {
ale= make_new_animlistelem(sce, ANIMTYPE_SCENE, NULL, ANIMTYPE_NONE, NULL);
if (ale) {
BLI_addtail(anim_data, ale);
items++;
}
}
}
/* if collapsed, don't go any further (unless adding keyframes only) */
if ( (EXPANDED_SCEC(sce) == 0) && !(filter_mode & ANIMFILTER_CURVESONLY) )
return items;
/* Action or Drivers */
if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS) == 0) {
/* Action? */
if (ANIMDATA_HAS_KEYS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE)) {
AnimData *adt= sce->adt;
/* include action-expand widget? */
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLACTD, sce, ANIMTYPE_SCENE, (ID *)sce);
if (ale) {
BLI_addtail(anim_data, ale);
items++;
}
}
/* add F-Curve channels? */
if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) {
items += animdata_filter_action(anim_data, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce);
}
}
}
else {
/* Drivers */
if (ANIMDATA_HAS_DRIVERS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE)) {
AnimData *adt= sce->adt;
/* include drivers-expand widget? */
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLDRIVERS, sce, ANIMTYPE_SCENE, (ID *)sce);
if (ale) {
BLI_addtail(anim_data, ale);
items++;
}
}
/* add F-Curve channels (drivers are F-Curves) */
if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) {
items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, sce, ANIMTYPE_SCENE, filter_mode, (ID *)sce);
}
}
}
/* world */
if ((wo) && !(ads->filterflag & ADS_FILTER_NOWOR)) {
/* Animation or Drivers */
if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS) == 0) {
AnimData *adt= wo->adt;
/* include world-expand widget? */
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
ale= make_new_animlistelem(wo, ANIMTYPE_DSWOR, sce, ANIMTYPE_SCENE, (ID *)sce);
if (ale) {
BLI_addtail(anim_data, ale);
items++;
}
}
/* add channels */
if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) {
items += animdata_filter_action(anim_data, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo);
}
}
else {
/* Drivers */
if (ANIMDATA_HAS_DRIVERS(wo)) {
AnimData *adt= wo->adt;
/* include shapekey-expand widget? */
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
ale= make_new_animlistelem(wo, ANIMTYPE_DSWOR, sce, ANIMTYPE_SCENE, (ID *)wo);
if (ale) {
BLI_addtail(anim_data, ale);
items++;
}
}
/* add F-Curve channels (drivers are F-Curves) */
if (FILTER_WOR_SCED(wo)/*EXPANDED_DRVD(adt)*/ || !(filter_mode & ANIMFILTER_CHANNELS)) {
// XXX owner info is messed up now...
items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, wo, ANIMTYPE_DSWOR, filter_mode, (ID *)wo);
}
}
}
}
/* return the number of items added to the list */
return items;
}
// TODO: implement pinning... (if and when pinning is done, what we need to do is to provide freeing mechanisms - to protect against data that was deleted)
static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int filter_mode)
{
@@ -1020,6 +1153,35 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
return 0;
}
/* scene-linked animation */
// TODO: sequencer, composite nodes - are we to include those here too?
{
short sceOk, worOk;
/* check filtering-flags if ok */
if (ads->filterflag) {
if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) {
sceOk= (ANIMDATA_HAS_DRIVERS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE));
worOk= ((sce->world) && ANIMDATA_HAS_DRIVERS(sce->world) && !(ads->filterflag & ADS_FILTER_NOWOR));
}
else {
sceOk= (ANIMDATA_HAS_KEYS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE));
worOk= ((sce->world) && ANIMDATA_HAS_KEYS(sce->world) && !(ads->filterflag & ADS_FILTER_NOWOR));
}
}
else {
sceOk= (ANIMDATA_HAS_KEYS(sce));
worOk= ((sce->world) && ANIMDATA_HAS_KEYS(sce->world));
}
/* check if not all bad (i.e. so there is something to show) */
if ( !(!sceOk && !worOk) ) {
/* add scene data to the list of filtered channels */
items += animdata_filter_dopesheet_scene(anim_data, ads, sce, filter_mode);
}
}
/* loop over all bases in the scene */
for (base= sce->base.first; base; base= base->next) {
/* check if there's an object (all the relevant checks are done in the ob-function) */
@@ -1049,16 +1211,6 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
/* only selected should be shown */
continue;
}
#if 0
if ((ads->filterflag & ADS_FILTER_NOARM) && (ob->type == OB_ARMATURE)) {
/* not showing armatures */
continue;
}
if ((ads->filterflag & ADS_FILTER_NOOBJ) && (ob->type != OB_ARMATURE)) {
/* not showing objects that aren't armatures */
continue;
}
#endif
/* check filters for datatypes */
if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) {
@@ -1066,7 +1218,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
keyOk= ((key) && ANIMDATA_HAS_DRIVERS(key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS));
}
else {
actOk= (ANIMDATA_HAS_KEYS(ob) /*&& !(ads->filterflag & ADS_FILTER_NOACTS)*/);
actOk= ANIMDATA_HAS_KEYS(ob);
keyOk= ((key) && ANIMDATA_HAS_KEYS(key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS));
}

View File

@@ -63,6 +63,7 @@
#include "DNA_userdef_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "BKE_action.h"
#include "BKE_depsgraph.h"
@@ -331,6 +332,18 @@ static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, fl
/* *************************** Channel Drawing Funcs *************************** */
void draw_scene_channel(gla2DDrawInfo *di, ActKeysInc *aki, Scene *sce, float ypos)
{
ListBase keys = {0, 0};
ListBase blocks = {0, 0};
scene_to_keylist(sce, &keys, &blocks, aki);
draw_keylist(di, &keys, &blocks, ypos);
BLI_freelistN(&keys);
BLI_freelistN(&blocks);
}
void draw_object_channel(gla2DDrawInfo *di, ActKeysInc *aki, Object *ob, float ypos)
{
ListBase keys = {0, 0};
@@ -390,9 +403,44 @@ void draw_gpl_channel(gla2DDrawInfo *di, ActKeysInc *aki, bGPDlayer *gpl, float
/* *************************** Keyframe List Conversions *************************** */
void scene_to_keylist(Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
{
if (sce) {
bDopeSheet *ads= (aki)? (aki->ads) : NULL;
AnimData *adt;
int filterflag;
/* get filterflag */
if (ads)
filterflag= ads->filterflag;
else if ((aki) && (aki->actmode == -1)) /* only set like this by NLA */
filterflag= ADS_FILTER_NLADUMMY;
else
filterflag= 0;
/* scene animdata */
if ((sce->adt) && !(filterflag & ADS_FILTER_NOSCE)) {
adt= sce->adt;
// TODO: when we adapt NLA system, this needs to be the NLA-scaled version
if (adt->action)
action_to_keylist(adt->action, keys, blocks, aki);
}
/* world animdata */
if ((sce->world) && (sce->world->adt) && !(filterflag & ADS_FILTER_NOWOR)) {
adt= sce->world->adt;
// TODO: when we adapt NLA system, this needs to be the NLA-scaled version
if (adt->action)
action_to_keylist(adt->action, keys, blocks, aki);
}
}
}
void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
{
// Key *key= ob_get_key(ob);
Key *key= ob_get_key(ob);
if (ob) {
bDopeSheet *ads= (aki)? (aki->ads) : NULL;
@@ -407,14 +455,15 @@ void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki
filterflag= 0;
/* Add action keyframes */
if ((ob->adt && ob->adt->action) /*&& !(filterflag & ADS_FILTER_NOACTS)*/)
if (ob->adt && ob->adt->action)
action_nlascaled_to_keylist(ob, ob->adt->action, keys, blocks, aki);
#if 0 // XXX old animation system
/* Add shapekey keyframes (only if dopesheet allows, if it is available) */
if ((key && key->ipo) && !(filterflag & ADS_FILTER_NOSHAPEKEYS))
ipo_to_keylist(key->ipo, keys, blocks, aki);
// TODO: when we adapt NLA system, this needs to be the NLA-scaled version
if ((key && key->adt && key->adt->action) && !(filterflag & ADS_FILTER_NOSHAPEKEYS))
action_to_keylist(key->adt->action, keys, blocks, aki);
#if 0 // XXX old animation system
/* Add material keyframes (only if dopesheet allows, if it is available) */
if ((ob->totcol) && !(filterflag & ADS_FILTER_NOMAT)) {
short a;

View File

@@ -119,10 +119,6 @@ FCurve *verify_fcurve (ID *id, const char group[], const char rna_path[], const
fcu->rna_path= BLI_strdupn(rna_path, strlen(rna_path));
fcu->array_index= array_index;
/* set additional flags */
// TODO: need to set the FCURVE_INT_VALUES flag must be set if property is not float!
/* if a group name has been provided, try to add or find a group, then add F-Curve to it */
if (group) {
/* try to find group */
@@ -734,6 +730,10 @@ short insertkey (ID *id, const char group[], const char rna_path[], int array_in
if (fcu) {
float curval= 0.0f;
/* set additional flags for the F-Curve (i.e. only integer values) */
if (RNA_property_type(&ptr, prop) != PROP_FLOAT)
fcu->flag |= FCURVE_INT_VALUES;
/* apply special time tweaking */
// XXX check on this stuff...
if (GS(id->name) == ID_OB) {
@@ -821,7 +821,7 @@ short deletekey (ID *id, const char group[], const char rna_path[], int array_in
* Note: here is one of the places where we don't want new Action + F-Curve added!
* so 'add' var must be 0
*/
// XXX we don't check the validity of the path here yet, but it should be ok...
/* we don't check the validity of the path here yet, but it should be ok... */
fcu= verify_fcurve(id, group, rna_path, array_index, 0);
adt= BKE_animdata_from_id(id);
@@ -2167,13 +2167,9 @@ static int insert_key_exec (bContext *C, wmOperator *op)
success= commonkey_modifykey(&dsources, ks, COMMONKEY_MODE_INSERT, cfra);
printf("KeyingSet '%s' - Successfully added %d Keyframes \n", ks->name, success);
/* report failure */
if (success == 0) {
BKE_report(op->reports, RPT_WARNING, "Keying Set failed to insert any keyframes");
return OPERATOR_CANCELLED; // XXX?
}
else
return OPERATOR_FINISHED;
/* report failure? */
if (success == 0)
BKE_report(op->reports, RPT_WARNING, "Keying Set failed to insert any keyframes");
}
else {
// more comprehensive tests will be needed
@@ -2265,7 +2261,9 @@ static int insert_key_exec (bContext *C, wmOperator *op)
/* send updates */
ED_anim_dag_flush_update(C);
if (mode == 4) // material color requires different notifiers
if (mode == 0) /* for now, only send ND_KEYS for KeyingSets */
WM_event_add_notifier(C, ND_KEYS, NULL);
else if (mode == 4) /* material color requires different notifiers */
WM_event_add_notifier(C, NC_MATERIAL|ND_KEYS, NULL);
else
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, NULL);

View File

@@ -107,6 +107,7 @@ typedef enum eAnim_ChannelType {
ANIMTYPE_NONE= 0,
ANIMTYPE_SPECIALDATA,
ANIMTYPE_SCENE,
ANIMTYPE_OBJECT,
ANIMTYPE_GROUP,
ANIMTYPE_FCURVE,
@@ -120,6 +121,7 @@ typedef enum eAnim_ChannelType {
ANIMTYPE_DSCAM,
ANIMTYPE_DSCUR,
ANIMTYPE_DSSKEY,
ANIMTYPE_DSWOR,
ANIMTYPE_SHAPEKEY, // XXX probably can become depreceated???
@@ -134,6 +136,7 @@ typedef enum eAnim_KeyType {
ALE_GPFRAME, /* Grease Pencil Frames */
// XXX the following are for summaries... should these be kept?
ALE_SCE, /* Scene summary */
ALE_OB, /* Object summary */
ALE_ACT, /* Action summary */
ALE_GROUP, /* Action Group summary */
@@ -158,6 +161,11 @@ typedef enum eAnimFilter_Flags {
// xxx check on all of these flags again...
/* Dopesheet only */
/* 'Scene' channels */
#define SEL_SCEC(sce) ((sce->flag & SCE_DS_SELECTED))
#define EXPANDED_SCEC(sce) ((sce->flag & SCE_DS_COLLAPSED)==0)
/* 'Sub-Scene' channels (flags stored in Data block) */
#define FILTER_WOR_SCED(wo) ((wo->flag & WO_DS_EXPAND))
/* 'Object' channels */
#define SEL_OBJC(base) ((base->flag & SELECT))
#define EXPANDED_OBJC(ob) ((ob->nlaflag & OB_ADS_COLLAPSED)==0)

View File

@@ -35,10 +35,10 @@ struct FCurve;
struct gla2DDrawInfo;
struct bAction;
struct bActionGroup;
struct bActListElem;
struct Object;
struct ListBase;
struct bGPDlayer;
struct Scene;
/* ****************************** Base Structs ****************************** */
@@ -82,6 +82,7 @@ void draw_fcurve_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct FCurv
void draw_agroup_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct bActionGroup *agrp, float ypos);
void draw_action_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct bAction *act, float ypos);
void draw_object_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct Object *ob, float ypos);
void draw_scene_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct Scene *sce, float ypos);
void draw_gpl_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct bGPDlayer *gpl, float ypos);
/* Keydata Generation */
@@ -90,6 +91,7 @@ void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase *bloc
void action_to_keylist(struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
void action_nlascaled_to_keylist(struct Object *ob, struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
void ob_to_keylist(struct Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
void scene_to_keylist(struct Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
void gpl_to_keylist(struct bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
#endif /* ED_KEYFRAMES_DRAW_H */

View File

@@ -62,6 +62,7 @@
#include "DNA_userdef_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "BKE_action.h"
#include "BKE_depsgraph.h"
@@ -443,6 +444,25 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
/* determine what needs to be drawn */
switch (ale->type) {
case ANIMTYPE_SCENE: /* scene */
{
Scene *sce= (Scene *)ale->data;
group= 4;
indent= 0;
special= ICON_SCENE;
/* only show expand if there are any channels */
if (EXPANDED_SCEC(sce))
expand= ICON_TRIA_DOWN;
else
expand= ICON_TRIA_RIGHT;
sel = SEL_SCEC(sce);
strcpy(name, sce->id.name+2);
}
break;
case ANIMTYPE_OBJECT: /* object */
{
Base *base= (Base *)ale->data;
@@ -573,7 +593,7 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
group = 4;
indent = 1;
special = ICON_EDIT;
special = ICON_EDIT; // XXX
if (FILTER_SKE_OBJD(key))
expand = ICON_TRIA_DOWN;
@@ -584,6 +604,22 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
strcpy(name, "Shape Keys");
}
break;
case ANIMTYPE_DSWOR: /* world (dopesheet) expand widget */
{
World *wo= (World *)ale->data;
group = 4;
indent = 1;
special = ICON_WORLD;
if (FILTER_WOR_SCED(wo))
expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
strcpy(name, wo->id.name+2);
}
break;
case ANIMTYPE_GROUP: /* action group */
@@ -781,7 +817,7 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
/* draw backing strip behind channel name */
if (group == 4) {
/* only used in dopesheet... */
if (ale->type == ANIMTYPE_OBJECT) {
if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) {
/* object channel - darker */
UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
@@ -1026,6 +1062,12 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
if (ale->datatype != ALE_NONE) {
/* determine if channel is selected */
switch (ale->type) {
case ANIMTYPE_SCENE:
{
Scene *sce= (Scene *)ale->data;
sel = SEL_SCEC(sce);
}
break;
case ANIMTYPE_OBJECT:
{
Base *base= (Base *)ale->data;
@@ -1056,6 +1098,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
gla2DDrawTranslatePt(di, v2d->cur.xmin, y, &frame1_x, &channel_y);
switch (ale->type) {
case ANIMTYPE_SCENE:
case ANIMTYPE_OBJECT:
{
if (sel) glColor4ub(col1b[0], col1b[1], col1b[2], 0x45);
@@ -1066,6 +1109,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
case ANIMTYPE_FILLACTD:
case ANIMTYPE_FILLMATD:
case ANIMTYPE_DSSKEY:
case ANIMTYPE_DSWOR:
{
if (sel) glColor4ub(col2b[0], col2b[1], col2b[2], 0x45);
else glColor4ub(col2b[0], col2b[1], col2b[2], 0x22);
@@ -1152,6 +1196,9 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
/* draw 'keyframes' for each specific datatype */
switch (ale->datatype) {
case ALE_SCE:
draw_scene_channel(di, aki, ale->key_data, y);
break;
case ALE_OB:
draw_object_channel(di, aki, ale->key_data, y);
break;

View File

@@ -1676,8 +1676,8 @@ void action_header_buttons(const bContext *C, ARegion *ar)
xco += 5;
uiBlockBeginAlign(block);
//uiDefIconButBitI(block, TOGN, ADS_FILTER_NOOBJ, B_REDR, ICON_OBJECT, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Non-Armature Objects");
//uiDefIconButBitI(block, TOGN, ADS_FILTER_NOARM, B_REDR, ICON_ARMATURE, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Armature Objects");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSCE, B_REDR, ICON_SCENE, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Scene Animation");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOWOR, B_REDR, ICON_WORLD, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display World Animation");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSHAPEKEYS, B_REDR, ICON_EDIT, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display ShapeKeys");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMAT, B_REDR, ICON_MATERIAL, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Materials");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Lamps");

View File

@@ -54,6 +54,7 @@
#include "DNA_userdef_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -763,6 +764,7 @@ static EnumPropertyItem prop_leftright_select_types[] = {
/* option 1) select keyframe directly under mouse */
static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode)
{
Scene *sce= NULL;
Object *ob= NULL;
bDopeSheet *ads= NULL;
bAction *act= NULL;
@@ -820,6 +822,9 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode)
case ANIMTYPE_OBJECT:
ob= ((Base *)anim_channel)->object;
break;
case ANIMTYPE_SCENE:
sce= (Scene *)anim_channel;
break;
case ANIMTYPE_GPLAYER:
gpl= (bGPDlayer *)anim_channel;
break;
@@ -887,6 +892,28 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode)
/* 'Sub-Object' animation data */
// TODO...
}
else if (sce) {
World *wo= sce->world;
AnimData *adt;
/* Scene's own animation */
if (sce->adt && sce->adt->action) {
adt= sce->adt;
act= adt->action;
for (fcu= act->curves.first; fcu; fcu= fcu->next)
ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL);
}
/* World */
if (wo && wo->adt && wo->adt->action) {
adt= wo->adt;
act= adt->action;
for (fcu= act->curves.first; fcu; fcu= fcu->next)
ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL);
}
}
//else if (gpl)
// select_gpencil_frame(gpl, (int)selx, selectmode);
}

View File

@@ -58,6 +58,7 @@
#include "DNA_userdef_types.h"
#include "DNA_view2d_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
@@ -239,7 +240,7 @@ void draw_fcurve_vertices (SpaceIpo *sipo, ARegion *ar, FCurve *fcu)
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
/* draw the two handles first (if they're shown, and if curve is being edited) */
if ((fcu->flag & FCURVE_PROTECTED)==0 && (sipo->flag & SIPO_NOHANDLES)==0) {
if ((fcu->flag & FCURVE_PROTECTED)==0 && (fcu->flag & FCURVE_INT_VALUES)==0 && (sipo->flag & SIPO_NOHANDLES)==0) {
set_fcurve_vertex_color(sipo, fcu, 0);
draw_fcurve_vertices_handles(fcu, v2d, 0);
@@ -267,7 +268,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, ARegion *ar, FCurve *fcu)
int sel, b;
/* don't draw handle lines if handles are not shown */
if ((sipo->flag & SIPO_NOHANDLES) || (fcu->flag & FCURVE_PROTECTED))
if ((sipo->flag & SIPO_NOHANDLES) || (fcu->flag & FCURVE_PROTECTED) || (fcu->flag & FCURVE_INT_VALUES))
return;
/* slightly hacky, but we want to draw unselected points before selected ones*/
@@ -420,7 +421,7 @@ static void draw_fcurve_repeat (FCurve *fcu, View2D *v2d, float cycxofs, float c
v1[0]= v2d->cur.xmin;
/* y-value depends on the interpolation */
if ((fcu->extend==FCURVE_EXTRAPOLATE_CONSTANT) || (prevbezt->ipo==BEZT_IPO_CONST) || (fcu->totvert==1)) {
if ((fcu->extend==FCURVE_EXTRAPOLATE_CONSTANT) || (fcu->flag & FCURVE_INT_VALUES) || (prevbezt->ipo==BEZT_IPO_CONST) || (fcu->totvert==1)) {
/* just extend across the first keyframe's value */
v1[1]= prevbezt->vec[1][1];
}
@@ -451,7 +452,7 @@ static void draw_fcurve_repeat (FCurve *fcu, View2D *v2d, float cycxofs, float c
/* draw curve between first and last keyframe (if there are enough to do so) */
// XXX this doesn't take into account modifiers, or sample data
while (b--) {
if (prevbezt->ipo==BEZT_IPO_CONST) {
if ((fcu->flag & FCURVE_INT_VALUES) || (prevbezt->ipo==BEZT_IPO_CONST)) {
/* Constant-Interpolation: draw segment between previous keyframe and next, but holding same value */
v1[0]= prevbezt->vec[1][0]+cycxofs;
v1[1]= prevbezt->vec[1][1]+cycyofs;
@@ -527,7 +528,7 @@ static void draw_fcurve_repeat (FCurve *fcu, View2D *v2d, float cycxofs, float c
v1[0]= v2d->cur.xmax;
/* y-value depends on the interpolation */
if ((fcu->extend==FCURVE_EXTRAPOLATE_CONSTANT) || (prevbezt->ipo==BEZT_IPO_CONST) || (fcu->totvert==1)) {
if ((fcu->extend==FCURVE_EXTRAPOLATE_CONSTANT) || (fcu->flag & FCURVE_INT_VALUES) || (prevbezt->ipo==BEZT_IPO_CONST) || (fcu->totvert==1)) {
/* based on last keyframe's value */
v1[1]= prevbezt->vec[1][1];
}
@@ -809,6 +810,25 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
/* determine what needs to be drawn */
switch (ale->type) {
case ANIMTYPE_SCENE: /* scene */
{
Scene *sce= (Scene *)ale->data;
group= 4;
indent= 0;
special= ICON_SCENE;
/* only show expand if there are any channels */
if (EXPANDED_SCEC(sce))
expand= ICON_TRIA_DOWN;
else
expand= ICON_TRIA_RIGHT;
sel = SEL_SCEC(sce);
strcpy(name, sce->id.name+2);
}
break;
case ANIMTYPE_OBJECT: /* object */
{
Base *base= (Base *)ale->data;
@@ -966,7 +986,23 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
strcpy(name, "Shape Keys");
}
break;
case ANIMTYPE_DSWOR: /* world (dopesheet) expand widget */
{
World *wo= (World *)ale->data;
group = 4;
indent = 1;
special = ICON_WORLD;
if (FILTER_WOR_SCED(wo))
expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
strcpy(name, wo->id.name+2);
}
break;
case ANIMTYPE_GROUP: /* action group */
{
@@ -1067,7 +1103,7 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
/* draw backing strip behind channel name */
if (group == 4) {
/* only used in dopesheet... */
if (ale->type == ANIMTYPE_OBJECT) {
if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) {
/* object channel - darker */
UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));

View File

@@ -185,8 +185,8 @@ void graph_header_buttons(const bContext *C, ARegion *ar)
xco += 5;
uiBlockBeginAlign(block);
//uiDefIconButBitI(block, TOGN, ADS_FILTER_NOOBJ, B_REDR, ICON_OBJECT, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Non-Armature Objects");
//uiDefIconButBitI(block, TOGN, ADS_FILTER_NOARM, B_REDR, ICON_ARMATURE, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Armature Objects");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSCE, B_REDR, ICON_SCENE, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Scene Animation");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOWOR, B_REDR, ICON_WORLD, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display World Animation");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSHAPEKEYS, B_REDR, ICON_EDIT, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display ShapeKeys");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMAT, B_REDR, ICON_MATERIAL, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Materials");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Lamps");

View File

@@ -337,6 +337,9 @@ static void graph_listener(ScrArea *sa, wmNotifier *wmn)
}*/
ED_area_tag_refresh(sa);
break;
default:
if(wmn->data==ND_KEYS)
ED_area_tag_refresh(sa);
}
}
@@ -354,10 +357,7 @@ static void graph_refresh(const bContext *C, ScrArea *sa)
case SIPO_MODE_DRIVERS: /* drivers only */
{
Object *ob= CTX_data_active_object(C);
/* sync changes to bones to the corresponding action channels */
ANIM_pose_to_action_sync(ob, sa);
}
break;
}

View File

@@ -289,14 +289,13 @@ typedef enum DOPESHEET_FILTERFLAG {
ADS_FILTER_ONLYDRIVERS = (1<<1),
/* datatype-based filtering */
ADS_FILTER_NOOBJ = (1<<4), // XXX
ADS_FILTER_NOARM = (1<<5), // XXX
ADS_FILTER_NOSHAPEKEYS = (1<<6),
ADS_FILTER_NOCAM = (1<<10),
ADS_FILTER_NOMAT = (1<<11),
ADS_FILTER_NOLAM = (1<<12),
ADS_FILTER_NOCUR = (1<<13),
ADS_FILTER_NOWOR = (1<<14),
ADS_FILTER_NOSCE = (1<<15),
/* combination filters (some only used at runtime) */
ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR),

View File

@@ -535,8 +535,9 @@ typedef struct Scene {
float editbutsize; /* size of normals */
short selectmode; /* for mesh only! */
short proportional, prop_mode;
short automerge, pad5, pad6;
short automerge, pad5;
short flag; /* various settings */
short autokey_mode; /* mode for autokeying (defines in DNA_userdef_types.h) */
short use_nodes;
@@ -801,6 +802,11 @@ typedef struct Scene {
#define PROP_CONST 5
#define PROP_RANDOM 6
/* sce->flag */
#define SCE_DS_SELECTED (1<<0)
#define SCE_DS_COLLAPSED (1<<1)
/* return flag next_object function */
#define F_START 0
#define F_SCENE 1

View File

@@ -104,8 +104,12 @@ typedef struct World {
short aomode, aosamp, aomix, aocolor;
float ao_adapt_thresh, ao_adapt_speed_fac;
float ao_approx_error, ao_approx_correction;
short ao_samp_method, ao_gather_method, ao_approx_passes, pad1;
short ao_samp_method, ao_gather_method, ao_approx_passes;
/* assorted settings (in the middle of ambient occlusion settings for padding reasons) */
short flag;
/* ambient occlusion (contd...) */
float *aosphere, *aotables;
@@ -180,5 +184,8 @@ typedef struct World {
#define WOPHY_ODE 4
#define WOPHY_BULLET 5
/* flag */
#define WO_DS_EXPAND (1<<0)
#endif