GetClipCount always 0

Hi All

Iam importing a scene which has animations, and when I add the objects to a scene and play sure enough they animate, but when I use animation.GetClipCount() it always returns 0.

	void OnPostprocessModel(GameObject go)
	{
		int count = go.animation.GetClipCount();
		Debug.Log("Anim count " + count);
	}

Can anyone point out what Iam doing wrong? Iam trying to split up the main imported animation at import time into 4 equal length clipsso they show up as clips in the inspector but I just cant seem to find the original animationclip.
Thanks
Chris

Is the value of GetClipCount correct at runtime? I suppose it could be that GetClipCount is still invalid at the postprocessing stage.

I would suspect that it calls onPostProcess for your model before loading animations. I can’t verify that right now, because I’m not at work (it’s a “fake holliday” in my country :))

Try using onPostProcessAllModels (or something like that) - it might work better.