mirror of
https://github.com/4sval/FModel.git
synced 2026-08-26 03:14:39 -05:00
Fix output pose layer detection to use AnimGraphNode_Root Name="AnimGraph"
The output pose layer is now correctly identified by finding the node whose Name property is "AnimGraph" (stored on AnimGraphNode_Root), instead of incorrectly matching any node with "Root" in ExportType. Co-authored-by: LoogLong <86428208+LoogLong@users.noreply.github.com>
This commit is contained in:
@@ -215,9 +215,9 @@ public class AnimGraphViewModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private static string GetLayerName(List<AnimGraphNode> nodes, int index)
|
private static string GetLayerName(List<AnimGraphNode> nodes, int index)
|
||||||
{
|
{
|
||||||
// Look for a prominent node type to name the layer
|
// The final output pose layer contains an AnimGraphNode_Root with Name="AnimGraph"
|
||||||
var rootNode = nodes.FirstOrDefault(n =>
|
var rootNode = nodes.FirstOrDefault(n =>
|
||||||
n.ExportType.Contains("Root", StringComparison.OrdinalIgnoreCase));
|
n.Name.Equals("AnimGraph", StringComparison.OrdinalIgnoreCase));
|
||||||
if (rootNode != null)
|
if (rootNode != null)
|
||||||
return "AnimGraph";
|
return "AnimGraph";
|
||||||
|
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ public partial class AnimGraphViewer
|
|||||||
if (_viewModel.Layers.Count == 0)
|
if (_viewModel.Layers.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Show only the final output pose layer (AnimGraph) initially
|
// Show only the final output pose layer (AnimGraph) initially.
|
||||||
|
// The root node of the output layer is an AnimGraphNode_Root with Name="AnimGraph".
|
||||||
var outputLayer = _viewModel.Layers.FirstOrDefault(l =>
|
var outputLayer = _viewModel.Layers.FirstOrDefault(l =>
|
||||||
l.Nodes.Any(n => n.ExportType.Contains("Root", StringComparison.OrdinalIgnoreCase) ||
|
l.Nodes.Any(n => n.Name.Equals("AnimGraph", StringComparison.OrdinalIgnoreCase)))
|
||||||
n.ExportType.Contains("Result", StringComparison.OrdinalIgnoreCase)))
|
|
||||||
?? _viewModel.Layers[0];
|
?? _viewModel.Layers[0];
|
||||||
|
|
||||||
var layersToShow = new[] { outputLayer };
|
var layersToShow = new[] { outputLayer };
|
||||||
|
|||||||
Reference in New Issue
Block a user