Users browsing this thread: 1 Guest(s)
NDS model + animation => COLLADA converter
#7
I'm glad it's useful! About the __BLEND##___ bones (those are, for example, the really long bones on Roxas's model above that go outside his body)... I'm also not exactly sure! I can tell you what technical feature in the model file makes them necessary, but the purpose they served to the modeler is a mystery to me. They'll only appear is a model uses vertices that are influenced by multiple bones.

Technical explanation follows:

There isn't really an "original rig" for an NSBMD model. The model file contains an array of named object matrices, but they're not connected together in a skeleton or anything (and one object might occur in many places or not at all in the final skeleton). The file also contains rendering commands, which essentially multiply these object matrices together and store them to GPU variables (for example, it might multiply "Root" -> "Torso" -> "LUpperLeg" -> "LLowerLeg" -> "LFoot" together and put it in GPU slot #3). Then before a group of vertices is drawn, the right matrix will be set from the GPU variables (in the last example, before the tris for the left foot are drawn, the matrix from GPU slot #3 would be loaded).

The skeleton is built by tracking which object matrices make up the matrix in a GPU variable and creating joints that will transform the vertices in the same way that running the rendering commands in the model file would. Simply speaking, every factor in a matrix product becomes a joint.

There's also a separate array of unnamed matrices in the model file I called blend matrices because they're used by a weird rendering command that blends matrices together. Specifically, it puts the sum of terms that look like (scalar weight) * (matrix from GPU slot #XXX) * (blend matrix #YYY) into a GPU slot. So if XXX=3 in the example above, you're looking at a matrix like "Root" -> "Torso" -> "LUpperLeg" -> "LLowerLeg" -> "LFoot" -> (blend matrix #YYY) and we need a joint to represent that final factor, and that's where the "__BLENDYYY__" at the leaf comes from. Why there's a command for this (as opposed to just summing terms like (scalar weight) * (matrix from GPU slot #XXX)), I don't know.

(This feature was kind of a pain btw. It was the last thing I needed to get Roxas to work though, which was something like my original goal Smile)
Reply
Thanked by:


Messages In This Thread
RE: NDS model + animation => COLLADA converter - by scurest - 04-06-2017, 04:14 PM

Forum Jump: