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-04-09 11:26:49 +0400
committerJoshua Leung <aligorith@gmail.com>2009-04-09 11:26:49 +0400
commita59ee83916bf8c38f138775be4a48b4d26bd07fc (patch)
tree2c1d72bceb9eb19954bcec4f05e8a0a458d96e04 /source/blender/editors
parent41b82595806c29adc9b55a371cb9ee66a202422e (diff)
Animation Editors - Bugfixes:
* Collapse selected channels should now work for most channels. It still doesn't work for Action Groups for some reason... * Objects are now deemed to only be selected in Animation Editors if the are selected (i.e. if they are active but not selected, they are no longer considered to be selected) * Outliner updates when scrubbing the TimeLine. As a consequence, anim playback with an Outliner open is a bit slower now.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels.c121
-rw-r--r--source/blender/editors/animation/anim_filter.c3
-rw-r--r--source/blender/editors/animation/anim_ops.c2
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c1
4 files changed, 124 insertions, 3 deletions
diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c
index dfe093641c1..4d200ca392d 100644
--- a/source/blender/editors/animation/anim_channels.c
+++ b/source/blender/editors/animation/anim_channels.c
@@ -100,6 +100,18 @@
else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag |= (sflag); \
else (channel)->flag &= ~(sflag); \
}
+
+/* set/clear/toggle macro, where the flag is negative
+ * - channel - channel with a 'flag' member that we're setting
+ * - smode - 0=clear, 1=set, 2=toggle
+ * - sflag - bitflag to set
+ */
+#define ACHANNEL_SET_FLAG_NEG(channel, smode, sflag) \
+ { \
+ if (smode == ACHANNEL_SETFLAG_TOGGLE) (channel)->flag ^= (sflag); \
+ else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag &= ~(sflag); \
+ else (channel)->flag |= (sflag); \
+ }
/* -------------------------- Exposed API ----------------------------------- */
@@ -716,6 +728,10 @@ EnumPropertyItem prop_animchannel_settings_types[] = {
/* ------------------- */
+/* macro to be used in setflag_anim_channels */
+#define ASUBCHANNEL_SEL_OK(ale) ( (onlysel == 0) || \
+ ((ale->id) && (GS(ale->id->name)==ID_OB) && (((Object *)ale->id)->flag & SELECT)) )
+
/* Set/clear a particular flag (setting) for all selected + visible channels
* setting: the setting to modify
* mode: eAnimChannels_SetFlag
@@ -748,6 +764,111 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
}
}
break;
+
+ case ANIMTYPE_FILLACTD:
+ {
+ bAction *act= (bAction *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG_NEG(act, mode, ACT_COLLAPSED);
+ }
+ }
+ }
+ break;
+ case ANIMTYPE_FILLDRIVERS:
+ {
+ AnimData *adt= (AnimData *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG_NEG(adt, mode, ADT_DRIVERS_COLLAPSED);
+ }
+ }
+ }
+ break;
+ case ANIMTYPE_FILLMATD:
+ {
+ Object *ob= (Object *)ale->data;
+
+ // XXX - settings should really be moved out of ob->nlaflag
+ if ((onlysel == 0) || (ob->flag & SELECT)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ if (mode == ACHANNEL_SETFLAG_TOGGLE) ob->nlaflag ^= OB_ADS_SHOWMATS;
+ else if (mode == ACHANNEL_SETFLAG_ADD) ob->nlaflag |= OB_ADS_SHOWMATS;
+ else ob->nlaflag &= ~OB_ADS_SHOWMATS;
+ }
+ }
+ }
+ break;
+
+ case ANIMTYPE_DSMAT:
+ {
+ Material *ma= (Material *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG(ma, mode, MA_DS_EXPAND);
+ }
+ }
+ }
+ break;
+ case ANIMTYPE_DSLAM:
+ {
+ Lamp *la= (Lamp *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG(la, mode, LA_DS_EXPAND);
+ }
+ }
+ }
+ break;
+ case ANIMTYPE_DSCAM:
+ {
+ Camera *ca= (Camera *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG(ca, mode, CAM_DS_EXPAND);
+ }
+ }
+ }
+ break;
+ case ANIMTYPE_DSCUR:
+ {
+ Curve *cu= (Curve *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG(cu, mode, CU_DS_EXPAND);
+ }
+ }
+ }
+ break;
+ case ANIMTYPE_DSSKEY:
+ {
+ Key *key= (Key *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG(key, mode, KEYBLOCK_DS_EXPAND);
+ }
+ }
+ }
+ break;
+ case ANIMTYPE_DSWOR:
+ {
+ World *wo= (World *)ale->data;
+
+ if (ASUBCHANNEL_SEL_OK(ale)) {
+ if (setting == ACHANNEL_SETTING_EXPAND) {
+ ACHANNEL_SET_FLAG(wo, mode, WO_DS_EXPAND);
+ }
+ }
+ }
+ break;
+
case ANIMTYPE_GROUP:
{
bActionGroup *agrp= (bActionGroup *)ale->data;
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index ea30fe83f35..f8bf3f08bde 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -869,7 +869,6 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad
static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
{
bAnimListElem *ale=NULL;
- Scene *sce= (Scene *)ads->source;
Object *ob= base->object;
Key *key= ob_get_key(ob);
int items = 0;
@@ -877,7 +876,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
/* add this object as a channel first */
if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) {
/* check if filtering by selection */
- if (ANIMCHANNEL_SELOK( ((base->flag & SELECT) || (base == sce->basact)) )) {
+ if ANIMCHANNEL_SELOK((base->flag & SELECT)) {
ale= make_new_animlistelem(base, ANIMTYPE_OBJECT, NULL, ANIMTYPE_NONE, NULL);
if (ale) {
BLI_addtail(anim_data, ale);
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 991349d3ed8..b7a59822e71 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -327,7 +327,7 @@ static int toggle_time_exec(bContext *C, wmOperator *op)
saction->flag ^= SACTION_DRAWTIME;
}
break;
- case SPACE_IPO: /* IPO Editor */
+ case SPACE_IPO: /* Graph Editor */
{
SpaceIpo *sipo= (SpaceIpo *)CTX_wm_space_data(C);
sipo->flag ^= SIPO_DRAWTIME;
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 4add1e88986..e0dc54ee377 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -120,6 +120,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_OB_SELECT:
case ND_MODE:
case ND_KEYINGSET:
+ case ND_FRAME:
ED_region_tag_redraw(ar);
break;
}