[Bf-blender-cvs] [253dbe71dce] master: Refactor: remove `BKE_<id_type>_copy` functions.

Bastien Montagne noreply at git.blender.org
Wed Oct 7 18:05:18 CEST 2020


Commit: 253dbe71dcefabc7abfb992d800caa1d963324d1
Author: Bastien Montagne
Date:   Wed Oct 7 18:01:25 2020 +0200
Branches: master
https://developer.blender.org/rB253dbe71dcefabc7abfb992d800caa1d963324d1

Refactor: remove `BKE_<id_type>_copy` functions.

Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).

Part of 71219.

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

M	source/blender/blenkernel/BKE_action.h
M	source/blender/blenkernel/BKE_armature.h
M	source/blender/blenkernel/BKE_brush.h
M	source/blender/blenkernel/BKE_cachefile.h
M	source/blender/blenkernel/BKE_camera.h
M	source/blender/blenkernel/BKE_curve.h
M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/BKE_hair.h
M	source/blender/blenkernel/BKE_image.h
M	source/blender/blenkernel/BKE_key.h
M	source/blender/blenkernel/BKE_lattice.h
M	source/blender/blenkernel/BKE_light.h
M	source/blender/blenkernel/BKE_lightprobe.h
M	source/blender/blenkernel/BKE_linestyle.h
M	source/blender/blenkernel/BKE_mask.h
M	source/blender/blenkernel/BKE_material.h
M	source/blender/blenkernel/BKE_mball.h
M	source/blender/blenkernel/BKE_mesh.h
M	source/blender/blenkernel/BKE_movieclip.h
M	source/blender/blenkernel/BKE_object.h
M	source/blender/blenkernel/BKE_paint.h
M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/BKE_pointcloud.h
M	source/blender/blenkernel/BKE_speaker.h
M	source/blender/blenkernel/BKE_text.h
M	source/blender/blenkernel/BKE_texture.h
M	source/blender/blenkernel/BKE_volume.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/anim_data.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/curve.c
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/hair.c
M	source/blender/blenkernel/intern/image.c
M	source/blender/blenkernel/intern/key.c
M	source/blender/blenkernel/intern/lattice.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/object.c
M	source/blender/blenkernel/intern/paint.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/pointcloud.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/volume.cc
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/mesh/editmesh_mask_extract.c
M	source/blender/editors/mesh/meshtools.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/physics/particle_object.c
M	source/blender/editors/render/render_shading.c
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/editors/space_action/action_data.c
M	source/blender/editors/space_nla/nla_edit.c
M	source/blender/editors/space_node/node_group.c
M	source/blender/io/collada/BCAnimationSampler.h
M	source/blender/io/collada/DocumentImporter.cpp

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

diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index e08604f02ad..699387a18c7 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -47,9 +47,6 @@ struct bPoseChannel_Runtime;
 /* Allocate a new bAction with the given name */
 struct bAction *BKE_action_add(struct Main *bmain, const char name[]);
 
-/* Allocate a copy of the given Action and all its data */
-struct bAction *BKE_action_copy(struct Main *bmain, const struct bAction *act_src);
-
 /* Action API ----------------- */
 
 /* types of transforms applied to the given item
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 092ca85a570..4e8775aefb3 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -143,7 +143,6 @@ struct bArmature *BKE_armature_from_object(struct Object *ob);
 int BKE_armature_bonelist_count(struct ListBase *lb);
 void BKE_armature_bonelist_free(struct ListBase *lb, const bool do_id_user);
 void BKE_armature_editbonelist_free(struct ListBase *lb, const bool do_id_user);
-struct bArmature *BKE_armature_copy(struct Main *bmain, const struct bArmature *arm);
 
 void BKE_armature_copy_bone_transforms(struct bArmature *armature_dst,
                                        const struct bArmature *armature_src);
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index b14d24e205a..e551ed76b6f 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -52,7 +52,6 @@ struct Brush *BKE_brush_add_gpencil(struct Main *bmain,
 bool BKE_brush_delete(struct Main *bmain, struct Brush *brush);
 void BKE_brush_init_gpencil_settings(struct Brush *brush);
 struct Brush *BKE_brush_first_search(struct Main *bmain, const eObjectMode ob_mode);
-struct Brush *BKE_brush_copy(struct Main *bmain, const struct Brush *brush);
 
 void BKE_brush_sculpt_reset(struct Brush *brush);
 
diff --git a/source/blender/blenkernel/BKE_cachefile.h b/source/blender/blenkernel/BKE_cachefile.h
index 9912b4e4b70..a6b2aa8540a 100644
--- a/source/blender/blenkernel/BKE_cachefile.h
+++ b/source/blender/blenkernel/BKE_cachefile.h
@@ -38,8 +38,6 @@ void BKE_cachefiles_exit(void);
 
 void *BKE_cachefile_add(struct Main *bmain, const char *name);
 
-struct CacheFile *BKE_cachefile_copy(struct Main *bmain, const struct CacheFile *cache_file);
-
 void BKE_cachefile_reload(struct Depsgraph *depsgraph, struct CacheFile *cache_file);
 
 void BKE_cachefile_eval(struct Main *bmain,
diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h
index 2ea03f30d88..b42fcbe7808 100644
--- a/source/blender/blenkernel/BKE_camera.h
+++ b/source/blender/blenkernel/BKE_camera.h
@@ -40,7 +40,6 @@ struct rctf;
 /* Camera Datablock */
 
 void *BKE_camera_add(struct Main *bmain, const char *name);
-struct Camera *BKE_camera_copy(struct Main *bmain, const struct Camera *cam);
 
 /* Camera Usage */
 
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index 91a9bcbc602..2b238ef18f5 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -84,7 +84,6 @@ typedef struct CVKeyIndex {
 void BKE_curve_editfont_free(struct Curve *cu);
 void BKE_curve_init(struct Curve *cu, const short curve_type);
 struct Curve *BKE_curve_add(struct Main *bmain, const char *name, int type);
-struct Curve *BKE_curve_copy(struct Main *bmain, const struct Curve *cu);
 short BKE_curve_type_get(const struct Curve *cu);
 void BKE_curve_type_test(struct Object *ob);
 void BKE_curve_curve_dimension_update(struct Curve *cu);
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index b07946856fd..7d50599a8f0 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -113,8 +113,6 @@ struct bGPDlayer *BKE_gpencil_layer_duplicate(const struct bGPDlayer *gpl_src);
 void BKE_gpencil_frame_copy_strokes(struct bGPDframe *gpf_src, struct bGPDframe *gpf_dst);
 struct bGPDstroke *BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, const bool dup_points);
 
-struct bGPdata *BKE_gpencil_copy(struct Main *bmain, const struct bGPdata *gpd);
-
 struct bGPdata *BKE_gpencil_data_duplicate(struct Main *bmain,
                                            const struct bGPdata *gpd,
                                            bool internal_copy);
diff --git a/source/blender/blenkernel/BKE_hair.h b/source/blender/blenkernel/BKE_hair.h
index 3bbe0ffa180..1d7985e5c98 100644
--- a/source/blender/blenkernel/BKE_hair.h
+++ b/source/blender/blenkernel/BKE_hair.h
@@ -35,7 +35,6 @@ struct Object;
 struct Scene;
 
 void *BKE_hair_add(struct Main *bmain, const char *name);
-struct Hair *BKE_hair_copy(struct Main *bmain, const struct Hair *hair);
 
 struct BoundBox *BKE_hair_boundbox_get(struct Object *ob);
 
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 369ddc444b6..303945dbf64 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -288,9 +288,6 @@ void BKE_image_packfiles_from_mem(struct ReportList *reports,
 /* prints memory statistics for images */
 void BKE_image_print_memlist(struct Main *bmain);
 
-/* empty image block, of similar type and filename */
-struct Image *BKE_image_copy(struct Main *bmain, const struct Image *ima);
-
 /* merge source into dest, and free source */
 void BKE_image_merge(struct Main *bmain, struct Image *dest, struct Image *source);
 
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index 347f16d3e0d..e3d69166b62 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -39,7 +39,6 @@ extern "C" {
 void BKE_key_free(struct Key *key);
 void BKE_key_free_nolib(struct Key *key);
 struct Key *BKE_key_add(struct Main *bmain, struct ID *id);
-struct Key *BKE_key_copy(struct Main *bmain, const struct Key *key);
 struct Key *BKE_key_copy_nolib(struct Key *key);
 void BKE_key_sort(struct Key *key);
 
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index 97f78a997e7..0396d050b35 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -43,7 +43,6 @@ struct bGPDstroke;
 
 void BKE_lattice_resize(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
 struct Lattice *BKE_lattice_add(struct Main *bmain, const char *name);
-struct Lattice *BKE_lattice_copy(struct Main *bmain, const struct Lattice *lt);
 void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du);
 
 bool object_deform_mball(struct Object *ob, struct ListBase *dispbase);
diff --git a/source/blender/blenkernel/BKE_light.h b/source/blender/blenkernel/BKE_light.h
index 9a619f0a0fa..919526b9378 100644
--- a/source/blender/blenkernel/BKE_light.h
+++ b/source/blender/blenkernel/BKE_light.h
@@ -35,7 +35,6 @@ struct Light;
 struct Main;
 
 struct Light *BKE_light_add(struct Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT;
-struct Light *BKE_light_copy(struct Main *bmain, const struct Light *la) ATTR_WARN_UNUSED_RESULT;
 
 void BKE_light_eval(struct Depsgraph *depsgraph, struct Light *la);
 
diff --git a/source/blender/blenkernel/BKE_lightprobe.h b/source/blender/blenkernel/BKE_lightprobe.h
index e66d4ef75ca..764914ee315 100644
--- a/source/blender/blenkernel/BKE_lightprobe.h
+++ b/source/blender/blenkernel/BKE_lightprobe.h
@@ -33,7 +33,6 @@ struct Main;
 
 void BKE_lightprobe_type_set(struct LightProbe *probe, const short lightprobe_type);
 void *BKE_lightprobe_add(struct Main *bmain, const char *name);
-struct LightProbe *BKE_lightprobe_copy(struct Main *bmain, const struct LightProbe *probe);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/BKE_linestyle.h b/source/blender/blenkernel/BKE_linestyle.h
index 19238c4d090..1236a96c8d9 100644
--- a/source/blender/blenkernel/BKE_linestyle.h
+++ b/source/blender/blenkernel/BKE_linestyle.h
@@ -42,7 +42,6 @@ struct bContext;
 
 void BKE_linestyle_init(struct FreestyleLineStyle *linestyle);
 FreestyleLineStyle *BKE_linestyle_new(struct Main *bmain, const char *name);
-FreestyleLineStyle *BKE_linestyle_copy(struct Main *bmain, const FreestyleLineStyle *linestyle);
 
 FreestyleLineStyle *BKE_linestyle_active_from_view_layer(struct ViewLayer *view_layer);
 
diff --git a/source/blender/blenkernel/BKE_mask.h b/source/blender/blenkernel/BKE_mask.h
index 5da8332cc53..80092c1d61a 100644
--- a/source/blender/blenkernel/BKE_mask.h
+++ b/source/blender/blenkernel/BKE_mask.h
@@ -142,7 +142,6 @@ void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point,
 /* general */
 struct Mask *BKE_mask_new(struct Main *bmain, const char *name);
 struct Mask *BKE_mask_copy_nolib(struct Mask *mask);
-struct Mask *BKE_mask_copy(struct Main *bmain, const struct Mask *mask);
 
 void BKE_mask_free(struct Mask *mask);
 
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index aeb7600d647..14ea50f808a 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -53,7 +53,6 @@ void BKE_object_material_remap_calc(struct Object *ob_dst,
                                     short *remap_src_to_dst);
 struct Material *BKE_material_add(struct Main *bmain, const char *name);
 struct Material *BKE_gpencil_material_add(struct Main *bmain, const char *name);
-struct Material *BKE_material_copy(struct Main *bmain, const struct Material *ma);
 void BKE_gpencil_material_attr_init(struct Material *ma);
 
 /* UNUSED */
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h
index 81a90be3fde..8a294c96e26 100644
--- a/source/blender/blenkernel/BKE_mball.h
+++ b/source/blender/blenkernel/BKE_mball.h
@@ -38,7 +38,6 @@ struct Object;
 struct Scene;
 
 struct MetaBall *BKE_mball_add(struct Main *bmain, const char *name);
-struct MetaBall *BKE_mball_copy(struct Main *bmain, const struct MetaBall *mb);
 
 bool BKE_mball_is_any_selected(const struct MetaBall *mb);


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list