diff --git a/addons/material_maker/main_window.tscn b/addons/material_maker/main_window.tscn index 5541263..71d0015 100644 --- a/addons/material_maker/main_window.tscn +++ b/addons/material_maker/main_window.tscn @@ -2,19 +2,24 @@ [ext_resource path="res://addons/material_maker/main_window.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/library.tscn" type="PackedScene" id=2] -[ext_resource path="res://addons/material_maker/preview.tscn" type="PackedScene" id=3] -[ext_resource path="res://addons/material_maker/panoramas/epping_forest_01.hdr" type="Texture" id=4] +[ext_resource path="res://addons/material_maker/preview/preview.tscn" type="PackedScene" id=3] +[ext_resource path="res://addons/material_maker/preview/panoramas/epping_forest_01.hdr" type="Texture" id=4] [ext_resource path="res://addons/material_maker/widgets/tabs.gd" type="Script" id=5] [ext_resource path="res://addons/material_maker/engine/renderer.tscn" type="PackedScene" id=6] [ext_resource path="res://addons/material_maker/node_factory.gd" type="Script" id=7] -[sub_resource type="PanoramaSky" id=1] +[sub_resource type="PanoramaSky" id=4] resource_local_to_scene = true panorama = ExtResource( 4 ) -[sub_resource type="Environment" id=2] +[sub_resource type="Environment" id=5] background_mode = 2 -background_sky = SubResource( 1 ) +background_sky = SubResource( 4 ) +background_energy = 1.5 +ambient_light_color = Color( 1, 1, 1, 1 ) +ambient_light_energy = 0.32 +tonemap_mode = 2 +tonemap_white = 16.0 [node name="MainWindow" type="Panel"] anchor_right = 1.0 @@ -119,7 +124,7 @@ render_target_update_mode = 0 [node name="Camera" type="Camera" parent="VBoxContainer/HBoxContainer/ProjectsPane/BackgroundPreview/Viewport"] transform = Transform( 1, 0, 0, 0, 0.766044, 0.642788, 0, -0.642788, 0.766044, 0, 2.24976, 2.68115 ) -environment = SubResource( 2 ) +environment = SubResource( 5 ) current = true [node name="Projects" type="Panel" parent="VBoxContainer/HBoxContainer/ProjectsPane"] diff --git a/addons/material_maker/panoramas/epping_forest_01.hdr b/addons/material_maker/preview/panoramas/epping_forest_01.hdr similarity index 100% rename from addons/material_maker/panoramas/epping_forest_01.hdr rename to addons/material_maker/preview/panoramas/epping_forest_01.hdr diff --git a/addons/material_maker/panoramas/moonless_golf.hdr b/addons/material_maker/preview/panoramas/moonless_golf.hdr similarity index 100% rename from addons/material_maker/panoramas/moonless_golf.hdr rename to addons/material_maker/preview/panoramas/moonless_golf.hdr diff --git a/addons/material_maker/preview.gd b/addons/material_maker/preview/preview.gd similarity index 100% rename from addons/material_maker/preview.gd rename to addons/material_maker/preview/preview.gd diff --git a/addons/material_maker/preview.tscn b/addons/material_maker/preview/preview.tscn similarity index 94% rename from addons/material_maker/preview.tscn rename to addons/material_maker/preview/preview.tscn index 331b073..932920e 100644 --- a/addons/material_maker/preview.tscn +++ b/addons/material_maker/preview/preview.tscn @@ -1,7 +1,8 @@ [gd_scene load_steps=6 format=2] -[ext_resource path="res://addons/material_maker/preview.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/preview_3d.tscn" type="PackedScene" id=2] +[ext_resource path="res://addons/material_maker/preview/preview.gd" type="Script" id=1] +[ext_resource path="res://addons/material_maker/preview/preview_3d.tscn" type="PackedScene" id=2] + [sub_resource type="World" id=1] diff --git a/addons/material_maker/preview/preview_3d.tscn b/addons/material_maker/preview/preview_3d.tscn new file mode 100644 index 0000000..b4177d4 --- /dev/null +++ b/addons/material_maker/preview/preview_3d.tscn @@ -0,0 +1,99 @@ +[gd_scene load_steps=12 format=2] + +[ext_resource path="res://addons/material_maker/preview/preview_objects.tscn" type="PackedScene" id=1] +[ext_resource path="res://addons/material_maker/preview/panoramas/moonless_golf.hdr" type="Texture" id=2] +[ext_resource path="res://addons/material_maker/environment.gd" type="Script" id=3] +[ext_resource path="res://addons/material_maker/preview/panoramas/epping_forest_01.hdr" type="Texture" id=4] + +[sub_resource type="PanoramaSky" id=1] +resource_local_to_scene = true +panorama = ExtResource( 2 ) + +[sub_resource type="Environment" id=2] +resource_local_to_scene = true +background_mode = 2 +background_sky = SubResource( 1 ) + +[sub_resource type="Animation" id=3] +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Objects:rotation_degrees") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ] +} + +[sub_resource type="PanoramaSky" id=4] +resource_local_to_scene = true +panorama = ExtResource( 4 ) + +[sub_resource type="Environment" id=5] +background_mode = 2 +background_sky = SubResource( 4 ) +background_energy = 1.5 +ambient_light_color = Color( 1, 1, 1, 1 ) +ambient_light_energy = 0.32 +tonemap_mode = 2 +tonemap_white = 16.0 + +[sub_resource type="CylinderMesh" id=6] +top_radius = 5.0 +bottom_radius = 5.0 +height = 0.5 + +[sub_resource type="SpatialMaterial" id=7] + +[node name="Preview3d" type="Spatial"] + +[node name="Objects" parent="." instance=ExtResource( 1 )] +transform = Transform( -0.799512, 0, 0.60065, 0, 1, 0, -0.60065, 0, -0.799512, 0, 0, 0 ) + +[node name="CameraPivot" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 0.766044, 0.642788, 0, -0.642788, 0.766044, 0, 0, 0 ) + +[node name="Camera" type="Camera" parent="CameraPivot"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3.5 ) +environment = SubResource( 2 ) +current = true + +[node name="RemoteTransform" type="RemoteTransform" parent="CameraPivot/Camera"] +remote_path = NodePath("../../../../../../ProjectsPane/BackgroundPreview/Viewport/Camera") + +[node name="ObjectRotate" type="AnimationPlayer" parent="."] +autoplay = "rotate" +playback_speed = 0.1 +anims/rotate = SubResource( 3 ) + +[node name="Environments" type="Spatial" parent="."] + +[node name="Epping Forest" type="Spatial" parent="Environments"] +visible = false +script = ExtResource( 3 ) +environment = SubResource( 5 ) + +[node name="DirectionalLight" type="DirectionalLight" parent="Environments/Epping Forest"] +transform = Transform( 0.976272, -0.0494319, -0.21083, 0.216548, 0.222856, 0.950496, -8.69534e-009, -0.973597, 0.228272, -5.08826, 21.6274, 5.3744 ) +light_energy = 0.5 +shadow_enabled = true + +[node name="MeshInstance" type="MeshInstance" parent="Environments/Epping Forest"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.3343, 0 ) +visible = false +mesh = SubResource( 6 ) +material/0 = SubResource( 7 ) + +[node name="Moonless Golf" type="Spatial" parent="Environments"] +visible = false +script = ExtResource( 3 ) +environment = SubResource( 2 ) + +[node name="DirectionalLight" type="DirectionalLight" parent="Environments/Moonless Golf"] +transform = Transform( 0.569388, 0.170928, 0.804103, 0.171359, -0.981336, 0.087263, 0.804011, 0.088104, -0.588051, 91.9658, 9.62053, -85.1176 ) +light_energy = 0.2 +shadow_enabled = true diff --git a/addons/material_maker/preview_light.gd b/addons/material_maker/preview/preview_light.gd similarity index 100% rename from addons/material_maker/preview_light.gd rename to addons/material_maker/preview/preview_light.gd diff --git a/addons/material_maker/preview_light.tscn b/addons/material_maker/preview/preview_light.tscn similarity index 92% rename from addons/material_maker/preview_light.tscn rename to addons/material_maker/preview/preview_light.tscn index dc27caf..837b85d 100644 --- a/addons/material_maker/preview_light.tscn +++ b/addons/material_maker/preview/preview_light.tscn @@ -1,6 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://addons/material_maker/preview_light.gd" type="Script" id=1] +[ext_resource path="res://addons/material_maker/preview/preview_light.gd" type="Script" id=1] + [sub_resource type="SphereShape" id=3] radius = 0.332384 diff --git a/addons/material_maker/preview_objects.tscn b/addons/material_maker/preview/preview_objects.tscn similarity index 100% rename from addons/material_maker/preview_objects.tscn rename to addons/material_maker/preview/preview_objects.tscn diff --git a/addons/material_maker/preview_3d.tscn b/addons/material_maker/preview_3d.tscn deleted file mode 100644 index 897f405..0000000 --- a/addons/material_maker/preview_3d.tscn +++ /dev/null @@ -1,88 +0,0 @@ -[gd_scene load_steps=13 format=2] - -[ext_resource path="res://addons/material_maker/preview_objects.tscn" type="PackedScene" id=1] -[ext_resource path="res://addons/material_maker/environment.gd" type="Script" id=2] -[ext_resource path="res://addons/material_maker/panoramas/epping_forest_01.hdr" type="Texture" id=3] -[ext_resource path="res://addons/material_maker/preview_light.tscn" type="PackedScene" id=4] -[ext_resource path="res://addons/material_maker/panoramas/moonless_golf.hdr" type="Texture" id=5] - -[sub_resource type="PanoramaSky" id=3] - -[sub_resource type="Environment" id=4] -background_mode = 2 -background_sky = SubResource( 3 ) -ambient_light_color = Color( 0.992157, 1, 0.709804, 1 ) -ambient_light_energy = 0.3 - -[sub_resource type="Animation" id=5] -loop = true -tracks/0/type = "value" -tracks/0/path = NodePath("Objects:rotation_degrees") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/keys = { -"times": PoolRealArray( 0, 1 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ] -} - -[sub_resource type="PanoramaSky" id=6] -resource_local_to_scene = true -panorama = ExtResource( 3 ) - -[sub_resource type="Environment" id=7] -background_mode = 2 -background_sky = SubResource( 6 ) - -[sub_resource type="PanoramaSky" id=8] -resource_local_to_scene = true -panorama = ExtResource( 5 ) - -[sub_resource type="Environment" id=9] -resource_local_to_scene = true -background_mode = 2 -background_sky = SubResource( 8 ) - -[node name="Preview3d" type="Spatial"] - -[node name="Objects" parent="." instance=ExtResource( 1 )] -transform = Transform( -0.799512, 0, 0.60065, 0, 1, 0, -0.60065, 0, -0.799512, 0, 0, 0 ) - -[node name="CameraPivot" type="Spatial" parent="."] -transform = Transform( 1, 0, 0, 0, 0.766044, 0.642788, 0, -0.642788, 0.766044, 0, 0, 0 ) - -[node name="Camera" type="Camera" parent="CameraPivot"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3.5 ) -environment = SubResource( 4 ) -current = true - -[node name="RemoteTransform" type="RemoteTransform" parent="CameraPivot/Camera"] -remote_path = NodePath("../../../../../../ProjectsPane/BackgroundPreview/Viewport/Camera") - -[node name="ObjectRotate" type="AnimationPlayer" parent="."] -autoplay = "rotate" -playback_speed = 0.1 -anims/rotate = SubResource( 5 ) - -[node name="Environments" type="Spatial" parent="."] - -[node name="Epping Forest" type="Spatial" parent="Environments"] -visible = false -script = ExtResource( 2 ) -environment = SubResource( 7 ) - -[node name="Light" parent="Environments/Epping Forest" instance=ExtResource( 4 )] -transform = Transform( 0.999755, 0.0162074, -0.0150931, 0, 0.681502, 0.731816, 0.0221468, -0.731637, 0.681335, 0.0511079, 4.03913, -2.64581 ) - -[node name="Moonless Golf" type="Spatial" parent="Environments"] -visible = false -script = ExtResource( 2 ) -environment = SubResource( 9 ) - -[node name="Light1" parent="Environments/Moonless Golf" instance=ExtResource( 4 )] - -[node name="Light2" parent="Environments/Moonless Golf" instance=ExtResource( 4 )] -transform = Transform( 0.999755, 0.0162074, -0.0150931, 0, 0.681502, 0.731816, 0.0221468, -0.731637, 0.681335, 2.3608, 3.98251, -2.64581 )