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
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3998
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 192
Contact:

Blender script: Limit bone count and normalize weights

Post by dark_sylinc » Tue May 24, 2011 9:57 pm

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!

Cheers
Dark Sylinc

PS: Released under GPL v3. Instructions inside the script as comments
Attachments
TLW_LimitBoneCount_Blender2.49b.py.bz2
(1.65 KiB) Downloaded 253 times
0 x

Post Reply