diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-18 19:32:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-18 19:56:27 +0300 |
commit | 602f0bc2d47d991672f7b79128f2ed677babb8da (patch) | |
tree | 25575b999cd1a9e27e9ec74f2eaeb33d8c49ea60 /source/blender/blenkernel | |
parent | 42b0cd1ea090a0693f25ccde0ce895671df12292 (diff) |
Use macros for looping over pose bones
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_action.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index a203b76ea26..e42a37cd444 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -208,6 +208,22 @@ 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 }; #endif |