From 84df34b4dc09f569b3952253f7d5605a6b4e2d15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 06:42:01 +0000 Subject: [PATCH] Fix output pose layer detection to use AdditionalProperties["Name"] instead of node.Name The root node's meaningful identifier "AnimGraph" is stored in the struct's "Name" property (AdditionalProperties["Name"]), not the node's generated Name field (e.g. "AnimGraphNode_Root_0"). Co-authored-by: LoogLong <86428208+LoogLong@users.noreply.github.com> --- FModel/ViewModels/AnimGraphViewModel.cs | 6 ++++-- FModel/Views/AnimGraphViewer.xaml.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/FModel/ViewModels/AnimGraphViewModel.cs b/FModel/ViewModels/AnimGraphViewModel.cs index f1e4061e..5785b3d6 100644 --- a/FModel/ViewModels/AnimGraphViewModel.cs +++ b/FModel/ViewModels/AnimGraphViewModel.cs @@ -215,9 +215,11 @@ public class AnimGraphViewModel /// private static string GetLayerName(List nodes, int index) { - // The final output pose layer contains an AnimGraphNode_Root with Name="AnimGraph" + // The final output pose layer contains an AnimGraphNode_Root whose + // "Name" property (in AdditionalProperties) is set to "AnimGraph" var rootNode = nodes.FirstOrDefault(n => - n.Name.Equals("AnimGraph", StringComparison.OrdinalIgnoreCase)); + n.AdditionalProperties.TryGetValue("Name", out var name) && + name.Equals("AnimGraph", StringComparison.OrdinalIgnoreCase)); if (rootNode != null) return "AnimGraph"; diff --git a/FModel/Views/AnimGraphViewer.xaml.cs b/FModel/Views/AnimGraphViewer.xaml.cs index 773b0044..c6eb207d 100644 --- a/FModel/Views/AnimGraphViewer.xaml.cs +++ b/FModel/Views/AnimGraphViewer.xaml.cs @@ -68,9 +68,11 @@ public partial class AnimGraphViewer return; // Show only the final output pose layer (AnimGraph) initially. - // The root node of the output layer is an AnimGraphNode_Root with Name="AnimGraph". + // The root node of the output layer has a "Name" property set to "AnimGraph" + // in its AdditionalProperties (from the AnimGraphNode_Root struct). var outputLayer = _viewModel.Layers.FirstOrDefault(l => - l.Nodes.Any(n => n.Name.Equals("AnimGraph", StringComparison.OrdinalIgnoreCase))) + l.Nodes.Any(n => n.AdditionalProperties.TryGetValue("Name", out var name) && + name.Equals("AnimGraph", StringComparison.OrdinalIgnoreCase))) ?? _viewModel.Layers[0]; var layersToShow = new[] { outputLayer };