Blender V4.3
pose_select.cc File Reference
#include <cstring>
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.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_bone_collections.hh"
#include "ANIM_bonecolor.hh"
#include "ANIM_keyingsets.hh"
#include "armature_intern.hh"

Go to the source code of this file.

Macros

#define PBONE_PREV_FLAG_GET(pchan)   ((void)0, POINTER_AS_INT((pchan)->temp))
 
#define PBONE_PREV_FLAG_SET(pchan, val)   ((pchan)->temp = POINTER_FROM_INT(val))
 

Enumerations

enum  ePose_SelectSame_Mode { POSE_SEL_SAME_COLLECTION = 0 , POSE_SEL_SAME_COLOR = 1 , POSE_SEL_SAME_KEYINGSET = 2 }
 

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, Bone *bone, 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, Bone *bone, int extend)
 
static int 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 int pose_select_linked_exec (bContext *C, wmOperator *)
 
void POSE_OT_select_linked (wmOperatorType *ot)
 
static int pose_de_select_all_exec (bContext *C, wmOperator *op)
 
void POSE_OT_select_all (wmOperatorType *ot)
 
static int pose_select_parent_exec (bContext *C, wmOperator *)
 
void POSE_OT_select_parent (wmOperatorType *ot)
 
static int pose_select_constraint_target_exec (bContext *C, wmOperator *)
 
void POSE_OT_select_constraint_target (wmOperatorType *ot)
 
static int 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 bool pose_select_same_keyingset (bContext *C, ReportList *reports, bool extend)
 
static int pose_select_grouped_exec (bContext *C, wmOperator *op)
 
void POSE_OT_select_grouped (wmOperatorType *ot)
 
static int pose_select_mirror_exec (bContext *C, wmOperator *op)
 
void POSE_OT_select_mirror (wmOperatorType *ot)
 

Macro Definition Documentation

◆ PBONE_PREV_FLAG_GET

#define PBONE_PREV_FLAG_GET ( pchan)    ((void)0, POINTER_AS_INT((pchan)->temp))

Definition at line 59 of file pose_select.cc.

Referenced by pose_select_mirror_exec().

◆ PBONE_PREV_FLAG_SET

#define PBONE_PREV_FLAG_SET ( pchan,
val )   ((pchan)->temp = POINTER_FROM_INT(val))

Definition at line 60 of file pose_select.cc.

Referenced by pose_select_mirror_exec().

Enumeration Type Documentation

◆ ePose_SelectSame_Mode

Enumerator
POSE_SEL_SAME_COLLECTION 
POSE_SEL_SAME_COLOR 
POSE_SEL_SAME_KEYINGSET 

Definition at line 825 of file pose_select.cc.

Function Documentation

◆ 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 285 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 103 of file pose_select.cc.

References bArmature::act_bone, bPoseChannel::bone, BONE_SELECTED, Object::data, ED_pose_bone_select_tag_update(), ELEM, Bone::flag, PBONE_SELECTABLE, Object::pose, 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 314 of file pose_select.cc.

References BONE_SELECTED, bPose::chanbase, Object::data, bArmature::flag, LISTBASE_FOREACH, PBONE_VISIBLE, Object::pose, pose_do_bone_select(), 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()

◆ 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()

static bool ed_pose_is_any_selected ( Object * ob,
bool ignore_visibility )
static

◆ ed_pose_is_any_selected_multi()

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

Definition at line 362 of file pose_select.cc.

References ed_pose_is_any_selected().

Referenced by ED_pose_deselect_all_multi_ex().

◆ pose_de_select_all_exec()

◆ pose_do_bone_select()

static void pose_do_bone_select ( bPoseChannel * pchan,
const int select_mode )
static

◆ POSE_OT_select_all()

◆ POSE_OT_select_constraint_target()

◆ POSE_OT_select_grouped()

◆ POSE_OT_select_hierarchy()

◆ POSE_OT_select_linked()

◆ POSE_OT_select_linked_pick()

◆ POSE_OT_select_mirror()

◆ POSE_OT_select_parent()

◆ 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()

static bool pose_select_linked_pick_poll ( bContext * C)
static

Definition at line 474 of file pose_select.cc.

References 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_same_collection()

◆ pose_select_same_color()

◆ pose_select_same_keyingset()

◆ selectconnected_posebonechildren()

static void selectconnected_posebonechildren ( Object * ob,
Bone * bone,
int extend )
static