|
Blender V4.3
|
#include "BLI_listbase.h"#include "BLI_map.hh"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_string_utils.hh"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "DNA_armature_types.h"#include "MEM_guardedalloc.h"#include "BKE_animsys.h"#include "BKE_idprop.hh"#include "BKE_lib_id.hh"#include "BKE_lib_override.hh"#include "ANIM_armature_iter.hh"#include "ANIM_bone_collections.hh"#include "intern/bone_collections_internal.hh"#include <cstring>#include <string>Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::animrig |
| namespace | blender::animrig::internal |
|
static |
Definition at line 868 of file animrig/intern/bone_collections.cc.
References BLI_addtail(), BoneCollectionMember::bone, and BoneCollection::bones.
Referenced by ANIM_armature_bonecoll_assign().
|
static |
Definition at line 875 of file animrig/intern/bone_collections.cc.
References BoneCollectionReference::bcoll, BLI_addtail(), Bone_Runtime::collections, and Bone::runtime.
Referenced by ANIM_armature_bonecoll_assign().
|
static |
Construct the mapping from the bones to this collection.
This assumes that the bones do not have such a pointer yet, i.e. calling this twice for the same bone collection will cause duplicate pointers.
Definition at line 88 of file animrig/intern/bone_collections.cc.
References BoneCollectionReference::bcoll, BLI_addtail(), BoneCollection::bones, and LISTBASE_FOREACH.
Referenced by ANIM_armature_runtime_refresh(), and copy_and_update_ownership().
|
static |
Clear BONE_COLLECTION_ANCESTORS_VISIBLE on all descendants of this bone collection.
Definition at line 744 of file animrig/intern/bone_collections.cc.
References ancestors_visible_descendants_clear(), and BoneCollection::flags.
Referenced by ancestors_visible_descendants_clear(), and ancestors_visible_descendants_update().
|
static |
Set or clear BONE_COLLECTION_ANCESTORS_VISIBLE on all descendants of this bone collection.
Definition at line 753 of file animrig/intern/bone_collections.cc.
References ancestors_visible_descendants_clear(), ancestors_visible_descendants_update(), and BONE_COLLECTION_ANCESTORS_VISIBLE.
Referenced by ancestors_visible_descendants_update(), ancestors_visible_update(), ANIM_bonecoll_hide(), and ANIM_bonecoll_show().
|
static |
Set/clear BONE_COLLECTION_ANCESTORS_VISIBLE on this bone collection and all its descendants.
Definition at line 772 of file animrig/intern/bone_collections.cc.
References ancestors_visible_descendants_update(), BONE_COLLECTION_ANCESTORS_VISIBLE, and BoneCollection::flags.
Referenced by ANIM_armature_runtime_refresh(), blender::animrig::armature_bonecoll_move_to_parent(), bonecoll_insert_as_child(), and bonecoll_insert_as_root().
Set the bone collection with the given index as the active one.
Pass -1 to clear the active bone collection.
Definition at line 419 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection, bArmature_Runtime::active_collection_index, bArmature::active_collection_name, armature_bonecoll_active_clear(), bArmature::collection_array, bArmature::collection_array_num, BoneCollection::name, bArmature::runtime, and STRNCPY.
Referenced by ANIM_armature_bonecoll_remove_from_index(), blender::animrig::armature_bonecoll_child_number_set(), armature_copy_data(), bonecoll_insert_at_index(), blender::ui::bonecollections::BoneCollectionDragController::on_drag_start(), blender::ui::bonecollections::BoneCollectionDropTarget::on_drop(), and blender::animrig::tests::TEST_F().
| void ANIM_armature_bonecoll_active_name_set | ( | bArmature * | armature, |
| const char * | name ) |
Set the bone collection with the given name as the active one.
Pass an empty name to clear the active bone collection. A non-existent name will also cause the active bone collection to be cleared.
Definition at line 433 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_active_set(), and ANIM_armature_bonecoll_get_by_name().
Referenced by bc_add_armature_collections(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| void ANIM_armature_bonecoll_active_runtime_refresh | ( | bArmature * | armature | ) |
Refresh the Armature runtime info about the active bone collection.
The ground truth for the active bone collection is the collection's name, whereas the runtime info also contains the active collection's index and pointer. This function updates the runtime info to point to the named collection. If that named collection cannot be found, the name will be cleared.
Definition at line 439 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection, bArmature_Runtime::active_collection_index, bArmature::active_collection_name, armature_bonecoll_active_clear(), and bArmature::runtime.
Referenced by ANIM_armature_bonecoll_insert_copy_after(), ANIM_armature_runtime_refresh(), and bone_collection_move_exec().
| void ANIM_armature_bonecoll_active_set | ( | bArmature * | armature, |
| BoneCollection * | bcoll ) |
Set the given bone collection as the active one.
Pass nullptr to clear the active bone collection.
The bone collection MUST already be owned by this armature. If it is not, this function will simply clear the active bone collection.
Definition at line 400 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection, bArmature_Runtime::active_collection_index, bArmature::active_collection_name, armature_bonecoll_active_clear(), blender::animrig::armature_bonecoll_find_index(), BoneCollection::name, bArmature::runtime, and STRNCPY.
Referenced by add_or_move_to_collection_bcoll(), ANIM_armature_bonecoll_active_name_set(), ANIM_armature_bonecoll_new(), bone_collection_add_exec(), bone_collection_create_and_assign_exec(), blender::ed::object::object_armature_add_exec(), blender::animrig::tests::TEST_F(), blender::ed::outliner::tree_element_bonecollection_activate(), and undoarm_to_editarm().
| bool ANIM_armature_bonecoll_assign | ( | BoneCollection * | bcoll, |
| Bone * | bone ) |
Assign the bone to the bone collection.
No-op if the bone is already a member of the collection.
Definition at line 882 of file animrig/intern/bone_collections.cc.
References add_membership(), add_reference(), BoneCollection::bones, and LISTBASE_FOREACH.
Referenced by ANIM_armature_bonecoll_assign_and_move(), assign_to_collection_exec(), bone_collection_assign_exec(), bone_collection_create_and_assign_exec(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and version_bonegroups_to_bonecollections().
Definition at line 1043 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_assign_editbone(), and bArmature::runtime.
Referenced by armature_bone_primitive_add_exec().
| bool ANIM_armature_bonecoll_assign_and_move | ( | BoneCollection * | bcoll, |
| Bone * | bone ) |
Definition at line 916 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_assign(), and ANIM_armature_bonecoll_unassign_all().
Referenced by move_to_collection_exec().
| bool ANIM_armature_bonecoll_assign_and_move_editbone | ( | BoneCollection * | bcoll, |
| EditBone * | ebone ) |
Definition at line 922 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_assign_editbone(), and ANIM_armature_bonecoll_unassign_all_editbone().
Referenced by move_to_collection_exec().
| bool ANIM_armature_bonecoll_assign_editbone | ( | BoneCollection * | bcoll, |
| EditBone * | ebone ) |
Definition at line 897 of file animrig/intern/bone_collections.cc.
References BoneCollectionReference::bcoll, BLI_addtail(), EditBone::bone_collections, and LISTBASE_FOREACH.
Referenced by ANIM_armature_bonecoll_assign_active(), ANIM_armature_bonecoll_assign_and_move_editbone(), assign_to_collection_exec(), bone_collection_assign_exec(), bone_collection_create_and_assign_exec(), and ED_armature_ebone_add_primitive().
| bool ANIM_armature_bonecoll_contains_active_bone | ( | const bArmature * | armature, |
| const BoneCollection * | bcoll ) |
Return whether the Armature's active bone is assigned to the given bone collection.
Definition at line 1064 of file animrig/intern/bone_collections.cc.
References bArmature::act_bone, bArmature::act_edbone, bcoll_list_contains(), EditBone::bone_collections, Bone_Runtime::collections, bArmature::edbo, and Bone::runtime.
Referenced by blender::ui::bonecollections::BoneCollectionItem::build_row(), and menu_add_item_for_move_assign_unassign().
| BoneCollection * ANIM_armature_bonecoll_get_by_name | ( | bArmature * | armature, |
| const char * | name ) |
Definition at line 727 of file animrig/intern/bone_collections.cc.
References bonecolls_get_by_name().
Referenced by ANIM_armature_bonecoll_active_name_set(), get_bonecoll_named_or_active(), and undoarm_to_editarm().
Scan the bone collections to find the one with the given name.
Definition at line 732 of file animrig/intern/bone_collections.cc.
References bArmature::collection_array, bArmature::collection_array_num, BoneCollection::name, and STREQ.
Referenced by blender::animrig::tests::TEST_F().
| void ANIM_armature_bonecoll_hide_all | ( | bArmature * | armature | ) |
Definition at line 1033 of file animrig/intern/bone_collections.cc.
References ANIM_bonecoll_hide().
| BoneCollection * ANIM_armature_bonecoll_insert_copy_after | ( | bArmature * | armature_dst, |
| const bArmature * | armature_src, | ||
| const BoneCollection * | anchor_in_dst, | ||
| const BoneCollection * | bcoll_to_copy ) |
Add a bone collection to the Armature.
If anchor is null or isn't found, this inserts the copy at the start of the collection array.
NOTE: this should not typically be used. It is only used by the library overrides system to apply override operations.
Definition at line 356 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_active_runtime_refresh(), blender::animrig::armature_bonecoll_find_index(), blender::animrig::armature_bonecoll_is_root(), BLI_assert_msg, bonecoll_ensure_name_unique(), bonecoll_insert_as_root(), copy_and_update_ownership(), bArmature::id, liboverride_recursively_add_children(), BoneCollection::name, ID::name, and printf.
Referenced by blender::animrig::tests::TEST_F().
| bool ANIM_armature_bonecoll_is_editable | ( | const bArmature * | armature, |
| const BoneCollection * | bcoll ) |
Determine whether the given bone collection is editable.
Bone collections are editable when they are local, so either on a local Armature or added to a linked Armature via a library override in the local file.
Definition at line 461 of file animrig/intern/bone_collections.cc.
References BKE_lib_override_library_is_system_defined(), BONE_COLLECTION_OVERRIDE_LIBRARY_LOCAL, BoneCollection::flags, bArmature::id, ID_IS_LINKED, and ID_IS_OVERRIDE_LIBRARY.
Referenced by active_bone_collection_poll(), add_or_move_to_collection_bcoll(), bone_collection_assign_exec(), blender::ui::bonecollections::BoneCollectionItem::build_row(), blender::ui::bonecollections::BoneCollectionItem::create_drag_controller(), move_to_collection_menu_create(), blender::ui::bonecollections::BoneCollectionDropTarget::on_drop(), blender::ui::bonecollections::BoneCollectionItem::supports_renaming(), and blender::animrig::tests::TEST_F().
| void ANIM_armature_bonecoll_is_expanded_set | ( | BoneCollection * | bcoll, |
| bool | is_expanded ) |
Expand or collapse a bone collection in the tree view.
Definition at line 857 of file animrig/intern/bone_collections.cc.
References BONE_COLLECTION_EXPANDED, and BoneCollection::flags.
Referenced by blender::animrig::bonecolls_copy_expanded_flag(), and blender::ui::bonecollections::BoneCollectionItem::set_collapsed().
| bool ANIM_armature_bonecoll_is_visible_effectively | ( | const bArmature * | armature, |
| const BoneCollection * | bcoll ) |
Determine whether this bone collection is visible, taking into account the visibility of its ancestors and the "solo" flags that are in use.
Definition at line 844 of file animrig/intern/bone_collections.cc.
References ARM_BCOLL_SOLO_ACTIVE, and bArmature::flag.
Referenced by any_bone_collection_visible().
| void ANIM_armature_bonecoll_is_visible_set | ( | bArmature * | armature, |
| BoneCollection * | bcoll, | ||
| bool | is_visible ) |
Show or hide this bone collection.
Calling this with a hard-coded is_visible parameter is equivalent to calling the dedicated show/hide functions. Prefer the dedicated functions for clarity.
Definition at line 797 of file animrig/intern/bone_collections.cc.
References ANIM_bonecoll_hide(), and ANIM_bonecoll_show().
| bool ANIM_armature_bonecoll_move | ( | bArmature * | armature, |
| BoneCollection * | bcoll, | ||
| int | step ) |
Move the bone collection by step places up/down.
from_index.Definition at line 572 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_move_to_index(), blender::animrig::armature_bonecoll_find_index(), and bArmature::collection_array_num.
Referenced by bone_collection_move_exec().
| int ANIM_armature_bonecoll_move_before_after_index | ( | bArmature * | armature, |
| const int | from_index, | ||
| int | to_index, | ||
| const MoveLocation | before_after ) |
Definition at line 530 of file animrig/intern/bone_collections.cc.
References After, ANIM_armature_bonecoll_move_to_index(), blender::animrig::armature_bonecoll_find_parent_index(), blender::animrig::armature_bonecoll_move_to_parent(), Before, and bonecoll_child_number().
Referenced by blender::ui::bonecollections::BoneCollectionDropTarget::on_drop(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
Move the bone collection at from_index to its sibling at to_index.
The element at to_index is shifted to make space; it is not overwritten. This shift happens towards from_index.
This operation does not change the total number of elements in the array.
from_index.from_index (before the call) will end up at to_index (after the call). The element at to_index before the call will shift towards from_index; in other words, depending on the direction of movement, the moved element will end up either before or after that one.TODO: add ASCII-art illustration of left & right movement.
Definition at line 480 of file animrig/intern/bone_collections.cc.
References blender::animrig::armature_bonecoll_find_parent_index(), blender::animrig::armature_bonecoll_is_child_of(), blender::animrig::internal::bonecolls_move_to_index(), BoneCollection::child_index, bArmature::collection_array, and bArmature::collection_array_num.
Referenced by ANIM_armature_bonecoll_move(), ANIM_armature_bonecoll_move_before_after_index(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| void ANIM_armature_bonecoll_name_set | ( | bArmature * | armature, |
| BoneCollection * | bcoll, | ||
| const char * | name ) |
Definition at line 589 of file animrig/intern/bone_collections.cc.
References BKE_animdata_fix_paths_rename_all(), bonecoll_ensure_name_unique(), DATA_, bArmature::id, BoneCollection::name, STRNCPY, and STRNCPY_UTF8.
Referenced by blender::ed::outliner::namebutton_fn().
| BoneCollection * ANIM_armature_bonecoll_new | ( | bArmature * | armature, |
| const char * | name, | ||
| int | parent_index = -1 ) |
Add a new bone collection to the given armature.
| parent_index | Index into the Armature's collections_array. -1 adds it as a root (i.e. parentless) collection. |
The Armature owns the returned pointer.
Definition at line 219 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection, ANIM_armature_bonecoll_active_set(), ANIM_bonecoll_new(), BONE_COLLECTION_OVERRIDE_LIBRARY_LOCAL, bonecoll_ensure_name_unique(), bonecoll_insert_as_child(), bonecoll_insert_as_root(), BoneCollection::flags, bArmature::id, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, and bArmature::runtime.
Referenced by add_or_move_to_collection_bcoll(), bc_add_armature_collections(), bone_collection_add_exec(), bone_collection_create_and_assign_exec(), join_armature_remap_collection(), blender::ed::object::object_armature_add_exec(), blender::animrig::tests::ArmatureBoneCollectionsLiboverrides::SetUp(), blender::animrig::tests::ArmatureBoneCollectionsTestList::SetUp(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), version_bonegroups_to_bonecollections(), and version_bonelayers_to_bonecollections().
| void ANIM_armature_bonecoll_reconstruct | ( | bArmature * | armature | ) |
Reconstruct the bone collection memberships, based on the bone runtime data.
This is needed to transition out of armature edit mode. That removes all bones, and recreates them from the edit-bones.
Definition at line 985 of file animrig/intern/bone_collections.cc.
References blender::animrig::ANIM_armature_foreach_bone(), BLI_freelistN(), and bArmature::bonebase.
Referenced by ED_armature_from_edit().
| void ANIM_armature_bonecoll_remove | ( | bArmature * | armature, |
| BoneCollection * | bcoll ) |
Remove a bone collection from the armature.
Definition at line 709 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_remove_from_index(), and blender::animrig::armature_bonecoll_find_index().
Referenced by bone_collection_create_and_assign_exec(), bone_collection_remove_exec(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
Remove the bone collection at index from the armature.
Definition at line 612 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection_index, ANIM_armature_bonecoll_active_index_set(), ANIM_armature_refresh_solo_active(), blender::animrig::armature_bonecoll_find_parent_index(), blender::animrig::armature_bonecoll_is_child_of(), blender::animrig::armature_bonecoll_move_to_parent(), BLI_assert, BLI_assert_msg, bonecoll_child_number(), blender::animrig::internal::bonecoll_unassign_and_free(), blender::animrig::internal::bonecolls_find_index_near(), blender::animrig::internal::bonecolls_move_to_index(), BoneCollection::child_count, BoneCollection::child_index, bArmature::collection_array, bArmature::collection_array_num, bArmature::collection_root_count, and bArmature::runtime.
Referenced by ANIM_armature_bonecoll_remove().
| void ANIM_armature_bonecoll_show_all | ( | bArmature * | armature | ) |
Definition at line 1026 of file animrig/intern/bone_collections.cc.
References ANIM_bonecoll_show().
Referenced by blender::ed::object::modifier_skin_armature_create().
Definition at line 1080 of file animrig/intern/bone_collections.cc.
References ANIM_bone_in_visible_collection(), BoneCollectionReference::bcoll, BONE_COLLECTION_VISIBLE, Bone_Runtime::collections, ListBase::first, BoneCollection::flags, and Bone::runtime.
Referenced by ANIM_armature_bonecoll_show_from_pchan().
Definition at line 1095 of file animrig/intern/bone_collections.cc.
References ANIM_bonecoll_is_visible_editbone(), BoneCollectionReference::bcoll, BONE_COLLECTION_VISIBLE, EditBone::bone_collections, ListBase::first, and BoneCollection::flags.
Referenced by blender::ed::object::jump_to_bone().
| void ANIM_armature_bonecoll_show_from_pchan | ( | bArmature * | armature, |
| const bPoseChannel * | pchan ) |
Definition at line 1110 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_show_from_bone(), and bPoseChannel::bone.
Referenced by blender::ed::object::jump_to_bone().
| void ANIM_armature_bonecoll_solo_set | ( | bArmature * | armature, |
| BoneCollection * | bcoll, | ||
| bool | is_solo ) |
Set or clear this bone collection's solo flag.
Definition at line 809 of file animrig/intern/bone_collections.cc.
References ANIM_armature_refresh_solo_active(), ARM_BCOLL_SOLO_ACTIVE, BONE_COLLECTION_SOLO, bArmature::flag, and BoneCollection::flags.
Referenced by blender::animrig::tests::TEST_F().
| bool ANIM_armature_bonecoll_unassign | ( | BoneCollection * | bcoll, |
| Bone * | bone ) |
Definition at line 928 of file animrig/intern/bone_collections.cc.
References BLI_freelinkN(), BoneCollection::bones, Bone_Runtime::collections, LISTBASE_FOREACH_MUTABLE, and Bone::runtime.
Referenced by ANIM_armature_bonecoll_unassign_all(), bone_collection_unassign_exec(), bone_collection_unassign_named_exec(), blender::animrig::internal::bonecoll_unassign_and_free(), and blender::animrig::tests::TEST_F().
| void ANIM_armature_bonecoll_unassign_all | ( | Bone * | bone | ) |
Definition at line 954 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_unassign(), Bone_Runtime::collections, LISTBASE_FOREACH_MUTABLE, and Bone::runtime.
Referenced by ANIM_armature_bonecoll_assign_and_move().
| void ANIM_armature_bonecoll_unassign_all_editbone | ( | EditBone * | ebone | ) |
Definition at line 963 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_unassign_editbone(), EditBone::bone_collections, and LISTBASE_FOREACH_MUTABLE.
Referenced by ANIM_armature_bonecoll_assign_and_move_editbone().
| bool ANIM_armature_bonecoll_unassign_editbone | ( | BoneCollection * | bcoll, |
| EditBone * | ebone ) |
Definition at line 970 of file animrig/intern/bone_collections.cc.
References BLI_freelinkN(), EditBone::bone_collections, and LISTBASE_FOREACH_MUTABLE.
Referenced by ANIM_armature_bonecoll_unassign_all_editbone(), bone_collection_unassign_exec(), bone_collection_unassign_named_exec(), and blender::animrig::internal::bonecoll_unassign_and_free().
| void ANIM_armature_refresh_solo_active | ( | bArmature * | armature | ) |
Refresh the ARM_BCOLL_SOLO_ACTIVE flag.
Definition at line 826 of file animrig/intern/bone_collections.cc.
References ARM_BCOLL_SOLO_ACTIVE, BONE_COLLECTION_SOLO, and bArmature::flag.
Referenced by ANIM_armature_bonecoll_remove_from_index(), and ANIM_armature_bonecoll_solo_set().
| void ANIM_armature_runtime_free | ( | bArmature * | armature | ) |
Free armature & bone runtime data. TODO: move to BKE?
Definition at line 113 of file animrig/intern/bone_collections.cc.
References blender::animrig::ANIM_armature_foreach_bone(), and bArmature::bonebase.
Referenced by ANIM_armature_runtime_refresh(), and armature_free_data().
| void ANIM_armature_runtime_refresh | ( | bArmature * | armature | ) |
Recalculate the armature & bone runtime data.
TODO: move to BKE?
Definition at line 97 of file animrig/intern/bone_collections.cc.
References add_reverse_pointers(), ancestors_visible_update(), ANIM_armature_bonecoll_active_runtime_refresh(), and ANIM_armature_runtime_free().
Referenced by armature_blend_read_data(), armature_copy_data(), ED_armature_join_objects_exec(), and undoarm_to_editarm().
Return true when any of the bone's collections is visible.
Definition at line 1017 of file animrig/intern/bone_collections.cc.
References any_bone_collection_visible(), Bone_Runtime::collections, and Bone::runtime.
Referenced by add_verts_to_dgroups(), ANIM_armature_bonecoll_show_from_bone(), ANIM_bone_is_visible(), ANIM_bonecoll_is_visible_actbone(), ANIM_bonecoll_is_visible_pchan(), armature_bone_transflags_update_recursive(), BKE_pose_channel_active(), BKE_pose_is_bonecoll_visible(), dgroup_skinnable_cb(), hide_pose_bone_fn(), set_pose_keys(), and show_pose_bone_cb().
| void ANIM_bonecoll_free | ( | BoneCollection * | bcoll, |
| bool | do_id_user_count = true ) |
Free the bone collection.
You don't typically need this function, unless you created a bone collection outside the scope of a bArmature. Normally bone collections are owned (and thus managed) by the armature.
| do_id_user_count | Whether to update user counts for IDs referenced from IDProperties of the bone collection. Needs to be false when freeing an evaluated copy, true otherwise. |
Definition at line 72 of file animrig/intern/bone_collections.cc.
References BLI_assert_msg, BLI_listbase_is_empty(), BoneCollection::bones, IDP_FreeProperty_ex(), and BoneCollection::prop.
Referenced by armature_free_data(), blender::animrig::internal::bonecoll_unassign_and_free(), blender::animrig::tests::TEST(), blender::animrig::tests::TEST(), and blender::animrig::tests::TEST_F().
| void ANIM_bonecoll_hide | ( | bArmature * | armature, |
| BoneCollection * | bcoll ) |
Hide this bone collection.
This marks the bone collection as 'hidden'. This also effectively hides its descendants, regardless of their visibility state.
Definition at line 791 of file animrig/intern/bone_collections.cc.
References ancestors_visible_descendants_update(), and BoneCollection::flags.
Referenced by ANIM_armature_bonecoll_hide_all(), ANIM_armature_bonecoll_is_visible_set(), bc_add_armature_collections(), blender::animrig::tests::TEST_F(), version_bonegroups_to_bonecollections(), and version_bonelayers_to_bonecollections().
Definition at line 1021 of file animrig/intern/bone_collections.cc.
References any_bone_collection_visible(), and EditBone::bone_collections.
Referenced by ANIM_armature_bonecoll_show_from_ebone(), ANIM_bone_is_visible_editbone(), armature_bone_primitive_add_exec(), armature_delete_ebone_cb(), armature_delete_selected_exec(), armature_dissolve_selected_exec(), armature_reveal_exec(), armature_select_mirrored_ex(), armature_tag_select_mirrored(), ED_transverts_create_from_obedit(), getTransformOrientation_ex(), snapArmature(), and v3d_editarmature_buts().
| BoneCollection * ANIM_bonecoll_new | ( | const char * | name | ) |
Construct a new BoneCollection with the given name.
The caller owns the returned pointer.
You don't typically use this function directly, but rather create a bone collection on a bArmature.
Definition at line 53 of file animrig/intern/bone_collections.cc.
References DATA_, BoneCollection::flags, BoneCollection::name, BoneCollection::prop, and STRNCPY_UTF8.
Referenced by ANIM_armature_bonecoll_new(), blender::animrig::tests::TEST(), blender::animrig::tests::TEST(), and blender::animrig::tests::TEST_F().
| void ANIM_bonecoll_show | ( | bArmature * | armature, |
| BoneCollection * | bcoll ) |
Show this bone collection.
This marks the bone collection as 'visible'. Whether it is effectively visible also depends on the visibility state of its ancestors.
Definition at line 785 of file animrig/intern/bone_collections.cc.
References ancestors_visible_descendants_update(), BONE_COLLECTION_VISIBLE, and BoneCollection::flags.
Referenced by ANIM_armature_bonecoll_is_visible_set(), ANIM_armature_bonecoll_show_all(), and bc_add_armature_collections().
|
static |
Definition at line 1000 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_is_visible_effectively(), BLI_listbase_is_empty(), and LISTBASE_FOREACH.
Referenced by ANIM_bone_in_visible_collection(), and ANIM_bonecoll_is_visible_editbone().
|
static |
Definition at line 393 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection, bArmature_Runtime::active_collection_index, bArmature::active_collection_name, and bArmature::runtime.
Referenced by ANIM_armature_bonecoll_active_index_set(), ANIM_armature_bonecoll_active_runtime_refresh(), and ANIM_armature_bonecoll_active_set().
|
static |
Definition at line 1053 of file animrig/intern/bone_collections.cc.
References LISTBASE_FOREACH.
Referenced by ANIM_armature_bonecoll_contains_active_bone().
|
static |
Definition at line 516 of file animrig/intern/bone_collections.cc.
References BoneCollection::child_index, and bArmature::collection_array.
Referenced by ANIM_armature_bonecoll_move_before_after_index(), ANIM_armature_bonecoll_remove_from_index(), and blender::animrig::armature_bonecoll_child_number_find().
|
static |
Ensure the bone collection's name is unique within the armature.
This assumes that the bone collection has already been inserted into the array.
Definition at line 125 of file animrig/intern/bone_collections.cc.
References BLI_uniquename_cb(), DATA_, BoneCollection::name, and STREQ.
Referenced by ANIM_armature_bonecoll_insert_copy_after(), ANIM_armature_bonecoll_name_set(), ANIM_armature_bonecoll_new(), and liboverride_recursively_add_children().
|
static |
Definition at line 197 of file animrig/intern/bone_collections.cc.
References ancestors_visible_update(), BLI_assert_msg, bonecoll_insert_at_index(), BoneCollection::child_count, BoneCollection::child_index, bArmature::collection_array, and bArmature::collection_array_num.
Referenced by ANIM_armature_bonecoll_new(), and liboverride_recursively_add_children().
|
static |
Definition at line 183 of file animrig/intern/bone_collections.cc.
References ancestors_visible_update(), BLI_assert, bonecoll_insert_at_index(), and bArmature::collection_root_count.
Referenced by ANIM_armature_bonecoll_insert_copy_after(), and ANIM_armature_bonecoll_new().
|
static |
Inserts bcoll into armature's array of bone collections at index.
NOTE: the specified index is where the given bone collection will end up. This means, for example, that for a collection array of length N, you can pass N as the index to append to the end.
Definition at line 160 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection_index, ANIM_armature_bonecoll_active_index_set(), BLI_assert, blender::animrig::internal::bonecolls_rotate_block(), bArmature::collection_array, bArmature::collection_array_num, MEM_reallocN_id, and bArmature::runtime.
Referenced by bonecoll_insert_as_child(), and bonecoll_insert_as_root().
|
static |
Definition at line 716 of file animrig/intern/bone_collections.cc.
References STREQ.
Referenced by ANIM_armature_bonecoll_get_by_name(), and blender::animrig::bonecolls_copy_expanded_flag().
|
static |
Copy a BoneCollection to a new armature, updating its internal pointers to point to the new armature.
This only updates the cloned BoneCollection, and does not actually add it to the armature.
Child collections are not taken into account; the returned bone collection is without children, regardless of bcoll_to_copy.
Definition at line 255 of file animrig/intern/bone_collections.cc.
References add_reverse_pointers(), BKE_armature_find_bone_name(), BLI_assert_msg, BLI_duplicatelist(), bArmature::bonehash, BoneCollection::bones, BoneCollection::child_count, BoneCollection::child_index, IDP_CopyProperty_ex(), LISTBASE_FOREACH, MEM_dupallocN, and BoneCollection::prop.
Referenced by ANIM_armature_bonecoll_insert_copy_after(), and liboverride_recursively_add_children().
|
static |
Copy all the child collections of the specified parent, from armature_src to armature_dst.
This assumes that the parent itself has already been copied.
Definition at line 292 of file animrig/intern/bone_collections.cc.
References blender::animrig::armature_bonecoll_find_index(), BLI_assert_msg, bonecoll_ensure_name_unique(), bonecoll_insert_as_child(), BoneCollection::child_count, BoneCollection::child_index, bArmature::collection_array, copy_and_update_ownership(), and liboverride_recursively_add_children().
Referenced by ANIM_armature_bonecoll_insert_copy_after(), and liboverride_recursively_add_children().