Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2018-04-30 19:46:52 +0300
committerJoshua Leung <aligorith@gmail.com>2018-04-30 19:46:52 +0300
commit6e67d8e3bb392f26bcd99d39763e8b25e72d118f (patch)
tree816cd12220cb1f05ee9cf19706f60fb0cc4735cd /source/blender/blenkernel/BKE_armature.h
parent0020a326ee82955fd33f098d31d3d32dc81c97bc (diff)
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
Diffstat (limited to 'source/blender/blenkernel/BKE_armature.h')
-rw-r--r--source/blender/blenkernel/BKE_armature.h71
1 files changed, 44 insertions, 27 deletions
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
}