|
Blender V5.0
|
#include <cstring>#include "ANIM_armature.hh"#include "ANIM_bone_collections.hh"#include "DNA_ID.h"#include "DNA_object_types.h"#include "BLI_listbase.h"#include "BKE_action.hh"#include "BKE_context.hh"#include "BKE_lib_override.hh"#include "BKE_library.hh"#include "BKE_report.hh"#include "BLT_translation.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_object.hh"#include "ED_outliner.hh"#include "UI_interface.hh"#include "UI_interface_layout.hh"#include "UI_resources.hh"#include "armature_intern.hh"Go to the source code of this file.
Typedefs | |
| using | assign_bone_func = bool (*)(BoneCollection *bcoll, Bone *bone) |
| using | assign_ebone_func = bool (*)(BoneCollection *bcoll, EditBone *ebone) |
Implementation of Bone Collection operators and editing API's.
Definition in file editors/armature/bone_collections.cc.
| using assign_bone_func = bool (*)(BoneCollection *bcoll, Bone *bone) |
Definition at line 239 of file editors/armature/bone_collections.cc.
| using assign_ebone_func = bool (*)(BoneCollection *bcoll, EditBone *ebone) |
Definition at line 240 of file editors/armature/bone_collections.cc.
|
static |
Allow edits of local bone collection only (full local or local override).
Definition at line 76 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_is_editable(), BKE_lib_override_library_is_system_defined(), C, CTX_wm_operator_poll_msg_set(), ED_armature_context(), bArmature::id, and bArmature::runtime.
Referenced by ARMATURE_OT_collection_move(), and ARMATURE_OT_collection_remove().
|
static |
Definition at line 894 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_active_set(), ANIM_armature_bonecoll_is_editable(), ANIM_armature_bonecoll_new(), BKE_reportf(), BLI_assert_msg, bArmature::collection_array, bArmature::collection_array_num, bArmature::id, MAX_NAME, BoneCollection::name, ID::name, wmOperator::ptr, wmOperator::reports, RNA_int_get(), RNA_property_is_set(), RNA_string_get(), RNA_struct_find_property(), and RPT_ERROR.
Referenced by add_or_move_to_collection_exec().
|
static |
Definition at line 936 of file editors/armature/bone_collections.cc.
References add_or_move_to_collection_bcoll(), BKE_report(), BKE_reportf(), bone_collection_assign_mode_specific(), C, blender::ed::object::context_object(), Object::data, DEG_id_tag_update(), ED_pose_object_from_context(), bArmature::id, ID_RECALC_SELECT, Object::mode, NC_OBJECT, ND_DATA, ND_POSE, OB_MODE_POSE, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, RPT_WARNING, and WM_event_add_notifier().
Referenced by assign_to_collection_exec(), and move_to_collection_exec().
|
static |
Definition at line 736 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, C, blender::ed::object::context_active_object(), blender::ed::object::context_object(), CTX_wm_operator_poll_msg_set(), Object::data, ED_armature_context(), bArmature::edbo, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, OB_ARMATURE, bArmature::runtime, and Object::type.
Referenced by ARMATURE_OT_collection_deselect(), and ARMATURE_OT_collection_select().
| void ARMATURE_OT_assign_to_collection | ( | wmOperatorType * | ot | ) |
Definition at line 1256 of file editors/armature/bone_collections.cc.
References assign_to_collection_exec(), MAX_NAME, move_to_collection_invoke(), move_to_collection_poll(), OPTYPE_UNDO, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_int(), RNA_def_property_flag(), and RNA_def_string().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_add | ( | wmOperatorType * | ot | ) |
Definition at line 129 of file editors/armature/bone_collections.cc.
References bone_collection_add_exec(), bone_collection_add_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_assign | ( | wmOperatorType * | ot | ) |
Definition at line 460 of file editors/armature/bone_collections.cc.
References bone_collection_assign_exec(), bone_collection_assign_poll(), MAX_NAME, OPTYPE_UNDO, ot, and RNA_def_string().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_create_and_assign | ( | wmOperatorType * | ot | ) |
Definition at line 559 of file editors/armature/bone_collections.cc.
References bone_collection_create_and_assign_exec(), bone_collection_create_and_assign_poll(), MAX_NAME, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_string().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_deselect | ( | wmOperatorType * | ot | ) |
Definition at line 877 of file editors/armature/bone_collections.cc.
References armature_bone_select_poll(), bone_collection_deselect_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_move | ( | wmOperatorType * | ot | ) |
Definition at line 191 of file editors/armature/bone_collections.cc.
References active_bone_collection_poll(), bone_collection_move_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_enum().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_remove | ( | wmOperatorType * | ot | ) |
Definition at line 157 of file editors/armature/bone_collections.cc.
References active_bone_collection_poll(), bone_collection_remove_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_select | ( | wmOperatorType * | ot | ) |
Definition at line 846 of file editors/armature/bone_collections.cc.
References armature_bone_select_poll(), bone_collection_select_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_unassign | ( | wmOperatorType * | ot | ) |
Definition at line 623 of file editors/armature/bone_collections.cc.
References bone_collection_assign_poll(), bone_collection_unassign_exec(), MAX_NAME, OPTYPE_UNDO, ot, and RNA_def_string().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_unassign_named | ( | wmOperatorType * | ot | ) |
Definition at line 697 of file editors/armature/bone_collections.cc.
References bone_collection_assign_poll(), bone_collection_unassign_named_exec(), MAX_NAME, OPTYPE_UNDO, ot, and RNA_def_string().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_move_to_collection | ( | wmOperatorType * | ot | ) |
Definition at line 1210 of file editors/armature/bone_collections.cc.
References MAX_NAME, move_to_collection_exec(), move_to_collection_invoke(), move_to_collection_poll(), OPTYPE_UNDO, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_int(), RNA_def_property_flag(), and RNA_def_string().
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 998 of file editors/armature/bone_collections.cc.
References add_or_move_to_collection_exec(), ANIM_armature_bonecoll_assign(), ANIM_armature_bonecoll_assign_editbone(), and C.
Referenced by ARMATURE_OT_assign_to_collection().
|
static |
Definition at line 104 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, bArmature_Runtime::active_collection_index, ANIM_armature_bonecoll_active_set(), ANIM_armature_bonecoll_new(), blender::animrig::armature_bonecoll_child_number_find(), blender::animrig::armature_bonecoll_child_number_set(), blender::animrig::armature_bonecoll_find_parent_index(), C, ED_armature_context(), NC_OBJECT, ND_POSE, OPERATOR_FINISHED, bArmature::runtime, and WM_event_add_notifier().
Referenced by ARMATURE_OT_collection_add().
|
static |
Definition at line 51 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), C, CTX_wm_operator_poll_msg_set(), ED_armature_context(), bArmature::id, and ID_IS_EDITABLE.
Referenced by ARMATURE_OT_collection_add().
|
static |
Definition at line 265 of file editors/armature/bone_collections.cc.
References blender::animrig::bone_is_visible(), C, Object::data, DEG_id_tag_update(), EBONE_EDITABLE, ED_armature_edit_sync_selection(), bArmature::edbo, Object::id, ID_RECALC_SYNC_TO_EVAL, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_COLLECTION, and WM_event_add_notifier().
Referenced by bone_collection_assign_mode_specific().
|
static |
Definition at line 411 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_assign(), ANIM_armature_bonecoll_assign_editbone(), ANIM_armature_bonecoll_is_editable(), BKE_report(), BKE_reportf(), bone_collection_assign_mode_specific(), C, blender::ed::object::context_active_object(), Object::data, get_bonecoll_named_or_active(), Object::id, BoneCollection::name, NC_OBJECT, ND_BONE_COLLECTION, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, RPT_WARNING, and WM_main_add_notifier().
Referenced by ARMATURE_OT_collection_assign().
|
static |
Assign or unassign all selected bones to/from the given bone collection.
Definition at line 293 of file editors/armature/bone_collections.cc.
References bone_collection_assign_editbones(), bone_collection_assign_pchans(), C, CTX_data_mode_enum(), CTX_MODE_EDIT_ARMATURE, CTX_MODE_POSE, and ED_outliner_select_sync_from_edit_bone_tag().
Referenced by add_or_move_to_collection_exec(), bone_collection_assign_exec(), bone_collection_create_and_assign_exec(), and bone_collection_unassign_exec().
|
static |
Assign or unassign the named bone to/from the given bone collection.
Definition at line 326 of file editors/armature/bone_collections.cc.
References BKE_pose_channel_find_name(), bPoseChannel::bone, C, CTX_data_mode_enum(), CTX_MODE_EDIT_ARMATURE, CTX_MODE_POSE, Object::data, DEG_id_tag_update(), ED_armature_ebone_find_name(), ED_armature_edit_sync_selection(), bArmature::edbo, bArmature::id, Object::id, ID_RECALC_SELECT, ID_RECALC_SYNC_TO_EVAL, NC_OBJECT, ND_BONE_COLLECTION, ND_POSE, Object::pose, and WM_event_add_notifier().
Referenced by bone_collection_unassign_named_exec().
|
static |
Definition at line 245 of file editors/armature/bone_collections.cc.
References C, Object::data, DEG_id_tag_update(), FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN, FOREACH_PCHAN_SELECTED_IN_OBJECT_END, bArmature::id, ID_RECALC_SELECT, NC_OBJECT, ND_POSE, and WM_event_add_notifier().
Referenced by bone_collection_assign_mode_specific().
|
static |
Definition at line 373 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), C, blender::ed::object::context_active_object(), CTX_wm_operator_poll_msg_set(), Object::data, ED_armature_context(), bArmature::id, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, OB_ARMATURE, and Object::type.
Referenced by ARMATURE_OT_collection_assign(), ARMATURE_OT_collection_unassign(), and ARMATURE_OT_collection_unassign_named().
|
static |
Definition at line 513 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_active_set(), ANIM_armature_bonecoll_assign(), ANIM_armature_bonecoll_assign_editbone(), ANIM_armature_bonecoll_new(), ANIM_armature_bonecoll_remove(), BKE_report(), bone_collection_assign_mode_specific(), C, blender::ed::object::context_object(), Object::data, Object::id, MAX_NAME, NC_OBJECT, ND_BONE_COLLECTION, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_string_get(), RPT_ERROR, RPT_WARNING, and WM_main_add_notifier().
Referenced by ARMATURE_OT_collection_create_and_assign().
|
static |
Definition at line 484 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), C, blender::ed::object::context_object(), CTX_wm_operator_poll_msg_set(), Object::data, bArmature::id, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, OB_ARMATURE, and Object::type.
Referenced by ARMATURE_OT_collection_create_and_assign().
|
static |
Definition at line 861 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, bone_collection_select(), C, ED_armature_context(), OPERATOR_CANCELLED, OPERATOR_FINISHED, and bArmature::runtime.
Referenced by ARMATURE_OT_collection_deselect().
|
static |
Definition at line 172 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_active_runtime_refresh(), ANIM_armature_bonecoll_move(), C, ED_armature_context(), NC_OBJECT, ND_BONE_COLLECTION, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), bArmature::runtime, and WM_event_add_notifier().
Referenced by ARMATURE_OT_collection_move().
|
static |
Definition at line 144 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_remove(), C, DEG_id_tag_update(), ED_armature_context(), bArmature::id, ID_RECALC_SELECT, NC_OBJECT, ND_POSE, OPERATOR_FINISHED, bArmature::runtime, and WM_event_add_notifier().
Referenced by ARMATURE_OT_collection_remove().
|
static |
Definition at line 773 of file editors/armature/bone_collections.cc.
References BKE_pose_channel_find_name(), BLI_assert_msg, BLI_assert_unreachable, blender::animrig::bone_is_visible(), BONE_UNSELECTABLE, BoneCollection::bones, C, blender::ed::object::context_active_object(), Object::data, DEG_id_tag_update(), EBONE_SELECTABLE, ED_armature_ebone_select_set(), ED_outliner_select_sync_from_edit_bone_tag(), ED_outliner_select_sync_from_pose_bone_tag(), bArmature::edbo, editbone_is_member(), Bone::flag, bPoseChannel::flag, bArmature::id, Object::id, ID_RECALC_SELECT, LISTBASE_FOREACH, Bone::name, NC_OBJECT, ND_BONE_COLLECTION, OB_ARMATURE, Object::pose, POSE_SELECTED, select, Object::type, and WM_event_add_notifier().
Referenced by bone_collection_deselect_exec(), and bone_collection_select_exec().
|
static |
Definition at line 830 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, bone_collection_select(), C, ED_armature_context(), OPERATOR_CANCELLED, OPERATOR_FINISHED, and bArmature::runtime.
Referenced by ARMATURE_OT_collection_select().
|
static |
Definition at line 582 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_unassign(), ANIM_armature_bonecoll_unassign_editbone(), BKE_reportf(), bone_collection_assign_mode_specific(), C, blender::ed::object::context_active_object(), get_bonecoll_named_or_active(), OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and RPT_WARNING.
Referenced by ARMATURE_OT_collection_unassign().
|
static |
Definition at line 646 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_unassign(), ANIM_armature_bonecoll_unassign_editbone(), BKE_reportf(), bone_collection_assign_named_mode_specific(), C, blender::ed::object::context_active_object(), get_bonecoll_named_or_active(), MAX_NAME, BoneCollection::name, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_string_get(), RPT_ERROR, and RPT_WARNING.
Referenced by ARMATURE_OT_collection_unassign_named().
|
static |
Definition at line 726 of file editors/armature/bone_collections.cc.
References EditBone::bone_collections, and LISTBASE_FOREACH.
Referenced by bone_collection_select().
|
static |
Definition at line 219 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_get_by_name(), BKE_reportf(), Object::data, MAX_NAME, wmOperator::ptr, wmOperator::reports, RNA_string_get(), RPT_ERROR, and bArmature::runtime.
Referenced by bone_collection_assign_exec(), bone_collection_unassign_exec(), and bone_collection_unassign_named_exec().
|
static |
Definition at line 1066 of file editors/armature/bone_collections.cc.
Referenced by menu_add_item_for_move_assign_unassign().
|
static |
Definition at line 1071 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_contains_active_bone(), icon_for_bone_collection(), wmOperator::layout, BoneCollection::name, uiLayout::op(), RNA_int_set(), and RNA_string_set().
Referenced by move_to_collection_menu_create().
|
static |
Decode the void* back into a bone collection index and a boolean is_move_operation.
Definition at line 1058 of file editors/armature/bone_collections.cc.
Referenced by move_to_collection_menu_create().
|
static |
Encode the parameters into an integer, and return as void*.
NOTE(@sybren): This makes it possible to use these values and pass them directly as 'custom data' pointer to uiLayout::menu_fn(). This makes it possible to give every menu a unique bone collection index for which it should show the child collections, without having to allocate memory or use static variables. See move_to_collection_invoke() in object_edit.cc for the alternative that I wanted to avoid.
Definition at line 1046 of file editors/armature/bone_collections.cc.
Referenced by move_to_collection_menu_create(), and move_to_collection_regular_invoke().
|
static |
Definition at line 990 of file editors/armature/bone_collections.cc.
References add_or_move_to_collection_exec(), ANIM_armature_bonecoll_assign_and_move(), ANIM_armature_bonecoll_assign_and_move_editbone(), and C.
Referenced by ARMATURE_OT_move_to_collection().
|
static |
Definition at line 1196 of file editors/armature/bone_collections.cc.
References C, move_to_collection_regular_invoke(), move_to_new_collection_invoke(), wmOperator::ptr, RNA_property_is_set(), and RNA_struct_find_property().
Referenced by ARMATURE_OT_assign_to_collection(), and ARMATURE_OT_move_to_collection().
|
static |
Add menu items to the layout, for a set of bone collections.
| menu_custom_data | Contains two values, encoded as void* to match the signature required by uiLayout::menu_fn. It contains the parent bone collection index (either -1 to show all roots, or another value to show the children of that collection), as well as a boolean that indicates whether the menu is created for the "move to collection" or "assign to collection" operator. |
Definition at line 1107 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_is_editable(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, blender::animrig::bonecoll_has_children(), C, BoneCollection::child_count, BoneCollection::child_index, bArmature::collection_array, bArmature::collection_root_count, blender::ed::object::context_object(), CTX_IFACE_, Object::data, uiLayout::enabled_set(), blender::wm::ExecDefault, blender::wm::InvokeDefault, wmOperator::layout, menu_add_item_for_move_assign_unassign(), menu_custom_data_decode(), menu_custom_data_encode(), uiLayout::menu_fn(), move_to_collection_menu_create(), BoneCollection::name, uiLayout::op(), uiLayout::operator_context_set(), RNA_int_set(), uiLayout::row(), and uiLayout::separator().
Referenced by move_to_collection_menu_create(), and move_to_collection_regular_invoke().
|
static |
Definition at line 1004 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), C, blender::ed::object::context_object(), CTX_wm_operator_poll_msg_set(), Object::data, bArmature::id, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, OB_ARMATURE, and Object::type.
Referenced by ARMATURE_OT_assign_to_collection(), and ARMATURE_OT_move_to_collection().
|
static |
Definition at line 1175 of file editors/armature/bone_collections.cc.
References C, CTX_IFACE_, wmOperatorType::idname, wmOperator::layout, menu_custom_data_encode(), move_to_collection_menu_create(), wmOperatorType::name, OPERATOR_INTERFACE, STREQ, wmOperatorType::translation_context, wmOperator::type, UI_popup_menu_begin(), UI_popup_menu_end(), and UI_popup_menu_layout().
Referenced by move_to_collection_invoke().
|
static |
Definition at line 1189 of file editors/armature/bone_collections.cc.
References C, IFACE_, wmOperator::ptr, RNA_string_set(), and WM_operator_props_dialog_popup().
Referenced by move_to_collection_invoke().