diff options
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 6b998828c77..d38d63a40c0 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -744,13 +744,13 @@ typedef struct OutlinerLibOverrideData { bool do_hierarchy; } OutlinerLibOverrideData; -static void id_override_library_cb(bContext *C, - ReportList *UNUSED(reports), - Scene *UNUSED(scene), - TreeElement *te, - TreeStoreElem *UNUSED(tsep), - TreeStoreElem *tselem, - void *user_data) +static void id_override_library_create_cb(bContext *C, + ReportList *UNUSED(reports), + Scene *UNUSED(scene), + TreeElement *te, + TreeStoreElem *UNUSED(tsep), + TreeStoreElem *tselem, + void *user_data) { BLI_assert(TSE_IS_REAL_ID(tselem)); ID *id_root = tselem->id; @@ -1546,8 +1546,8 @@ typedef enum eOutlinerIdOpTypes { OUTLINER_IDOP_UNLINK, OUTLINER_IDOP_LOCAL, - OUTLINER_IDOP_OVERRIDE_LIBRARY, - OUTLINER_IDOP_OVERRIDE_LIBRARY_HIERARCHY, + OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE, + OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY, OUTLINER_IDOP_SINGLE, OUTLINER_IDOP_DELETE, OUTLINER_IDOP_REMAP, @@ -1566,16 +1566,6 @@ typedef enum eOutlinerIdOpTypes { static const EnumPropertyItem prop_id_op_types[] = { {OUTLINER_IDOP_UNLINK, "UNLINK", 0, "Unlink", ""}, {OUTLINER_IDOP_LOCAL, "LOCAL", 0, "Make Local", ""}, - {OUTLINER_IDOP_OVERRIDE_LIBRARY, - "OVERRIDE_LIBRARY", - 0, - "Add Library Override", - "Add a local override of this linked data-block"}, - {OUTLINER_IDOP_OVERRIDE_LIBRARY_HIERARCHY, - "OVERRIDE_LIBRARY_HIERARCHY", - 0, - "Add Library Override Hierarchy", - "Add a local override of this linked data-block, and its hierarchy of dependencies"}, {OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""}, {OUTLINER_IDOP_DELETE, "DELETE", ICON_X, "Delete", ""}, {OUTLINER_IDOP_REMAP, @@ -1584,6 +1574,17 @@ static const EnumPropertyItem prop_id_op_types[] = { "Remap Users", "Make all users of selected data-blocks to use instead current (clicked) one"}, {0, "", 0, NULL, NULL}, + {OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE, + "OVERRIDE_LIBRARY_CREATE", + 0, + "Add Library Override", + "Add a local override of this linked data-block"}, + {OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY, + "OVERRIDE_LIBRARY_CREATE_HIERARCHY", + 0, + "Add Library Override Hierarchy", + "Add a local override of this linked data-block, and its hierarchy of dependencies"}, + {0, "", 0, NULL, NULL}, {OUTLINER_IDOP_COPY, "COPY", ICON_COPYDOWN, "Copy", ""}, {OUTLINER_IDOP_PASTE, "PASTE", ICON_PASTEDOWN, "Paste", ""}, {0, "", 0, NULL, NULL}, @@ -1607,7 +1608,8 @@ static bool outliner_id_operation_item_poll(bContext *C, SpaceOutliner *soops = CTX_wm_space_outliner(C); switch (enum_value) { - case OUTLINER_IDOP_OVERRIDE_LIBRARY: + case OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE: + case OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY: return true; case OUTLINER_IDOP_SINGLE: if (!soops || ELEM(soops->outlinevis, SO_SCENES, SO_VIEW_LAYER)) { @@ -1721,28 +1723,28 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op) ED_undo_push(C, "Localized Data"); break; } - case OUTLINER_IDOP_OVERRIDE_LIBRARY: { + case OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE: { /* make local */ outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, - id_override_library_cb, + id_override_library_create_cb, &(OutlinerLibOverrideData){.do_hierarchy = false}); ED_undo_push(C, "Overridden Data"); break; } - case OUTLINER_IDOP_OVERRIDE_LIBRARY_HIERARCHY: { + case OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY: { /* make local */ outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, - id_override_library_cb, + id_override_library_create_cb, &(OutlinerLibOverrideData){.do_hierarchy = true}); - ED_undo_push(C, "Overridden Data"); + ED_undo_push(C, "Overridden Data Hierarchy"); break; } case OUTLINER_IDOP_SINGLE: { |