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

View File

@@ -0,0 +1,14 @@
tool
extends EditorScenePostImport
func post_import(scene):
var queue = [scene]
var d = "res://scenes/clothes/"
while queue.size() > 0:
var g = queue.pop_front()
if g is MeshInstance:
ResourceSaver.save(d + g.name + ".mesh", g.mesh)
print("Saving " + d + g.name + ".mesh")
for e in g.get_children():
queue.push_back(e)
return scene