Alright, mecanim keeps giving me really hard time.
But ranting aside. .anim format itself presents another challenge altogether, due to complete lack of documentation on internal workings of mecanim.
Here’s the current problem i have - Animator permits SetBoneLocalRotation. Which is fine, however - .anim (yaml serialization) format itself (humanoid one, not generic/legacy) contains a set of curves which are muscle set tensors such as
…And no way of setting those to animator. Could you, perhaps, provide a table of translating these into direct bone rotations? And also explaining why mecanim is STILL so rigid and under-exposed to scripting, after all this time?
p.s. I mean, I do suspect that you compile animations and state machines into bytecode for sake of speed optimization, but don’t tell me you could’ve not added JIT recompiler for them. This goes completely against every other piece of flexibility unity3d has to offer.
p.p.s. Or is SetBoneLocalRotation for legacy/generics only, and humanoid is completely sealed beyond a rigid wall?
Oh, hey. this is actually useful. however - there is another problem with this - you see - Left Upper Leg In-Out, Left Upper Leg Twist In-Out, Left Lower Leg Stretch - these are not directly compatible with Quaternion rotations. Can you explain how to convert from one to another? like to example. twist in-out for the left side of body is reverse of one in right side of body?
The algorithm to convert from FK pose to muscle pose is complex and needs a lot of data that is not accessible from c#, the easiest way to convert it is to use the HumanPoseHandler
Yes, but what if i’m building a tool to mix animations? I mean sure - i already handle loading, thanks to your post i now fully handle everything. However - i cannot take that prototype outside of unity because you walled off your algorithm.
I mean - does it really matter that you spill out that part of properitary information? it’s still only compliant with unity mecanim. On the other hand it will help me (and potentially anyone else) to build a service system compliant with unity.
Or even - build a better, more open mecanim for unity to begin with and sell it as 3rd party asset (because as I’ve mentioned - rigidness is awfull)
p.s. and no you don’t go out of work either, since you can suck-in all the improvements into your own system, just like unity3d does with most of the best assets (textmeshpro, ngui), you’re still gonna have support and development role.
We have no plan to publish it and it not because it proprietary information but because it complex and would need a lot of love before it could be published and we simply don’t have the bandwidth for this.
this is all the baked bindings for a clip which tell us which animation curve map to which unity component attribute.
Editor curve like the name imply are not serialized for standalone build, they are all stripped when we do build for the player
Well. this all was successful. Biggest boon of unity3d serialized yaml format is that it can be stripped to bare minimum you require, and rest will be filled with default variables. i’ve been able to build a working .anim exporter. And it works quite alright. So thanks again.
What about importing .anim files at runtime? Is this possible?
(I’ve been googling for a while now and so far the answer appears to be “no”… or at least, not without getting down and dirty with the yaml format, as you have done… but I hope I’m missing something.)
So you just create the anim text file yourself not? I am trying that too.
In this way I can createvthe muscle data, so the anim file parser can parse it