Blender script: Limit bone count and normalize weights

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
OGRE Team Member
OGRE Team Member
Posts: 4692
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1020

Blender script: Limit bone count and normalize weights

Post by dark_sylinc »

Hi all!

I'm surprised a script like this doesn't exist.
We all know Ogre has a bone count limit of 4 bones per vertex, and for a few reasons, the sum of all weights should be 1.
These limitations (i.e. the 4 bone per vertex) may be automatically handled inside the engine, but it may affect the animation which comes as a surprise.

Most importantly, I have other engine/performance restrictions (i.e. max limit = 2) and fixing them with thousands of vertices is hell.

I wrote a script (attached) for Blender 2.49b that will remove extra bones with lowest weights, and will additionally normalize all weights.
Hope you enjoy!

Dark Sylinc

PS: Released under GPL v3. Instructions inside the script as comments
(1.65 KiB) Downloaded 265 times
Post Reply