Blender V5.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 )

◆ 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 1571 of file animrig/intern/bone_collections.cc.

References bonecolls_find_index_near(), blender::bArmature::collection_array, and index.

Referenced by blender::ANIM_armature_bonecoll_remove_from_index(), and bonecolls_find_index_near().

◆ 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 1548 of file animrig/intern/bone_collections.cc.

References blender::BLI_assert(), bonecolls_move_to_index(), and bonecolls_rotate_block().

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

◆ 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 1491 of file animrig/intern/bone_collections.cc.

References blender::bke::bArmature_Runtime::active_collection_index, BLI_assert_msg, bonecolls_rotate_block(), blender::bArmature::collection_array, ELEM, and blender::bArmature::runtime.

Referenced by blender::bonecoll_insert_at_index(), bonecolls_move_to_index(), bonecolls_rotate_block(), 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 301 of file evaluation.cc.

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

Referenced by blender::animrig::evaluate_action(), evaluate_layer(), blender::animrig::tests::AnimationEvaluationTest::evaluate_single_property(), blender::animrig::tests::TEST_F(), 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 blender::Main::actions, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::BLI_assert(), BLI_assert_msg, blender::animrig::foreach_action_slot_use(), FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, blender::GS(), blender::bNodeTree::id, blender::id_can_have_animdata(), blender::id_type_can_have_animdata(), blender::Main::is_action_slot_to_id_map_dirty, blender::bke::node_tree_from_id(), rebuild_slot_user_cache(), blender::animrig::Action::slot_for_handle(), blender::animrig::Action::slots(), and blender::animrig::Slot::users_add().

Referenced by rebuild_slot_user_cache(), and blender::animrig::Slot::users().