Suppose that I have a mesh with model vertices in an “approximately idle” pose (pretend A-pose, which it happens to be modelled in, is very close to the idle animation.)
Is there a way I can gradually blend on the influence of the animation, taking producing an effective transition from “no animation” (i.e. the model looks identical to when rendered with a MeshRenderer, without skinning), to its skinned idle?
Alternatively, is there a way I can generate a “null animation” corresponding to “no animation” on the model (i.e. so that the model is rendered with a SkinnedMeshRenderer identically to with just a regular MeshRenderer?) This would then give us two animations and allow the use of just a regular mechanim transition.
In short, for some reason, I am transitioning from a non-animated mesh to an animated mesh, and want to avoid any “pop” as that happens.
You will have to make your first pose frame of the animation the same pose as the skinned pose - usually T pose, and have the character perform an animation from that pose to whichever other pose you want him to assume.
A null animation pose can be accomplished with a 1 keyframe animation - I think. Essentially the character IS animated, but there is only 1 keyframe in the animation so he never changes the initial pose.
Agreed I could generate an animation in Maya, but I was hoping for a way to generate that one frame in Unity. I suppose I could write a script to copy create keys from every SQT on every bone of the object and generate an animation from that, but last time I did this kind of manual animation/curve/key generation in Unity, it was a suprising amount of code.
To be clear, I don’t want to generate extra FBX input data (because we’ve got thousands of models to do this on, and I don’t want to touch the source data.)
OK - I’m an animator so most of my suggestions will be non-code.
Assuming you have a bunch of animations, and some are in a combined imported fbx, in the inspector when defining a animation cycle keyframe range, you could choose to define a cycle as a 1 keyframe animation (probably the first pose of an animation would be best).
I have not attempted this in Unity so there might be some unintended results, but doesn’t hurt to try. Other than that - I agree, to avoid editing source data, the only other option would be some code solution.
Or - possibly another solution to a ‘null animation’ is to control the time/speed of one animation. To make an animation freeze/stop before transitioning into another animation, or freeze/stop upon transition into the animation. Essentially holding the desired pose until the player hits a button, or you want the animation to progress.