1

I have a large scene made in Blender, where many of the objects have mesh colliders. However, mesh colliders are a bit inefficient compared to using primitives. I would like to get rid of all mesh colliders, so that when I export to a game engine I can manually approximate the collisions using primitives such as cubes, added in-engine.

Is there a way to remove all colliders at once? If not, how do I remove colliders from specific objects? I don't see anything enabled in the "Physics Properties", but the objects still have colliders when imported into a game engine. I'm using Blender 2.83 and Godot 3.2.2 (both are betas).

Aaron Franke
  • 359
  • 6
  • 16

1 Answers1

1

This script removes all colliders from the active view layer :

import bpy

for obj in bpy.context.view_layer.objects:
    if obj.rigid_body:
        bpy.context.view_layer.objects.active = obj
        bpy.ops.rigidbody.object_remove()

How to run a script

Gorgious
  • 30,723
  • 2
  • 44
  • 101
  • I ran the script and all of the colliders are still there. Here is the Blender file, with the script included: http://www.mediafire.com/file/ctdf26rxzagb5po/core.blend/file – Aaron Franke Jun 08 '20 at 21:16
  • Could you add a screenshot in your question about what your mesh colliders are and on which objects they are applied ? I can't find any in your file – Gorgious Jun 09 '20 at 06:34
  • When I export to GLB and import into Godot, there are still colliders that show up. Here is the branch I am working on which includes Blender files, GLB files, and them imported into a Godot project (requires Git LFS) https://github.com/aaronfranke/tps-demo/tree/remake – Aaron Franke Jun 09 '20 at 07:37
  • Here is a screenshot. Only a few objects have colliders, including these pipes. I want to get rid of all of them. https://i.imgur.com/ykobezC.png – Aaron Franke Jun 09 '20 at 07:39
  • Okay so you are not using blender's rigidbody system for your colliders, my bad. I think this should be treated in godot when importing rather than in blender. What add-on do you use to export in GLB format ? – Gorgious Jun 09 '20 at 12:20
  • None, I am using the built-in GLB exporter in Blender 2.83 beta. Godot does not have an import option to remove colliders, and removing them manually is non-trivial. – Aaron Franke Jun 09 '20 at 17:51
  • Alright, sorry I can't help you then :( – Gorgious Jun 09 '20 at 18:02