52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
[gd_resource type="Resource" load_steps=3 format=2]
|
|
|
|
[ext_resource path="res://production/blueprints/mannequin/mat.tres" type="Material" id=1]
|
|
|
|
[sub_resource type="GDScript" id=1]
|
|
script/source = "tool
|
|
extends SummerDayBlueprint
|
|
|
|
|
|
export(Resource) var custom_material
|
|
var table: Image
|
|
var model: PackedScene = null
|
|
|
|
|
|
func _create_model():
|
|
if model == null:
|
|
var caps = CapsuleMesh.new()
|
|
var arr_mesh := ArrayMesh.new()
|
|
arr_mesh.add_surface_from_arrays(
|
|
Mesh.PRIMITIVE_TRIANGLES, caps.get_mesh_arrays()
|
|
)
|
|
|
|
var m = MeshInstance.new()
|
|
m.material_override = custom_material
|
|
m.add_to_group(\"SummerDaySpatialTransform\")
|
|
m.mesh = arr_mesh
|
|
|
|
table = Image.new()
|
|
table.create(8, 1, false, Image.FORMAT_RGBAF)
|
|
#
|
|
var texture = ImageTexture.new()
|
|
#
|
|
texture.create_from_image(table, 0)
|
|
m.material_override.set_shader_param(\"table\", texture)
|
|
|
|
|
|
model = PackedScene.new()
|
|
var result = model.pack(m)
|
|
return model
|
|
|
|
|
|
func _create_cell():
|
|
var cell = SummerDayCell.new()
|
|
var cylinder = SummerDayEditableTube.new()
|
|
cell.editable_list.append(cylinder)
|
|
return cell
|
|
"
|
|
|
|
[resource]
|
|
script = SubResource( 1 )
|
|
custom_material = ExtResource( 1 )
|