@@ -35,12 +35,8 @@ public class ModelImportOptions : ICloneable
35
35
{
36
36
public bool CopyAttributes { get ; set ; }
37
37
public bool CopyMaterials { get ; set ; }
38
- public bool UseOriginalShapeData { get ; set ; }
39
38
public bool ShiftImportUV { get ; set ; }
40
- public bool ClearUV2 { get ; set ; }
41
39
public bool CloneUV2 { get ; set ; }
42
- public bool ClearVColor { get ; set ; }
43
- public bool ClearVAlpha { get ; set ; }
44
40
public bool AutoScale { get ; set ; }
45
41
public bool UseImportedTangents { get ; set ; }
46
42
public XivRace SourceRace { get ; set ; }
@@ -75,13 +71,9 @@ public ModelImportOptions()
75
71
{
76
72
CopyAttributes = true ;
77
73
CopyMaterials = true ;
78
- UseOriginalShapeData = false ;
79
74
UseImportedTangents = false ;
80
75
ShiftImportUV = true ;
81
- ClearUV2 = false ;
82
76
CloneUV2 = false ;
83
- ClearVColor = false ;
84
- ClearVAlpha = false ;
85
77
AutoScale = true ;
86
78
ValidateMaterials = true ;
87
79
SourceRace = XivRace . All_Races ;
@@ -133,26 +125,11 @@ public async Task Apply(TTModel ttModel, XivMdl currentMdl = null, XivMdl origin
133
125
ModelModifiers . MergeMaterialData ( ttModel , currentMdl , LoggingFunction ) ;
134
126
}
135
127
136
- if ( ClearUV2 )
137
- {
138
- ModelModifiers . ClearUV2 ( ttModel , LoggingFunction ) ;
139
- }
140
-
141
128
if ( CloneUV2 )
142
129
{
143
130
ModelModifiers . CloneUV2 ( ttModel , LoggingFunction ) ;
144
131
}
145
132
146
- if ( ClearVColor )
147
- {
148
- ModelModifiers . ClearVColor ( ttModel , LoggingFunction ) ;
149
- }
150
-
151
- if ( ClearVAlpha )
152
- {
153
- ModelModifiers . ClearVAlpha ( ttModel , LoggingFunction ) ;
154
- }
155
-
156
133
if ( SourceRace != XivRace . All_Races && SourceRace != TargetRace )
157
134
{
158
135
if ( TargetRace == XivRace . All_Races && currentMdl != null )
@@ -173,24 +150,6 @@ public async Task Apply(TTModel ttModel, XivMdl currentMdl = null, XivMdl origin
173
150
await ModelModifiers . RaceConvertRecursive ( ttModel , TargetRace , SourceRace , LoggingFunction , tx ) ;
174
151
}
175
152
176
- // We need to load the original unmodified model to get the shape data.
177
- if ( UseOriginalShapeData && originalMdl != null )
178
- {
179
- if ( originalMdl == null )
180
- {
181
- throw new Exception ( "Cannot copy settings from null MDL." ) ;
182
- }
183
- ModelModifiers . ClearShapeData ( ttModel , LoggingFunction ) ;
184
- try
185
- {
186
- ModelModifiers . MergeShapeData ( ttModel , originalMdl , LoggingFunction ) ;
187
- }
188
- catch
189
- {
190
- throw new Exception ( "Failed to apply the original shape data.\n This is likely due to changes to the original model without preserving the vertices' order." ) ;
191
- }
192
- }
193
-
194
153
if ( AutoScale && originalMdl != null )
195
154
{
196
155
if ( originalMdl == null )
@@ -988,6 +947,23 @@ public static void ClearUV2_Part(TTMeshPart p)
988
947
}
989
948
UpdateShapeParts ( p ) ;
990
949
}
950
+ public static void ClearFlow_Part ( TTMeshPart p )
951
+ {
952
+ foreach ( var v in p . Vertices )
953
+ {
954
+ v . FlowDirection = Vector3 . Zero ;
955
+ }
956
+ UpdateShapeParts ( p ) ;
957
+ }
958
+
959
+ public static void SetFlow_Part ( TTMeshPart p , Vector2 tangentDirection )
960
+ {
961
+ foreach ( var v in p . Vertices )
962
+ {
963
+ v . FlowDirection = new Vector3 ( v . TangentToWorld ( tangentDirection . ToArray ( ) ) ) ;
964
+ }
965
+ UpdateShapeParts ( p ) ;
966
+ }
991
967
992
968
// Resets Vertex Color to White(c1)/Black(c2)
993
969
public static void ClearVColor ( TTModel model , Action < bool , string > loggingFunction = null )
@@ -1199,7 +1175,9 @@ public static async Task RaceConvertRecursive(TTModel model, XivRace targetRace,
1199
1175
// The model is still added but no deforms are applied
1200
1176
if ( loggingFunction != null )
1201
1177
{
1202
- loggingFunction ( true , "Unable to convert racial model." ) ;
1178
+ loggingFunction ( true , "Unable to convert racial model:" + ex . Message ) ;
1179
+ var tempLog = Path . Combine ( IOUtil . GetFrameworkTempFolder ( ) , "race_convert_log.txt" ) ;
1180
+ File . WriteAllText ( tempLog , ex . StackTrace ) ;
1203
1181
} else
1204
1182
{
1205
1183
throw ;
0 commit comments