Blender
V3.3
|
#include <string.h>
#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.h"
#include "BKE_armature.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_layer.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_keyframing.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_view3d.h"
#include "armature_intern.h"
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)) |
Typedefs | |
typedef enum ePose_SelectSame_Mode | ePose_SelectSame_Mode |
Enumerations | |
enum | ePose_SelectSame_Mode { POSE_SEL_SAME_LAYER = 0 , POSE_SEL_SAME_GROUP = 1 , POSE_SEL_SAME_KEYINGSET = 2 } |
#define PBONE_PREV_FLAG_GET | ( | pchan | ) | ((void)0, (POINTER_AS_INT((pchan)->temp))) |
Definition at line 51 of file pose_select.c.
#define PBONE_PREV_FLAG_SET | ( | pchan, | |
val | |||
) | ((pchan)->temp = POINTER_FROM_INT(val)) |
Definition at line 52 of file pose_select.c.
typedef enum ePose_SelectSame_Mode ePose_SelectSame_Mode |
Enumerator | |
---|---|
POSE_SEL_SAME_LAYER | |
POSE_SEL_SAME_GROUP | |
POSE_SEL_SAME_KEYINGSET |
Definition at line 839 of file pose_select.c.
void ED_armature_pose_select_in_wpaint_mode | ( | struct ViewLayer * | view_layer, |
struct 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 269 of file pose_select.c.
References BA_DESELECT, BA_SELECT, BASE_SELECTED, BKE_gpencil_modifiers_get_virtual_modifierlist(), BKE_modifiers_get_virtual_modifierlist(), BKE_view_layer_base_find(), BLI_assert, ED_object_base_select(), eGpencilModifierType_Armature, eModifierType_Armature, Base::flag, Object::mode, GpencilModifierData::next, ModifierData::next, NULL, OB_ARMATURE, OB_GPENCIL, OB_MODE_ALL_WEIGHT_PAINT, OBACT, ArmatureGpencilModifierData::object, Base::object, ArmatureModifierData::object, GpencilModifierData::type, ModifierData::type, and Object::type.
Referenced by bone_select_menu_exec(), and ed_object_select_pick().
bool ED_armature_pose_select_pick_bone | ( | struct ViewLayer * | view_layer, |
struct View3D * | v3d, | ||
struct Object * | ob, | ||
struct Bone * | bone, | ||
const struct SelectPick_Params * | params | ||
) |
Definition at line 124 of file pose_select.c.
References bArmature::act_bone, ARM_HAS_VIZ_DEPS, BLI_assert, BLI_assert_unreachable, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, BONE_UNSELECTABLE, Object::data, DEG_id_tag_update(), ED_pose_bone_select_tag_update(), ED_pose_deselect_all(), ED_vgroup_select_by_name(), Bone::flag, bArmature::flag, FOREACH_VISIBLE_BASE_BEGIN, FOREACH_VISIBLE_BASE_END, bArmature::id, Object::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, Object::mode, Bone::name, NULL, OB_ARMATURE, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_POSE, OBACT, OBEDIT_FROM_VIEW_LAYER, params, Object::pose, SEL_DESELECT, SEL_OP_ADD, SEL_OP_AND, SEL_OP_SET, SEL_OP_SUB, SEL_OP_XOR, and Object::type.
Referenced by bone_select_menu_exec(), and ED_armature_pose_select_pick_with_buffer().
bool ED_armature_pose_select_pick_with_buffer | ( | struct ViewLayer * | view_layer, |
struct View3D * | v3d, | ||
struct Base * | base, | ||
const struct GPUSelectResult * | buffer, | ||
short | hits, | ||
const struct SelectPick_Params * | params, | ||
bool | do_nearest | ||
) |
Called for mode-less pose selection. assumes the active object is still on old situation.
Definition at line 246 of file pose_select.c.
References buffer, ED_armature_pick_bone_from_selectbuffer(), ED_armature_pose_select_pick_bone(), NULL, Base::object, params, and Object::pose.
Referenced by ed_object_select_pick().
void ED_pose_bone_select | ( | struct Object * | ob, |
struct bPoseChannel * | pchan, | ||
bool | select | ||
) |
Utility method for changing the selection status of a bone.
Definition at line 95 of file pose_select.c.
References bArmature::act_bone, bPoseChannel::bone, BONE_SELECTED, Object::data, ED_pose_bone_select_tag_update(), ELEM, Bone::flag, NULL, PBONE_SELECTABLE, Object::pose, and select().
Referenced by click_select_channel_group(), ED_object_jump_to_bone(), and select_pchan_for_action_group().
Definition at line 80 of file pose_select.c.
References ARM_HAS_VIZ_DEPS, BLI_assert, Object::data, DEG_id_tag_update(), bArmature::flag, bArmature::id, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_SELECT, NC_GEOM, NC_OBJECT, ND_BONE_SELECT, ND_DATA, OB_ARMATURE, Object::type, and WM_main_add_notifier().
Referenced by do_pose_tag_select_op_exec(), ED_armature_pose_select_pick_bone(), ED_object_jump_to_bone(), ED_pose_bone_select(), ED_pose_deselect_all_multi_ex(), pose_circle_select(), pose_select_connected_invoke(), pose_select_constraint_target_exec(), pose_select_hierarchy_exec(), pose_select_linked_exec(), pose_select_parent_exec(), pose_select_same_group(), pose_select_same_keyingset(), and pose_select_same_layer().
'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 315 of file pose_select.c.
References bPoseChannel::bone, BONE_SELECTED, bPose::chanbase, Object::data, ListBase::first, Bone::flag, bPoseChannel::next, NULL, 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_object_jump_to_bone(), ED_pose_deselect_all_multi_ex(), and pose_circle_select().
Definition at line 397 of file pose_select.c.
References BKE_object_pose_base_array_get_unique(), C, CTX_data_ensure_evaluated_depsgraph(), depsgraph, ED_pose_deselect_all_multi_ex(), ED_view3d_viewcontext_init(), MEM_freeN, ViewContext::v3d, and ViewContext::view_layer.
bool ED_pose_deselect_all_multi_ex | ( | Base ** | bases, |
uint | bases_len, | ||
int | select_mode, | ||
const bool | ignore_visibility | ||
) |
Definition at line 375 of file pose_select.c.
References ED_pose_bone_select_tag_update(), ED_pose_deselect_all(), ed_pose_is_any_selected_multi(), Base::object, SEL_DESELECT, SEL_SELECT, and SEL_TOGGLE.
Referenced by ED_pose_deselect_all_multi().
Definition at line 351 of file pose_select.c.
References BONE_SELECTED, bPose::chanbase, Object::data, LISTBASE_FOREACH, PBONE_VISIBLE, and Object::pose.
Referenced by ed_pose_is_any_selected_multi().
|
static |
Definition at line 364 of file pose_select.c.
References ed_pose_is_any_selected(), and Base::object.
Referenced by ED_pose_deselect_all_multi_ex().
|
static |
Definition at line 574 of file pose_select.c.
References ARM_HAS_VIZ_DEPS, C, CTX_DATA_BEGIN_WITH_ID, CTX_DATA_COUNT, CTX_DATA_END, CTX_data_scene(), DEG_id_tag_update(), ED_outliner_select_sync_from_pose_bone_tag(), bArmature::flag, bArmature::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ToolSettings::multipaint, NC_OBJECT, ND_BONE_SELECT, NULL, OPERATOR_FINISHED, pose_do_bone_select(), wmOperator::ptr, RNA_enum_get(), scene, SEL_DESELECT, SEL_SELECT, SEL_TOGGLE, Scene::toolsettings, and WM_event_add_notifier().
Referenced by POSE_OT_select_all().
|
static |
Definition at line 57 of file pose_select.c.
References bPoseChannel::bone, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, BONE_UNSELECTABLE, Bone::flag, SEL_DESELECT, SEL_INVERT, and SEL_SELECT.
Referenced by ED_pose_deselect_all(), and pose_de_select_all_exec().
void POSE_OT_select_all | ( | wmOperatorType * | ot | ) |
Definition at line 611 of file pose_select.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, pose_de_select_all_exec(), and WM_operator_properties_select_all().
Referenced by ED_operatortypes_armature().
void POSE_OT_select_constraint_target | ( | wmOperatorType * | ot | ) |
Definition at line 718 of file pose_select.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_select_constraint_target_exec().
Referenced by ED_operatortypes_armature().
void POSE_OT_select_grouped | ( | wmOperatorType * | ot | ) |
Definition at line 1157 of file pose_select.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, POSE_SEL_SAME_GROUP, POSE_SEL_SAME_KEYINGSET, POSE_SEL_SAME_LAYER, pose_select_grouped_exec(), wmOperatorType::prop, prop_select_grouped_types, RNA_def_boolean(), RNA_def_enum(), wmOperatorType::srna, and WM_menu_invoke().
Referenced by ED_operatortypes_armature().
void POSE_OT_select_hierarchy | ( | wmOperatorType * | ot | ) |
Definition at line 810 of file pose_select.c.
References BONE_SELECT_CHILD, BONE_SELECT_PARENT, wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, pose_select_hierarchy_exec(), wmOperatorType::prop, RNA_def_boolean(), RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
void POSE_OT_select_linked | ( | wmOperatorType * | ot | ) |
Definition at line 557 of file pose_select.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_select_linked_exec().
Referenced by ED_operatortypes_armature().
void POSE_OT_select_linked_pick | ( | wmOperatorType * | ot | ) |
Definition at line 490 of file pose_select.c.
References wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, pose_select_connected_invoke(), pose_select_linked_pick_poll(), PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
void POSE_OT_select_mirror | ( | wmOperatorType * | ot | ) |
Definition at line 1266 of file pose_select.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, pose_select_mirror_exec(), RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
void POSE_OT_select_parent | ( | wmOperatorType * | ot | ) |
Definition at line 658 of file pose_select.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_select_parent_exec().
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 436 of file pose_select.c.
References BONE_CONNECTED, BONE_SELECTED, BONE_UNSELECTABLE, C, Bone::childbase, ED_armature_pick_bone(), ED_outliner_select_sync_from_pose_bone_tag(), ED_pose_bone_select_tag_update(), ListBase::first, Bone::flag, wmEvent::mval, Bone::next, next, NULL, Base::object, OPERATOR_CANCELLED, OPERATOR_FINISHED, Bone::parent, wmOperator::ptr, RNA_boolean_get(), selectconnected_posebonechildren(), and view3d_operator_needs_opengl().
Referenced by POSE_OT_select_linked_pick().
|
static |
Definition at line 675 of file pose_select.c.
References BKE_constraint_targets_flush(), BKE_constraint_targets_get(), BKE_pose_channel_find_name(), bPoseChannel::bone, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, BONE_UNSELECTABLE, C, CTX_DATA_BEGIN, CTX_DATA_END, ED_outliner_select_sync_from_pose_bone_tag(), ED_pose_bone_select_tag_update(), ListBase::first, Bone::flag, Object::mode, bConstraint::next, bConstraintTarget::next, NULL, OB_ARMATURE, OB_MODE_POSE, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, bConstraintTarget::subtarget, bConstraintTarget::tar, and Object::type.
Referenced by POSE_OT_select_constraint_target().
|
static |
Definition at line 1117 of file pose_select.c.
References BKE_object_pose_armature_get(), C, CTX_data_active_object(), ED_outliner_select_sync_from_pose_bone_tag(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, POSE_SEL_SAME_GROUP, POSE_SEL_SAME_KEYINGSET, POSE_SEL_SAME_LAYER, pose_select_same_group(), pose_select_same_keyingset(), pose_select_same_layer(), wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_enum_get(), and type.
Referenced by POSE_OT_select_grouped().
|
static |
Definition at line 737 of file pose_select.c.
References bArmature::act_bone, BKE_object_pose_armature_get(), BKE_pose_channel_active_if_layer_visible(), bPoseChannel::bone, BONE_CONNECTED, BONE_SELECT_PARENT, BONE_SELECTED, C, bPose::chanbase, CTX_data_active_object(), Object::data, ED_outliner_select_sync_from_pose_bone_tag(), ED_pose_bone_select_tag_update(), ListBase::first, Bone::flag, bPoseChannel::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, bPoseChannel::parent, PBONE_SELECTABLE, Object::pose, wmOperator::ptr, RNA_boolean_get(), and RNA_enum_get().
Referenced by POSE_OT_select_hierarchy().
|
static |
Definition at line 516 of file pose_select.c.
References BONE_CONNECTED, BONE_SELECTED, C, Bone::childbase, CTX_DATA_BEGIN_WITH_ID, CTX_DATA_END, ED_outliner_select_sync_from_pose_bone_tag(), ED_pose_bone_select_tag_update(), ListBase::first, Bone::flag, Bone::next, next, NULL, OPERATOR_FINISHED, Bone::parent, PBONE_SELECTABLE, and selectconnected_posebonechildren().
Referenced by POSE_OT_select_linked().
Definition at line 485 of file pose_select.c.
References C, ED_operator_posemode(), and ED_operator_view3d_active().
Referenced by POSE_OT_select_linked_pick().
|
static |
Definition at line 1197 of file pose_select.c.
References bArmature::act_bone, BKE_object_pose_array_get_unique(), BKE_pose_channel_get_mirrored(), bPoseChannel::bone, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, C, bPose::chanbase, CTX_data_active_object(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), ED_outliner_select_sync_from_pose_bone_tag(), ED_vgroup_select_by_name(), ELEM, ListBase::first, Bone::flag, bArmature::id, Object::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, MEM_freeN, Object::mode, bPoseChannel::name, NC_OBJECT, ND_BONE_SELECT, bPoseChannel::next, NULL, OB_MODE_WEIGHT_PAINT, OPERATOR_FINISHED, PBONE_PREV_FLAG_GET, PBONE_PREV_FLAG_SET, PBONE_SELECTABLE, PBONE_VISIBLE, Object::pose, wmOperator::ptr, RNA_boolean_get(), and WM_event_add_notifier().
Referenced by POSE_OT_select_mirror().
|
static |
Definition at line 630 of file pose_select.c.
References bArmature::act_bone, BKE_object_pose_armature_get(), bPoseChannel::bone, BONE_HIDDEN_P, BONE_SELECTED, BONE_UNSELECTABLE, C, CTX_data_active_object(), CTX_data_active_pose_bone(), Object::data, ED_outliner_select_sync_from_pose_bone_tag(), ED_pose_bone_select_tag_update(), Bone::flag, OPERATOR_CANCELLED, OPERATOR_FINISHED, and bPoseChannel::parent.
Referenced by POSE_OT_select_parent().
Definition at line 845 of file pose_select.c.
References BKE_object_pose_armature_get(), BKE_object_pose_array_get_unique(), BLI_listbase_count(), BONE_SELECTED, BONE_UNSELECTABLE, C, CTX_DATA_BEGIN_WITH_ID, CTX_DATA_END, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, ED_pose_bone_select_tag_update(), ELEM, Object::flag, Object::id, LIB_TAG_DOIT, MAX2, MEM_callocN, MEM_freeN, NULL, Object::pose, and ID::tag.
Referenced by pose_select_grouped_exec().
|
static |
Definition at line 1033 of file pose_select.c.
References ANIM_scene_get_active_keyingset(), ANIM_validate_keyingset(), BKE_object_pose_armature_get(), BKE_object_pose_array_get_unique(), BKE_pose_channel_find_name(), BKE_report(), BLI_str_quoted_substr(), bPoseChannel::bone, BONE_SELECTED, BONE_UNSELECTABLE, C, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, ED_pose_bone_select_tag_update(), ELEM, ListBase::first, KeyingSet::flag, Bone::flag, KS_Path::id, Object::id, KEYINGSET_ABSOLUTE, MEM_freeN, bPoseChannel::name, KS_Path::next, NULL, KeyingSet::paths, PBONE_SELECTABLE, Object::pose, KS_Path::rna_path, and RPT_ERROR.
Referenced by pose_select_grouped_exec().
Definition at line 948 of file pose_select.c.
References BKE_object_pose_array_get_unique(), BONE_SELECTED, BONE_UNSELECTABLE, C, CTX_DATA_BEGIN_WITH_ID, CTX_DATA_END, CTX_data_view_layer(), CTX_wm_view3d(), ED_pose_bone_select_tag_update(), Object::flag, Object::id, LIB_TAG_DOIT, MEM_callocN, MEM_freeN, NULL, and ID::tag.
Referenced by pose_select_grouped_exec().
Definition at line 413 of file pose_select.c.
References BONE_CONNECTED, BONE_SELECTED, BONE_UNSELECTABLE, Bone::childbase, ListBase::first, Bone::flag, and Bone::next.
Referenced by pose_select_connected_invoke(), and pose_select_linked_exec().