[Bf-blender-cvs] [827959ff98e] master: Cleanup: use const arguments to deform functions

Campbell Barton noreply at git.blender.org
Sat Jun 13 08:21:58 CEST 2020


Commit: 827959ff98e77739e5753789ad645d4b53cca3c9
Author: Campbell Barton
Date:   Sat Jun 13 16:08:34 2020 +1000
Branches: master
https://developer.blender.org/rB827959ff98e77739e5753789ad645d4b53cca3c9

Cleanup: use const arguments to deform functions

This changes curve deform code not to set the objects inverse matrix,
this shouldn't cause problems as it's not used elsewhere afterwards.

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

M	source/blender/blenkernel/BKE_anim_path.h
M	source/blender/blenkernel/BKE_armature.h
M	source/blender/blenkernel/BKE_curve.h
M	source/blender/blenkernel/BKE_deform.h
M	source/blender/blenkernel/BKE_lattice.h
M	source/blender/blenkernel/intern/anim_path.c
M	source/blender/blenkernel/intern/armature_deform.c
M	source/blender/blenkernel/intern/curve_deform.c
M	source/blender/blenkernel/intern/deform.c
M	source/blender/blenkernel/intern/lattice.c
M	source/blender/blenkernel/intern/lattice_deform.c

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

diff --git a/source/blender/blenkernel/BKE_anim_path.h b/source/blender/blenkernel/BKE_anim_path.h
index b56e4a4a262..4de853303ad 100644
--- a/source/blender/blenkernel/BKE_anim_path.h
+++ b/source/blender/blenkernel/BKE_anim_path.h
@@ -36,7 +36,7 @@ struct Path;
 
 void free_path(struct Path *path);
 void calc_curvepath(struct Object *ob, struct ListBase *nurbs);
-bool where_on_path(struct Object *ob,
+bool where_on_path(const struct Object *ob,
                    float ctime,
                    float r_vec[4],
                    float r_dir[3],
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 7572c3cb452..6fb6675a05a 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -352,8 +352,8 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph,
 /* Note that we could have a 'BKE_armature_deform_coords' that doesn't take object data
  * currently there are no callers for this though. */
 
-void BKE_armature_deform_coords_with_gpencil_stroke(struct Object *ob_arm,
-                                                    struct Object *ob_target,
+void BKE_armature_deform_coords_with_gpencil_stroke(const struct Object *ob_arm,
+                                                    const struct Object *ob_target,
                                                     float (*vert_coords)[3],
                                                     float (*vert_deform_mats)[3][3],
                                                     int vert_coords_len,
@@ -362,8 +362,8 @@ void BKE_armature_deform_coords_with_gpencil_stroke(struct Object *ob_arm,
                                                     const char *defgrp_name,
                                                     struct bGPDstroke *gps_target);
 
-void BKE_armature_deform_coords_with_mesh(struct Object *ob_arm,
-                                          struct Object *ob_target,
+void BKE_armature_deform_coords_with_mesh(const struct Object *ob_arm,
+                                          const struct Object *ob_target,
                                           float (*vert_coords)[3],
                                           float (*vert_deform_mats)[3][3],
                                           int vert_coords_len,
@@ -372,8 +372,8 @@ void BKE_armature_deform_coords_with_mesh(struct Object *ob_arm,
                                           const char *defgrp_name,
                                           const struct Mesh *me_target);
 
-void BKE_armature_deform_coords_with_editmesh(struct Object *ob_arm,
-                                              struct Object *ob_target,
+void BKE_armature_deform_coords_with_editmesh(const struct Object *ob_arm,
+                                              const struct Object *ob_target,
                                               float (*vert_coords)[3],
                                               float (*vert_deform_mats)[3][3],
                                               int vert_coords_len,
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index 5ea77058520..d32ab474229 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -309,8 +309,8 @@ void BKE_curve_decimate_nurb(struct Nurb *nu,
 /** \name Deform 3D Coordinates by Curve (curve_deform.c)
  * \{ */
 
-void BKE_curve_deform_coords(struct Object *ob_curve,
-                             struct Object *ob_target,
+void BKE_curve_deform_coords(const struct Object *ob_curve,
+                             const struct Object *ob_target,
                              float (*vert_coords)[3],
                              const int vert_coords_len,
                              const struct MDeformVert *dvert,
@@ -318,8 +318,8 @@ void BKE_curve_deform_coords(struct Object *ob_curve,
                              const short flag,
                              const short defaxis);
 
-void BKE_curve_deform_coords_with_editmesh(Object *ob_curve,
-                                           Object *ob_target,
+void BKE_curve_deform_coords_with_editmesh(const Object *ob_curve,
+                                           const Object *ob_target,
                                            float (*vert_coords)[3],
                                            const int vert_coords_len,
                                            const int defgrp_index,
@@ -327,8 +327,8 @@ void BKE_curve_deform_coords_with_editmesh(Object *ob_curve,
                                            const short defaxis,
                                            struct BMEditMesh *em_target);
 
-void BKE_curve_deform_co(struct Object *ob_curve,
-                         struct Object *ob_target,
+void BKE_curve_deform_co(const struct Object *ob_curve,
+                         const struct Object *ob_target,
                          const float orco[3],
                          float vec[3],
                          const int no_rot_axis,
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index c86b877b575..04b85aebb39 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -40,14 +40,16 @@ struct bDeformGroup;
 struct bDeformGroup *BKE_object_defgroup_new(struct Object *ob, const char *name);
 void BKE_defgroup_copy_list(struct ListBase *lb1, const struct ListBase *lb2);
 struct bDeformGroup *BKE_defgroup_duplicate(const struct bDeformGroup *ingroup);
-struct bDeformGroup *BKE_object_defgroup_find_name(struct Object *ob, const char *name);
-int *BKE_object_defgroup_flip_map(struct Object *ob, int *flip_map_len, const bool use_default);
-int *BKE_object_defgroup_flip_map_single(struct Object *ob,
+struct bDeformGroup *BKE_object_defgroup_find_name(const struct Object *ob, const char *name);
+int *BKE_object_defgroup_flip_map(const struct Object *ob,
+                                  int *flip_map_len,
+                                  const bool use_default);
+int *BKE_object_defgroup_flip_map_single(const struct Object *ob,
                                          int *flip_map_len,
                                          const bool use_default,
                                          int defgroup);
-int BKE_object_defgroup_flip_index(struct Object *ob, int index, const bool use_default);
-int BKE_object_defgroup_name_index(struct Object *ob, const char *name);
+int BKE_object_defgroup_flip_index(const struct Object *ob, int index, const bool use_default);
+int BKE_object_defgroup_name_index(const struct Object *ob, const char *name);
 void BKE_object_defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob);
 
 struct MDeformWeight *BKE_defvert_find_index(const struct MDeformVert *dv, const int defgroup);
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index a1e335447fe..bb23ad63020 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -59,7 +59,7 @@ void BKE_lattice_modifiers_calc(struct Depsgraph *depsgraph,
                                 struct Scene *scene,
                                 struct Object *ob);
 
-struct MDeformVert *BKE_lattice_deform_verts_get(struct Object *lattice);
+struct MDeformVert *BKE_lattice_deform_verts_get(const struct Object *lattice);
 struct BPoint *BKE_lattice_active_point_get(struct Lattice *lt);
 
 struct BoundBox *BKE_lattice_boundbox_get(struct Object *ob);
@@ -103,23 +103,23 @@ extern void (*BKE_lattice_batch_cache_free_cb)(struct Lattice *lt);
 /** \name Deform 3D Coordinates by Lattice (lattice_deform.c)
  * \{ */
 
-struct LatticeDeformData *BKE_lattice_deform_data_create(struct Object *oblatt, struct Object *ob)
-    ATTR_WARN_UNUSED_RESULT;
+struct LatticeDeformData *BKE_lattice_deform_data_create(
+    const struct Object *oblatt, const struct Object *ob) ATTR_WARN_UNUSED_RESULT;
 void BKE_lattice_deform_data_eval_co(struct LatticeDeformData *lattice_deform_data,
                                      float co[3],
                                      float weight);
 void BKE_lattice_deform_data_destroy(struct LatticeDeformData *lattice_deform_data);
 
-void BKE_lattice_deform_coords(struct Object *ob_lattice,
-                               struct Object *ob_target,
+void BKE_lattice_deform_coords(const struct Object *ob_lattice,
+                               const struct Object *ob_target,
                                float (*vert_coords)[3],
                                const int vert_coords_len,
                                const short flag,
                                const char *defgrp_name,
                                float influence);
 
-void BKE_lattice_deform_coords_with_mesh(struct Object *ob_lattice,
-                                         struct Object *ob_target,
+void BKE_lattice_deform_coords_with_mesh(const struct Object *ob_lattice,
+                                         const struct Object *ob_target,
                                          float (*vert_coords)[3],
                                          const int vert_coords_len,
                                          const short flag,
@@ -127,8 +127,8 @@ void BKE_lattice_deform_coords_with_mesh(struct Object *ob_lattice,
                                          const float influence,
                                          const struct Mesh *me_target);
 
-void BKE_lattice_deform_coords_with_editmesh(struct Object *ob_lattice,
-                                             struct Object *ob_target,
+void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice,
+                                             const struct Object *ob_target,
                                              float (*vert_coords)[3],
                                              const int vert_coords_len,
                                              const short flag,
diff --git a/source/blender/blenkernel/intern/anim_path.c b/source/blender/blenkernel/intern/anim_path.c
index 56ff7d07809..628e54971ce 100644
--- a/source/blender/blenkernel/intern/anim_path.c
+++ b/source/blender/blenkerne

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list