You can get the scripts in a ZIP archive right here: viewtopic.php?f=7&t=5620&p=232622#p232622
(Used to be http://www.alice-dsl.net/wolf.mathwig/tools/py/ -- not anymore though)
Before you do anything, backup your Data folder.
Overview
- lugaru_skel_import.py imports a skeleton and its ragdoll into Blender
- lugaru_skel_merge.py writes the vertex groups of the selected Object into a skeleton
Basic Figure: Body.solid-Body7.solid
Basic Figurelow: Bodylow.solid
Basic Figure wolf: Wolf.solid - Wolf7.solid
Basic Figure wolf low: Wolflow.solid
Skeleton Import
Basic principle
Skeletons in Lugaru consist of vertices.
Each bone is represented by a pair of those vertices.
All vertices of the Body mesh that's animated via a skeleton are associated with some bone.
What I've done is I made it so that each bone is represented by a vertex group.
So if you import a skeleton into Blender, select the skeleton, go into Edit Mode, deselect all vertices, choose one Vertex Group and click Select, you'll see which bone is which vertex group.
Automatic generation of vertex groups
If you have imported a Body.solid into Blender of which you know that the skeleton you're about to import references its vertices, you can select that Object before importing the skeleton. If you do that, vertex groups are automatically generated for you.
So if you've imported Body.solid, go ahead and select it in Object Mode, then choose "File>Import>Lugaru skeletons...". Then choose "Lugaru/Data/Skeleton/Basic Figure".
The skeleton and the ragdoll should appear; the skeleton should be inside the Body mesh, the ragdoll should be located a bit to the right of the Body mesh.
Now, select the Body mesh and go into Edit Mode. Deselect all vertices.
In the Buttons view, choose the Edit panel. You should see something like this:
Choose some vertex group, let's say s0. If you now click "Select" in the Vertex Groups buttongroup, Blender will choose all vertices that are in s0. By default, that's the head of the rabbit.
Skeleton Merge
To merge a Body into a skeleton, select the Body mesh in Blender.
Then, choose "File>Export>Lugaru skeleton merge..."
Choose an existing skeleton from the File system. You should of course choose a skeleton that matches the solid you're modding. See the list above for figuring out which skeleton matches which solid.
I HIGHLY recommend always choosing the original stock skeletons that came with Lugaru. So choose them in this file dialog. As soon as you've got a skeleton that isn't similar in structure to the stock skeleton, you may run into problems in the merging step.
As soon as you click the "Merge with Skeleton" button, the program goes through all vertex groups of the selected mesh and writes the vertex indices inside them into the appropriate bones.
It writes these values into a copy of the skeleton you chose. That copy is named FILENAME_merge, where FILENAME is the name of the file you chose.
All that's left then is exporting the Body, overwriting the Body.solids and the skeletons in your modding Data folder and trying it out.
Making a Body.solid from scratch
The first thing to do is building your mesh in Blender.
Then, DESELECT the mesh in Object mode. You don't want to automatically assign vertex groups.
Import the skeleton.
As you should know by now, the skeleton has vertex groups s0-s14, where each vertex group represents a bone.
Select the skeleton in Object mode. Choose vertex group s0. Do not type it in the box, that would rename the vertex group; pick it from the select thingie (the two arrows left to the textbox).
Switch to edit mode. Deselect all vertices. Click "Select" in the "Vertex Groups" button group.
The bone associated with s0 should light up.
Exit Edit Mode. Select your mesh. Go into Edit Mode.
Make a new vertex group by clicking "New" in the "Vertex Groups" button group.
Name the vertex group s0 by clicking into the textbox and typing it in there.
Select the vertices that should be moved by the bone s0.
Click "Assign" in the "Vertex Groups" button group.
Exit Edit Mode. Select the skeleton. Switch to vertex group s1. Switch to Edit Mode. Deselect all vertices. Click "Select". The bone s1 should light up. Exit Edit Mode. Select your mesh. Enter Edit Mode. Make a new vertex group s1. Select appropriate vertices. Assign.
And so on and so forth.
Once you're done with s0-s14 for your mesh, make sure you haven't forgotten any vertices (go through s0-s14 and click "Select" each time, then choose "Select>Inverse" from the Edit View menu -- then just look at the upper right, where it says how many of all vertices are selected).
If you've assigned all vertices to appropriate vertex groups, you're done.
Go ahead and delete the ragdoll and the skeleton in Object Mode.
Select the mesh in Object mode.
Click "File>Export>Lugaru skeleton merge..."
Choose the skeleton you worked with, click the button.
You're done! Your Body should now work as expected in Lugaru.
So replace the skeleton with your merged skeleton, replace the associated bodies with your new mesh and start the game to test it out.