diff --git a/addons/flexible_layout/flexible_dragger.gd b/addons/flexible_layout/flexible_dragger.gd index a69f5d363..a8d4baca0 100644 --- a/addons/flexible_layout/flexible_dragger.gd +++ b/addons/flexible_layout/flexible_dragger.gd @@ -2,7 +2,7 @@ extends Control var dragging : bool = false -var flex_split +var flex_split : WeakRef var dragger_index : int var vertical : bool @@ -10,7 +10,7 @@ func _init(): set_meta("flexlayout", true) func set_split(s, i : int, v : bool): - flex_split = s + flex_split = weakref(s) dragger_index = i vertical = v if vertical: @@ -28,7 +28,7 @@ func _on_gui_input(event): if dragging: if vertical: position.y += event.position.y-5 - flex_split.drag(dragger_index, position.y) + flex_split.get_ref().drag(dragger_index, position.y) else: position.x += event.position.x-5 - flex_split.drag(dragger_index, position.x) + flex_split.get_ref().drag(dragger_index, position.x) diff --git a/addons/flexible_layout/flexible_layout.gd b/addons/flexible_layout/flexible_layout.gd index 0a39e218a..257ff497e 100644 --- a/addons/flexible_layout/flexible_layout.gd +++ b/addons/flexible_layout/flexible_layout.gd @@ -1,25 +1,22 @@ extends Control -class FlexPanel: - var name : String - var widget : Control - - class FlexNode: + extends RefCounted var type : String - var parent : FlexNode = null + var parent : WeakRef var flexible_layout : Control var rect : Rect2 = Rect2(0, 0, 1000, 1000) - func _init(p : FlexNode = null,fl : Control = null): + func _init(p : FlexNode = null, fl : Control = null): type = "FlexNode" - parent = p + parent = weakref(p) flexible_layout = fl func _notification(what): if what == NOTIFICATION_PREDELETE: - print("removing %s!" % type) + print("removing %s (%s)!" % [ self, type ]) + print("Done") func serialize() -> Dictionary: var rv : Dictionary = { type=type, w=rect.size.x, h=rect.size.y, children=[] } @@ -27,6 +24,9 @@ class FlexNode: rv.children.append(c.serialize()) return rv + func deserialize(data : Dictionary): + rect = Rect2(0, 0, data.w, data.h) + func get_children() -> Array[FlexNode]: return [] @@ -46,9 +46,9 @@ class FlexNode: class PanelInfo: var flex_node : FlexNode - var flex_panel : FlexPanel + var flex_panel : Control - func _init(fn : FlexNode, fp : FlexPanel): + func _init(fn : FlexNode, fp : Control): flex_node = fn flex_panel = fp flex_node.flexible_layout.start_drag() @@ -67,9 +67,12 @@ class FlexTop: func _init(fl : Control, c : Control = null): type = "FlexTop" control = c if c else fl - parent = null flexible_layout = fl + func deserialize(data : Dictionary): + super.deserialize(data) + child = flexible_layout.deserialize(self, data.children[0]) + func get_children() -> Array[FlexNode]: if child: return [ child ] @@ -83,7 +86,7 @@ class FlexTop: return false if new_fn: child = new_fn - new_fn.parent = self + new_fn.parent = weakref(self) else: child = null return true @@ -106,11 +109,24 @@ class FlexSplit: super._init(p, fl) type = "FlexSplit" + func _notification(what): + if what == NOTIFICATION_PREDELETE: + for d in draggers: + if is_instance_valid(d): + d.queue_free() + func serialize() -> Dictionary: var rv : Dictionary = super.serialize() rv.dir = "v" if vertical else "h" return rv + func deserialize(data : Dictionary): + super.deserialize(data) + vertical = data.dir == "v" + children.clear() + for c in data.children: + children.append(flexible_layout.deserialize(self, c)) + func get_children() -> Array[FlexNode]: return children @@ -128,7 +144,7 @@ class FlexSplit: ref.rect.size.x /= 2 fn.rect = ref.rect children.insert(index, fn) - fn.parent = self + fn.parent = weakref(self) func replace(fn : FlexNode, new_fn : FlexNode) -> bool: var index : int = children.find(fn) @@ -139,23 +155,22 @@ class FlexSplit: if new_fn: new_fn.rect = fn.rect children.insert(index, new_fn) - new_fn.parent = self + new_fn.parent = weakref(self) if children.size() == 1: - parent.replace(self, children[0]) + parent.get_ref().replace(self, children[0]) children.remove_at(0) for d in draggers: d.queue_free() return true func layout(r : Rect2): - print("Layout FlexSplit (%d children) - %s" % [ children.size(), str(r) ]) + #print("Layout FlexSplit (%d children) - %s" % [ children.size(), str(r) ]) var grip_size : int = 10 rect = r var children_count : int = children.size() var draggers_count : int = draggers.size() if draggers_count < children_count-1: for i in children_count-1-draggers_count: - print("Creating dragger") var dragger = DRAGGER_SCENE.instantiate() draggers.append(dragger) flexible_layout.add_child(dragger) @@ -212,7 +227,6 @@ class FlexSplit: class FlexTab: extends FlexNode - var children : Array[FlexPanel] = [] var tabs : Control const TAB_SCENE = preload("res://addons/flexible_layout/flexible_tabs.tscn") @@ -225,60 +239,72 @@ class FlexTab: flexible_layout.add_child(tabs) tabs.set_flex_tab(self) + func _notification(what): + if what == NOTIFICATION_PREDELETE: + if is_instance_valid(tabs): + tabs.queue_free() + func serialize() -> Dictionary: var rv : Dictionary = super.serialize() rv.tabs = [] - for t in children: + for t in tabs.get_controls(): rv.tabs.append(t.name) rv.current = tabs.current return rv - func add(fp : FlexPanel): - children.push_back(fp) + func deserialize(data : Dictionary): + super.deserialize(data) + for c in data.tabs: + add(flexible_layout.panels[c]) + + func add(fp : Control): tabs.add(fp) - if fp.widget.get_parent() != flexible_layout: - flexible_layout.add_child(fp.widget) + if fp.get_parent() != flexible_layout: + flexible_layout.add_child(fp) - func remove(fp : FlexPanel): - children.erase(fp) + func remove(fp : Control): tabs.erase(fp) - if children.is_empty(): + if tabs.get_controls().is_empty(): tabs.queue_free() - parent.replace(self, null) + parent.get_ref().replace(self, null) - func set_current(fp : FlexPanel): - tabs.set_current(tabs.controls.find(fp)) + func set_current(fp : Control): + tabs.set_current(tabs.get_control_index(fp)) func layout(r : Rect2): - print("Layout FlexTab - "+str(r)) + #print("Layout FlexTab - "+str(r)) rect = r tabs.position = rect.position tabs.size = Vector2i(rect.size.x, 0) var tabs_height : int = tabs.get_combined_minimum_size().y - for c in children: - c.widget.position = rect.position+Vector2(0, tabs.get_combined_minimum_size().y) - c.widget.size = rect.size-Vector2(0, tabs.get_combined_minimum_size().y) + for c in tabs.get_controls(): + c.position = rect.position+Vector2(0, tabs_height) + c.size = rect.size-Vector2(0, tabs_height) class FlexMain: extends FlexNode - var child : FlexPanel = null + var child : Control = null func _init(p : FlexNode = null, fl : Control = null): super._init(p, fl) type = "FlexMain" - func add(fp : FlexPanel): - assert(child == null) + func deserialize(data : Dictionary): + super.deserialize(data) + add(flexible_layout.panels["Main"]) + + func add(fp : Control): + #assert(child == null) child = fp - if fp.widget.get_parent() != flexible_layout: - flexible_layout.add_child(fp.widget) + if fp.get_parent() != flexible_layout: + flexible_layout.add_child(fp) func layout(r : Rect2): - print("Layout FlexNode - "+str(r)) + #print("Layout FlexNode - "+str(r)) rect = r - child.widget.position = rect.position - child.widget.size = rect.size + child.position = rect.position + child.size = rect.size class FlexWindow: @@ -286,7 +312,8 @@ class FlexWindow: var top : FlexTop = null -var unassigned : Array = [] +var unassigned : Array[Control] = [] +var panels : Dictionary = {} var overlay : Control @@ -294,17 +321,38 @@ var overlay : Control const OVERLAY_SCENE = preload("res://addons/flexible_layout/flexible_overlay.tscn") +signal layout_changed + + func _ready(): var children = get_children() for c in children: if c.visible and ! c.has_meta("flexlayout"): add(c.name, c) - await get_tree().process_frame - layout() + +func serialize() -> Dictionary: + return top.serialize() + +func deserialize(parent : FlexNode, data : Dictionary) -> FlexNode: + var fn : FlexNode + match data.type: + "FlexTop": + fn = FlexTop.new(self) + "FlexMain": + fn = FlexMain.new(parent, self) + "FlexSplit": + fn = FlexSplit.new(parent, self) + "FlexTab": + fn = FlexTab.new(parent, self) + _: + print(data.type) + assert(false) + fn.deserialize(data) + return fn func get_flexmain(p : FlexNode = top) -> FlexMain: for c in p.get_children(): - if c is FlexTab: + if c is FlexMain: return c for c in p.get_children(): var rv : FlexMain = get_flexmain(c) @@ -342,35 +390,37 @@ func get_default_flextab(p : FlexNode = top) -> FlexTab: top.child.insert(tab) return tab -func layout(): +func layout(layout = null): var default_flextab : FlexTab = null - print("layout") - if top == null: - print("creating top") + if layout != null: top = FlexTop.new(self) - for fp in unassigned: - if fp.name == "Main": - get_flexmain().add(fp) - else: - if default_flextab == null: - default_flextab = get_default_flextab() - default_flextab.add(fp) - unassigned = [] + print("Deleted?") + top = deserialize(null, layout) + unassigned = [] + else: + if top == null: + top = FlexTop.new(self) + for c in unassigned: + if c.name == "Main": + get_flexmain().add(c) + else: + if default_flextab == null: + default_flextab = get_default_flextab() + default_flextab.add(c) + unassigned = [] top.layout(get_rect()) print("done") func add(n : String, c : Control): - var fp = FlexPanel.new() - fp.name = n - fp.widget = c - unassigned.push_back(fp) + c.name = n + unassigned.push_back(c) + panels[n] = c func _on_resized(): - print("resized") layout() + layout_changed.emit() func start_drag(): - print("Starting drag") overlay = OVERLAY_SCENE.instantiate() overlay.position = Vector2(0, 0) overlay.size = size @@ -384,7 +434,7 @@ func get_flexnode_at(p : Vector2) -> FlexNode: return top.get_flexnode_at(p) func move_panel(panel, reference_panel : FlexNode, destination): - var parent_panel : FlexNode = reference_panel.parent + var parent_panel : FlexNode = reference_panel.parent.get_ref() as FlexNode var vertical : bool var offset : int var tab : FlexTab = null @@ -422,4 +472,5 @@ func move_panel(panel, reference_panel : FlexNode, destination): panel.flex_node.remove(panel.flex_panel) tab.add(panel.flex_panel) layout() - print(top.serialize()) + layout_changed.emit() + diff --git a/addons/flexible_layout/flexible_tab.gd b/addons/flexible_layout/flexible_tab.gd index 1ac9919ee..1581c26c3 100644 --- a/addons/flexible_layout/flexible_tab.gd +++ b/addons/flexible_layout/flexible_tab.gd @@ -1,23 +1,32 @@ extends Container -var flex_panel +var flex_panel : Control -func init(fp): +func _ready(): + $Container/Close.texture_normal = get_theme_icon("close", "TabBar") + +func init(fp : Control): flex_panel = fp $Container/Label.text = flex_panel.name func _draw(): var is_current : bool = (get_index() == get_parent().get_parent().current) draw_style_box(get_theme_stylebox("tab_selected" if is_current else "tab_unselected", "TabBar"), Rect2(Vector2(), size)) - $Container/Undock.visible = is_current + #$Container/Undock.visible = is_current $Container/Close.visible = is_current +func _on_close_pressed(): + var flex_tab = get_parent().get_parent().get_flex_tab() + flex_tab.remove(flex_panel) + flex_tab.flexible_layout.layout() + func _gui_input(event): if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed: get_parent().get_parent().set_current(get_index()) func _get_drag_data(_position): - var flexible_layout = get_parent().get_parent().flex_tab.flexible_layout - return flexible_layout.PanelInfo.new(get_parent().get_parent().flex_tab, flex_panel) + var flex_tab = get_parent().get_parent().get_flex_tab() + var flexible_layout = flex_tab.flexible_layout + return flexible_layout.PanelInfo.new(flex_tab, flex_panel) diff --git a/addons/flexible_layout/flexible_tab.tscn b/addons/flexible_layout/flexible_tab.tscn index c4475741e..3d7c82c94 100644 --- a/addons/flexible_layout/flexible_tab.tscn +++ b/addons/flexible_layout/flexible_tab.tscn @@ -44,3 +44,5 @@ layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 4 texture_normal = SubResource("PlaceholderTexture2D_bok24") + +[connection signal="pressed" from="Container/Close" to="." method="_on_close_pressed"] diff --git a/addons/flexible_layout/flexible_tabs.gd b/addons/flexible_layout/flexible_tabs.gd index c3baaadc1..a3e99fc2b 100644 --- a/addons/flexible_layout/flexible_tabs.gd +++ b/addons/flexible_layout/flexible_tabs.gd @@ -1,44 +1,58 @@ extends Control -var flex_tab -var controls : Array = [] +var flex_tab : WeakRef var current : int = -1 func _init(): set_meta("flexlayout", true) -func add(ft): +func get_controls() -> Array[Control]: + var controls : Array[Control] = [] + for c in $Tabs.get_children(): + controls.append(c.flex_panel) + return controls + +func get_control_index(fp : Control) -> int: + for i in range($Tabs.get_child_count()): + if fp == $Tabs.get_child(i).flex_panel: + return i + return -1 + +func add(ft : Control): var tab = load("res://addons/flexible_layout/flexible_tab.tscn").instantiate() tab.init(ft) $Tabs.add_child(tab) custom_minimum_size.y = $Tabs.get_minimum_size().y - controls.push_back(ft) if current == -1: set_current(0) else: - ft.widget.visible = false + ft.visible = false -func erase(ft): - var index : int = controls.find(ft) +func erase(ft : Control): + var index : int = get_control_index(ft) + if ft.get_parent() != null: + ft.get_parent().remove_child(ft) $Tabs.remove_child($Tabs.get_child(index)) - controls.erase(ft) if index == current: if $Tabs.get_child_count() > 0: set_current(0) else: set_current(-1) +func get_flex_tab(): + return flex_tab.get_ref() + func set_flex_tab(ft): - flex_tab = ft + flex_tab = weakref(ft) func set_current(c : int): current = c - for i in controls.size(): - controls[i].widget.visible = (i == current) + for i in range($Tabs.get_child_count()): + $Tabs.get_child(i).flex_panel.visible = (i == current) $Tabs.get_child(i).queue_redraw() func _on_resized(): - print("%s: %s - %s" % [ str(self), str(position), str(size) ]) + #print("%s: %s - %s" % [ str(self), str(position), str(size) ]) $Tabs.queue_sort() diff --git a/addons/flexible_layout/test.gd b/addons/flexible_layout/test.gd index db343c98f..265919f85 100644 --- a/addons/flexible_layout/test.gd +++ b/addons/flexible_layout/test.gd @@ -3,3 +3,13 @@ extends Control func _ready(): get_window().borderless = false get_window().size = Vector2i(1024, 768) + var file : FileAccess = FileAccess.open("res://addons/flexible_layout/layout.json", FileAccess.READ) + if file: + var layout : Dictionary = JSON.parse_string(file.get_as_text()) + $FlexibleLayout.layout(layout) + +func _on_tree_exiting(): + var file : FileAccess = FileAccess.open("res://addons/flexible_layout/layout.json", FileAccess.WRITE) + if file: + file.store_string(JSON.stringify($FlexibleLayout.serialize())) + diff --git a/addons/flexible_layout/test.tscn b/addons/flexible_layout/test.tscn index a9e6362c9..119c42b5d 100644 --- a/addons/flexible_layout/test.tscn +++ b/addons/flexible_layout/test.tscn @@ -71,3 +71,6 @@ layout_mode = 0 offset_right = 40.0 offset_bottom = 40.0 color = Color(1, 0.988235, 0.368627, 1) + +[connection signal="tree_exiting" from="." to="." method="_on_tree_exiting"] +[connection signal="layout_changed" from="FlexibleLayout" to="." method="_on_flexible_layout_layout_changed"] diff --git a/material_maker/main_window_layout.gd b/material_maker/main_window_layout.gd index 71931a43d..3e075e00b 100644 --- a/material_maker/main_window_layout.gd +++ b/material_maker/main_window_layout.gd @@ -38,10 +38,6 @@ func toggle_side_panels() -> void: func load_panels() -> void: # Create panels - """ - for panel_pos in PANEL_POSITIONS.keys(): - get_node(PANEL_POSITIONS[panel_pos]).set_tabs_rearrange_group(1) - """ for panel in PANELS: var node : Node = panel.scene.instantiate() node.name = panel.name @@ -50,50 +46,13 @@ func load_panels() -> void: node.set(p, panel.parameters[p]) panels[panel.name] = node $FlexibleLayout.add(panel.name, node) - """ - var tab = get_node(PANEL_POSITIONS[panel.position]) - var config_panel_name = panel.name.replace(" ", "_").replace("(", "_").replace(")", "_") - if mm_globals.config.has_section_key("layout", config_panel_name+"_location"): - tab = get_node(PANEL_POSITIONS[mm_globals.config.get_value("layout", config_panel_name+"_location")]) - if mm_globals.config.has_section_key("layout", config_panel_name+"_hidden") && mm_globals.config.get_value("layout", config_panel_name+"_hidden"): - node.set_meta("parent_tab_container", tab) - node.set_meta("hidden", true) - else: - tab.add_child(node) - node.set_meta("hidden", false) - """ - # Split positions - """ - await get_tree().process_frame - if mm_globals.config.has_section_key("layout", "LeftVSplitOffset"): - split_offset = mm_globals.config.get_value("layout", "LeftVSplitOffset") - if mm_globals.config.has_section_key("layout", "LeftHSplitOffset"): - $Left.split_offset = mm_globals.config.get_value("layout", "LeftHSplitOffset") - if mm_globals.config.has_section_key("layout", "RightVSplitOffset"): - $SplitRight.split_offset = mm_globals.config.get_value("layout", "RightVSplitOffset") - if mm_globals.config.has_section_key("layout", "RightHSplitOffset"): - $SplitRight/Right.split_offset = mm_globals.config.get_value("layout", "RightHSplitOffset") - """ + if mm_globals.config.has_section_key("layout", "material"): + var current_config : Dictionary = JSON.parse_string(mm_globals.config.get_value("layout", "material")) + $FlexibleLayout.layout(current_config) func save_config() -> void: - return - for p in panels: - var config_panel_name = p.replace(" ", "_").replace("(", "_").replace(")", "_") - var location = panels[p].get_parent() - var panel_hidden = false - if location == null: - panel_hidden = panels[p].get_meta("hidden") - location = panels[p].get_meta("parent_tab_container") - mm_globals.config.set_value("layout", config_panel_name+"_hidden", panel_hidden) - for l in PANEL_POSITIONS.keys(): - if location == get_node(PANEL_POSITIONS[l]): - mm_globals.config.set_value("layout", config_panel_name+"_location", l) - """ - mm_globals.config.set_value("layout", "LeftVSplitOffset", split_offset) - mm_globals.config.set_value("layout", "LeftHSplitOffset", $Left.split_offset) - mm_globals.config.set_value("layout", "RightVSplitOffset", $SplitRight.split_offset) - mm_globals.config.set_value("layout", "RightHSplitOffset", $SplitRight/Right.split_offset) - """ + var current_config : Dictionary = $FlexibleLayout.serialize() + mm_globals.config.set_value("layout", "material", JSON.stringify(current_config)) func get_panel(n) -> Control: if panels.has(n): diff --git a/material_maker/panels/library/library.gd b/material_maker/panels/library/library.gd index 5af08559e..47b9bd308 100644 --- a/material_maker/panels/library/library.gd +++ b/material_maker/panels/library/library.gd @@ -209,9 +209,6 @@ func _on_Tree_item_collapsed(item) -> void: expanded_items.push_back(path) -func _on_SectionButtons_resized(): - $SectionButtons.columns = $SectionButtons.size.x / 33 - var current_category = "" func _on_Section_Button_pressed(category : String) -> void: diff --git a/material_maker/panels/library/library.tscn b/material_maker/panels/library/library.tscn index fecc4c309..cb3788152 100644 --- a/material_maker/panels/library/library.tscn +++ b/material_maker/panels/library/library.tscn @@ -14,7 +14,7 @@ atlas = ExtResource("3_el42x") region = Rect2(48, 0, 16, 16) [node name="Library" type="VBoxContainer" groups=["updated_from_locale"]] -custom_minimum_size = Vector2(200, 200) +custom_minimum_size = Vector2(100, 100) anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -30,7 +30,7 @@ layout_mode = 2 layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 0 -text = "Manage Libraries" +text = "Manage" icon = SubResource("1") [node name="Control" type="Control" parent="HBoxContainer"] @@ -43,9 +43,8 @@ size_flags_vertical = 4 tooltip_text = "Get more nodes from website" texture_normal = SubResource("AtlasTexture_m5x46") -[node name="SectionButtons" type="GridContainer" parent="."] +[node name="SectionButtons" type="HFlowContainer" parent="."] layout_mode = 2 -columns = 5 [node name="Filter" type="HBoxContainer" parent="."] layout_mode = 2 @@ -61,7 +60,7 @@ size_flags_horizontal = 3 clear_button_enabled = true [node name="Tree" type="Tree" parent="."] -custom_minimum_size = Vector2(100, 100) +custom_minimum_size = Vector2(50, 50) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -87,7 +86,6 @@ item_4/id = 4 [connection signal="about_to_popup" from="HBoxContainer/Libraries" to="." method="_on_Libraries_about_to_show"] [connection signal="pressed" from="HBoxContainer/GetFromWebsite" to="." method="_on_GetFromWebsite_pressed"] -[connection signal="resized" from="SectionButtons" to="." method="_on_SectionButtons_resized"] [connection signal="text_changed" from="Filter/Filter" to="." method="_on_Filter_text_changed"] [connection signal="item_collapsed" from="Tree" to="." method="_on_Tree_item_collapsed"] [connection signal="item_mouse_selected" from="Tree" to="." method="_on_tree_item_mouse_selected"] diff --git a/material_maker/panels/preview_2d/preview_2d_panel.tscn b/material_maker/panels/preview_2d/preview_2d_panel.tscn index 50938dd4d..1a3122d8c 100644 --- a/material_maker/panels/preview_2d/preview_2d_panel.tscn +++ b/material_maker/panels/preview_2d/preview_2d_panel.tscn @@ -38,7 +38,7 @@ shader = SubResource("5") [node name="Preview2D" instance=ExtResource("3")] material = SubResource("2") -custom_minimum_size = Vector2(200, 200) +custom_minimum_size = Vector2(100, 100) offset_right = -758.0 offset_bottom = -267.0 script = ExtResource("4") diff --git a/material_maker/panels/preview_3d/preview_3d_panel.tscn b/material_maker/panels/preview_3d/preview_3d_panel.tscn index a3705d11f..2cf99d7bf 100644 --- a/material_maker/panels/preview_3d/preview_3d_panel.tscn +++ b/material_maker/panels/preview_3d/preview_3d_panel.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://cj6b1r8b6jel3"] +[gd_scene load_steps=10 format=3 uid="uid://cj6b1r8b6jel3"] [ext_resource type="PackedScene" uid="uid://dpaxvlnn2u1f6" path="res://material_maker/panels/preview_3d/preview_3d.tscn" id="1"] [ext_resource type="PackedScene" uid="uid://brlp703awvxbn" path="res://material_maker/panels/preview_3d/preview_3d_ui.tscn" id="2"] @@ -26,7 +26,17 @@ shader = SubResource("1") shader_parameter/aabb_position = null shader_parameter/aabb_size = null +[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_40ogr"] + +[sub_resource type="Sky" id="Sky_wye7d"] +sky_material = SubResource("PanoramaSkyMaterial_40ogr") + +[sub_resource type="Environment" id="Environment_qxxdb"] +background_mode = 2 +sky = SubResource("Sky_wye7d") + [sub_resource type="World3D" id="World3D_3xlky"] +environment = SubResource("Environment_qxxdb") [node name="Preview3D" instance=ExtResource("1")] custom_minimum_size = Vector2(250, 200) @@ -39,7 +49,7 @@ click_material = SubResource("2") [node name="MaterialPreview" parent="." index="0"] world_3d = SubResource("World3D_3xlky") -size = Vector2i(1280, 720) +size = Vector2i(250, 200) [node name="TextureRect" type="TextureRect" parent="." index="1"] visible = false diff --git a/material_maker/panels/reference/color_slot.tscn b/material_maker/panels/reference/color_slot.tscn index c7e70975b..858c4284d 100644 --- a/material_maker/panels/reference/color_slot.tscn +++ b/material_maker/panels/reference/color_slot.tscn @@ -13,10 +13,10 @@ script = ExtResource("1") layout_mode = 0 anchor_right = 1.0 anchor_bottom = 1.0 -offset_left = 3.0 -offset_top = 3.0 -offset_right = -3.0 -offset_bottom = -3.0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = -2.0 +offset_bottom = -2.0 mouse_filter = 2 color = Color(0.501961, 0.501961, 0.501961, 1)