More Elephants
1,248
7
Advertisement
A super frustrating few days for me trying to track down the skinning corruption on the little elephants. If you look closely at the screenshot from last week, you can see the vertices on the elephant's left shoulders and the top of the right leg are corrupted. Here's a more obvious shot with the shader removed:

Given I'd had a lot of grief in the past trying to correctly support Maya's "jointOrient" (which basically allows each bone in a skeleton to define an arbitrary "local" rotation space), I assumed there must still have been a some matrix or attribute I'd overlooked. I pulled the whole skeleton/skin export code apart and rebuilt all the matrix maths from scratch. After checking I'd correct exported the Maya joint matrices properly, I did the same thing to my runtime Skeletal animation and skinning code. After pouring through MBs of log files ... everything looked like it should have been fine.
So I started doing what I should have done right at the start. I removed parts of the model (bones, attached meshes, shaders) trying to build the simplest scene I could that still showed the problem. In my experience, this is the fastest way to fix any of these kinds of issues. In this case, the very first thing I did (removing all the bones inside the head ... which should have nothing to do with the arms or legs) made the problem go away. It turns out that despite all the different models I've exported, this is the first model that has skeleton bones that aren't actually used by some of the skin bindings. The runtime code didn't know how to deal with this - so a quick re-write of the exporter to optimise these out, and my little elephants are whole again.
Here's the fixed result with the "good enough" idle animation (click for movie):

Custom exporters can be really nice when they work ... but a huge amount of work when they don't. I'm still glad I have my own Maya integration (as it allows me to attach, configure and wire-up the run time behaviours on the game objects - meaning the behaviour of a game object and the object itself are all saved in a single file, rather than having a second level of "game bindings"), but if you have the option of using a "standard" exporter, it certainly saves a lot of work.
Cheers!

Given I'd had a lot of grief in the past trying to correctly support Maya's "jointOrient" (which basically allows each bone in a skeleton to define an arbitrary "local" rotation space), I assumed there must still have been a some matrix or attribute I'd overlooked. I pulled the whole skeleton/skin export code apart and rebuilt all the matrix maths from scratch. After checking I'd correct exported the Maya joint matrices properly, I did the same thing to my runtime Skeletal animation and skinning code. After pouring through MBs of log files ... everything looked like it should have been fine.
So I started doing what I should have done right at the start. I removed parts of the model (bones, attached meshes, shaders) trying to build the simplest scene I could that still showed the problem. In my experience, this is the fastest way to fix any of these kinds of issues. In this case, the very first thing I did (removing all the bones inside the head ... which should have nothing to do with the arms or legs) made the problem go away. It turns out that despite all the different models I've exported, this is the first model that has skeleton bones that aren't actually used by some of the skin bindings. The runtime code didn't know how to deal with this - so a quick re-write of the exporter to optimise these out, and my little elephants are whole again.
Here's the fixed result with the "good enough" idle animation (click for movie):

Custom exporters can be really nice when they work ... but a huge amount of work when they don't. I'm still glad I have my own Maya integration (as it allows me to attach, configure and wire-up the run time behaviours on the game objects - meaning the behaviour of a game object and the object itself are all saved in a single file, rather than having a second level of "game bindings"), but if you have the option of using a "standard" exporter, it certainly saves a lot of work.
Cheers!
Advertisement
Advertisement
Advertisement
Discussion