Remove operators to manually convert proxies to liboverrides.
Now that proxy conversions if enforced, those operations are not useful anymore. Part of T91671.
This commit is contained in:
parent
f0cfa94d94
commit
a83fff7c63
|
@ -677,7 +677,6 @@ url_manual_mapping = (
|
|||
("bpy.ops.gpencil.stroke_merge_by_distance*", "grease_pencil/modes/edit/grease_pencil_menu.html#bpy-ops-gpencil-stroke-merge-by-distance"),
|
||||
("bpy.ops.node.collapse_hide_unused_toggle*", "interface/controls/nodes/editing.html#bpy-ops-node-collapse-hide-unused-toggle"),
|
||||
("bpy.ops.object.anim_transforms_to_deltas*", "scene_layout/object/editing/apply.html#bpy-ops-object-anim-transforms-to-deltas"),
|
||||
("bpy.ops.object.convert_proxy_to_override*", "files/linked_libraries/library_overrides.html#bpy-ops-object-convert-proxy-to-override"),
|
||||
("bpy.ops.object.modifier_copy_to_selected*", "modeling/modifiers/introduction.html#bpy-ops-object-modifier-copy-to-selected"),
|
||||
("bpy.ops.preferences.app_template_install*", "advanced/app_templates.html#bpy-ops-preferences-app-template-install"),
|
||||
("bpy.types.actionposemarkers.active_index*", "animation/armatures/properties/pose_library.html#bpy-types-actionposemarkers-active-index"),
|
||||
|
|
|
@ -2228,8 +2228,6 @@ class VIEW3D_MT_object_relations(Menu):
|
|||
|
||||
layout.operator("object.make_override_library", text="Make Library Override...")
|
||||
|
||||
layout.operator("object.convert_proxy_to_override")
|
||||
|
||||
layout.operator("object.make_dupli_face")
|
||||
|
||||
layout.separator()
|
||||
|
|
|
@ -65,7 +65,6 @@ void OBJECT_OT_track_set(struct wmOperatorType *ot);
|
|||
void OBJECT_OT_track_clear(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_make_local(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_make_override_library(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_convert_proxy_to_override(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_make_single_user(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_make_links_scene(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_make_links_data(struct wmOperatorType *ot);
|
||||
|
|
|
@ -75,7 +75,6 @@ void ED_operatortypes_object(void)
|
|||
WM_operatortype_append(OBJECT_OT_track_clear);
|
||||
WM_operatortype_append(OBJECT_OT_make_local);
|
||||
WM_operatortype_append(OBJECT_OT_make_override_library);
|
||||
WM_operatortype_append(OBJECT_OT_convert_proxy_to_override);
|
||||
WM_operatortype_append(OBJECT_OT_make_single_user);
|
||||
WM_operatortype_append(OBJECT_OT_make_links_scene);
|
||||
WM_operatortype_append(OBJECT_OT_make_links_data);
|
||||
|
|
|
@ -2419,63 +2419,6 @@ void OBJECT_OT_make_override_library(wmOperatorType *ot)
|
|||
ot->prop = prop;
|
||||
}
|
||||
|
||||
static bool convert_proxy_to_override_poll(bContext *C)
|
||||
{
|
||||
Object *obact = CTX_data_active_object(C);
|
||||
|
||||
return obact != NULL && obact->proxy != NULL;
|
||||
}
|
||||
|
||||
static int convert_proxy_to_override_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
|
||||
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
|
||||
|
||||
Object *ob_proxy = CTX_data_active_object(C);
|
||||
Object *ob_proxy_group = ob_proxy->proxy_group;
|
||||
const bool is_override_instancing_object = ob_proxy_group != NULL;
|
||||
|
||||
const bool success = BKE_lib_override_library_proxy_convert(bmain, scene, view_layer, ob_proxy);
|
||||
|
||||
if (!success) {
|
||||
BKE_reportf(
|
||||
op->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 OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* Remove the instance empty from this scene, the items now have an overridden collection
|
||||
* instead. */
|
||||
if (is_override_instancing_object) {
|
||||
ED_object_base_free_and_unlink(bmain, scene, ob_proxy_group);
|
||||
}
|
||||
|
||||
DEG_id_tag_update(&CTX_data_scene(C)->id, ID_RECALC_BASE_FLAGS | ID_RECALC_COPY_ON_WRITE);
|
||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void OBJECT_OT_convert_proxy_to_override(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Convert Proxy to Override";
|
||||
ot->description = "Convert a proxy to a local library override";
|
||||
ot->idname = "OBJECT_OT_convert_proxy_to_override";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = convert_proxy_to_override_exec;
|
||||
ot->poll = convert_proxy_to_override_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* ------------------------------------------------------------------- */
|
||||
|
|
|
@ -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;
|
||||
/**
|
||||
|
@ -1532,7 +1500,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 +1512,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 +1576,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 +1747,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 +1788,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 +1860,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 +2036,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,
|
||||
|
|
Loading…
Reference in New Issue