diff --git a/AVA/Common/Editor/AVA_Collider.cs b/AVA/Common/Editor/AVA_Collider.cs index f5c9821..0eb5b91 100644 --- a/AVA/Common/Editor/AVA_Collider.cs +++ b/AVA/Common/Editor/AVA_Collider.cs @@ -37,13 +37,12 @@ public void Process(NNAContext Context, Transform Node, string Name) if(Regex.Match(Name, _Match_Sphere) is var match && match.Success) { Context.AddResultById( - ParseUtil.GetNameComponentId(Node.name), + ParseUtil.GetNameComponentId(Name), BuildSphereCollider(Context, Node, match.Groups["inside_bounds"].Success, float.Parse(match.Groups["radius"].Value[1..]) ) ); - if(Name.Contains("$$")) Node.name = Name[..Name.IndexOf('$')]; return; } } @@ -51,14 +50,13 @@ public void Process(NNAContext Context, Transform Node, string Name) if(Regex.Match(Name, _Match_Capsule) is var match && match.Success) { Context.AddResultById( - ParseUtil.GetNameComponentId(Node.name), + ParseUtil.GetNameComponentId(Name), BuildCapsuleCollider(Context, Node, match.Groups["inside_bounds"].Success, float.Parse(match.Groups["radius"].Value[1..]), float.Parse(match.Groups["height"].Value[1..]) ) ); - if(Name.Contains("$$")) Node.name = Name[..Name.IndexOf('$')]; return; } } @@ -66,10 +64,9 @@ public void Process(NNAContext Context, Transform Node, string Name) if(Regex.Match(Name, _Match_Plane) is var match && match.Success) { Context.AddResultById( - ParseUtil.GetNameComponentId(Node.name), + ParseUtil.GetNameComponentId(Name), BuildPlaneCollider(Context, Node) ); - if(Name.Contains("$$")) Node.name = Name[..Name.IndexOf('$')]; return; } } diff --git a/AVA/VRChat/Editor/Processors/NNA_Twist.cs b/AVA/VRChat/Editor/Processors/NNA_Twist.cs index 95d86f0..22a4660 100644 --- a/AVA/VRChat/Editor/Processors/NNA_Twist.cs +++ b/AVA/VRChat/Editor/Processors/NNA_Twist.cs @@ -51,7 +51,6 @@ public void Process(NNAContext Context, Transform Node, string Name) var converted = CreateVRCTwistBoneConstraint.CreateConstraint(Node, sourceNode, sourceWeight); if(ParseUtil.GetNameComponentId(Node.name) is var componentId && componentId != null) Context.AddResultById(componentId, converted); - Node.name = ParseUtil.GetNodeNameCleaned(Node.name); } } diff --git a/AVA/VRChat/Editor/Processors/VRC_ImposterSettings.cs b/AVA/VRChat/Editor/Processors/VRC_ImposterSettings.cs index 95c2d38..e610a65 100644 --- a/AVA/VRChat/Editor/Processors/VRC_ImposterSettings.cs +++ b/AVA/VRChat/Editor/Processors/VRC_ImposterSettings.cs @@ -31,12 +31,7 @@ public void Process(NNAContext Context, Transform Node, JObject Json) var transformsToIgnore = new List(); foreach(string name in transformsToIgnoreNames) { - Debug.Log("transformsToIgnoreNames"); - Debug.Log(name); - var node = ParseUtil.FindNode(Context.Root.transform, name); - Debug.Log(node); - transformsToIgnore.Add(node); } imposterSettings.transformsToIgnore = transformsToIgnore.ToArray(); diff --git a/NNA/Runtime/NNAConverter.cs b/NNA/Runtime/NNAConverter.cs index 1a5756c..5f1e83a 100644 --- a/NNA/Runtime/NNAConverter.cs +++ b/NNA/Runtime/NNAConverter.cs @@ -40,12 +40,12 @@ public static ImportResult Convert( if(node.name == "$meta") { State.SetNNAMeta(ParseUtil.ParseMetaNode(node, State.Trash)); - State.AddTrash(node); + //State.AddTrash(node); continue; } if(node.name == "$nna") { - State.AddTrash(node); + State.AddTrash(node.GetComponentsInChildren()); continue; } @@ -115,10 +115,16 @@ public static ImportResult Convert( if(selectedProcessor != null) { State.RegisterNameComponent(node, selectedProcessor.Type); + var nameDefinition = node.name; + node.name = ParseUtil.GetNodeNameCleaned(node.name); State.AddProcessorTask(selectedProcessor.Order, new Task(() => { - selectedProcessor.Process(Context, node, node.name); + selectedProcessor.Process(Context, node, nameDefinition); })); } + else + { + State.Errors.Add(new System.AggregateException(new NNAException($"Invalid Name Component: {node.name}", null, node))); + } } // Processor execution. diff --git a/NNA/Runtime/Processors/NNA_Humanoid.cs b/NNA/Runtime/Processors/NNA_Humanoid.cs index eac7403..c834924 100644 --- a/NNA/Runtime/Processors/NNA_Humanoid.cs +++ b/NNA/Runtime/Processors/NNA_Humanoid.cs @@ -50,7 +50,7 @@ public void Process(NNAContext Context, Transform Node, string Name) var locomotionType = match.Groups["digi"].Success ? "digi" : "planti"; var noJaw = match.Groups["no_jaw"].Success; - Node.name = ParseUtil.GetNodeNameCleaned(Node.name); // Get clean node-name before the humanoid avatar is created + //Node.name = ParseUtil.GetNodeNameCleaned(Node.name); // Get clean node-name before the humanoid avatar is created var converted = CreateHumanoidMapping.Create(Context, Node, locomotionType, noJaw); diff --git a/NNA/Runtime/Processors/NNA_Twist.cs b/NNA/Runtime/Processors/NNA_Twist.cs index 306111b..2299d85 100644 --- a/NNA/Runtime/Processors/NNA_Twist.cs +++ b/NNA/Runtime/Processors/NNA_Twist.cs @@ -53,7 +53,6 @@ public void Process(NNAContext Context, Transform Node, string Name) : Node.transform.parent.parent; var constraint = CreateTwistBoneConstraint.CreateConstraint(Node, sourceNode, sourceWeight); if(ParseUtil.GetNameComponentId(Node.name) is var componentId && componentId != null) Context.AddResultById(componentId, constraint); - Node.name = ParseUtil.GetNodeNameCleaned(Node.name); } public static (string SourceName, float Weight, int startIndex) ParseName(Transform Node, string Name)