Skip to content

Commit 4a87a8d

Browse files
author
Benoit Hudson
committed
uni-42394: don't reset transforms when transfering anim
Viktoria pointed out this piece of code; we were resetting the transform to the identity for the path from the root being exported down to the root being animated. That's made to be bad by the prior commit (and it never quite did what we intended), so I removed that code. It's still possible to reset transforms when exporting but only via the API right now. Maybe we shouldn't?
1 parent 2a2d305 commit 4a87a8d

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,9 +2236,6 @@ protected int ExportTransformHierarchy(
22362236
// Use RSrs as the scaling inheritance instead.
22372237
fbxNode.SetTransformationInheritType (FbxTransform.EInheritType.eInheritRSrs);
22382238

2239-
if (TransformShouldBeReset (unityGo.transform)) {
2240-
exportType = TransformExportType.Reset;
2241-
}
22422239
ExportTransform (unityGo.transform, fbxNode, newCenter, exportType);
22432240

22442241
fbxNodeParent.AddChild (fbxNode);
@@ -2287,35 +2284,6 @@ protected int ExportTransformHierarchy(
22872284
return numObjectsExported;
22882285
}
22892286

2290-
/// <summary>
2291-
/// Checks if the transform should be reset.
2292-
/// Transform should be reset if animation is being transferred, and this transform
2293-
/// is either the animation source, destination, or between these nodes.
2294-
/// </summary>
2295-
/// <returns><c>true</c>, if transform should be reset, <c>false</c> otherwise.</returns>
2296-
/// <param name="t">Transform.</param>
2297-
private bool TransformShouldBeReset(Transform t){
2298-
var source = ExportOptions.AnimationSource;
2299-
var dest = ExportOptions.AnimationDest;
2300-
2301-
if (!source || !dest || source == dest) {
2302-
return false;
2303-
}
2304-
2305-
// don't want to reset destination, if it's a bone this could cause issues with the skinning
2306-
var curr = dest.parent;
2307-
while (curr != source && curr != null) {
2308-
if (t == curr) {
2309-
return true;
2310-
}
2311-
curr = curr.parent;
2312-
}
2313-
if (t == source) {
2314-
return true;
2315-
}
2316-
return false;
2317-
}
2318-
23192287
/// <summary>
23202288
/// Export data containing what to export when
23212289
/// exporting animation only.
@@ -2543,9 +2511,6 @@ private bool ExportGameObjectAndParents(
25432511

25442512
// export regular transform if we are not a bone or failed to export as a bone
25452513
if(!exportedBoneTransform){
2546-
if (TransformShouldBeReset (unityGo.transform)) {
2547-
exportType = TransformExportType.Reset;
2548-
}
25492514
ExportTransform (unityGo.transform, fbxNode, newCenter, exportType);
25502515
}
25512516

0 commit comments

Comments
 (0)