Add Mesh.create_convex_shapes()
to expose convex decomposition for scripts
#93625
+34
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
Mesh.create_convex_shapes()
functions so scripts can make use of the convex decomposition withMeshConvexDecompositionSettings
parameters.Usage example:
In the past due to all the other engine functions using types that do not work with script bindings the only function exposed for scripting that could work with the
MeshConvexDecompositionSettings
parameters was theMeshInstance3D.create_multiple_convex_collisions(settings)
function changed/added by #72152.That MeshInstance3D function always had the down-side of being an extra node and also creating new StaticBody3D and CollisionShape3D nodes for compatibility instead of just the collision shapes. This caused a number of frequent complains from users that needed convex decomposition of meshes for procedural stuff but were only interested in the resulting shapes, not all the performance costing unneeded extras.