Is there any way to extract curves from custom properties
It seems OnPostprocessGameObjectWithUserProperties only retrieves the very first value of a curve
Does AnimationUtility contain what you’re looking for?
Thanks for the reply. It doesn’t hold the solution.
I just wrote a python reader that dumps the data to binary and a c# read that converts it to a unity curve. Can’t believe I had to do that.
in OnPostprocessModel:
foreach (var clip in Object.FindObjectsOfType<AnimationClip>())
{
Debug.Log("clip " + clip.name);
var curveBindings = UnityEditor.AnimationUtility.GetCurveBindings(clip);
foreach (var curveBinding in curveBindings)
{
var editorCurve = UnityEditor.AnimationUtility.GetEditorCurve(clip, curveBinding);
Debug.Log(editorCurve.length);
foreach (var key in editorCurve.keys)
{
Debug.Log("\t" + key.time + ",\t " + key.value);
}
}
}
This should give you all curves including custom properties and all of their keys. Code is rough and you’ll need to filter out any editor preview clips from the model being imported when accessing them this way.
1 Like
This doesn’t work if the clips are stored in a separate bone (not part of the humanoid skeleton)