diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 36 |
3 files changed, 34 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 70e9a33aeae..c61a8f95ee6 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -463,7 +463,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) case UI_ID_LOCAL: if (id) { Main *bmain = CTX_data_main(C); - if (CTX_wm_window(C)->eventstate->shift) { + if (BKE_override_static_is_enabled() && CTX_wm_window(C)->eventstate->shift) { ID *override_id = BKE_override_static_create_from_id(bmain, id); if (override_id != NULL) { BKE_main_id_clear_newpoins(bmain); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 5d9b6a2d13e..d239b1f25dc 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2404,7 +2404,8 @@ static bool make_override_static_poll(bContext *C) Object *obact = CTX_data_active_object(C); /* Object must be directly linked to be overridable. */ - return (ED_operator_objectmode(C) && obact != NULL && + return (BKE_override_static_is_enabled() && + ED_operator_objectmode(C) && obact != NULL && ((ID_IS_LINKED(obact) && obact->id.tag & LIB_TAG_EXTERN) || (!ID_IS_LINKED(obact) && obact->dup_group != NULL && ID_IS_LINKED(obact->dup_group)))); } diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 2f84340e34e..b66622536e9 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -1076,8 +1076,8 @@ 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_STATIC_OVERRIDE, "STATIC_OVERRIDE", - 0, "Add Static Override", "Add a local static override of this data-block"}, + {OUTLINER_IDOP_STATIC_OVERRIDE, "STATIC_OVERRIDE", 0, "Add Static Override", + "Add a local static override of this data-block"}, {OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""}, {OUTLINER_IDOP_DELETE, "DELETE", 0, "Delete", "WARNING: no undo"}, {OUTLINER_IDOP_REMAP, "REMAP", 0, "Remap Users", @@ -1090,6 +1090,29 @@ static const EnumPropertyItem prop_id_op_types[] = { {0, NULL, 0, NULL, NULL} }; +static const EnumPropertyItem *outliner_id_operation_itemf( + bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) +{ + if (BKE_override_static_is_enabled()) { + *r_free = false; + return prop_id_op_types; + } + + EnumPropertyItem *items = NULL; + int totitem = 0; + + for (const EnumPropertyItem *it = prop_id_op_types; it->identifier != NULL; it++) { + if (it->value == OUTLINER_IDOP_STATIC_OVERRIDE) { + continue; + } + RNA_enum_item_add(&items, &totitem, it); + } + RNA_enum_item_end(&items, &totitem); + *r_free = true; + + return items; +} + static int outliner_id_operation_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -1163,9 +1186,11 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op) } case OUTLINER_IDOP_STATIC_OVERRIDE: { - /* make local */ - outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_static_override_cb, NULL); - ED_undo_push(C, "Overridden Data"); + if (BKE_override_static_is_enabled()) { + /* make local */ + outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_static_override_cb, NULL); + ED_undo_push(C, "Overridden Data"); + } break; } case OUTLINER_IDOP_SINGLE: @@ -1270,6 +1295,7 @@ void OUTLINER_OT_id_operation(wmOperatorType *ot) ot->flag = 0; ot->prop = RNA_def_enum(ot->srna, "type", prop_id_op_types, 0, "ID data Operation", ""); + RNA_def_enum_funcs(ot->prop, outliner_id_operation_itemf); } /* **************************************** */ |