25 const float4x4 &obmat,
26 bool is_object_active)
39 const bool is_editmode = arm->
edbo !=
nullptr;
41 if (is_editmode ==
false) {
50 const float *head_vec =
nullptr, *tail_vec =
nullptr;
53 const bool skip_selected = (is_editmode || is_posemode) &&
66 if (is_selected && skip_selected) {
70 if (nearest2d.
snap_edge(eBone->head, eBone->tail)) {
71 head_vec = eBone->head;
72 tail_vec = eBone->tail;
79 Bone *bone = pchan->bone;
86 if (is_selected && skip_selected) {
90 if (nearest2d.
snap_edge(pchan->pose_head, pchan->pose_tail)) {
91 head_vec = pchan->pose_head;
92 tail_vec = pchan->pose_tail;
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
bool ANIM_bonecoll_is_visible_editbone(const bArmature *armature, const EditBone *ebone)
std::optional< blender::Bounds< blender::float3 > > BKE_armature_min_max(const Object *ob)
#define LISTBASE_FOREACH(type, var, list)
@ SCE_SNAP_TARGET_NOT_SELECTED
@ SCE_SNAP_TO_EDGE_ENDPOINT
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
void clip_planes_enable(SnapObjectContext *sctx, const Object *ob_eval, bool skip_occlusion_plane=false)
bool snap_point(const blender::float3 &co, int index=-1)
static void register_result(SnapObjectContext *sctx, const Object *ob_eval, const ID *id_eval, const blender::float4x4 &obmat, BVHTreeNearest *r_nearest)
BVHTreeNearest nearest_point
bool snap_boundbox(const blender::float3 &min, const blender::float3 &max)
bool snap_edge(const blender::float3 &va, const blender::float3 &vb, int edge_index=-1)
struct SnapObjectContext::@590 ret
struct SnapObjectContext::@589 runtime
eSnapTargetOP snap_target_select