diff --git a/Editor/AnimationWindow.cpp b/Editor/AnimationWindow.cpp index 7a6914378..f47ae794d 100644 --- a/Editor/AnimationWindow.cpp +++ b/Editor/AnimationWindow.cpp @@ -1071,7 +1071,7 @@ void AnimationWindow::SetEntity(Entity entity) wi::scene::Scene& scene = editor->GetCurrentScene(); AnimationComponent* animation = scene.animations.GetComponent(entity); - if (animation != nullptr || (IsCollapsed() && entity == INVALID_ENTITY)) + if (animation != nullptr || (IsCollapsed() && !scene.Entity_IsDescendant(entity, this->entity))) { this->entity = entity; RefreshKeyframesList(); diff --git a/Editor/ArmatureWindow.cpp b/Editor/ArmatureWindow.cpp index a40317274..0bb9319c6 100644 --- a/Editor/ArmatureWindow.cpp +++ b/Editor/ArmatureWindow.cpp @@ -219,7 +219,7 @@ void ArmatureWindow::SetEntity(Entity entity) const ArmatureComponent* armature = scene.armatures.GetComponent(entity); - if (armature != nullptr || (IsCollapsed() && entity == INVALID_ENTITY)) + if (armature != nullptr || (IsCollapsed() && !scene.Entity_IsDescendant(entity, this->entity))) { this->entity = entity; RefreshBoneList(); diff --git a/Editor/HumanoidWindow.cpp b/Editor/HumanoidWindow.cpp index 54ed0cf2f..bea6c8e24 100644 --- a/Editor/HumanoidWindow.cpp +++ b/Editor/HumanoidWindow.cpp @@ -319,7 +319,7 @@ void HumanoidWindow::SetEntity(Entity entity) ragdollCheckBox.SetCheck(humanoid->IsRagdollPhysicsEnabled()); // this is always force updated } - if (humanoid != nullptr || (IsCollapsed() && entity == INVALID_ENTITY)) + if (humanoid != nullptr || (IsCollapsed() && !scene.Entity_IsDescendant(entity, this->entity))) { if (this->entity != entity) {