diff --git a/MeshIO.FBX/Converters/NodeConverterBase.cs b/MeshIO.FBX/Converters/NodeConverterBase.cs index 893b9ba..998bb28 100644 --- a/MeshIO.FBX/Converters/NodeConverterBase.cs +++ b/MeshIO.FBX/Converters/NodeConverterBase.cs @@ -322,9 +322,6 @@ public Element BuildMaterial(FbxNode node) { switch (n.Name) { - case string value when this._propertiesRegex.IsMatch(n.Name): - properties = this.BuildProperties(n); - break; case "ShadingModel": material.ShadingModel = (string)n.Value; break; @@ -332,7 +329,8 @@ public Element BuildMaterial(FbxNode node) material.MultiLayer = Convert.ToInt32(n.Value); break; default: - this.notify($"Unknow node while building Material:: with name {n.Name}"); + if (!this.isCommonElementField(material, n, properties)) + this.notify($"Unknow node while building Material:: with name {n.Name}"); break; } } @@ -545,7 +543,7 @@ public LayerElement BuildLayerElementUV(FbxNode node) switch (n.Name) { case "UV": - layer.UV = this.arrToXY(this.arrToDoubleArray(n.Value as IEnumerable)); + layer.UV.AddRange(this.arrToXY(this.arrToDoubleArray(n.Value as IEnumerable))); break; case "UVIndex": layer.Indices.AddRange(this.toArr(n.Value as IEnumerable)); @@ -560,6 +558,27 @@ public LayerElement BuildLayerElementUV(FbxNode node) return layer; } + public LayerElement BuildLayerElementSmoothing(FbxNode node) + { + LayerElementSmoothing layer = new LayerElementSmoothing(); + + foreach (FbxNode n in node) + { + switch (n.Name) + { + case "Smoothing": + layer.Smoothing.AddRange(this.toArr(n.Value as IEnumerable)); + break; + default: + if (!this.isCommonLayerField(layer, n)) + this.notify($"Unknow node while building LayerElement with name {n.Name}"); + break; + } + } + + return layer; + } + public LayerElement BuildLayerElementMaterial(FbxNode node) { LayerElementMaterial layer = new LayerElementMaterial(); @@ -762,6 +781,9 @@ private bool isCommonGeometryField(Geometry geometry, FbxNode node, List Smoothing { get; set; } = new List(); + + public LayerElementSmoothing() : base() { } + + public LayerElementSmoothing(Geometry owner) : base(owner) { } } }