Skip to content

Commit a963663

Browse files
committed
don't reset destination node
- could cause issues with bind pose - minor fixes to code
1 parent f5baa22 commit a963663

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ private void TransferMotion(Transform source, Transform dest, float sampleRate,
19971997
RemoveTransformCurves (ref destUnityCurves);
19981998

19991999
unityCurves [source.gameObject] = sourceUnityCurves;
2000-
if (destUnityCurves.Count == 0) {
2000+
if (!unityCurves.ContainsKey(dest.gameObject)) {
20012001
unityCurves.Add (dest.gameObject, newUnityCurves);
20022002
return;
20032003
}
@@ -2028,7 +2028,7 @@ private Matrix4x4 GetTransformMatrix(float currSampleTime, Transform orig, List<
20282028
var sourceScale = orig.localScale;
20292029

20302030
foreach (var uniCurve in unityCurves) {
2031-
float currSampleValue = uniCurve.uniAnimCurve.Evaluate((float)currSampleTime);
2031+
float currSampleValue = uniCurve.uniAnimCurve.Evaluate(currSampleTime);
20322032
string propName = uniCurve.propertyName;
20332033
// try position, scale, quat then euler
20342034
int temp = QuaternionCurve.GetQuaternionIndex(propName);
@@ -2307,7 +2307,8 @@ private bool ResetTransform(Transform t){
23072307
var source = ExportOptions.AnimationSource;
23082308
var dest = ExportOptions.AnimationDest;
23092309

2310-
var curr = dest;
2310+
// don't want to reset destination, if it's a bone this could cause issues with the skinning
2311+
var curr = dest.parent;
23112312
while (curr != source && curr != null) {
23122313
if (t == curr) {
23132314
return true;

0 commit comments

Comments
 (0)