[Bf-blender-cvs] [76d8e8693fa] master: Cleanup: Rename 'make local' functions to new scheme.

Bastien Montagne noreply at git.blender.org
Wed Mar 4 11:43:36 CET 2020


Commit: 76d8e8693fab13d300130dc3a9bd75f6f637991d
Author: Bastien Montagne
Date:   Wed Mar 4 10:38:30 2020 +0100
Branches: master
https://developer.blender.org/rB76d8e8693fab13d300130dc3a9bd75f6f637991d

Cleanup: Rename 'make local' functions to new scheme.

Also removed some only used locally from the header, `BKE_lib_id.h`
is already way too big, no need to overload it with unused things.

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

M	source/blender/blenkernel/BKE_lib_id.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenkernel/intern/cachefile.c
M	source/blender/blenkernel/intern/camera.c
M	source/blender/blenkernel/intern/collection.c
M	source/blender/blenkernel/intern/curve.c
M	source/blender/blenkernel/intern/font.c
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/image.c
M	source/blender/blenkernel/intern/lattice.c
M	source/blender/blenkernel/intern/lib_id.c
M	source/blender/blenkernel/intern/light.c
M	source/blender/blenkernel/intern/lightprobe.c
M	source/blender/blenkernel/intern/linestyle.c
M	source/blender/blenkernel/intern/mask.c
M	source/blender/blenkernel/intern/material.c
M	source/blender/blenkernel/intern/mball.c
M	source/blender/blenkernel/intern/mesh.c
M	source/blender/blenkernel/intern/movieclip.c
M	source/blender/blenkernel/intern/node.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/paint.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenkernel/intern/sound.c
M	source/blender/blenkernel/intern/speaker.c
M	source/blender/blenkernel/intern/text.c
M	source/blender/blenkernel/intern/texture.c
M	source/blender/blenkernel/intern/world.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/space_outliner/outliner_tools.c
M	source/blender/makesrna/intern/rna_ID.c

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

diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index d9d99d607c5..aa4ccd9dbb8 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -179,7 +179,6 @@ void BKE_libblock_management_main_remove(struct Main *bmain, void *idv);
 void BKE_libblock_management_usercounts_set(struct Main *bmain, void *idv);
 void BKE_libblock_management_usercounts_clear(struct Main *bmain, void *idv);
 
-void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id);
 void id_lib_extern(struct ID *id);
 void id_lib_indirect_weak_link(struct ID *id);
 void id_us_ensure_real(struct ID *id);
@@ -191,11 +190,14 @@ void id_fake_user_set(struct ID *id);
 void id_fake_user_clear(struct ID *id);
 void BKE_id_clear_newpoin(struct ID *id);
 
-void BKE_id_make_local_generic(struct Main *bmain,
-                               struct ID *id,
-                               const bool id_in_mainlist,
-                               const bool lib_local);
-bool id_make_local(struct Main *bmain, struct ID *id, const bool test, const bool force_local);
+void BKE_lib_id_make_local_generic(struct Main *bmain,
+                                   struct ID *id,
+                                   const bool id_in_mainlist,
+                                   const bool lib_local);
+bool BKE_lib_id_make_local(struct Main *bmain,
+                           struct ID *id,
+                           const bool test,
+                           const bool force_local);
 bool id_single_user(struct bContext *C,
                     struct ID *id,
                     struct PointerRNA *ptr,
@@ -205,13 +207,11 @@ bool BKE_id_copy(struct Main *bmain, const struct ID *id, struct ID **newid);
 bool BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag);
 void BKE_id_swap(struct Main *bmain, struct ID *id_a, struct ID *id_b);
 void id_sort_by_name(struct ListBase *lb, struct ID *id, struct ID *id_sorting_hint);
-void BKE_id_expand_local(struct Main *bmain, struct ID *id);
-void BKE_id_copy_ensure_local(struct Main *bmain, const struct ID *old_id, struct ID *new_id);
+void BKE_lib_id_expand_local(struct Main *bmain, struct ID *id);
 
 bool BKE_id_new_name_validate(struct ListBase *lb, struct ID *id, const char *name)
     ATTR_NONNULL(1, 2);
-void id_clear_lib_data(struct Main *bmain, struct ID *id);
-void id_clear_lib_data_ex(struct Main *bmain, struct ID *id, const bool id_in_mainlist);
+void BKE_lib_id_clear_library_data(struct Main *bmain, struct ID *id);
 
 /* Affect whole Main database. */
 void BKE_main_id_tag_idcode(struct Main *mainvar,
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 97b6a7b2f40..8477a46bb7e 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -93,7 +93,7 @@ bAction *BKE_action_add(Main *bmain, const char name[])
 // does copy_fcurve...
 void BKE_action_make_local(Main *bmain, bAction *act, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &act->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &act->id, true, lib_local);
 }
 
 /* .................................. */
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index d4498017ffd..3e27e9e7514 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -138,7 +138,7 @@ void BKE_armature_free(bArmature *arm)
 
 void BKE_armature_make_local(Main *bmain, bArmature *arm, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &arm->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &arm->id, true, lib_local);
 }
 
 static void copy_bonechildren(Bone *bone_dst,
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 7eef2bac3e8..aba7df0a936 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -781,15 +781,15 @@ void BKE_brush_make_local(Main *bmain, Brush *brush, const bool lib_local)
 
   if (brush->clone.image) {
     /* Special case: ima always local immediately. Clone image should only have one user anyway. */
-    id_make_local(bmain, &brush->clone.image->id, false, false);
+    BKE_lib_id_make_local(bmain, &brush->clone.image->id, false, false);
   }
 
   BKE_library_ID_test_usages(bmain, brush, &is_local, &is_lib);
 
   if (lib_local || is_local) {
     if (!is_lib) {
-      id_clear_lib_data(bmain, &brush->id);
-      BKE_id_expand_local(bmain, &brush->id);
+      BKE_lib_id_clear_library_data(bmain, &brush->id);
+      BKE_lib_id_expand_local(bmain, &brush->id);
 
       /* enable fake user by default */
       id_fake_user_set(&brush->id);
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index cfef2a7e8e7..25c4d4aedcf 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -213,7 +213,7 @@ CacheFile *BKE_cachefile_copy(Main *bmain, const CacheFile *cache_file)
 
 void BKE_cachefile_make_local(Main *bmain, CacheFile *cache_file, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &cache_file->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &cache_file->id, true, lib_local);
 }
 
 void BKE_cachefile_reload(Depsgraph *depsgraph, CacheFile *cache_file)
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 77a7c9581ac..bbf5e398017 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -98,7 +98,7 @@ Camera *BKE_camera_copy(Main *bmain, const Camera *cam)
 
 void BKE_camera_make_local(Main *bmain, Camera *cam, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &cam->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &cam->id, true, lib_local);
 }
 
 /** Free (or release) any data used by this camera (does not free the camera itself). */
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index ba0f019e700..8a260e918fd 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -371,7 +371,7 @@ Collection *BKE_collection_duplicate(Main *bmain,
 
 void BKE_collection_make_local(Main *bmain, Collection *collection, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &collection->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &collection->id, true, lib_local);
 }
 
 /********************************* Naming *******************************/
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index fe4f814ca1f..be011c10608 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -222,7 +222,7 @@ Curve *BKE_curve_copy(Main *bmain, const Curve *cu)
 
 void BKE_curve_make_local(Main *bmain, Curve *cu, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &cu->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &cu->id, true, lib_local);
 }
 
 /* Get list of nurbs from editnurbs structure */
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 3d840c6232c..20a0e794f03 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -327,7 +327,7 @@ VFont *BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
 
 void BKE_vfont_make_local(Main *bmain, VFont *vfont, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &vfont->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &vfont->id, true, lib_local);
 }
 
 static VFont *which_vfont(Curve *cu, CharInfo *info)
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index e3d6e73e8c9..ce0ed8a9083 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -709,7 +709,7 @@ bGPdata *BKE_gpencil_data_duplicate(Main *bmain, const bGPdata *gpd_src, bool in
 
 void BKE_gpencil_make_local(Main *bmain, bGPdata *gpd, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &gpd->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &gpd->id, true, lib_local);
 }
 
 /* ************************************************** */
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 5761bec98b2..efdcf3a92f4 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -464,7 +464,7 @@ Image *BKE_image_copy(Main *bmain, const Image *ima)
 
 void BKE_image_make_local(Main *bmain, Image *ima, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &ima->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &ima->id, true, lib_local);
 }
 
 void BKE_image_merge(Main *bmain, Image *dest, Image *source)
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 5446640b2dd..2f10bdcf732 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -331,7 +331,7 @@ void BKE_lattice_free(Lattice *lt)
 
 void BKE_lattice_make_local(Main *bmain, Lattice *lt, const bool lib_local)
 {
-  BKE_id_make_local_generic(bmain, &lt->id, true, lib_local);
+  BKE_lib_id_make_local_generic(bmain, &lt->id, true, lib_local);
 }
 
 typedef struct LatticeDeformData {
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 051b43a177e..6f51356f8fb 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -138,11 +138,11 @@ static CLG_LogRef LOG = {.identifier = "bke.lib_id"};
 
 /* ************* general ************************ */
 
-/* this has to be called from each make_local_* func, we could call
- * from id_make_local() but then the make local functions would not be self
- * contained.
- * also note that the id _must_ have a library - campb

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list