[Bf-blender-cvs] [5fc992e76ae] master: Cleanup: Move `EditBone` structure definition from `ED` to `BKE` area.

Bastien Montagne noreply at git.blender.org
Fri Oct 2 17:46:29 CEST 2020


Commit: 5fc992e76aeeedf1955c9d7c561fb8b7c8a398a5
Author: Bastien Montagne
Date:   Fri Oct 2 15:36:42 2020 +0200
Branches: master
https://developer.blender.org/rB5fc992e76aeeedf1955c9d7c561fb8b7c8a398a5

Cleanup: Move `EditBone` structure definition from `ED` to `BKE` area.

Access to this structure will be needed in BKE's armature code.

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

M	source/blender/blenkernel/BKE_armature.h
M	source/blender/editors/armature/armature_add.c
M	source/blender/editors/armature/armature_intern.h
M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/armature/editarmature_undo.c
M	source/blender/editors/include/ED_armature.h
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/object/object_utils.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/editors/space_info/info_stats.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_outliner/outliner_tools.c
M	source/blender/editors/space_outliner/outliner_tree.c
M	source/blender/editors/space_outliner/outliner_utils.c
M	source/blender/editors/space_view3d/view3d_buttons.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/transform/transform_gizmo_3d.c
M	source/blender/editors/transform/transform_orientations.c
M	source/blender/editors/util/ed_transverts.c
M	source/blender/io/collada/collada_internal.cpp
M	source/blender/io/collada/collada_utils.cpp

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

diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 8164d34f32b..d7ed92b69b7 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -30,6 +30,7 @@ extern "C" {
 struct BMEditMesh;
 struct Bone;
 struct Depsgraph;
+struct IDProperty;
 struct ListBase;
 struct Main;
 struct Mesh;
@@ -42,6 +43,77 @@ struct bGPDstroke;
 struct bPose;
 struct bPoseChannel;
 
+typedef struct EditBone {
+  struct EditBone *next, *prev;
+  /** User-Defined Properties on this Bone */
+  struct IDProperty *prop;
+  /** Editbones have a one-way link  (i.e. children refer
+   * to parents.  This is converted to a two-way link for
+   * normal bones when leaving editmode. */
+  struct EditBone *parent;
+  /** (64 == MAXBONENAME) */
+  char name[64];
+  /** Roll along axis.  We'll ultimately use the axis/angle method
+   * for determining the transformation matrix of the bone.  The axis
+   * is tail-head while roll provides the angle. Refer to Graphics
+   * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
+  float roll;
+
+  /** Orientation and length is implicit during editing */
+  float head[3];
+  float tail[3];
+  /** All joints are considered to have zero rotation with respect to
+   * their parents. Therefore any rotations specified during the
+   * animation are automatically relative to the bones' rest positions*/
+  int flag;
+  int layer;
+  char inherit_scale_mode;
+
+  /* Envelope distance & weight */
+  float dist, weight;
+  /** put them in order! transform uses this as scale */
+  float xwidth, length, zwidth;
+  float rad_head, rad_tail;
+
+  /* Bendy-Bone parameters */
+  short segments;
+  float roll1, roll2;
+  float curve_in_x, curve_in_y;
+  float curve_out_x, curve_out_y;
+  float ease1, ease2;
+  float scale_in_x, scale_in_y;
+  float scale_out_x, scale_out_y;
+
+  /** for envelope scaling */
+  float oldlength;
+
+  /** Type of next/prev bone handles */
+  char bbone_prev_type;
+  char bbone_next_type;
+  /** Next/prev bones to use as handle references when calculating bbones (optional) */
+  struct EditBone *bbone_prev;
+  struct EditBone *bbone_next;
+
+  /* Used for display */
+  /** in Armature space, rest pos matrix */
+  float disp_mat[4][4];
+  /** in Armature space, rest pos matrix */
+  float disp_tail_mat[4][4];
+  /** in Armature space, rest pos matrix (32 == MAX_BBONE_SUBDIV) */
+  float disp_bbone_mat[32][4][4];
+
+  /** connected child temporary during drawing */
+  struct EditBone *bbone_child;
+
+  /* Used to store temporary data */
+  union {
+    struct EditBone *ebone;
+    struct Bone *bone;
+    void *p;
+    int i;
+  } temp;
+} EditBone;
+
 typedef struct PoseTarget {
   struct PoseTarget *next, *prev;
 
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index 016a00bda56..5f01c4ed038 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -36,6 +36,7 @@
 #include "BLI_string_utils.h"
 
 #include "BKE_action.h"
+#include "BKE_armature.h"
 #include "BKE_constraint.h"
 #include "BKE_context.h"
 #include "BKE_deform.h"
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 438bb8e447b..4fff2ae03b0 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -223,7 +223,9 @@ void POSE_OT_propagate(struct wmOperatorType *ot);
  * but some tools still have a bit of overlap which makes things messy -- Feb 2013
  */
 
-EditBone *make_boneList(struct ListBase *edbo, struct ListBase *bones, struct Bone *actBone);
+struct EditBone *make_boneList(struct ListBase *edbo,
+                               struct ListBase *bones,
+                               struct Bone *actBone);
 
 /* duplicate method */
 void preEditBoneDuplicate(struct ListBase *editbones);
@@ -241,7 +243,7 @@ struct EditBone *duplicateEditBoneObjects(struct EditBone *cur_bone,
                                           struct Object *src_ob,
                                           struct Object *dst_ob);
 
-EditBone *add_points_bone(struct Object *obedit, float head[3], float tail[3]);
+struct EditBone *add_points_bone(struct Object *obedit, float head[3], float tail[3]);
 void bone_free(struct bArmature *arm, struct EditBone *bone);
 
 void armature_tag_select_mirrored(struct bArmature *arm);
@@ -249,10 +251,10 @@ void armature_select_mirrored_ex(struct bArmature *arm, const int flag);
 void armature_select_mirrored(struct bArmature *arm);
 void armature_tag_unselect(struct bArmature *arm);
 
-EditBone *ED_armature_pick_ebone(struct bContext *C,
-                                 const int xy[2],
-                                 bool findunsel,
-                                 struct Base **r_base);
+struct EditBone *ED_armature_pick_ebone(struct bContext *C,
+                                        const int xy[2],
+                                        bool findunsel,
+                                        struct Base **r_base);
 struct bPoseChannel *ED_armature_pick_pchan(struct bContext *C,
                                             const int xy[2],
                                             bool findunsel,
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 09d54410e55..c9bcd4f02e9 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -34,6 +34,7 @@
 #include "BLI_string_utils.h"
 
 #include "BKE_action.h"
+#include "BKE_armature.h"
 #include "BKE_context.h"
 #include "BKE_layer.h"
 #include "BKE_object.h"
diff --git a/source/blender/editors/armature/editarmature_undo.c b/source/blender/editors/armature/editarmature_undo.c
index a3a73f8d509..bdb08abbf2c 100644
--- a/source/blender/editors/armature/editarmature_undo.c
+++ b/source/blender/editors/armature/editarmature_undo.c
@@ -31,6 +31,7 @@
 #include "BLI_array_utils.h"
 #include "BLI_listbase.h"
 
+#include "BKE_armature.h"
 #include "BKE_context.h"
 #include "BKE_layer.h"
 #include "BKE_main.h"
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index 47633033b6c..1eeb81d4dc7 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -30,6 +30,7 @@ extern "C" {
 struct Base;
 struct Bone;
 struct Depsgraph;
+struct EditBone;
 struct IDProperty;
 struct ListBase;
 struct Main;
@@ -47,77 +48,6 @@ struct bPoseChannel;
 struct wmKeyConfig;
 struct wmOperator;
 
-typedef struct EditBone {
-  struct EditBone *next, *prev;
-  /** User-Defined Properties on this Bone */
-  struct IDProperty *prop;
-  /** Editbones have a one-way link  (i.e. children refer
-   * to parents.  This is converted to a two-way link for
-   * normal bones when leaving editmode. */
-  struct EditBone *parent;
-  /** (64 == MAXBONENAME) */
-  char name[64];
-  /** Roll along axis.  We'll ultimately use the axis/angle method
-   * for determining the transformation matrix of the bone.  The axis
-   * is tail-head while roll provides the angle. Refer to Graphics
-   * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
-  float roll;
-
-  /** Orientation and length is implicit during editing */
-  float head[3];
-  float tail[3];
-  /** All joints are considered to have zero rotation with respect to
-   * their parents. Therefore any rotations specified during the
-   * animation are automatically relative to the bones' rest positions*/
-  int flag;
-  int layer;
-  char inherit_scale_mode;
-
-  /* Envelope distance & weight */
-  float dist, weight;
-  /** put them in order! transform uses this as scale */
-  float xwidth, length, zwidth;
-  float rad_head, rad_tail;
-
-  /* Bendy-Bone parameters */
-  short segments;
-  float roll1, roll2;
-  float curve_in_x, curve_in_y;
-  float curve_out_x, curve_out_y;
-  float ease1, ease2;
-  float scale_in_x, scale_in_y;
-  float scale_out_x, scale_out_y;
-
-  /** for envelope scaling */
-  float oldlength;
-
-  /** Type of next/prev bone handles */
-  char bbone_prev_type;
-  char bbone_next_type;
-  /** Next/prev bones to use as handle references when calculating bbones (optional) */
-  struct EditBone *bbone_prev;
-  struct EditBone *bbone_next;
-
-  /* Used for display */
-  /** in Armature space, rest pos matrix */
-  float disp_mat[4][4];
-  /** in Armature space, rest pos matrix */
-  float disp_tail_mat[4][4];
-  /** in Armature space, rest pos matrix (32 == MAX_BBONE_SUBDIV) */
-  float disp_bbone_mat[32][4][4];
-
-  /** connected child temporary during drawing */
-  struct EditBone *bbone_child;
-
-  /* Used to store temporary data */
-  union {
-    struct EditBone *ebone;
-    struct Bone *bone;
-    void *p;
-    int i;
-  } temp;
-} EditBone;
-
 #define BONESEL_ROOT (1u << 29)
 #define BONESEL_TIP (1u << 30)
 #define BONESEL_BONE (1u << 31)
@@ -141,13 +71,13 @@ typedef struct EditBone {
 #define BONE_SELECT_CHILD 1
 
 /* armature_add.c */
-EditBone *ED_armature_ebone_add(struct bArmature *arm, const char *name);
-EditBone *ED_armature_ebone_add_primitive(struct Object *obedit_arm,
-                                          float length,
-                                          bool view_aligned);
+struct EditBone *ED_armature_ebone_add(struct bArmature *arm, const char *name);
+struct EditBone *ED_armature_ebone_add_primitive(struct Object *obedit_arm,
+                                                 float length,
+                                                 bool view_aligned);
 
 /* armature_edit.c */
-float ED_armature_ebone_roll_to_vector(const EditBone *bone,
+float ED_armature_ebone_roll_to_vector(const struct EditBone *bone,
                                        const float align_axis[3],
                                        const bool axis_only);
 void ED_armature_origin_set(
@@ -156,7 +86,7 @@ void ED_armature_edit_transform(struct bArmature *arm, const float mat[4][4], co
 void ED_armature_transform(struct bArmature *arm, const float mat[4][4]

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list