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:
authorCampbell Barton <ideasman42@gmail.com>2020-04-03 07:45:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-03 07:52:26 +0300
commitb18608f3e9066407b1d8a837161ad295d7719937 (patch)
treeec62ed5d98221a3c99500b50986514c762d5706a /source/blender/editors/armature/armature_intern.h
parent09071e27993a6a113ea08376e361230d99e7690d (diff)
Cleanup: bone cursor picking API
There was one function to access both pose/edit bones, which returned a void pointer type. Split these into 3 functions which return EditBone, bPoseChannel or Bone types. Internally the logic is still shared, this just makes it clearer to callers which type is expected. Also use more conventional prefix for picking API: - ED_armature_pick_(ebone/pchan/bone) - ED_armature_pick_(ebone/pchan/bone)_from_selectbuffer
Diffstat (limited to 'source/blender/editors/armature/armature_intern.h')
-rw-r--r--source/blender/editors/armature/armature_intern.h40
1 files changed, 32 insertions, 8 deletions
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 37f0c7197a9..a454461b144 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -258,16 +258,40 @@ 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);
-void *get_nearest_bone(struct bContext *C, const int xy[2], bool findunsel, struct Base **r_base);
-
-void *get_bone_from_selectbuffer(struct Base **bases,
- uint bases_len,
- bool is_editmode,
- const unsigned int *buffer,
- short hits,
+EditBone *ED_armature_pick_ebone(struct bContext *C,
+ const int xy[2],
bool findunsel,
- bool do_nearest,
struct Base **r_base);
+struct bPoseChannel *ED_armature_pick_pchan(struct bContext *C,
+ const int xy[2],
+ bool findunsel,
+ struct Base **r_base);
+struct Bone *ED_armature_pick_bone(struct bContext *C,
+ const int xy[2],
+ bool findunsel,
+ struct Base **r_base);
+
+struct EditBone *ED_armature_pick_ebone_from_selectbuffer(struct Base **bases,
+ uint bases_len,
+ const uint *buffer,
+ short hits,
+ bool findunsel,
+ bool do_nearest,
+ struct Base **r_base);
+struct bPoseChannel *ED_armature_pick_pchan_from_selectbuffer(struct Base **bases,
+ uint bases_len,
+ const uint *buffer,
+ short hits,
+ bool findunsel,
+ bool do_nearest,
+ struct Base **r_base);
+struct Bone *ED_armature_pick_bone_from_selectbuffer(struct Base **bases,
+ uint bases_len,
+ const uint *buffer,
+ short hits,
+ bool findunsel,
+ bool do_nearest,
+ struct Base **r_base);
int bone_looper(struct Object *ob,
struct Bone *bone,