@@ -121,6 +121,36 @@ public class TTMeshPart
121
121
122
122
public Dictionary < string , TTShapePart > ShapeParts = new Dictionary < string , TTShapePart > ( ) ;
123
123
124
+
125
+ /// <summary>
126
+ /// Updates all shapes in this part to any updated UV/Normal/etc. data from the base model.
127
+ /// </summary>
128
+ public void UpdateShapeData ( )
129
+ {
130
+ foreach ( var shpKv in ShapeParts )
131
+ {
132
+ var shp = shpKv . Value ;
133
+
134
+ foreach ( var rKv in shp . VertexReplacements )
135
+ {
136
+ var baseVert = Vertices [ rKv . Key ] ;
137
+ var shapeVert = shp . Vertices [ rKv . Value ] ;
138
+
139
+ shapeVert . Normal = baseVert . Normal ;
140
+ shapeVert . Tangent = baseVert . Tangent ;
141
+ shapeVert . Binormal = baseVert . Binormal ;
142
+ shapeVert . Handedness = baseVert . Handedness ;
143
+ shapeVert . UV1 = baseVert . UV1 ;
144
+ shapeVert . UV2 = baseVert . UV2 ;
145
+
146
+ Array . Copy ( baseVert . VertexColor , shapeVert . VertexColor , 4 ) ;
147
+ Array . Copy ( baseVert . BoneIds , shapeVert . BoneIds , 4 ) ;
148
+ Array . Copy ( baseVert . Weights , shapeVert . Weights , 4 ) ;
149
+
150
+ }
151
+ }
152
+ }
153
+
124
154
}
125
155
126
156
/// <summary>
@@ -385,6 +415,17 @@ public int GetIndexAt(int id)
385
415
386
416
}
387
417
418
+ /// <summary>
419
+ /// Updates all shapes in this mesh group to any updated UV/Normal/etc. data from the base model.
420
+ /// </summary>
421
+ public void UpdateShapeData ( )
422
+ {
423
+ foreach ( var p in Parts )
424
+ {
425
+ p . UpdateShapeData ( ) ;
426
+ }
427
+ }
428
+
388
429
/// <summary>
389
430
/// When stacked together, this is the list of points which the Triangle Index pointer would start for each part.
390
431
/// </summary>
@@ -1945,6 +1986,18 @@ public static TTModel FromRaw(XivMdl rawMdl, Action<bool, string> loggingFunctio
1945
1986
return ttModel ;
1946
1987
}
1947
1988
1989
+
1990
+ /// <summary>
1991
+ /// Updates all shapes in this model to any updated UV/Normal/etc. data from the base model.
1992
+ /// </summary>
1993
+ public void UpdateShapeData ( )
1994
+ {
1995
+ foreach ( var m in MeshGroups )
1996
+ {
1997
+ m . UpdateShapeData ( ) ;
1998
+ }
1999
+ }
2000
+
1948
2001
#endregion
1949
2002
1950
2003
#region Internal Helper Functions
0 commit comments