Using convex decomposition as collider

Godot Version 4.2.1

Question

I have a model I have made in blender.

I have also created a convex decomposition of it in blender.

The model is complex, and the decomposition is made of several convex shapes.

I can export/import the models into Godot. But I cant seem to assign the collision mesh as the shape.

I assume I am just approaching it wrong.

After I create the rigidBody3d and CollisionShape3D, I go to assign a shape to it.

But I cant assign my collision mesh to it. It is looking for a .tres or similar while the engine has imported it as glb.

I assume either my approach is misguided or it is a simple thing I am missing.

Any help would be appreciated, thank you.

You can add a suffix to the objects in Blender that will automatically convert them to the correct Node when imported. More info here Node type customization using name suffixes — Godot Engine (stable) documentation in English

I will try this later tonight.

I apologize I cannot try it right now, so I have a few additional queations.

So, if I understand, I should put -rigid in the name of the mesh for the visual model, and -convcolonly (not -convcol?) in the names of the collision meshes.

Does the hierarchy within blender affect this at all?

Since my collision is several shapes, will it import them seperately, or as one object?

Okay, I have tried to follow this - and tried many variations of it, but don’t quite get the correct results.

For example:

In blender, I created a simple concave test shape. I decomposed it into convex shapes.

In blender, the convex shapes are parented under the original shape and have the “-convcolonly” suffix. For the parent shape, I have tried bot not giving it a suffix and giving it a suffix of “-rigid”.

Regardless, what I get is a scene that

  1. has the original shape as a RigidBody3D
  2. automatically created by Godot (not mine) convex collider (CollisionShape3D).
  3. My custom convex shapes become children that are StaticBody3D, each with the CollisionShape3D corresponding to a custom convex shape.

#2 isnt an issue, as I can easily tell the import process to skip that.

But, the result isnt usable. The main mesh has child static bodies and grandchild collision shapes (which doesnt behave as desired). I think what is needed is the collosion shapes should be direct children of the rigidbody, but that is not what happens.

Can you help me understand what I am missing?

Sorry, it seems that it only works by creating static bodies.

You could try using a EditorScenePostImport script to generate the collision nodes and shapes. You can use Mesh.create_convex_shape() to generate the ConvexPolygonShape3D.