Cleanup: rename BKE_pose_channels_hash_{make => ensure}
Use the term `ensure` since it makes it clear the data is not manipulated if it already exists.
This commit is contained in:
parent
0dde73b4fc
commit
af3eda8185
|
@ -140,7 +140,7 @@ void BKE_pose_channel_free_bbone_cache(struct bPoseChannel_Runtime *runtime);
|
|||
void BKE_pose_channels_free(struct bPose *pose);
|
||||
void BKE_pose_channels_free_ex(struct bPose *pose, bool do_id_user);
|
||||
|
||||
void BKE_pose_channels_hash_make(struct bPose *pose);
|
||||
void BKE_pose_channels_hash_ensure(struct bPose *pose);
|
||||
void BKE_pose_channels_hash_free(struct bPose *pose);
|
||||
|
||||
void BKE_pose_channels_remove(struct Object *ob,
|
||||
|
|
|
@ -815,7 +815,7 @@ void BKE_pose_copy_data_ex(bPose **dst,
|
|||
*/
|
||||
if (outPose->chanbase.first != outPose->chanbase.last) {
|
||||
outPose->chanhash = NULL;
|
||||
BKE_pose_channels_hash_make(outPose);
|
||||
BKE_pose_channels_hash_ensure(outPose);
|
||||
}
|
||||
|
||||
outPose->iksolver = src->iksolver;
|
||||
|
@ -945,7 +945,7 @@ bool BKE_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
|
|||
* Removes the hash for quick lookup of channels, must
|
||||
* be done when adding/removing channels.
|
||||
*/
|
||||
void BKE_pose_channels_hash_make(bPose *pose)
|
||||
void BKE_pose_channels_hash_ensure(bPose *pose)
|
||||
{
|
||||
if (!pose->chanhash) {
|
||||
bPoseChannel *pchan;
|
||||
|
@ -1774,7 +1774,7 @@ void what_does_obaction(Object *ob,
|
|||
* allocation and also will make lookup slower.
|
||||
*/
|
||||
if (pose->chanbase.first != pose->chanbase.last) {
|
||||
BKE_pose_channels_hash_make(pose);
|
||||
BKE_pose_channels_hash_ensure(pose);
|
||||
}
|
||||
if (pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
|
||||
BKE_pose_update_constraint_flags(pose);
|
||||
|
|
|
@ -2562,7 +2562,7 @@ void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, const bool do_id_
|
|||
/* and a check for garbage */
|
||||
BKE_pose_channels_clear_with_null_bone(pose, do_id_user);
|
||||
|
||||
BKE_pose_channels_hash_make(pose);
|
||||
BKE_pose_channels_hash_ensure(pose);
|
||||
|
||||
for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||
/* Find the custom B-Bone handles. */
|
||||
|
|
|
@ -4343,7 +4343,7 @@ void BKE_object_handle_update_ex(Depsgraph *depsgraph,
|
|||
}
|
||||
/* Speed optimization for animation lookups. */
|
||||
if (ob->pose != NULL) {
|
||||
BKE_pose_channels_hash_make(ob->pose);
|
||||
BKE_pose_channels_hash_ensure(ob->pose);
|
||||
if (ob->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
|
||||
BKE_pose_update_constraint_flags(ob->pose);
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object, bool is_object_visible)
|
|||
}
|
||||
/* Speed optimization for animation lookups. */
|
||||
if (object->pose != nullptr) {
|
||||
BKE_pose_channels_hash_make(object->pose);
|
||||
BKE_pose_channels_hash_ensure(object->pose);
|
||||
if (object->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
|
||||
BKE_pose_update_constraint_flags(object->pose);
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object, bool is_object_visibl
|
|||
/* Armature. */
|
||||
build_armature(armature);
|
||||
/* speed optimization for animation lookups */
|
||||
BKE_pose_channels_hash_make(object->pose);
|
||||
BKE_pose_channels_hash_ensure(object->pose);
|
||||
if (object->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
|
||||
BKE_pose_update_constraint_flags(object->pose);
|
||||
}
|
||||
|
|
|
@ -339,7 +339,7 @@ void postEditBoneDuplicate(struct ListBase *editbones, Object *ob)
|
|||
}
|
||||
|
||||
BKE_pose_channels_hash_free(ob->pose);
|
||||
BKE_pose_channels_hash_make(ob->pose);
|
||||
BKE_pose_channels_hash_ensure(ob->pose);
|
||||
|
||||
GHash *name_map = BLI_ghash_str_new(__func__);
|
||||
|
||||
|
|
Loading…
Reference in New Issue