@@ -1869,6 +1869,35 @@ public static void SaveFullToFile(string filePath, XivRace race, List<TTModel> m
1869
1869
}
1870
1870
}
1871
1871
1872
+ // Shape Parts
1873
+ foreach ( var shpKv in p . ShapeParts )
1874
+ {
1875
+ if ( ! shpKv . Key . StartsWith ( "shp_" ) ) continue ;
1876
+ var shp = shpKv . Value ;
1877
+
1878
+ query = @"insert into shape_vertices ( mesh, part, shape, vertex_id, position_x, position_y, position_z)
1879
+ values($mesh, $part, $shape, $vertex_id, $position_x, $position_y, $position_z);" ;
1880
+ using ( var cmd = new SQLiteCommand ( query , db ) )
1881
+ {
1882
+ foreach ( var vKv in shp . VertexReplacements )
1883
+ {
1884
+ var v = shp . Vertices [ vKv . Value ] ;
1885
+ cmd . Parameters . AddWithValue ( "part" , partIdx ) ;
1886
+ cmd . Parameters . AddWithValue ( "mesh" , meshIdx ) ;
1887
+ cmd . Parameters . AddWithValue ( "shape" , shpKv . Key ) ;
1888
+ cmd . Parameters . AddWithValue ( "vertex_id" , vKv . Key ) ;
1889
+
1890
+ cmd . Parameters . AddWithValue ( "position_x" , v . Position . X ) ;
1891
+ cmd . Parameters . AddWithValue ( "position_y" , v . Position . Y ) ;
1892
+ cmd . Parameters . AddWithValue ( "position_z" , v . Position . Z ) ;
1893
+
1894
+
1895
+ cmd . ExecuteScalar ( ) ;
1896
+ vIdx ++ ;
1897
+ }
1898
+ }
1899
+ }
1900
+
1872
1901
partIdx ++ ;
1873
1902
}
1874
1903
@@ -1986,7 +2015,14 @@ public static TTModel FromRaw(XivMdl rawMdl, Action<bool, string> loggingFunctio
1986
2015
ModelModifiers . MergeGeometryData ( ttModel , rawMdl , loggingFunction ) ;
1987
2016
ModelModifiers . MergeAttributeData ( ttModel , rawMdl , loggingFunction ) ;
1988
2017
ModelModifiers . MergeMaterialData ( ttModel , rawMdl , loggingFunction ) ;
1989
- ModelModifiers . MergeShapeData ( ttModel , rawMdl , loggingFunction ) ;
2018
+ try
2019
+ {
2020
+ ModelModifiers . MergeShapeData ( ttModel , rawMdl , loggingFunction ) ;
2021
+ } catch ( Exception ex )
2022
+ {
2023
+ loggingFunction ( true , "Unable to load shape data: " + ex . Message ) ;
2024
+ ModelModifiers . ClearShapeData ( ttModel , loggingFunction ) ;
2025
+ }
1990
2026
ttModel . Source = rawMdl . MdlPath ;
1991
2027
1992
2028
return ttModel ;
0 commit comments