[Bf-blender-cvs] [16595b9ea1c] master: Cleanup: split object data deform functions into their own files

Campbell Barton noreply at git.blender.org
Fri Jun 12 08:29:18 CEST 2020


Commit: 16595b9ea1c5c5b6f3d07a31d3aa6b4713426abc
Author: Campbell Barton
Date:   Fri Jun 12 15:12:54 2020 +1000
Branches: master
https://developer.blender.org/rB16595b9ea1c5c5b6f3d07a31d3aa6b4713426abc

Cleanup: split object data deform functions into their own files

Move armature/curve functions into their headers,
they were previously in BKE_lattice.h

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

M	source/blender/blenkernel/BKE_armature.h
M	source/blender/blenkernel/BKE_curve.h
M	source/blender/blenkernel/BKE_lattice.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/armature.c
A	source/blender/blenkernel/intern/armature_deform.c
M	source/blender/blenkernel/intern/curve.c
A	source/blender/blenkernel/intern/curve_deform.c
M	source/blender/blenkernel/intern/lattice.c
A	source/blender/blenkernel/intern/lattice_deform.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
M	source/blender/modifiers/intern/MOD_armature.c
M	source/blender/modifiers/intern/MOD_curve.c

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

diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index c22e7a24afe..30a1644af39 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -32,11 +32,13 @@ struct Bone;
 struct Depsgraph;
 struct ListBase;
 struct Main;
+struct Mesh;
 struct Object;
 struct PoseTree;
 struct Scene;
 struct bArmature;
 struct bConstraint;
+struct bGPDstroke;
 struct bPose;
 struct bPoseChannel;
 
@@ -342,6 +344,35 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph,
                                    struct Object *object,
                                    int pchan_index);
 
+/* -------------------------------------------------------------------- */
+/** \name Deform 3D Coordinates by Armature (armature_deform.c)
+ * \{ */
+
+/* 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,
+                                                    float (*vert_coords)[3],
+                                                    float (*vert_deform_mats)[3][3],
+                                                    int vert_coords_len,
+                                                    int deformflag,
+                                                    float (*vert_coords_prev)[3],
+                                                    const char *defgrp_name,
+                                                    struct bGPDstroke *gps_target);
+
+void BKE_armature_deform_coords_with_mesh(struct Object *ob_arm,
+                                          struct Object *ob_target,
+                                          float (*vert_coords)[3],
+                                          float (*vert_deform_mats)[3][3],
+                                          int vert_coords_len,
+                                          int deformflag,
+                                          float (*vert_coords_prev)[3],
+                                          const char *defgrp_name,
+                                          const struct Mesh *me_target);
+
+/** \} */
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index 40f73ccfe84..417dbd49855 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -34,6 +34,7 @@ struct Curve;
 struct Depsgraph;
 struct GHash;
 struct ListBase;
+struct MDeformVert;
 struct Main;
 struct Nurb;
 struct Object;
@@ -278,7 +279,15 @@ enum {
 void BKE_curve_batch_cache_dirty_tag(struct Curve *cu, int mode);
 void BKE_curve_batch_cache_free(struct Curve *cu);
 
-/* curve_decimate.c */
+extern void (*BKE_curve_batch_cache_dirty_tag_cb)(struct Curve *cu, int mode);
+extern void (*BKE_curve_batch_cache_free_cb)(struct Curve *cu);
+
+/* -------------------------------------------------------------------- */
+/** \name Decimate Curve (curve_decimate.c)
+ *
+ * Simplify curve data.
+ * \{ */
+
 unsigned int BKE_curve_decimate_bezt_array(struct BezTriple *bezt_array,
                                            const unsigned int bezt_array_len,
                                            const unsigned int resolu,
@@ -293,8 +302,28 @@ void BKE_curve_decimate_nurb(struct Nurb *nu,
                              const float error_sq_max,
                              const unsigned int error_target_len);
 
-extern void (*BKE_curve_batch_cache_dirty_tag_cb)(struct Curve *cu, int mode);
-extern void (*BKE_curve_batch_cache_free_cb)(struct Curve *cu);
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Deform 3D Coordinates by Curve (curve_deform.c)
+ * \{ */
+
+void BKE_curve_deform_coords(struct Object *ob_curve,
+                             struct Object *ob_target,
+                             float (*vert_coords)[3],
+                             const int vert_coords_len,
+                             const struct MDeformVert *dvert,
+                             const int defgrp_index,
+                             const short flag,
+                             const short defaxis);
+void BKE_curve_deform_co(struct Object *ob_curve,
+                         struct Object *ob_target,
+                         const float orco[3],
+                         float vec[3],
+                         float mat[3][3],
+                         const int no_rot_axis);
+
+/** \} */
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index 19cb4f5c4e1..922f7278034 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -45,77 +45,9 @@ 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);
 
-struct LatticeDeformData *init_latt_deform(struct Object *oblatt,
-                                           struct Object *ob) ATTR_WARN_UNUSED_RESULT;
-void calc_latt_deform(struct LatticeDeformData *lattice_deform_data, float co[3], float weight);
-void end_latt_deform(struct LatticeDeformData *lattice_deform_data);
-
 bool object_deform_mball(struct Object *ob, struct ListBase *dispbase);
 void outside_lattice(struct Lattice *lt);
 
-/* -------------------------------------------------------------------- */
-/** \name Deform 3D Coordinates by Object Data
- *
- * Used by modifiers (odd location for this API, for now keep these related functions together).
- * \{ */
-
-void BKE_curve_deform_coords(struct Object *ob_curve,
-                             struct Object *ob_target,
-                             float (*vert_coords)[3],
-                             const int vert_coords_len,
-                             const struct MDeformVert *dvert,
-                             const int defgrp_index,
-                             const short flag,
-                             const short defaxis);
-void BKE_curve_deform_co(struct Object *ob_curve,
-                         struct Object *ob_target,
-                         const float orco[3],
-                         float vec[3],
-                         float mat[3][3],
-                         const int no_rot_axis);
-
-void BKE_lattice_deform_coords(struct Object *ob_lattice,
-                               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,
-                                         float (*vert_coords)[3],
-                                         const int vert_coords_len,
-                                         const short flag,
-                                         const char *defgrp_name,
-                                         const float influence,
-                                         const struct Mesh *me_target);
-
-/* 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,
-                                                    float (*vert_coords)[3],
-                                                    float (*vert_deform_mats)[3][3],
-                                                    int vert_coords_len,
-                                                    int deformflag,
-                                                    float (*vert_coords_prev)[3],
-                                                    const char *defgrp_name,
-                                                    struct bGPDstroke *gps_target);
-
-void BKE_armature_deform_coords_with_mesh(struct Object *ob_arm,
-                                          struct Object *ob_target,
-                                          float (*vert_coords)[3],
-                                          float (*vert_deform_mats)[3][3],
-                                          int vert_coords_len,
-                                          int deformflag,
-                                          float (*vert_coords_prev)[3],
-                                          const char *defgrp_name,
-                                          const struct Mesh *me_target);
-
-/** \} */
-
 float (*BKE_lattice_vert_coords_alloc(const struct Lattice *lt, int *r_vert_len))[3];
 void BKE_lattice_vert_coords_get(const struct Lattice *lt, float (*vert_coords)[3]);
 void BKE_lattice_vert_coords_apply_with_mat4(struct Lattice *lt,
@@ -166,6 +98,33 @@ void BKE_lattice_batch_cache_free(struct Lattice *lt);
 extern void (*BKE_lattice_batch_cache_dirty_tag_cb)(struct Lattice *lt, int mode);
 extern void (*BKE_lattice_batch_cache_free_cb)(struct Lattice *lt);
 
+/* -------------------------------------------------------------------- */
+/** \name Deform 3D Coordinates by Lattice (lattice_deform.c)
+ * \{ */
+
+struct LatticeDeformData *init_latt_deform(struct Object *oblatt,
+                                           struct Object *ob) ATTR_WARN_UNUSED_RESULT;
+void calc_latt_deform(struct LatticeDeformData *lattice_deform_data, float co[3], float weight);
+void end_latt_deform(struct LatticeDeformData *lattice_deform_data);
+
+void BKE_lattice_deform_coords(struct Object *ob_lattice,
+                               struct Object *ob_target,
+                               float (*vert_coords)[3],
+                               const int vert_coords_len,
+                               const short flag,
+                               const char *

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list