[Bf-blender-cvs] [a83fff7c632] master: Remove operators to manually convert proxies to liboverrides.

Bastien Montagne noreply at git.blender.org
Wed Feb 2 16:56:29 CET 2022


Commit: a83fff7c6324d1a6d651409f6d7a4f4fc5364a5b
Author: Bastien Montagne
Date:   Wed Feb 2 16:49:01 2022 +0100
Branches: master
https://developer.blender.org/rBa83fff7c6324d1a6d651409f6d7a4f4fc5364a5b

Remove operators to manually convert proxies to liboverrides.

Now that proxy conversions if enforced, those operations are not useful
anymore.

Part of T91671.

===================================================================

M	release/scripts/modules/rna_manual_reference.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/editors/object/object_intern.h
M	source/blender/editors/object/object_ops.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/space_outliner/outliner_tools.cc

===================================================================

diff --git a/release/scripts/modules/rna_manual_reference.py b/release/scripts/modules/rna_manual_reference.py
index 0467e7b5788..232046ebd60 100644
--- a/release/scripts/modules/rna_manual_reference.py
+++ b/release/scripts/modules/rna_manual_reference.py
@@ -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"),
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 5eca606216e..03f5d7abe02 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -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()
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index d517d68f1fc..f478f5004d4 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -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);
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index b171da42522..03a36006fea 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -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);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index ee594398f4a..57a0fe0a39d 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -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;
-}
-
 /** \} */
 
 /* ------------------------------------------------------------------- */
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 02e8ab2f128..12c5c9f99f5 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -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,
-  

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list