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:
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c30
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c51
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c14
3 files changed, 58 insertions, 37 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 18769476118..068532a08a2 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -43,6 +43,7 @@
#include "DNA_world_types.h"
#include "BLI_utildefines.h"
+#include "BLI_listbase.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
@@ -52,6 +53,7 @@
#include "ED_armature.h"
#include "ED_object.h"
#include "ED_screen.h"
+#include "ED_sequencer.h"
#include "ED_util.h"
#include "WM_api.h"
@@ -568,16 +570,34 @@ static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *UNUS
return 0;
}
-static int tree_element_active_sequence(TreeElement *te, TreeStoreElem *UNUSED(tselem), int set)
+static int tree_element_active_sequence(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tselem), int set)
{
Sequence *seq = (Sequence *) te->directdata;
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (set) {
-// XXX select_single_seq(seq, 1);
+ /* only check on setting */
+ if (BLI_findindex(ed->seqbasep, seq) != -1) {
+ if (set == 2) {
+ BKE_sequencer_active_set(scene, NULL);
+ }
+ ED_sequencer_deselect_all(scene);
+
+ if (set == 2 && seq->flag & SELECT) {
+ seq->flag &= ~SELECT;
+ }
+ else {
+ seq->flag |= SELECT;
+ BKE_sequencer_active_set(scene, seq);
+ }
+ }
+
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
}
else {
- if (seq->flag & SELECT)
- return(1);
+ if (ed->act_seq == seq && seq->flag & SELECT) {
+ return 1;
+ }
}
return(0);
}
@@ -678,7 +698,7 @@ int tree_element_type_active(bContext *C, Scene *scene, SpaceOops *soops, TreeEl
case TSE_POSEGRP:
return tree_element_active_posegroup(C, scene, te, tselem, set);
case TSE_SEQUENCE:
- return tree_element_active_sequence(te, tselem, set);
+ return tree_element_active_sequence(C, scene, te, tselem, set);
case TSE_SEQUENCE_DUP:
return tree_element_active_sequence_dup(scene, te, tselem, set);
case TSE_KEYMAP_ITEM:
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index cf236c66e53..72b954b88e7 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -39,6 +39,7 @@
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_scene_types.h"
+#include "DNA_sequence_types.h"
#include "DNA_world_types.h"
#include "DNA_object_types.h"
@@ -54,10 +55,12 @@
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_scene.h"
+#include "BKE_sequencer.h"
#include "ED_armature.h"
#include "ED_object.h"
#include "ED_screen.h"
+#include "ED_sequencer.h"
#include "ED_util.h"
#include "WM_api.h"
@@ -396,13 +399,13 @@ void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOops *soop
/* ******************************************** */
-static void unlinkact_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem)
+static void unlinkact_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem, void *UNUSED(arg))
{
/* just set action to NULL */
BKE_animdata_set_action(NULL, tselem->id, NULL);
}
-static void cleardrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem)
+static void cleardrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem, void *UNUSED(arg))
{
IdAdtTemplate *iat = (IdAdtTemplate *)tselem->id;
@@ -410,7 +413,7 @@ static void cleardrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te),
free_fcurves(&iat->adt->drivers);
}
-static void refreshdrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem)
+static void refreshdrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te), TreeStoreElem *tselem, void *UNUSED(arg))
{
IdAdtTemplate *iat = (IdAdtTemplate *)tselem->id;
FCurve *fcu;
@@ -426,7 +429,7 @@ static void refreshdrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te
/* --------------------------------- */
-static void pchan_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
+static void pchan_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg))
{
bPoseChannel *pchan = (bPoseChannel *)te->directdata;
@@ -442,7 +445,7 @@ static void pchan_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
pchan->bone->flag &= ~BONE_HIDDEN_P;
}
-static void bone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
+static void bone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg))
{
Bone *bone = (Bone *)te->directdata;
@@ -458,7 +461,7 @@ static void bone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
bone->flag &= ~BONE_HIDDEN_P;
}
-static void ebone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
+static void ebone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg))
{
EditBone *ebone = (EditBone *)te->directdata;
@@ -474,16 +477,23 @@ static void ebone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
ebone->flag &= ~BONE_HIDDEN_A;
}
-static void sequence_cb(int event, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tselem))
+static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem, void *scene_ptr)
{
-// Sequence *seq= (Sequence*) te->directdata;
+ Sequence *seq = (Sequence *)te->directdata;
if (event == 1) {
-// XXX select_single_seq(seq, 1);
+ Scene *scene = (Scene *)scene_ptr;
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+ if (BLI_findindex(ed->seqbasep, seq) != -1) {
+ ED_sequencer_select_sequence_single(scene, seq, TRUE);
+ }
}
+
+ (void)tselem;
}
-static void outliner_do_data_operation(SpaceOops *soops, int type, int event, ListBase *lb,
- void (*operation_cb)(int, TreeElement *, TreeStoreElem *))
+static void outliner_do_data_operation(SpaceOops *soops, int type, int event, ListBase *lb,
+ void (*operation_cb)(int, TreeElement *, TreeStoreElem *, void *),
+ void *arg)
{
TreeElement *te;
TreeStoreElem *tselem;
@@ -492,11 +502,11 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li
tselem = TREESTORE(te);
if (tselem->flag & TSE_SELECTED) {
if (tselem->type == type) {
- operation_cb(event, te, tselem);
+ operation_cb(event, te, tselem, arg);
}
}
if (TSELEM_OPEN(tselem, soops)) {
- outliner_do_data_operation(soops, type, event, &te->subtree, operation_cb);
+ outliner_do_data_operation(soops, type, event, &te->subtree, operation_cb, arg);
}
}
}
@@ -1013,14 +1023,14 @@ static int outliner_animdata_operation_exec(bContext *C, wmOperator *op)
case OUTLINER_ANIMOP_CLEAR_ACT:
/* clear active action - using standard rules */
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, unlinkact_animdata_cb);
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, unlinkact_animdata_cb, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
ED_undo_push(C, "Unlink action");
break;
case OUTLINER_ANIMOP_REFRESH_DRV:
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, refreshdrivers_animdata_cb);
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, refreshdrivers_animdata_cb, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN, NULL);
//ED_undo_push(C, "Refresh Drivers"); /* no undo needed - shouldn't have any impact? */
@@ -1028,7 +1038,7 @@ static int outliner_animdata_operation_exec(bContext *C, wmOperator *op)
break;
case OUTLINER_ANIMOP_CLEAR_DRV:
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, cleardrivers_animdata_cb);
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, cleardrivers_animdata_cb, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN, NULL);
ED_undo_push(C, "Clear Drivers");
@@ -1097,28 +1107,29 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
if (datalevel == TSE_POSE_CHANNEL) {
if (event > 0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb);
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "PoseChannel operation");
}
}
else if (datalevel == TSE_BONE) {
if (event > 0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb);
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "Bone operation");
}
}
else if (datalevel == TSE_EBONE) {
if (event > 0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb);
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "EditBone operation");
}
}
else if (datalevel == TSE_SEQUENCE) {
if (event > 0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb);
+ Scene *scene = CTX_data_scene(C);
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb, scene);
}
}
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 097823135f3..ff3648fc2b8 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -897,24 +897,16 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
*/
te->idcode = seq->type;
te->directdata = seq;
+ te->name = seq->name + 2;
- if (seq->type < 7) {
+ if (seq->type < SEQ_EFFECT) {
/*
* This work like the sequence.
* If the sequence have a name (not default name)
* show it, in other case put the filename.
*/
- if (strcmp(seq->name, "SQ"))
- te->name = seq->name;
- else {
- if ((seq->strip) && (seq->strip->stripdata))
- te->name = seq->strip->stripdata->name;
- else
- te->name = "SQ None";
- }
if (seq->type == SEQ_META) {
- te->name = "Meta Strip";
p = seq->seqbase.first;
while (p) {
outliner_add_element(soops, &te->subtree, (void *)p, te, TSE_SEQUENCE, index);
@@ -924,8 +916,6 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
else
outliner_add_element(soops, &te->subtree, (void *)seq->strip, te, TSE_SEQ_STRIP, index);
}
- else
- te->name = "Effect";
}
else if (type == TSE_SEQ_STRIP) {
Strip *strip = (Strip *)idv;