7
7
using Fantome . Libraries . League . Helpers . Structures ;
8
8
using Fantome . Libraries . League . IO . SimpleSkinFile ;
9
9
using Fantome . Libraries . League . IO . SkeletonFile ;
10
+ using Fantome . Libraries . League . IO . StaticObjectFile ;
11
+ using Fantome . Libraries . League . IO . WGT ;
10
12
using ImageMagick ;
11
13
12
14
using LeagueAnimation = Fantome . Libraries . League . IO . AnimationFile . Animation ;
@@ -25,7 +27,8 @@ static void Main(string[] args)
25
27
( SimpleSkinOptions opts ) => ConvertSimpleSkin ( opts ) ,
26
28
( SkinnedModelOptions opts ) => ConvertSkinnedModel ( opts ) ,
27
29
( DumpSimpleSkinInfoOptions opts ) => DumpSimpleSkinInfo ( opts ) ,
28
- errors => HandleErrors ( errors )
30
+ ( CreateSimpleSkinFromLegacyOptions opts ) => CreateSimpleSkinFromLegacy ( opts ) ,
31
+ errors => 1
29
32
) ;
30
33
}
31
34
@@ -91,9 +94,22 @@ private static int ConvertSkinnedModel(SkinnedModelOptions opts)
91
94
return 1 ;
92
95
}
93
96
94
- private static int HandleErrors ( IEnumerable < Error > errors )
97
+ private static int CreateSimpleSkinFromLegacy ( CreateSimpleSkinFromLegacyOptions opts )
95
98
{
96
- // dont handle errors cuz uhhhhhhhh idk
99
+ try
100
+ {
101
+ StaticObject staticObject = StaticObject . ReadSCO ( opts . StaticObjectPath ) ;
102
+ WGTFile weightFile = new WGTFile ( opts . WeightFilePath ) ;
103
+ SimpleSkin simpleSkin = new SimpleSkin ( staticObject , weightFile ) ;
104
+
105
+ simpleSkin . Write ( opts . SimpleSkinPath ) ;
106
+ }
107
+ catch ( Exception exception )
108
+ {
109
+ Console . WriteLine ( "Failed to convert Simple Skin to glTF" ) ;
110
+ Console . WriteLine ( exception ) ;
111
+ }
112
+
97
113
return 1 ;
98
114
}
99
115
0 commit comments