[Bf-blender-cvs] [6e67d8e3bb3] blender2.8: Cleanup: Move FOREACH_PCHAN_*_IN_OBJECT_*() macros to BKE_armature.h

Joshua Leung noreply at git.blender.org
Mon Apr 30 18:46:56 CEST 2018


Commit: 6e67d8e3bb392f26bcd99d39763e8b25e72d118f
Author: Joshua Leung
Date:   Mon Apr 30 18:46:52 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB6e67d8e3bb392f26bcd99d39763e8b25e72d118f

Cleanup: Move FOREACH_PCHAN_*_IN_OBJECT_*() macros to BKE_armature.h

This reduces the number of headers we need to import (and/or dependencies
on the order of them), as these depend on PBONE_VISIBLE(), which is already
in BKE_armature.h

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

M	source/blender/blenkernel/BKE_action.h
M	source/blender/blenkernel/BKE_armature.h

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

diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index e42a37cd444..72a8ffd7a26 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -208,21 +208,6 @@ void BKE_pose_rest(struct bPose *pose);
 /* Tag pose for recalc. Also tag all related data to be recalc. */
 void BKE_pose_tag_recalc(struct Main *bmain, struct bPose *pose);
 
-/* context.selected_pose_bones */
-#define FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN(_ob, _pchan) \
-	for (bPoseChannel *_pchan = (_ob)->pose->chanbase.first; _pchan;  _pchan = _pchan->next) { \
-		if (PBONE_VISIBLE(((bArmature *)(_ob)->data), (_pchan)->bone) && ((_pchan)->bone->flag & BONE_SELECTED)) {
-#define FOREACH_PCHAN_SELECTED_IN_OBJECT_END \
-		} \
-	} ((void)0)
-/* context.visible_pose_bones */
-#define FOREACH_PCHAN_VISIBLE_IN_OBJECT_BEGIN(_ob, _pchan) \
-	for (bPoseChannel *_pchan = (_ob)->pose->chanbase.first; _pchan;  _pchan = _pchan->next) { \
-		if (PBONE_VISIBLE(((bArmature *)(_ob)->data), (_pchan)->bone)) {
-#define FOREACH_PCHAN_VISIBLE_IN_OBJECT_END \
-		} \
-	} ((void)0)
-
 
 #ifdef __cplusplus
 };
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index e286c1248c0..2ecab73ac79 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -152,61 +152,78 @@ void b_bone_spline_setup(struct bPoseChannel *pchan, int rest, Mat4 result_array
 #define PBONE_SELECTABLE(arm, bone) \
 	(PBONE_VISIBLE(arm, bone) && !((bone)->flag & BONE_UNSELECTABLE))
 
+
+/* context.selected_pose_bones */
+#define FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN(_ob, _pchan) \
+	for (bPoseChannel *_pchan = (_ob)->pose->chanbase.first; _pchan;  _pchan = _pchan->next) { \
+		if (PBONE_VISIBLE(((bArmature *)(_ob)->data), (_pchan)->bone) && ((_pchan)->bone->flag & BONE_SELECTED)) {
+#define FOREACH_PCHAN_SELECTED_IN_OBJECT_END \
+		} \
+	} ((void)0)
+/* context.visible_pose_bones */
+#define FOREACH_PCHAN_VISIBLE_IN_OBJECT_BEGIN(_ob, _pchan) \
+	for (bPoseChannel *_pchan = (_ob)->pose->chanbase.first; _pchan;  _pchan = _pchan->next) { \
+		if (PBONE_VISIBLE(((bArmature *)(_ob)->data), (_pchan)->bone)) {
+#define FOREACH_PCHAN_VISIBLE_IN_OBJECT_END \
+		} \
+	} ((void)0)
+
+
 /* Evaluation helpers */
 struct bKinematicConstraint;
 struct bPose;
 struct bSplineIKConstraint;
 
 struct bPoseChannel *BKE_armature_ik_solver_find_root(
-        struct bPoseChannel *pchan,
-        struct bKinematicConstraint *data);
+				struct bPoseChannel *pchan,
+				struct bKinematicConstraint *data);
 struct bPoseChannel *BKE_armature_splineik_solver_find_root(
-        struct bPoseChannel *pchan,
-        struct bSplineIKConstraint *data);
+				struct bPoseChannel *pchan,
+				struct bSplineIKConstraint *data);
 
 void BKE_pose_splineik_init_tree(struct Scene *scene, struct Object *ob, float ctime);
 void BKE_splineik_execute_tree(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, struct bPoseChannel *pchan_root, float ctime);
+				struct Depsgraph *depsgraph, struct Scene *scene,
+				struct Object *ob, struct bPoseChannel *pchan_root, float ctime);
 
 void BKE_pose_eval_init(struct Depsgraph *depsgraph,
-                        struct Scene *scene,
-                        struct Object *ob);
+												struct Scene *scene,
+												struct Object *ob);
 
 void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph,
-                           struct Scene *scene,
-                           struct Object *ob);
+													 struct Scene *scene,
+													 struct Object *ob);
 
 void BKE_pose_eval_bone(struct Depsgraph *depsgraph,
-                        struct Scene *scene,
-                        struct Object *ob,
-                        int pchan_index);
+												struct Scene *scene,
+												struct Object *ob,
+												int pchan_index);
 
 void BKE_pose_constraints_evaluate(struct Depsgraph *depsgraph,
-                                   struct Scene *scene,
-                                   struct Object *ob,
-                                   int pchan_index);
+																	 struct Scene *scene,
+																	 struct Object *ob,
+																	 int pchan_index);
 
 void BKE_pose_bone_done(struct Depsgraph *depsgraph,
-                        struct Object *ob,
-                        int pchan_index);
+												struct Object *ob,
+												int pchan_index);
 
 void BKE_pose_iktree_evaluate(struct Depsgraph *depsgraph,
-                              struct Scene *scene,
-                              struct Object *ob,
-                              int rootchan_index);
+															struct Scene *scene,
+															struct Object *ob,
+															int rootchan_index);
 
 void BKE_pose_splineik_evaluate(struct Depsgraph *depsgraph,
-                                struct Scene *scene,
-                                struct Object *ob,
-                                int rootchan_index);
+																struct Scene *scene,
+																struct Object *ob,
+																int rootchan_index);
 
 void BKE_pose_eval_flush(struct Depsgraph *depsgraph,
-                         struct Scene *scene,
-                         struct Object *ob);
+												 struct Scene *scene,
+												 struct Object *ob);
 
 void BKE_pose_eval_proxy_copy(struct Depsgraph *depsgraph,
-                              struct Object *ob);
+															struct Object *ob);
 
 #ifdef __cplusplus
 }



More information about the Bf-blender-cvs mailing list