This commit is contained in:
Segey Lapin
2021-10-26 21:51:45 +03:00
commit d6c8a24f5a
58 changed files with 271059 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
tool
extends EditorScenePostImport
func post_import(scene):
var queue = [scene]
while queue.size() > 0:
var item = queue.pop_front()
if item is MeshInstance:
if item.name == "car_base":
var shape = item.mesh.create_convex_shape()
var cs = CollisionShape.new()
cs.shape = shape
cs.name = item.name + "_shape"
scene.add_child(cs)
cs.owner = scene
print("generated collision shape")
break
for e in item.get_children():
queue.push_back(e)
return scene