mirror of
https://github.com/4sval/FModel.git
synced 2026-03-23 02:04:26 -05:00
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>
This commit is contained in:
parent
c1962c77be
commit
84df34b4dc
|
|
@ -215,9 +215,11 @@ public class AnimGraphViewModel
|
|||
/// </summary>
|
||||
private static string GetLayerName(List<AnimGraphNode> 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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user