Squash and Stretch Dive Roll Sketchfab

http://www.conghal.com/blog/2016/11/18/squash-and-stretch-dive-roll-sketchfab

Alright, I finally figured out how to get animations to work properly on Sketchfab (If the player doesn't work you can try another browser, on my computer it doesn't load on Chrome, but everything else seems to be fine). Basically, I was having problems with shading, lots of vertex normals facing the wrong way, etc. The trick is, just before exporting, to put the mesh in it's bind pose and then lock the normals. The shading will look totally broken and weird in Maya, but it'll be fine in Sketchfab. Or, if you locked your normals before applying the skin, you set 'Deform User Normals' to 'off' in the skinCluster node, which will basically have the same effect re: things looking broken and weird in Maya. 
All of that to say, blam, real time squash and stretch. So, here is the whole thing: game engines don't really like it when you animate with scale, usually it'll skew all of the joints down the chain (i.e. if you stretch an arm joint, the hand will end up looking skewed and broken.). The trick is basically just to have all your squash-able bits skinned to leaf joints, animating the un-skinned hierarchical joints in position and rotation, and only scaling the skinned leaf joints (which do not have any child joints). This can also be combined with leaf-style twist and 'noodle' joints (as it is in this rig), so that you end up with this sort of structure (with the idea being that joints are skinned and pivots are just there for structure, interpolation, etc):


So this is roughly how my hacked version of abAutoRig does squash and stretch, obviously some joints are squishy leaf joints and some aren't. Stretching joints with translation shouldn't cause any problems in an engine, and that is plenty in most cases, so there's no need to replace every single joint with a scale-able leaf joints, the key is getting the major volumes to work, in this case it's the spine, arms, and legs, but not the hands, fingers, head, etc..

Comentários

Mensagens populares