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:
authorCampbell Barton <ideasman42@gmail.com>2018-06-04 10:39:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-04 10:39:04 +0300
commit95011f6d484b369db92ae13c674a6522d664ea8f (patch)
tree91ba2719c9f3096fad0f1f768aa7b1c4d79aa32a /source/blender/editors/space_outliner/outliner_tools.c
parent0911acb5cf49c5ba05b1df045b41697704aa288a (diff)
parent44505b38df557a5711703613685a1dec9fc2c3d9 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tools.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c216
1 files changed, 108 insertions, 108 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index b9e5bc80a3f..8a01e5a7f2f 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -101,7 +101,7 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb,
{
TreeElement *te;
TreeStoreElem *tselem;
-
+
for (te = lb->first; te; te = te->next) {
tselem = TREESTORE(te);
if (tselem->flag & TSE_SELECTED) {
@@ -121,7 +121,7 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb,
case ID_OB:
*objectlevel = 1;
break;
-
+
case ID_ME: case ID_CU: case ID_MB: case ID_LT:
case ID_LA: case ID_AR: case ID_CA: case ID_SPK:
case ID_MA: case ID_TE: case ID_IP: case ID_IM:
@@ -158,7 +158,7 @@ static void unlink_material_cb(
{
Material **matar = NULL;
int a, totcol = 0;
-
+
if (GS(tsep->id->name) == ID_OB) {
Object *ob = (Object *)tsep->id;
totcol = ob->totcol;
@@ -199,7 +199,7 @@ static void unlink_texture_cb(
{
MTex **mtex = NULL;
int a;
-
+
if (GS(tsep->id->name) == ID_LS) {
FreestyleLineStyle *ls = (FreestyleLineStyle *)tsep->id;
mtex = ls->mtex;
@@ -252,7 +252,7 @@ static void unlink_object_cb(
{
Main *bmain = CTX_data_main(C);
Object *ob = (Object *)tselem->id;
-
+
if (tsep) {
if (GS(tsep->id->name) == ID_GR) {
Collection *parent = (Collection *)tsep->id;
@@ -273,7 +273,7 @@ static void unlink_world_cb(
{
Scene *parscene = (Scene *)tsep->id;
World *wo = (World *)tselem->id;
-
+
/* need to use parent scene not just scene, otherwise may end up getting wrong one */
id_us_min(&wo->id);
parscene->world = NULL;
@@ -286,7 +286,7 @@ static void outliner_do_libdata_operation(
{
TreeElement *te;
TreeStoreElem *tselem;
-
+
for (te = lb->first; te; te = te->next) {
tselem = TREESTORE(te);
if (tselem->flag & TSE_SELECTED) {
@@ -496,7 +496,7 @@ static void id_fake_user_set_cb(
TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
{
ID *id = tselem->id;
-
+
id_fake_user_set(id);
}
@@ -505,7 +505,7 @@ static void id_fake_user_clear_cb(
TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
{
ID *id = tselem->id;
-
+
id_fake_user_clear(id);
}
@@ -523,15 +523,15 @@ static void singleuser_action_cb(
TreeStoreElem *tsep, TreeStoreElem *tselem, void *UNUSED(user_data))
{
ID *id = tselem->id;
-
+
if (id) {
IdAdtTemplate *iat = (IdAdtTemplate *)tsep->id;
PointerRNA ptr = {{NULL}};
PropertyRNA *prop;
-
+
RNA_pointer_create(&iat->id, &RNA_AnimData, iat->adt, &ptr);
prop = RNA_struct_find_property(&ptr, "action");
-
+
id_single_user(C, id, &ptr, prop);
}
}
@@ -541,16 +541,16 @@ static void singleuser_world_cb(
TreeStoreElem *tsep, TreeStoreElem *tselem, void *UNUSED(user_data))
{
ID *id = tselem->id;
-
+
/* need to use parent scene not just scene, otherwise may end up getting wrong one */
if (id) {
Scene *parscene = (Scene *)tsep->id;
PointerRNA ptr = {{NULL}};
PropertyRNA *prop;
-
+
RNA_id_pointer_create(&parscene->id, &ptr);
prop = RNA_struct_find_property(&ptr, "world");
-
+
id_single_user(C, id, &ptr, prop);
}
}
@@ -563,7 +563,7 @@ void outliner_do_object_operation_ex(
outliner_operation_cb operation_cb, bool select_recurse)
{
TreeElement *te;
-
+
for (te = lb->first; te; te = te->next) {
TreeStoreElem *tselem = TREESTORE(te);
bool select_handled = false;
@@ -617,7 +617,7 @@ static void cleardrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te),
TreeStoreElem *tselem, void *UNUSED(arg))
{
IdAdtTemplate *iat = (IdAdtTemplate *)tselem->id;
-
+
/* just free drivers - stored as a list of F-Curves */
free_fcurves(&iat->adt->drivers);
}
@@ -627,11 +627,11 @@ static void refreshdrivers_animdata_cb(int UNUSED(event), TreeElement *UNUSED(te
{
IdAdtTemplate *iat = (IdAdtTemplate *)tselem->id;
FCurve *fcu;
-
+
/* loop over drivers, performing refresh (i.e. check graph_buttons.c and rna_fcurve.c for details) */
for (fcu = iat->adt->drivers.first; fcu; fcu = fcu->next) {
fcu->flag &= ~FCURVE_DISABLED;
-
+
if (fcu->driver)
fcu->driver->flag &= ~DRIVER_FLAG_INVALID;
}
@@ -662,7 +662,7 @@ typedef enum eOutliner_PropModifierOps {
static void pchan_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg))
{
bPoseChannel *pchan = (bPoseChannel *)te->directdata;
-
+
if (event == OL_DOP_SELECT)
pchan->bone->flag |= BONE_SELECTED;
else if (event == OL_DOP_DESELECT)
@@ -678,7 +678,7 @@ static void pchan_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;
-
+
if (event == OL_DOP_SELECT)
bone->flag |= BONE_SELECTED;
else if (event == OL_DOP_DESELECT)
@@ -694,7 +694,7 @@ static void bone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), v
static void ebone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg))
{
EditBone *ebone = (EditBone *)te->directdata;
-
+
if (event == OL_DOP_SELECT)
ebone->flag |= BONE_SELECTED;
else if (event == OL_DOP_DESELECT)
@@ -724,7 +724,7 @@ static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem, void
static void gp_layer_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg))
{
bGPDlayer *gpl = (bGPDlayer *)te->directdata;
-
+
if (event == OL_DOP_SELECT)
gpl->flag |= GP_LAYER_SELECT;
else if (event == OL_DOP_DESELECT)
@@ -816,7 +816,7 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li
{
TreeElement *te;
TreeStoreElem *tselem;
-
+
for (te = lb->first; te; te = te->next) {
tselem = TREESTORE(te);
if (tselem->flag & TSE_SELECTED) {
@@ -932,11 +932,11 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
SpaceOops *soops = CTX_wm_space_outliner(C);
int event;
const char *str = NULL;
-
+
/* check for invalid states */
if (soops == NULL)
return OPERATOR_CANCELLED;
-
+
event = RNA_enum_get(op->ptr, "type");
if (event == OL_OP_SELECT) {
@@ -945,7 +945,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
if (scene != sce) {
WM_window_change_active_scene(bmain, C, win, sce);
}
-
+
str = "Select Objects";
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
@@ -1005,7 +1005,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
}
ED_undo_push(C, str);
-
+
return OPERATOR_FINISHED;
}
@@ -1016,12 +1016,12 @@ void OUTLINER_OT_object_operation(wmOperatorType *ot)
ot->name = "Outliner Object Operation";
ot->idname = "OUTLINER_OT_object_operation";
ot->description = "";
-
+
/* callbacks */
ot->invoke = WM_menu_invoke;
ot->exec = outliner_object_operation_exec;
ot->poll = ED_operator_outliner_active;
-
+
ot->flag = 0;
ot->prop = RNA_def_enum(ot->srna, "type", prop_object_op_types, 0, "Object Operation", "");
@@ -1031,14 +1031,14 @@ void OUTLINER_OT_object_operation(wmOperatorType *ot)
typedef enum eOutlinerIdOpTypes {
OUTLINER_IDOP_INVALID = 0,
-
+
OUTLINER_IDOP_UNLINK,
OUTLINER_IDOP_LOCAL,
OUTLINER_IDOP_STATIC_OVERRIDE,
OUTLINER_IDOP_SINGLE,
OUTLINER_IDOP_DELETE,
OUTLINER_IDOP_REMAP,
-
+
OUTLINER_IDOP_FAKE_ADD,
OUTLINER_IDOP_FAKE_CLEAR,
OUTLINER_IDOP_RENAME,
@@ -1070,15 +1070,15 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
SpaceOops *soops = CTX_wm_space_outliner(C);
int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;
eOutlinerIdOpTypes event;
-
+
/* check for invalid states */
if (soops == NULL)
return OPERATOR_CANCELLED;
-
+
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
-
+
event = RNA_enum_get(op->ptr, "type");
-
+
switch (event) {
case OUTLINER_IDOP_UNLINK:
{
@@ -1094,25 +1094,25 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
switch (idlevel) {
case ID_AC:
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, unlink_action_cb, NULL);
-
+
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
ED_undo_push(C, "Unlink action");
break;
case ID_MA:
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, unlink_material_cb, NULL);
-
+
WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, NULL);
ED_undo_push(C, "Unlink material");
break;
case ID_TE:
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, unlink_texture_cb, NULL);
-
+
WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, NULL);
ED_undo_push(C, "Unlink texture");
break;
case ID_WO:
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, unlink_world_cb, NULL);
-
+
WM_event_add_notifier(C, NC_SCENE | ND_WORLD, NULL);
ED_undo_push(C, "Unlink world");
break;
@@ -1148,18 +1148,18 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
switch (idlevel) {
case ID_AC:
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, singleuser_action_cb, NULL);
-
+
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
ED_undo_push(C, "Single-User Action");
break;
-
+
case ID_WO:
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, singleuser_world_cb, NULL);
-
+
WM_event_add_notifier(C, NC_SCENE | ND_WORLD, NULL);
ED_undo_push(C, "Single-User World");
break;
-
+
default:
BKE_report(op->reports, RPT_WARNING, "Not yet implemented");
break;
@@ -1186,7 +1186,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
{
/* set fake user */
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_fake_user_set_cb, NULL);
-
+
WM_event_add_notifier(C, NC_ID | NA_EDITED, NULL);
ED_undo_push(C, "Add Fake User");
break;
@@ -1195,7 +1195,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
{
/* clear fake user */
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_fake_user_clear_cb, NULL);
-
+
WM_event_add_notifier(C, NC_ID | NA_EDITED, NULL);
ED_undo_push(C, "Clear Fake User");
break;
@@ -1204,7 +1204,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
{
/* rename */
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, item_rename_cb, NULL);
-
+
WM_event_add_notifier(C, NC_ID | NA_EDITED, NULL);
ED_undo_push(C, "Rename");
break;
@@ -1213,18 +1213,18 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_select_linked_cb, NULL);
ED_undo_push(C, "Select");
break;
-
+
default:
// invalid - unhandled
break;
}
-
+
/* wrong notifier still... */
WM_event_add_notifier(C, NC_ID | NA_EDITED, NULL);
-
- // XXX: this is just so that outliner is always up to date
+
+ // XXX: this is just so that outliner is always up to date
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_OUTLINER, NULL);
-
+
return OPERATOR_FINISHED;
}
@@ -1235,14 +1235,14 @@ void OUTLINER_OT_id_operation(wmOperatorType *ot)
ot->name = "Outliner ID data Operation";
ot->idname = "OUTLINER_OT_id_operation";
ot->description = "";
-
+
/* callbacks */
ot->invoke = WM_menu_invoke;
ot->exec = outliner_id_operation_exec;
ot->poll = ED_operator_outliner_active;
-
+
ot->flag = 0;
-
+
ot->prop = RNA_def_enum(ot->srna, "type", prop_id_op_types, 0, "ID data Operation", "");
}
@@ -1346,7 +1346,7 @@ static void outliner_do_id_set_operation(SpaceOops *soops, int type, ListBase *l
{
TreeElement *te;
TreeStoreElem *tselem;
-
+
for (te = lb->first; te; te = te->next) {
tselem = TREESTORE(te);
if (tselem->flag & TSE_SELECTED) {
@@ -1366,12 +1366,12 @@ static void outliner_do_id_set_operation(SpaceOops *soops, int type, ListBase *l
static void actionset_id_cb(TreeElement *UNUSED(te), TreeStoreElem *tselem, TreeStoreElem *tsep, ID *actId)
{
bAction *act = (bAction *)actId;
-
+
if (tselem->type == TSE_ANIM_DATA) {
/* "animation" entries - action is child of this */
BKE_animdata_set_action(NULL, tselem->id, act);
}
- /* TODO: if any other "expander" channels which own actions need to support this menu,
+ /* TODO: if any other "expander" channels which own actions need to support this menu,
* add: tselem->type = ...
*/
else if (tsep && (tsep->type == TSE_ANIM_DATA)) {
@@ -1385,17 +1385,17 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
{
SpaceOops *soops = CTX_wm_space_outliner(C);
int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;
-
+
bAction *act;
-
+
/* check for invalid states */
if (soops == NULL)
return OPERATOR_CANCELLED;
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
-
+
/* get action to use */
act = BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action"));
-
+
if (act == NULL) {
BKE_report(op->reports, RPT_ERROR, "No valid action to add");
return OPERATOR_CANCELLED;
@@ -1408,7 +1408,7 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
"for this action to avoid future problems)",
act->id.name + 2);
}
-
+
/* perform action if valid channel */
if (datalevel == TSE_ANIM_DATA)
outliner_do_id_set_operation(soops, datalevel, &soops->tree, (ID *)act, actionset_id_cb);
@@ -1416,11 +1416,11 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
outliner_do_id_set_operation(soops, idlevel, &soops->tree, (ID *)act, actionset_id_cb);
else
return OPERATOR_CANCELLED;
-
+
/* set notifier that things have changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
ED_undo_push(C, "Set action");
-
+
/* done */
return OPERATOR_FINISHED;
}
@@ -1433,15 +1433,15 @@ void OUTLINER_OT_action_set(wmOperatorType *ot)
ot->name = "Outliner Set Action";
ot->idname = "OUTLINER_OT_action_set";
ot->description = "Change the active action used";
-
+
/* api callbacks */
ot->invoke = WM_enum_search_invoke;
ot->exec = outliner_action_set_exec;
ot->poll = ED_operator_outliner_active;
-
+
/* flags */
ot->flag = 0;
-
+
/* props */
// TODO: this would be nicer as an ID-pointer...
prop = RNA_def_enum(ot->srna, "action", DummyRNA_NULL_items, 0, "Action", "");
@@ -1454,15 +1454,15 @@ void OUTLINER_OT_action_set(wmOperatorType *ot)
typedef enum eOutliner_AnimDataOps {
OUTLINER_ANIMOP_INVALID = 0,
-
+
OUTLINER_ANIMOP_CLEAR_ADT,
-
+
OUTLINER_ANIMOP_SET_ACT,
OUTLINER_ANIMOP_CLEAR_ACT,
-
+
OUTLINER_ANIMOP_REFRESH_DRV,
OUTLINER_ANIMOP_CLEAR_DRV
-
+
//OUTLINER_ANIMOP_COPY_DRIVERS,
//OUTLINER_ANIMOP_PASTE_DRIVERS
} eOutliner_AnimDataOps;
@@ -1484,66 +1484,66 @@ static int outliner_animdata_operation_exec(bContext *C, wmOperator *op)
int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;
eOutliner_AnimDataOps event;
short updateDeps = 0;
-
+
/* check for invalid states */
if (soops == NULL)
return OPERATOR_CANCELLED;
-
+
event = RNA_enum_get(op->ptr, "type");
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
-
+
if (datalevel != TSE_ANIM_DATA)
return OPERATOR_CANCELLED;
-
+
/* perform the core operation */
switch (event) {
case OUTLINER_ANIMOP_CLEAR_ADT:
/* Remove Animation Data - this may remove the active action, in some cases... */
outliner_do_data_operation(soops, datalevel, event, &soops->tree, clear_animdata_cb, NULL);
-
+
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
ED_undo_push(C, "Clear Animation Data");
break;
-
+
case OUTLINER_ANIMOP_SET_ACT:
/* delegate once again... */
WM_operator_name_call(C, "OUTLINER_OT_action_set", WM_OP_INVOKE_REGION_WIN, NULL);
break;
-
+
case OUTLINER_ANIMOP_CLEAR_ACT:
/* clear active action - using standard rules */
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, 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? */
updateDeps = 1;
break;
-
+
case OUTLINER_ANIMOP_CLEAR_DRV:
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");
updateDeps = 1;
break;
-
+
default: // invalid
break;
}
-
+
/* update dependencies */
if (updateDeps) {
/* rebuild depsgraph for the new deps */
DEG_relations_tag_update(CTX_data_main(C));
}
-
+
return OPERATOR_FINISHED;
}
@@ -1554,14 +1554,14 @@ void OUTLINER_OT_animdata_operation(wmOperatorType *ot)
ot->name = "Outliner Animation Data Operation";
ot->idname = "OUTLINER_OT_animdata_operation";
ot->description = "";
-
+
/* callbacks */
ot->invoke = WM_menu_invoke;
ot->exec = outliner_animdata_operation_exec;
ot->poll = ED_operator_outliner_active;
-
+
ot->flag = 0;
-
+
ot->prop = RNA_def_enum(ot->srna, "type", prop_animdata_op_types, 0, "Animation Operation", "");
}
@@ -1674,14 +1674,14 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
SpaceOops *soops = CTX_wm_space_outliner(C);
int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;
eOutliner_PropDataOps event;
-
+
/* check for invalid states */
if (soops == NULL)
return OPERATOR_CANCELLED;
-
+
event = RNA_enum_get(op->ptr, "type");
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
-
+
switch (datalevel) {
case TSE_POSE_CHANNEL:
{
@@ -1733,7 +1733,7 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_WARNING, "Not yet implemented");
break;
}
-
+
return OPERATOR_FINISHED;
}
@@ -1744,14 +1744,14 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot)
ot->name = "Outliner Data Operation";
ot->idname = "OUTLINER_OT_data_operation";
ot->description = "";
-
+
/* callbacks */
ot->invoke = WM_menu_invoke;
ot->exec = outliner_data_operation_exec;
ot->poll = ED_operator_outliner_active;
-
+
ot->flag = 0;
-
+
ot->prop = RNA_def_enum(ot->srna, "type", prop_data_op_types, 0, "Data Operation", "");
}
@@ -1763,24 +1763,24 @@ static int do_outliner_operation_event(bContext *C, ARegion *ar, SpaceOops *soop
TreeElement *te, const float mval[2])
{
ReportList *reports = CTX_wm_reports(C); // XXX...
-
+
if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) {
int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;
TreeStoreElem *tselem = TREESTORE(te);
-
+
/* select object that's clicked on and popup context menu */
if (!(tselem->flag & TSE_SELECTED)) {
-
+
if (outliner_has_one_flag(&soops->tree, TSE_SELECTED, 1))
outliner_set_flag(&soops->tree, TSE_SELECTED, 0);
-
+
tselem->flag |= TSE_SELECTED;
/* Only redraw, don't rebuild here because TreeElement pointers will
* become invalid and operations will crash. */
ED_region_tag_redraw_no_rebuild(ar);
}
-
+
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
if (scenelevel) {
@@ -1842,10 +1842,10 @@ static int do_outliner_operation_event(bContext *C, ARegion *ar, SpaceOops *soop
}
}
}
-
+
return 1;
}
-
+
for (te = te->subtree.first; te; te = te->next) {
if (do_outliner_operation_event(C, ar, soops, te, mval))
return 1;
@@ -1868,7 +1868,7 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent
}
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]);
-
+
for (te = soops->tree.first; te; te = te->next) {
if (do_outliner_operation_event(C, ar, soops, te, fmval)) {
found = true;
@@ -1882,7 +1882,7 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent
WM_menu_name_call(C, "OUTLINER_MT_collection_new", WM_OP_INVOKE_REGION_WIN);
}
}
-
+
return OPERATOR_FINISHED;
}
@@ -1892,9 +1892,9 @@ void OUTLINER_OT_operation(wmOperatorType *ot)
ot->name = "Execute Operation";
ot->idname = "OUTLINER_OT_operation";
ot->description = "Context menu for item operations";
-
+
ot->invoke = outliner_operation;
-
+
ot->poll = ED_operator_outliner_active;
}