D2 log 039 – Collision shapes, pt.2

My custom shape editor has been a great tool for making Box2D collision meshes. Except I never used it. It was WAY too much work. I just kept putting it off, telling myself that the default boxes would be fine “for now”.

So I ditched it (all 400 lines of it) and decided to use some more Blender scripting to simplify my workflow.

I extended my export script to look for a mesh named “Collision” attached to each object. If found, it reads its vertex coordinates (x,y) and writes them into a file.

Took a while to match the camera transform correctly but now I can edit all the shapes directly in Blender!

Collision shape in Blender Collision shape in game