- Home /
Can't set animation curve binding type to custom component
I'm using an AssetPostprocessor to get custom properties on FBX models imported from 3DS MAX, everything is working as expected except for one thing, the curve binding key, I set it to CCharacterIK (a custom component) and in the animation they appear as Mono Behaviour, I tried setting it as SpriteRenderer (a common type in animation) and it works fine.
What am I doing wrong? Is this a bug?
This is the Postprocessor code:
public class CAssetPostprocessor : AssetPostprocessor {
void OnPostprocessGameObjectWithAnimatedUserProperties(GameObject go, EditorCurveBinding[] bindings) {
ClipAnimationInfoCurve[] curves = new ClipAnimationInfoCurve[bindings.Length];
for ( int i = 0; i < bindings.Length; i++ ) {
// Limb weights
EditorCurveBinding binding = bindings[i];
if ( binding.propertyName == "leftFootWeight"
|| binding.propertyName == "rightFootWeight"
|| binding.propertyName == "leftHandWeight"
|| binding.propertyName == "rightHandWeight") {
bindings[i].type = typeof(CCharacterIK);
bindings[i].path = bindings[i].path = "";
}
}
}
}
Your answer
Follow this Question
Related Questions
How do you add AnimClips at import time correctly? 1 Answer
Grab one child of an imported FBX asset 0 Answers
Hooks into further FBX data using AssetPostprocessor 2 Answers
Editing curve binding types on AssetPostprocessor for custom fbx properties not working 3 Answers
Create a Prefab from imported Assets automatically 0 Answers