Refactor: Anim, rename BoneCollection::is_visible_effectively()

Rename `BoneCollection::is_visible_effectively()` to
`is_visible_with_ancestors()`. Soon a "solo" flag will be introduced,
and the effective visibility of the bone collection will depend on that
too. This particular function doesn't take that into account, though,
and thus needs a rename.

Note that this does NOT rename the RNA property
`is_visible_effectively`. That will be updated when the "solo" flag is
introduced to also take that into account.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/117414
This commit is contained in:
Sybren A. Stüvel
2024-01-25 16:48:27 +01:00
parent ddd06eeb8f
commit 8a569a8da4
4 changed files with 10 additions and 9 deletions

View File

@@ -738,7 +738,7 @@ static void ancestors_visible_descendants_clear(bArmature *armature, BoneCollect
/** Set or clear #BONE_COLLECTION_ANCESTORS_VISIBLE on all descendants of this bone collection. */
static void ancestors_visible_descendants_update(bArmature *armature, BoneCollection *parent_bcoll)
{
if (!parent_bcoll->is_visible_effectively()) {
if (!parent_bcoll->is_visible_with_ancestors()) {
/* If this bone collection is not visible itself, or any of its ancestors are
* invisible, all descendants have an invisible ancestor. */
ancestors_visible_descendants_clear(armature, parent_bcoll);
@@ -759,7 +759,7 @@ static void ancestors_visible_update(bArmature *armature,
const BoneCollection *parent_bcoll,
BoneCollection *bcoll)
{
if (parent_bcoll == nullptr || parent_bcoll->is_visible_effectively()) {
if (parent_bcoll == nullptr || parent_bcoll->is_visible_with_ancestors()) {
bcoll->flags |= BONE_COLLECTION_ANCESTORS_VISIBLE;
}
else {
@@ -934,7 +934,7 @@ static bool any_bone_collection_visible(const ListBase /*BoneCollectionRef*/ *co
LISTBASE_FOREACH (const BoneCollectionReference *, bcoll_ref, collection_refs) {
const BoneCollection *bcoll = bcoll_ref->bcoll;
if (bcoll->is_visible_effectively()) {
if (bcoll->is_visible_with_ancestors()) {
return true;
}
}

View File

@@ -3182,7 +3182,7 @@ bool BoneCollection::is_visible_ancestors() const
{
return this->flags & BONE_COLLECTION_ANCESTORS_VISIBLE;
}
bool BoneCollection::is_visible_effectively() const
bool BoneCollection::is_visible_with_ancestors() const
{
return this->is_visible() && this->is_visible_ancestors();
}

View File

@@ -279,7 +279,7 @@ typedef struct BoneCollection {
*
* Note that its effective visibility depends on the visibility of its ancestors as well.
*
* \see is_visible_effectively
* \see is_visible_with_ancestors
* \see ANIM_bonecoll_show
* \see ANIM_bonecoll_hide
*/
@@ -288,18 +288,19 @@ typedef struct BoneCollection {
/**
* Return whether this collection's ancestors are visible or not.
*
* \see is_visible_effectively
* \see is_visible_with_ancestors
*/
bool is_visible_ancestors() const;
/**
* Return whether this collection is effectively visible.
* Return whether this collection is visible, taking into account the
* visibility of its ancestors.
*
* \return true when this collection and all its ancestors are visible.
*
* \see is_visible
*/
bool is_visible_effectively() const;
bool is_visible_with_ancestors() const;
#endif
} BoneCollection;

View File

@@ -390,7 +390,7 @@ static void rna_BoneCollection_is_visible_set(PointerRNA *ptr, const bool is_vis
static bool rna_BoneCollection_is_visible_effectively_get(PointerRNA *ptr)
{
const BoneCollection *bcoll = (BoneCollection *)ptr->data;
return bcoll->is_visible_effectively();
return bcoll->is_visible_with_ancestors();
}
static char *rna_BoneCollection_path(const PointerRNA *ptr)