The built in import functions (with import hints) do not support creating RigidBody3Ds with custom collision (only StaticBody3D).
I also happened to want to figure out how to make and use import scripts.
This was a simple enough task. I am sharing my results here.
2 Likes
This is interesting.
I’m working on a plugin in a similar vein, except importing meshes and setting a primitive CollisionShape (cube, sphere etc) sized and centered per the mesh, or multiple mesh’s AABB.
1 Like
There is a blender script I updated as a sister to this one to decompose meshes into convex hulls.
The blender script is forked from another project to update to Blender 4 and add GLTF export. It provides to separate algorithms for decomposing a mesh into convex meshes. V-HCD and CoACD (you need to download these executables from their respective repos).
CoACD does a much better job with anything that has a hole or concave area that is important to preserve.
The GDScript is made for importing the resulting GLB file. It imports the mesh, creates a rigidbody3d for it and creates and attache…
I am currently updating it and adding some functionality.
With it you can use V-HACD (which godot uses) or CoACD (which I prefer). But you can tweak their settings to get better results.
In Godot, I found that writing an import script was easier than making import plugin (although I will try that again sometime).
Anyway, please feel free to make the script your own if there is anything useful to you in it.
1 Like
Thanks i’ll check it out as I use blender also.