Skip to content

Commit

Permalink
fix: ignore MotionT and MotionQ on animator, can't be resolved for KH…
Browse files Browse the repository at this point in the history
…R_animation, seems to be a magic unity name
  • Loading branch information
marwie committed Jan 19, 2023
1 parent 4b3c5c4 commit 01d9bf4
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,15 @@ private static bool TryFindMemberBinding(EditorCurveBinding binding, PropertyCur
return true;
}

if (binding.type == typeof(Animator))
{
// These seem to be magic names when exporting humanoid animation (?)
if (memberName == "MotionT" || memberName == "MotionQ")
{
return false;
}
}

var member = FindMemberOnTypeIncludingBaseTypes(binding.type, memberName);
if (member is FieldInfo field) prop.propertyType = field.FieldType;
else if (member is PropertyInfo p) prop.propertyType = p.PropertyType;
Expand Down Expand Up @@ -1129,7 +1138,17 @@ bool AddValue(float t)
}
else
{
Debug.LogWarning(null, "Property is animated but can't be exported - Name: " + prop.propertyName + ", Type: " + prop.propertyType + ". Does its target exist? You can enable KHR_animation_pointer export in the Project Settings to export more animated properties.");
switch (prop.propertyName)
{
case "MotionT":
case "MotionQ":
// Ignore
break;
default:
Debug.LogWarning(null, "Property is animated but can't be exported - Name: " + prop.propertyName + ", Type: " + prop.propertyType + ". Does its target exist? You can enable KHR_animation_pointer export in the Project Settings to export more animated properties.");
break;

}
return false;
}
}
Expand Down

0 comments on commit 01d9bf4

Please sign in to comment.