Fix actor icons drawing in prefab viewport to skip disabled actors

This commit is contained in:
Wojtek Figat
2024-03-18 15:33:01 +01:00
parent 91298fee19
commit e606ccec57

View File

@@ -187,6 +187,8 @@ void ViewportIconsRendererService::DrawIcons(RenderContext& renderContext, Scene
void ViewportIconsRendererService::DrawIcons(RenderContext& renderContext, Actor* actor, Mesh::DrawInfo& draw)
{
if (!actor || !actor->IsActiveInHierarchy())
return;
auto& view = renderContext.View;
const BoundingFrustum frustum = view.Frustum;
Matrix m1, m2, world;
@@ -208,8 +210,7 @@ void ViewportIconsRendererService::DrawIcons(RenderContext& renderContext, Actor
draw.DrawState = &drawState;
draw.Deformation = nullptr;
// Support custom icons through types, but not onces that were added through actors,
// since they cant register while in prefab view anyway
// Support custom icons through types, but not ones that were added through actors, since they cant register while in prefab view anyway
if (ActorTypeToTexture.TryGet(actor->GetTypeHandle(), texture))
{
// Use custom texture