File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2199,6 +2199,9 @@ protected int ExportTransformHierarchy(
2199
2199
// Use RSrs as the scaling inheritance instead.
2200
2200
fbxNode . SetTransformationInheritType ( FbxTransform . EInheritType . eInheritRSrs ) ;
2201
2201
2202
+ if ( ResetTransform ( unityGo . transform ) ) {
2203
+ exportType = TransformExportType . Reset ;
2204
+ }
2202
2205
ExportTransform ( unityGo . transform , fbxNode , newCenter , exportType ) ;
2203
2206
2204
2207
fbxNodeParent . AddChild ( fbxNode ) ;
@@ -2247,6 +2250,24 @@ protected int ExportTransformHierarchy(
2247
2250
return numObjectsExported ;
2248
2251
}
2249
2252
2253
+
2254
+ private bool ResetTransform ( Transform t ) {
2255
+ var source = ExportOptions . AnimationSource ;
2256
+ var dest = ExportOptions . AnimationDest ;
2257
+
2258
+ var curr = dest ;
2259
+ while ( curr != source && curr != null ) {
2260
+ if ( t == curr ) {
2261
+ return true ;
2262
+ }
2263
+ curr = curr . parent ;
2264
+ }
2265
+ if ( t == source ) {
2266
+ return true ;
2267
+ }
2268
+ return false ;
2269
+ }
2270
+
2250
2271
/// <summary>
2251
2272
/// Export data containing what to export when
2252
2273
/// exporting animation only.
You can’t perform that action at this time.
0 commit comments