stuff
This commit is contained in:
20
scripts/import/car_import.gd
Normal file
20
scripts/import/car_import.gd
Normal 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
|
||||
14
scripts/import/import_clothes.gd
Normal file
14
scripts/import/import_clothes.gd
Normal 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
|
||||
Reference in New Issue
Block a user