Implemented basic model binding to blueprints.
This commit is contained in:
parent
1cb8a639f3
commit
2aed1dc58b
|
@ -0,0 +1,16 @@
|
|||
[gd_resource type="ImageTexture" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="Image" id=1]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63 ),
|
||||
"format": "RGBAFloat",
|
||||
"height": 1,
|
||||
"mipmaps": false,
|
||||
"width": 8
|
||||
}
|
||||
|
||||
[resource]
|
||||
flags = 0
|
||||
flags = 0
|
||||
image = SubResource( 1 )
|
||||
size = Vector2( 8, 1 )
|
File diff suppressed because one or more lines are too long
39
Main.tscn
39
Main.tscn
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=20 format=2]
|
||||
[gd_scene load_steps=17 format=2]
|
||||
|
||||
[ext_resource path="res://TryingOutSomethingNew.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Node2D.gd" type="Script" id=2]
|
||||
|
@ -6,6 +6,7 @@
|
|||
[ext_resource path="res://addons/summer_day/display/display.gd" type="Script" id=4]
|
||||
[ext_resource path="res://Bullshit/Main.gd" type="Script" id=5]
|
||||
[ext_resource path="res://addons/summer_day/user_interface/canvas/rendering/space_camera.gd" type="Script" id=6]
|
||||
[ext_resource path="res://Bullshit/THIS SHOULD FIX IThoefully.tres" type="Texture" id=7]
|
||||
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type spatial;
|
||||
|
@ -38,21 +39,6 @@ shader = SubResource( 1 )
|
|||
shader_param/albedo = Color( 0.768627, 0.231373, 0.231373, 1 )
|
||||
shader_param/ha = null
|
||||
|
||||
[sub_resource type="Image" id=16]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63 ),
|
||||
"format": "RGBAFloat",
|
||||
"height": 1,
|
||||
"mipmaps": false,
|
||||
"width": 8
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=15]
|
||||
flags = 0
|
||||
flags = 0
|
||||
image = SubResource( 16 )
|
||||
size = Vector2( 8, 1 )
|
||||
|
||||
[sub_resource type="CapsuleMesh" id=5]
|
||||
radius = 0.9
|
||||
mid_height = 2.0
|
||||
|
@ -105,25 +91,10 @@ void fragment() {
|
|||
ALBEDO = texture(table, UV).rgb;
|
||||
}"
|
||||
|
||||
[sub_resource type="Image" id=17]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 128, 62, 0, 0, 0, 0, 154, 153, 25, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63 ),
|
||||
"format": "RGBAFloat",
|
||||
"height": 1,
|
||||
"mipmaps": false,
|
||||
"width": 8
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=18]
|
||||
flags = 0
|
||||
flags = 0
|
||||
image = SubResource( 17 )
|
||||
size = Vector2( 8, 1 )
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=7]
|
||||
shader = SubResource( 6 )
|
||||
shader_param/canvas_transform = Basis( 1.07527, 0, -0.716846, 0, -2, 1, 0, 0, 1 )
|
||||
shader_param/table = SubResource( 18 )
|
||||
shader_param/canvas_transform = Basis( 0.89779, 0.0130737, -0.857315, 0.0243171, -1.66989, 0.724701, 0, 0, 1 )
|
||||
shader_param/table = ExtResource( 7 )
|
||||
|
||||
[sub_resource type="QuadMesh" id=8]
|
||||
|
||||
|
@ -176,7 +147,7 @@ script = ExtResource( 6 )
|
|||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 619.786, 73.103 )
|
||||
texture = SubResource( 15 )
|
||||
texture = ExtResource( 7 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||
|
|
|
@ -5,6 +5,7 @@ extends Resource
|
|||
class_name SummerDayBlueprint
|
||||
|
||||
|
||||
export(PackedScene) var model = null
|
||||
var active = true # Not handled right now.
|
||||
|
||||
|
||||
|
@ -18,3 +19,9 @@ func _create_cell() -> SummerDayCell: # Virtual.
|
|||
|
||||
func _input(event): # Virtual.
|
||||
pass
|
||||
|
||||
|
||||
func get_model() -> PackedScene:
|
||||
if model == null:
|
||||
model = _create_model()
|
||||
return model
|
||||
|
|
|
@ -11,6 +11,11 @@ export(Resource) var scene = _scene_generation()
|
|||
export(Array, Resource) var tracks
|
||||
|
||||
|
||||
func setup_tracks():
|
||||
for track in tracks:
|
||||
emit_signal("track_added", track)
|
||||
|
||||
|
||||
func add_track(blueprint: SummerDayBlueprint):
|
||||
var track = SummerDayTrack.new()
|
||||
track.blueprint = blueprint
|
||||
|
|
|
@ -51,6 +51,7 @@ func _on_SummerDay_document_changed(new_doc):
|
|||
document = new_doc
|
||||
new_doc.connect("track_added",
|
||||
MeshContainer, "_on_Document_add_track")
|
||||
new_doc.setup_tracks()
|
||||
|
||||
|
||||
func _on_SummerDay_scene_changed(new_scene):
|
||||
|
@ -90,7 +91,11 @@ func _on_view_transform_changed(canvas_transform, spatial_transform):
|
|||
Vector3(spatial_transform.y.x, spatial_transform.y.y, 0.0),
|
||||
Vector3(spatial_transform.origin.x, spatial_transform.origin.y, 1.0)
|
||||
)
|
||||
i.get_material().set_shader_param("canvas_transform", basis)
|
||||
if i is MeshInstance:
|
||||
var mat = i.material_override
|
||||
mat.set_shader_param("canvas_transform", basis)
|
||||
else:
|
||||
i.get_material().set_shader_param("canvas_transform", basis)
|
||||
|
||||
|
||||
func _on_canvas_polygon_changed(new_polygon):
|
||||
|
|
|
@ -76,6 +76,7 @@ script = ExtResource( 2 )
|
|||
[node name="Camera" type="Camera" parent="Render/RenderLayer"]
|
||||
projection = 1
|
||||
current = true
|
||||
near = 0.01
|
||||
|
||||
[node name="BorderShadow" type="Polygon2D" parent="Render/RenderLayer" groups=["SummerDayCanvasPolygon"]]
|
||||
material = SubResource( 5 )
|
||||
|
|
|
@ -3,9 +3,8 @@ extends Spatial
|
|||
|
||||
|
||||
func _on_Document_add_track(track: SummerDayTrack):
|
||||
var packed_scene = track.blueprint._create_model()
|
||||
var packed_scene = track.blueprint.get_model()
|
||||
print("I'm winning it")
|
||||
var instance = packed_scene.instance()
|
||||
add_child(instance, true)
|
||||
#instance.name = "THE_BIG"
|
||||
print("pain")
|
||||
|
|
|
@ -1,31 +1,25 @@
|
|||
[gd_resource type="Resource" load_steps=12 format=2]
|
||||
[gd_resource type="Resource" load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://addons/summer_day/data/document/document.gd" type="Script" id=1]
|
||||
[ext_resource path="res://production/test/scene_001.tres" type="Resource" id=2]
|
||||
[ext_resource path="res://addons/summer_day/data/document/cell.gd" type="Script" id=3]
|
||||
[ext_resource path="res://addons/summer_day/data/document/track.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/summer_day/data/blueprint/template_editables/tube.gd" type="Script" id=5]
|
||||
[ext_resource path="res://production/blueprints/mannequin/mannequin.tres" type="Resource" id=6]
|
||||
[ext_resource path="res://production/blueprints/mannequin/mannequin.tres" type="Resource" id=4]
|
||||
[ext_resource path="res://addons/summer_day/data/document/track.gd" type="Script" id=5]
|
||||
[ext_resource path="res://addons/summer_day/data/blueprint/template_editables/tube.gd" type="Script" id=6]
|
||||
|
||||
[sub_resource type="Resource" id=1]
|
||||
script = ExtResource( 5 )
|
||||
script = ExtResource( 6 )
|
||||
|
||||
[sub_resource type="Resource" id=2]
|
||||
script = ExtResource( 5 )
|
||||
script = ExtResource( 3 )
|
||||
editable_list = [ SubResource( 1 ) ]
|
||||
|
||||
[sub_resource type="Resource" id=3]
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[sub_resource type="Resource" id=4]
|
||||
script = ExtResource( 3 )
|
||||
editable_list = [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ) ]
|
||||
|
||||
[sub_resource type="Resource" id=5]
|
||||
script = ExtResource( 4 )
|
||||
blueprint = ExtResource( 6 )
|
||||
cells = [ SubResource( 4 ) ]
|
||||
blueprint = ExtResource( 4 )
|
||||
cells = [ SubResource( 2 ) ]
|
||||
|
||||
[resource]
|
||||
script = ExtResource( 1 )
|
||||
scene = ExtResource( 2 )
|
||||
tracks = [ SubResource( 5 ) ]
|
||||
tracks = [ SubResource( 3 ) ]
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
tool
|
||||
extends SummerDayBlueprint
|
||||
|
||||
|
||||
|
||||
func _setup_editables():
|
||||
editables
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,6 @@
|
|||
[gd_resource type="ShaderMaterial" load_steps=4 format=2]
|
||||
[gd_resource type="ShaderMaterial" load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://Bullshit/THIS SHOULD FIX IThoefully.tres" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type spatial;
|
||||
|
@ -51,22 +53,7 @@ void fragment() {
|
|||
ALBEDO = vec3(0.33, 0.81, 0.95);
|
||||
}"
|
||||
|
||||
[sub_resource type="Image" id=4]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
|
||||
"format": "RGBAFloat",
|
||||
"height": 1,
|
||||
"mipmaps": false,
|
||||
"width": 8
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=3]
|
||||
flags = 0
|
||||
flags = 0
|
||||
image = SubResource( 4 )
|
||||
size = Vector2( 8, 1 )
|
||||
|
||||
[resource]
|
||||
shader = SubResource( 1 )
|
||||
shader_param/canvas_transform = null
|
||||
shader_param/table = SubResource( 3 )
|
||||
shader_param/canvas_transform = Basis( 0.837104, 0, -0.573479, 0, -1.14486, 0.428697, 0, 0, 1 )
|
||||
shader_param/table = ExtResource( 1 )
|
||||
|
|
Loading…
Reference in New Issue
Block a user