Blender V5.0
pose_select.cc File Reference
#include <cstring>
#include "DNA_action_types.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_listbase.h"
#include "BLI_map.hh"
#include "BLI_string.h"
#include "BKE_action.hh"
#include "BKE_armature.hh"
#include "BKE_constraint.h"
#include "BKE_context.hh"
#include "BKE_layer.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_report.hh"
#include "DEG_depsgraph.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_armature.hh"
#include "ED_keyframing.hh"
#include "ED_mesh.hh"
#include "ED_object.hh"
#include "ED_object_vgroup.hh"
#include "ED_outliner.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "ED_view3d.hh"
#include "ANIM_armature.hh"
#include "ANIM_bonecolor.hh"
#include "ANIM_keyingsets.hh"
#include "armature_intern.hh"

Go to the source code of this file.

Enumerations

enum class  SelectRelatedMode {
  SAME_COLLECTION = 0 , SAME_COLOR , SAME_KEYINGSET , CHILDREN ,
  IMMEDIATE_CHILDREN , PARENT , SIBLINGS
}

Functions

static void pose_do_bone_select (bPoseChannel *pchan, const int select_mode)
void ED_pose_bone_select_tag_update (Object *ob)
void ED_pose_bone_select (Object *ob, bPoseChannel *pchan, bool select, bool change_active)
bool ED_armature_pose_select_pick_bone (const Scene *scene, ViewLayer *view_layer, View3D *v3d, Object *ob, bPoseChannel *pchan, const SelectPick_Params &params)
bool ED_armature_pose_select_pick_with_buffer (const Scene *scene, ViewLayer *view_layer, View3D *v3d, Base *base, const GPUSelectResult *hit_results, const int hits, const SelectPick_Params &params, bool do_nearest)
void ED_armature_pose_select_in_wpaint_mode (const Scene *scene, ViewLayer *view_layer, Base *base_select)
bool ED_pose_deselect_all (Object *ob, int select_mode, const bool ignore_visibility)
static bool ed_pose_is_any_selected (Object *ob, bool ignore_visibility)
static bool ed_pose_is_any_selected_multi (const Span< Base * > bases, bool ignore_visibility)
bool ED_pose_deselect_all_multi_ex (const Span< Base * > bases, int select_mode, const bool ignore_visibility)
bool ED_pose_deselect_all_multi (bContext *C, int select_mode, const bool ignore_visibility)
static void selectconnected_posebonechildren (Object &ob, bPoseChannel &pose_bone, const bool extend)
static wmOperatorStatus pose_select_connected_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static bool pose_select_linked_pick_poll (bContext *C)
void POSE_OT_select_linked_pick (wmOperatorType *ot)
static wmOperatorStatus pose_select_linked_exec (bContext *C, wmOperator *)
void POSE_OT_select_linked (wmOperatorType *ot)
static wmOperatorStatus pose_de_select_all_exec (bContext *C, wmOperator *op)
void POSE_OT_select_all (wmOperatorType *ot)
static wmOperatorStatus pose_select_parent_exec (bContext *C, wmOperator *)
void POSE_OT_select_parent (wmOperatorType *ot)
static wmOperatorStatus pose_select_constraint_target_exec (bContext *C, wmOperator *)
void POSE_OT_select_constraint_target (wmOperatorType *ot)
static wmOperatorStatus pose_select_hierarchy_exec (bContext *C, wmOperator *op)
void POSE_OT_select_hierarchy (wmOperatorType *ot)
static bool pose_select_same_color (bContext *C, const bool extend)
static bool pose_select_same_collection (bContext *C, const bool extend)
static blender::Set< bPoseChannel * > get_selected_pose_bones (Object *pose_object)
static bool pose_bone_is_below_one_of (bPoseChannel &bone, const blender::Set< bPoseChannel * > &potential_parents)
static void deselect_pose_bones (const blender::Set< bPoseChannel * > &pose_bones)
static bool pose_select_children (bContext *C, const bool all, const bool extend)
static bool pose_select_parents (bContext *C, const bool extend)
static bool pose_select_siblings (bContext *C, const bool extend)
static bool pose_select_same_keyingset (bContext *C, ReportList *reports, bool extend)
static wmOperatorStatus pose_select_grouped_exec (bContext *C, wmOperator *op)
void POSE_OT_select_grouped (wmOperatorType *ot)
static void bone_selection_flags_add (bPoseChannel *pchan, const ePchan_Flag new_selection_flags)
static void bone_selection_flags_set (bPoseChannel *pchan, const ePchan_Flag new_selection_flags)
static wmOperatorStatus pose_select_mirror_exec (bContext *C, wmOperator *op)
void POSE_OT_select_mirror (wmOperatorType *ot)

Enumeration Type Documentation

◆ SelectRelatedMode

enum class SelectRelatedMode
strong
Enumerator
SAME_COLLECTION 
SAME_COLOR 
SAME_KEYINGSET 
CHILDREN 
IMMEDIATE_CHILDREN 
PARENT 
SIBLINGS 

Definition at line 827 of file pose_select.cc.

Function Documentation

◆ bone_selection_flags_add()

void bone_selection_flags_add ( bPoseChannel * pchan,
const ePchan_Flag new_selection_flags )
static

Definition at line 1293 of file pose_select.cc.

References bPoseChannel::flag.

Referenced by pose_select_mirror_exec().

◆ bone_selection_flags_set()

void bone_selection_flags_set ( bPoseChannel * pchan,
const ePchan_Flag new_selection_flags )
static

Definition at line 1299 of file pose_select.cc.

References bPoseChannel::flag.

Referenced by pose_select_mirror_exec().

◆ deselect_pose_bones()

void deselect_pose_bones ( const blender::Set< bPoseChannel * > & pose_bones)
static

Definition at line 977 of file pose_select.cc.

References POSE_SELECTED.

Referenced by pose_select_children(), pose_select_parents(), and pose_select_siblings().

◆ ED_armature_pose_select_in_wpaint_mode()

void ED_armature_pose_select_in_wpaint_mode ( const Scene * scene,
ViewLayer * view_layer,
Base * base_select )

While in weight-paint mode, a single pose may be active as well. While not common, it's possible we have multiple armatures deforming a mesh.

This function de-selects all other objects, and selects the new base. It can't be set to the active object because we need to keep this set to the weight paint object.

Definition at line 281 of file pose_select.cc.

References blender::ed::object::BA_DESELECT, blender::ed::object::BA_SELECT, blender::ed::object::base_select(), BASE_SELECTED, BKE_modifiers_get_virtual_modifierlist(), BKE_view_layer_active_object_get(), BKE_view_layer_base_find(), BKE_view_layer_synced_ensure(), BLI_assert, eModifierType_Armature, Base::flag, Object::mode, ModifierData::next, OB_ARMATURE, OB_MODE_ALL_WEIGHT_PAINT, ArmatureModifierData::object, and ModifierData::type.

Referenced by bone_select_menu_exec(), and ed_object_select_pick().

◆ ED_armature_pose_select_pick_bone()

◆ ED_armature_pose_select_pick_with_buffer()

bool ED_armature_pose_select_pick_with_buffer ( const Scene * scene,
ViewLayer * view_layer,
View3D * v3d,
Base * base,
const GPUSelectResult * hit_results,
const int hits,
const SelectPick_Params & params,
bool do_nearest )

◆ ED_pose_bone_select()

void ED_pose_bone_select ( Object * ob,
bPoseChannel * pchan,
bool select,
bool change_active )

Utility method for changing the selection status of a bone. change_active determines whether to change the active bone of the armature when selecting pose channels. It is false during range selection otherwise true.

Definition at line 99 of file pose_select.cc.

References bArmature::act_bone, bPoseChannel::bone, blender::animrig::bone_is_selectable(), Object::data, ED_pose_bone_select_tag_update(), ELEM, bPoseChannel::flag, Object::pose, POSE_SELECTED, and select.

Referenced by click_select_channel_group(), blender::ed::object::jump_to_bone(), and select_pchan_for_action_group().

◆ ED_pose_bone_select_tag_update()

◆ ED_pose_deselect_all()

bool ED_pose_deselect_all ( Object * ob,
int select_mode,
bool ignore_visibility )

'select_mode' is usual SEL_SELECT/SEL_DESELECT/SEL_TOGGLE/SEL_INVERT. When true, 'ignore_visibility' makes this func also affect invisible bones (hidden or on hidden layers).

Definition at line 310 of file pose_select.cc.

References blender::animrig::bone_is_visible(), bPose::chanbase, Object::data, LISTBASE_FOREACH, Object::pose, pose_do_bone_select(), POSE_SELECTED, SEL_DESELECT, SEL_SELECT, and SEL_TOGGLE.

Referenced by click_select_channel_group(), do_pose_tag_select_op_exec(), ED_armature_pose_select_pick_bone(), ED_pose_deselect_all_multi_ex(), blender::ed::object::jump_to_bone(), and pose_circle_select().

◆ ED_pose_deselect_all_multi()

bool ED_pose_deselect_all_multi ( bContext * C,
int select_mode,
const bool ignore_visibility )

◆ ED_pose_deselect_all_multi_ex()

bool ED_pose_deselect_all_multi_ex ( const Span< Base * > bases,
int select_mode,
const bool ignore_visibility )

◆ ed_pose_is_any_selected()

bool ed_pose_is_any_selected ( Object * ob,
bool ignore_visibility )
static

◆ ed_pose_is_any_selected_multi()

bool ed_pose_is_any_selected_multi ( const Span< Base * > bases,
bool ignore_visibility )
static

Definition at line 358 of file pose_select.cc.

References ed_pose_is_any_selected().

Referenced by ED_pose_deselect_all_multi_ex().

◆ get_selected_pose_bones()

◆ pose_bone_is_below_one_of()

bool pose_bone_is_below_one_of ( bPoseChannel & bone,
const blender::Set< bPoseChannel * > & potential_parents )
static

◆ pose_de_select_all_exec()

◆ pose_do_bone_select()

◆ POSE_OT_select_all()

◆ POSE_OT_select_constraint_target()

void POSE_OT_select_constraint_target ( wmOperatorType * ot)

◆ POSE_OT_select_grouped()

◆ POSE_OT_select_hierarchy()

◆ POSE_OT_select_linked()

void POSE_OT_select_linked ( wmOperatorType * ot)

◆ POSE_OT_select_linked_pick()

◆ POSE_OT_select_mirror()

void POSE_OT_select_mirror ( wmOperatorType * ot)

◆ POSE_OT_select_parent()

void POSE_OT_select_parent ( wmOperatorType * ot)

◆ pose_select_children()

◆ pose_select_connected_invoke()

◆ pose_select_constraint_target_exec()

◆ pose_select_grouped_exec()

◆ pose_select_hierarchy_exec()

◆ pose_select_linked_exec()

◆ pose_select_linked_pick_poll()

bool pose_select_linked_pick_poll ( bContext * C)
static

Definition at line 476 of file pose_select.cc.

References C, ED_operator_posemode(), and ED_operator_view3d_active().

Referenced by POSE_OT_select_linked_pick().

◆ pose_select_mirror_exec()

◆ pose_select_parent_exec()

◆ pose_select_parents()

◆ pose_select_same_collection()

◆ pose_select_same_color()

◆ pose_select_same_keyingset()

◆ pose_select_siblings()

◆ selectconnected_posebonechildren()

void selectconnected_posebonechildren ( Object & ob,
bPoseChannel & pose_bone,
const bool extend )
static