Creating a character procedurally?

I’m trying to create a character procedurally. I have already created a geomnode procedurally as explained in the manual. Now I want to convert that into a Character by creating joints and assigning weights manually. (I don’t necessarily have to convert the geomnode, doing everything from scratch is ok, too.)

But I can’t make sense of the Character class, could I get a small primer of what methods I’m looking for? Is this possible at all with the current interface?

Depending on your needs, it might be easier to create a character using the egg interface, which is easier to understand and reasonably well documented, and then using load_egg_file() to turn that egg structure into a renderable node including a Character.

But, if you want to be close to the metal, it is possible to do it directly. You need to create your GeomVertexData with a TransformBlendTable, and a “transform_blend” column that indexes into it, directing each vertex to a transform space. You will populate your TransformBlendTable with a list of VertexTransform pointers in different combinations, each VertexTransform defines a matrix. It might be as simple as a UserVertexTransform, which you can fill on the fly with your own matrix each frame; but it might also be a JointVertexTransform, which indexes into the Character’s internal hierarchy of joints.

For more specifics, look to GeomVertexData::update_animate_vertices(). It might also be helpful to study how the CharacterMaker class (used by the egg loader) constructs these things.


Thanks, that explains a lot. I will try the egg interface first as you suggested, since I bet it’s pretty fast and I don’t need to modify anything once created.