Skip to content
bartteunis edited this page Feb 17, 2020 · 11 revisions

Blender Rigidbody Exporter

This plugin exports the rigidbody world from a Blender project. It exports to a JSON-based format that closely resembles the structure of the bpy API.

The main goal of this plugin is to have a straightforward and easy-to-use way to export 2D collision shapes for use in GameMaker:Studio.

World info

The plugin exports the scene's gravity as found under Scene > Gravity.

The general simulation parameters found under Scene > Rigid Body World are also exported. These are: time scale, steps per second and solver iterations.

Collision shapes

Mesh

The mesh is the most versatile collision shape and allows several face loops.

What actually gets exported in this case are loop cycles.

More complex shapes

Some models have a very complex shape. The requirement for a polygon shape is that it should be convex. For a more complex concave shape this can be solved by using Mesh > Clean up > Split Concave FacesThis may result in polygon shapes with >8 points. The plugin currently doesn't warn for this or prevent it.

Before Mesh Clean-Up

After Mesh Clean-Up

Convex Hull

The convex hull shape generates a new mesh shape that surrounds the mesh while being convex in shape. To achieve this, the plugin first makes a copy of the current mesh and applies the Vertices> Convex Hull operator on it, then cuts the vertices using Tools > Knife Project with the Cut Through option enabled.

Cone, Cylinder, Capsule, Sphere

These all map to a circle shape in 2D.

Box

Corresponds to a box shape in 2D.

Box Shape

Constraints

These correspond to joints in GameMaker:Studio.

  • Fixed - Not really an equivalent joint in GM (Weld joint?)
  • Hinge/Point - Revolute joint
  • Slider - No equivalent
  • Piston - Prismatic
Clone this wiki locally