Blender V4.3
blender::animrig::internal Namespace Reference

Functions

void rebuild_slot_user_cache (Main &bmain)
 
void bonecolls_rotate_block (bArmature *armature, const int start_index, const int count, const int direction)
 
void bonecolls_move_to_index (bArmature *armature, const int from_index, const int to_index)
 
int bonecolls_find_index_near (bArmature *armature, BoneCollection *bcoll, const int index)
 
void bonecolls_debug_list (const bArmature *armature)
 
void bonecoll_unassign_and_free (bArmature *armature, BoneCollection *bcoll)
 
EvaluationResult evaluate_layer (PointerRNA &animated_id_ptr, Action &owning_action, Layer &layer, const slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context)
 

Detailed Description

Functions declared in bone_collections_internal.hh.

Function Documentation

◆ bonecoll_unassign_and_free()

void blender::animrig::internal::bonecoll_unassign_and_free ( bArmature * armature,
BoneCollection * bcoll )

Unassign all (edit)bones from this bone collection, and free it.

Note that this does NOT take care of updating the collection hierarchy information. See ANIM_armature_bonecoll_remove_from_index and ANIM_armature_bonecoll_remove for that.

Definition at line 1572 of file animrig/intern/bone_collections.cc.

References ANIM_armature_bonecoll_unassign(), ANIM_armature_bonecoll_unassign_editbone(), ANIM_bonecoll_free(), BoneCollection::bones, bArmature::edbo, LISTBASE_FOREACH, and LISTBASE_FOREACH_MUTABLE.

Referenced by ANIM_armature_bonecoll_remove_from_index().

◆ bonecolls_debug_list()

◆ bonecolls_find_index_near()

int blender::animrig::internal::bonecolls_find_index_near ( bArmature * armature,
BoneCollection * bcoll,
int index )

Find the given bone collection in the armature's collections, and return its index.

The bone collection is only searched for at the given index, index+1, and index-1.

If the bone collection cannot be found, -1 is returned.

Definition at line 1534 of file animrig/intern/bone_collections.cc.

References bArmature::collection_array.

Referenced by ANIM_armature_bonecoll_remove_from_index().

◆ bonecolls_move_to_index()

void blender::animrig::internal::bonecolls_move_to_index ( bArmature * armature,
int from_index,
int to_index )

Move a bone collection to another index.

This is implemented via a call to bonecolls_rotate_block, so all the documentation of that function (including its invariants and caveats) applies here too.

Definition at line 1511 of file animrig/intern/bone_collections.cc.

References BLI_assert, and bonecolls_rotate_block().

Referenced by ANIM_armature_bonecoll_move_to_index(), ANIM_armature_bonecoll_remove_from_index(), blender::animrig::armature_bonecoll_child_number_set(), and blender::animrig::armature_bonecoll_move_to_parent().

◆ bonecolls_rotate_block()

void blender::animrig::internal::bonecolls_rotate_block ( bArmature * armature,
int start_index,
int count,
int direction )

Move a block of BoneCollections in the Armature's collections_array, from start_index to start_index + direction.

The move operation is actually implemented as a rotation, so that no BoneCollection* is lost. In other words, one of these operations is performed, depending on direction. Here B indicates an element in the moved block, and X indicates the rotated element.

direction = +1: [. . . X B B B B . . .] -> [. . . B B B B X . . .] direction = -1: [. . . B B B B X . . .] -> [. . . X B B B B . . .]

This function does not alter the length of collections_array. It only performs the rotation, and updates any child_index when they reference elements of the moved block.

It also does not touch any child_count properties of bone collections. Updating those, as well as any references to the rotated element, is the responsibility of the caller.

Parameters
directionMust be either -1 or 1.

Definition at line 1456 of file animrig/intern/bone_collections.cc.

References bArmature_Runtime::active_collection_index, BLI_assert_msg, BoneCollection::child_index, bArmature::collection_array, count, and bArmature::runtime.

Referenced by bonecoll_insert_at_index(), bonecolls_move_to_index(), and blender::animrig::tests::TEST_F().

◆ evaluate_layer()

EvaluationResult blender::animrig::internal::evaluate_layer ( PointerRNA & animated_id_ptr,
Action & owning_action,
Layer & layer,
slot_handle_t slot_handle,
const AnimationEvalContext & anim_eval_context )

Evaluate the animation data on the given layer, for the given slot. This just returns the evaluation result, without taking any other layers, blending, influence, etc. into account.

Definition at line 264 of file evaluation.cc.

References AnimationEvalContext::eval_time, and blender::animrig::evaluate_strip().

Referenced by blender::animrig::evaluate_action(), blender::animrig::tests::AnimationEvaluationTest::evaluate_single_property(), and blender::animrig::tests::TEST_F().

◆ rebuild_slot_user_cache()

void blender::animrig::internal::rebuild_slot_user_cache ( Main & bmain)

Rebuild the SlotRuntime::users cache of all Slots in all Action for a specific bmain.

The reason that all slot users are re-cached at once is two-fold:

  1. Regardless of how many slot caches are rebuilt, this function will need to loop over all IDs anyway.
  2. Deletion of IDs may be hard to detect otherwise. This is a bit of a weak argument, as if this is not implemented properly (i.e. not un-assigning the Action first), the 'dirty' flag will also not be set, and thus a rebuild will not be triggered. In any case, because the rebuild is global, any subsequent call at least ensures correctness even with such bugs.

Definition at line 28 of file action_runtime.cc.

References Main::actions, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_library_foreach_ID_link(), BLI_assert, BLI_assert_msg, ListBase::first, blender::animrig::foreach_action_slot_use(), FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, GS, id_can_have_animdata(), id_type_can_have_animdata(), IDWALK_IGNORE_MISSING_OWNER_ID, IDWALK_READONLY, IDWALK_RECURSE, IDWALK_RET_NOP, IDWALK_RET_STOP_RECURSION, Main::is_action_slot_to_id_map_dirty, LISTBASE_FOREACH, blender::animrig::Action::slot_for_handle(), and blender::animrig::Action::slots().

Referenced by blender::animrig::Slot::users().