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/outliner_tools.cc')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.cc94
1 files changed, 13 insertions, 81 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 03fc4c20fe5..337649834a4 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -29,8 +29,8 @@
#include "DNA_armature_types.h"
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_curves_types.h"
#include "DNA_gpencil_types.h"
-#include "DNA_hair_types.h"
#include "DNA_light_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_material_types.h"
@@ -164,7 +164,7 @@ static void get_element_operation_type(
case ID_CF:
case ID_WS:
case ID_LP:
- case ID_HA:
+ case ID_CV:
case ID_PT:
case ID_VO:
case ID_SIM:
@@ -262,10 +262,10 @@ static void unlink_material_fn(bContext *UNUSED(C),
totcol = mb->totcol;
matar = mb->mat;
}
- else if (GS(tsep->id->name) == ID_HA) {
- Hair *hair = (Hair *)tsep->id;
- totcol = hair->totcol;
- matar = hair->mat;
+ else if (GS(tsep->id->name) == ID_CV) {
+ Curves *curves = (Curves *)tsep->id;
+ totcol = curves->totcol;
+ matar = curves->mat;
}
else if (GS(tsep->id->name) == ID_PT) {
PointCloud *pointcloud = (PointCloud *)tsep->id;
@@ -764,38 +764,6 @@ static void id_local_fn(bContext *C,
}
}
-static void object_proxy_to_override_convert_fn(bContext *C,
- ReportList *reports,
- Scene *UNUSED(scene),
- TreeElement *UNUSED(te),
- TreeStoreElem *UNUSED(tsep),
- TreeStoreElem *tselem,
- void *UNUSED(user_data))
-{
- BLI_assert(TSE_IS_REAL_ID(tselem));
- ID *id_proxy = tselem->id;
- BLI_assert(GS(id_proxy->name) == ID_OB);
- Object *ob_proxy = (Object *)id_proxy;
- Scene *scene = CTX_data_scene(C);
-
- if (ob_proxy->proxy == nullptr) {
- return;
- }
-
- if (!BKE_lib_override_library_proxy_convert(
- CTX_data_main(C), scene, CTX_data_view_layer(C), ob_proxy)) {
- BKE_reportf(
- reports,
- RPT_ERROR_INVALID_INPUT,
- "Could not create a library override from proxy '%s' (might use already local data?)",
- ob_proxy->id.name + 2);
- return;
- }
-
- DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS | ID_RECALC_COPY_ON_WRITE);
- WM_event_add_notifier(C, NC_WINDOW, nullptr);
-}
-
struct OutlinerLibOverrideData {
bool do_hierarchy;
/**
@@ -874,8 +842,13 @@ static void id_override_library_create_fn(bContext *C,
te->store_elem->id->tag |= LIB_TAG_DOIT;
}
- success = BKE_lib_override_library_create(
- bmain, CTX_data_scene(C), CTX_data_view_layer(C), id_root, id_reference, nullptr);
+ success = BKE_lib_override_library_create(bmain,
+ CTX_data_scene(C),
+ CTX_data_view_layer(C),
+ nullptr,
+ id_root,
+ id_reference,
+ nullptr);
}
else if (ID_IS_OVERRIDABLE_LIBRARY(id_root)) {
success = BKE_lib_override_library_create_from_id(bmain, id_root, true) != nullptr;
@@ -1532,7 +1505,6 @@ enum {
OL_OP_SELECT_HIERARCHY,
OL_OP_REMAP,
OL_OP_RENAME,
- OL_OP_PROXY_TO_OVERRIDE_CONVERT,
};
static const EnumPropertyItem prop_object_op_types[] = {
@@ -1545,11 +1517,6 @@ static const EnumPropertyItem prop_object_op_types[] = {
"Remap Users",
"Make all users of selected data-blocks to use instead a new chosen one"},
{OL_OP_RENAME, "RENAME", 0, "Rename", ""},
- {OL_OP_PROXY_TO_OVERRIDE_CONVERT,
- "OBJECT_PROXY_TO_OVERRIDE",
- 0,
- "Convert Proxy to Override",
- "Convert a Proxy object to a full library override, including all its dependencies"},
{0, nullptr, 0, nullptr, nullptr},
};
@@ -1614,15 +1581,6 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
C, op->reports, scene, space_outliner, &space_outliner->tree, item_rename_fn);
str = "Rename Object";
}
- else if (event == OL_OP_PROXY_TO_OVERRIDE_CONVERT) {
- outliner_do_object_operation(C,
- op->reports,
- scene,
- space_outliner,
- &space_outliner->tree,
- object_proxy_to_override_convert_fn);
- str = "Convert Proxy to Override";
- }
else {
BLI_assert(0);
return OPERATOR_CANCELLED;
@@ -1794,7 +1752,6 @@ enum eOutlinerIdOpTypes {
OUTLINER_IDOP_LOCAL,
OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE,
OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY,
- OUTLINER_IDOP_OVERRIDE_LIBRARY_PROXY_CONVERT,
OUTLINER_IDOP_OVERRIDE_LIBRARY_RESET,
OUTLINER_IDOP_OVERRIDE_LIBRARY_RESET_HIERARCHY,
OUTLINER_IDOP_OVERRIDE_LIBRARY_RESYNC_HIERARCHY,
@@ -1836,11 +1793,6 @@ static const EnumPropertyItem prop_id_op_types[] = {
0,
"Make Library Override Hierarchy",
"Make a local override of this linked data-block, and its hierarchy of dependencies"},
- {OUTLINER_IDOP_OVERRIDE_LIBRARY_PROXY_CONVERT,
- "OVERRIDE_LIBRARY_PROXY_CONVERT",
- 0,
- "Convert Proxy to Override",
- "Convert a Proxy object to a full library override, including all its dependencies"},
{OUTLINER_IDOP_OVERRIDE_LIBRARY_RESET,
"OVERRIDE_LIBRARY_RESET",
0,
@@ -1913,16 +1865,6 @@ static bool outliner_id_operation_item_poll(bContext *C,
return true;
}
return false;
- case OUTLINER_IDOP_OVERRIDE_LIBRARY_PROXY_CONVERT: {
- if (GS(tselem->id->name) == ID_OB) {
- Object *ob = (Object *)tselem->id;
-
- if ((ob != nullptr) && (ob->proxy != nullptr)) {
- return true;
- }
- }
- return false;
- }
case OUTLINER_IDOP_OVERRIDE_LIBRARY_RESET:
case OUTLINER_IDOP_OVERRIDE_LIBRARY_RESET_HIERARCHY:
case OUTLINER_IDOP_OVERRIDE_LIBRARY_RESYNC_HIERARCHY:
@@ -2099,16 +2041,6 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
ED_undo_push(C, "Overridden Data Hierarchy");
break;
}
- case OUTLINER_IDOP_OVERRIDE_LIBRARY_PROXY_CONVERT: {
- outliner_do_object_operation(C,
- op->reports,
- scene,
- space_outliner,
- &space_outliner->tree,
- object_proxy_to_override_convert_fn);
- ED_undo_push(C, "Convert Proxy to Override");
- break;
- }
case OUTLINER_IDOP_OVERRIDE_LIBRARY_RESET: {
OutlinerLibOverrideData override_data{};
outliner_do_libdata_operation(C,