|
Blender V4.3
|
#include <cstring>#include "ANIM_bone_collections.hh"#include "DNA_ID.h"#include "DNA_object_types.h"#include "BKE_action.hh"#include "BKE_context.hh"#include "BKE_lib_override.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_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 234 of file editors/armature/bone_collections.cc.
| using assign_ebone_func = bool (*)(BoneCollection *bcoll, EditBone *ebone) |
Definition at line 235 of file editors/armature/bone_collections.cc.
|
static |
Allow edits of local bone collection only (full local or local override).
Definition at line 71 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_is_editable(), BKE_lib_override_library_is_system_defined(), 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 852 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 894 of file editors/armature/bone_collections.cc.
References add_or_move_to_collection_bcoll(), BKE_reportf(), bone_collection_assign_mode_specific(), 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, WM_event_add_notifier(), and WM_report().
Referenced by assign_to_collection_exec(), and move_to_collection_exec().
|
static |
Definition at line 714 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, blender::ed::object::context_object(), CTX_wm_operator_poll_msg_set(), Object::data, 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 1214 of file editors/armature/bone_collections.cc.
References assign_to_collection_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, MAX_NAME, move_to_collection_invoke(), move_to_collection_poll(), wmOperatorType::name, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_int(), RNA_def_property_flag(), RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_add | ( | wmOperatorType * | ot | ) |
Definition at line 124 of file editors/armature/bone_collections.cc.
References bone_collection_add_exec(), bone_collection_add_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_assign | ( | wmOperatorType * | ot | ) |
Definition at line 447 of file editors/armature/bone_collections.cc.
References bone_collection_assign_exec(), bone_collection_assign_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MAX_NAME, wmOperatorType::name, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_create_and_assign | ( | wmOperatorType * | ot | ) |
Definition at line 544 of file editors/armature/bone_collections.cc.
References bone_collection_create_and_assign_exec(), bone_collection_create_and_assign_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MAX_NAME, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_deselect | ( | wmOperatorType * | ot | ) |
Definition at line 835 of file editors/armature/bone_collections.cc.
References armature_bone_select_poll(), bone_collection_deselect_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_move | ( | wmOperatorType * | ot | ) |
Definition at line 186 of file editors/armature/bone_collections.cc.
References active_bone_collection_poll(), bone_collection_move_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_remove | ( | wmOperatorType * | ot | ) |
Definition at line 152 of file editors/armature/bone_collections.cc.
References active_bone_collection_poll(), bone_collection_remove_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_select | ( | wmOperatorType * | ot | ) |
Definition at line 803 of file editors/armature/bone_collections.cc.
References armature_bone_select_poll(), bone_collection_select_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_unassign | ( | wmOperatorType * | ot | ) |
Definition at line 605 of file editors/armature/bone_collections.cc.
References bone_collection_assign_poll(), bone_collection_unassign_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MAX_NAME, wmOperatorType::name, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_collection_unassign_named | ( | wmOperatorType * | ot | ) |
Definition at line 675 of file editors/armature/bone_collections.cc.
References bone_collection_assign_poll(), bone_collection_unassign_named_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MAX_NAME, wmOperatorType::name, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_move_to_collection | ( | wmOperatorType * | ot | ) |
Definition at line 1168 of file editors/armature/bone_collections.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, MAX_NAME, move_to_collection_exec(), move_to_collection_invoke(), move_to_collection_poll(), wmOperatorType::name, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_int(), RNA_def_property_flag(), RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 953 of file editors/armature/bone_collections.cc.
References add_or_move_to_collection_exec(), ANIM_armature_bonecoll_assign(), and ANIM_armature_bonecoll_assign_editbone().
Referenced by ARMATURE_OT_assign_to_collection().
|
static |
Definition at line 99 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(), 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 46 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), 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 260 of file editors/armature/bone_collections.cc.
References 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 401 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_assign(), ANIM_armature_bonecoll_assign_editbone(), ANIM_armature_bonecoll_is_editable(), bone_collection_assign_mode_specific(), blender::ed::object::context_object(), Object::data, get_bonecoll_named_or_active(), Object::id, BoneCollection::name, NC_OBJECT, ND_BONE_COLLECTION, OPERATOR_CANCELLED, OPERATOR_FINISHED, RPT_ERROR, RPT_WARNING, WM_main_add_notifier(), WM_report(), and WM_reportf().
Referenced by ARMATURE_OT_collection_assign().
|
static |
Assign or unassign all selected bones to/from the given bone collection.
Definition at line 288 of file editors/armature/bone_collections.cc.
References bone_collection_assign_editbones(), bone_collection_assign_pchans(), 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 321 of file editors/armature/bone_collections.cc.
References BKE_pose_channel_find_name(), bPoseChannel::bone, 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 240 of file editors/armature/bone_collections.cc.
References 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 368 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), 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_assign(), ARMATURE_OT_collection_unassign(), and ARMATURE_OT_collection_unassign_named().
|
static |
Definition at line 500 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(), bone_collection_assign_mode_specific(), blender::ed::object::context_object(), Object::data, Object::id, MAX_NAME, NC_OBJECT, ND_BONE_COLLECTION, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_string_get(), RPT_ERROR, RPT_WARNING, WM_main_add_notifier(), and WM_report().
Referenced by ARMATURE_OT_collection_create_and_assign().
|
static |
Definition at line 471 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), 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 818 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, bone_collection_select(), blender::ed::object::context_object(), Object::data, OPERATOR_CANCELLED, OPERATOR_FINISHED, and bArmature::runtime.
Referenced by ARMATURE_OT_collection_deselect().
|
static |
Definition at line 167 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_active_runtime_refresh(), ANIM_armature_bonecoll_move(), 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 139 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_remove(), 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 737 of file editors/armature/bone_collections.cc.
References ANIM_bone_is_visible(), BONE_SELECTED, BONE_UNSELECTABLE, BoneCollection::bones, 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, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_COLLECTION, select(), and WM_event_add_notifier().
Referenced by bone_collection_deselect_exec(), and bone_collection_select_exec().
|
static |
Definition at line 786 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, bone_collection_select(), blender::ed::object::context_object(), Object::data, OPERATOR_CANCELLED, OPERATOR_FINISHED, and bArmature::runtime.
Referenced by ARMATURE_OT_collection_select().
|
static |
Definition at line 567 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_unassign(), ANIM_armature_bonecoll_unassign_editbone(), bone_collection_assign_mode_specific(), blender::ed::object::context_object(), get_bonecoll_named_or_active(), OPERATOR_CANCELLED, OPERATOR_FINISHED, RPT_ERROR, RPT_WARNING, and WM_report().
Referenced by ARMATURE_OT_collection_unassign().
|
static |
Definition at line 628 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_unassign(), ANIM_armature_bonecoll_unassign_editbone(), bone_collection_assign_named_mode_specific(), blender::ed::object::context_object(), get_bonecoll_named_or_active(), MAX_NAME, BoneCollection::name, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_string_get(), RPT_ERROR, RPT_WARNING, WM_report(), and WM_reportf().
Referenced by ARMATURE_OT_collection_unassign_named().
|
static |
Definition at line 704 of file editors/armature/bone_collections.cc.
References EditBone::bone_collections, and LISTBASE_FOREACH.
Referenced by bone_collection_select().
|
static |
Definition at line 214 of file editors/armature/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_get_by_name(), Object::data, MAX_NAME, wmOperator::ptr, RNA_string_get(), RPT_ERROR, bArmature::runtime, and WM_reportf().
Referenced by bone_collection_assign_exec(), bone_collection_unassign_exec(), and bone_collection_unassign_named_exec().
|
static |
Definition at line 1021 of file editors/armature/bone_collections.cc.
Referenced by menu_add_item_for_move_assign_unassign().
|
static |
Definition at line 1026 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_contains_active_bone(), icon_for_bone_collection(), wmOperator::layout, BoneCollection::name, uiItemIntO(), and uiItemStringO().
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 1013 of file editors/armature/bone_collections.cc.
References int.
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 uiItemMenuF(). 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 1001 of file editors/armature/bone_collections.cc.
Referenced by move_to_collection_menu_create(), and move_to_collection_regular_invoke().
|
static |
Definition at line 945 of file editors/armature/bone_collections.cc.
References add_or_move_to_collection_exec(), ANIM_armature_bonecoll_assign_and_move(), and ANIM_armature_bonecoll_assign_and_move_editbone().
Referenced by ARMATURE_OT_move_to_collection().
|
static |
Definition at line 1156 of file editors/armature/bone_collections.cc.
References 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 uiItemMenuF. 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 1064 of file editors/armature/bone_collections.cc.
References ANIM_armature_bonecoll_is_editable(), blender::animrig::bonecoll_has_children(), BoneCollection::child_count, BoneCollection::child_index, bArmature::collection_array, bArmature::collection_root_count, blender::ed::object::context_object(), Object::data, wmOperator::layout, menu_add_item_for_move_assign_unassign(), menu_custom_data_decode(), menu_custom_data_encode(), move_to_collection_menu_create(), BoneCollection::name, uiItemIntO(), uiItemMenuF(), uiItemS(), uiLayoutRow(), uiLayoutSetEnabled(), uiLayoutSetOperatorContext(), WM_OP_EXEC_DEFAULT, and WM_OP_INVOKE_DEFAULT.
Referenced by move_to_collection_menu_create(), and move_to_collection_regular_invoke().
|
static |
Definition at line 959 of file editors/armature/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), 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 1135 of file editors/armature/bone_collections.cc.
References 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 1149 of file editors/armature/bone_collections.cc.
References IFACE_, wmOperator::ptr, RNA_string_set(), and WM_operator_props_dialog_popup().
Referenced by move_to_collection_invoke().