Fix Tracy even regression crash on anim graph tick

This commit is contained in:
Wojtek Figat
2021-09-01 14:43:38 +02:00
parent 8c9a0b2b2f
commit 86c7ad2b2c

View File

@@ -56,16 +56,17 @@ void AnimationsSystem::Job(int32 index)
auto animatedModel = UpdateList[index];
auto skinnedModel = animatedModel->SkinnedModel.Get();
auto graph = animatedModel->AnimationGraph.Get();
#if COMPILE_WITH_PROFILER && TRACY_ENABLE
const StringView graphName(graph->GetPath());
ZoneName(*graphName, graphName.Length());
#endif
if (graph && graph->IsLoaded() && graph->Graph.CanUseWithSkeleton(skinnedModel)
#if USE_EDITOR
&& graph->Graph.Parameters.Count() == animatedModel->GraphInstance.Parameters.Count() // It may happen in editor so just add safe check to prevent any crashes
#endif
)
{
#if COMPILE_WITH_PROFILER && TRACY_ENABLE
const StringView graphName(graph->GetPath());
ZoneName(*graphName, graphName.Length());
#endif
// Prepare skinning data
animatedModel->SetupSkinningData();