HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Adding bones\rigging with mdl editing

11-09-2006, 05:36 PM#1
Nasrudin
Just to give Dao something to play with. I'm looking for a way to add bones, (eventually linking them to a parent bone) and assigning them to a part of the mesh.
11-09-2006, 06:00 PM#2
Rao Dao Zao
Adding bones is easy. Linking to parents is also easy.

Code:
Bone "Bone_Bacon" {
	ObjectId 6,
	ParentId 0, // <--- Linking to parent bone. :)
}

That's all it is.

Adding them in to a mesh is the difficult part, because you have to work on the vertex level; each vertex is assigned a group, and each group has matrices that tell it what bones to follow. To manipulate these effectively, you'd need a graphical interface; it's as simple as that.

But here's how it works anyway.

Code:
	VertexGroup {
		4,
		4,
		4,
		4,
		4,
		4,
		14,
		14,
		14,
		14,
		14,
		...
	}

One of them for every Geoset; and one assignment per vertex, presumably counting them up in line with counting up the actual points/TVertices moving down the MDL. See why I say we need a graphical interface?

Anyway, these point to this section:

Code:
	Groups 16 16 {
		Matrices { 0 }, //Bone_Turret
		Matrices { 1 }, //Bone_Pelvis
		Matrices { 2 }, //Bone_Chest
		Matrices { 3 }, //Bone_Head
		Matrices { 4 }, //Bone_Arm1_R
		Matrices { 5 }, //Bone_Arm1_L
		Matrices { 6 }, //Bone_Arm2_L
		Matrices { 7 }, //Bone_Arm2_R
		Matrices { 8 }, //Bone_Hand_R
		Matrices { 9 }, //Bone_Hand_L
		Matrices { 10 }, //Bone_Leg1_R
		Matrices { 11 }, //Bone_Leg1_L
		Matrices { 12 }, //Bone_Leg2_R
		Matrices { 13 }, //Bone_Leg2_L
		Matrices { 14 }, //Bone_Foot_R
		Matrices { 15 }, //Bone_Foot_L
	}

(Amen to the Guesstsporter for commenting which bones these groups follow.)

Each of the matrices points to one or more bones in the model (bones ONLY).

Therefore, through assigning a vertex to a vertexgroup and assigning a bone to the vertexgroup, you can make geometry do shit.

I do believe that Vertex Modifier has support for modifying groups and matrices, but I have never explored it.

Happy now, Nazza?
11-10-2006, 01:22 PM#3
Nasrudin
I don't think I got it... I need an example to understand what you're saying. Let's say I want to assign the upper vertices of a cube to a new bone. Do I have to make a new vertexgroup?
11-10-2006, 02:40 PM#4
Rao Dao Zao
Yes.

The problem is understanding just which of those arbitrary points are the "upper vertices".
11-10-2006, 03:22 PM#5
Guesst
Warshape it much easier to use than that. You click that fourth blue button, scroll through the bones by pressing ] or [ or something (it's in the readme), and then select whatever vertices you want controlled by that bone. Just look at some Blizzard model for an example of how those are set up. And for adding bones there's that fifth button
11-10-2006, 04:03 PM#6
Nasrudin
One of the problems with warshape is that you must actually drag and click to select the vertices. If the selection doesn't include all the vertices that you need (or more likely, include some others that aren't needed) then you're in throuble. The bone functions also used to screw the parent order, mess with the materials, and cause others random bugs.
11-14-2006, 04:24 PM#7
Nasrudin
Well, I've figured that making vertexgroups is easy enough in the VM (though you can only assign the selected vertices to ONE group), but assigning matrices is still a problem. How am I supposed to know which bones the matrices are pointing to?
11-15-2006, 12:14 AM#8
Guesst
Tools-View Matrices appears to do that. But that matrix interface looks so crude, it would probably be easier to just use notepad. Not for vertexgroups, though.