Skip to content

Commit

Permalink
Fixed incorrect setup order for character context
Browse files Browse the repository at this point in the history
  • Loading branch information
fLindahl committed Nov 22, 2024
1 parent 8a9bb38 commit 06f57a0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions code/addons/graphicsfeature/managers/graphicsmanager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ RegisterModelEntity(
{
Raytracing::RaytracingContext::RegisterEntity(gid);
}
if (anim.IsValid() && skeleton.IsValid())
{
Characters::CharacterContext::RegisterEntity(gid);
}
Models::ModelContext::Setup(
gid,
res,
Expand All @@ -74,16 +70,17 @@ RegisterModelEntity(
return;
Visibility::ObservableContext::RegisterEntity(gid);
Models::ModelContext::SetTransform(gid, t);
Visibility::ObservableContext::Setup(gid, Visibility::VisibilityEntityType::Model);
if (raytracing && CoreGraphics::RayTracingSupported)
{
Raytracing::RaytracingContext::SetupModel(gid, CoreGraphics::BlasInstanceFlags::NoFlags, 0xFF);
}
if (anim.IsValid() && skeleton.IsValid())
{
Characters::CharacterContext::RegisterEntity(gid);
Characters::CharacterContext::Setup(gid, skeleton, 0, anim, 0, "NONE");
Characters::CharacterContext::PlayClip(gid, nullptr, 0, 0, Characters::EnqueueMode::Replace);
}
Visibility::ObservableContext::Setup(gid, Visibility::VisibilityEntityType::Model);
}
);
}
Expand All @@ -102,6 +99,10 @@ DeregisterModelEntity(Model const* model)
{
Raytracing::RaytracingContext::DeregisterEntity(model->graphicsEntityId);
}
if (Characters::CharacterContext::IsEntityRegistered(model->graphicsEntityId))
{
Characters::CharacterContext::DeregisterEntity(model->graphicsEntityId);
}
if (Visibility::ObservableContext::IsEntityRegistered(model->graphicsEntityId))
{
Visibility::ObservableContext::DeregisterEntity(model->graphicsEntityId);
Expand Down

0 comments on commit 06f57a0

Please sign in to comment.