1
$\begingroup$

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).

$\endgroup$

1 Answer 1

1
$\begingroup$

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

$\endgroup$
7
  • $\begingroup$ I ran the script and all of the colliders are still there. Here is the Blender file, with the script included: mediafire.com/file/ctdf26rxzagb5po/core.blend/file $\endgroup$ Jun 8, 2020 at 21:16
  • $\begingroup$ 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 $\endgroup$
    – Gorgious
    Jun 9, 2020 at 6:34
  • $\begingroup$ 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) github.com/aaronfranke/tps-demo/tree/remake $\endgroup$ Jun 9, 2020 at 7:37
  • $\begingroup$ Here is a screenshot. Only a few objects have colliders, including these pipes. I want to get rid of all of them. i.imgur.com/ykobezC.png $\endgroup$ Jun 9, 2020 at 7:39
  • $\begingroup$ 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 ? $\endgroup$
    – Gorgious
    Jun 9, 2020 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.