icons cleanup

This commit is contained in:
RodZill4 2019-10-06 14:07:49 +02:00
parent d024688511
commit a7f371e142
28 changed files with 183 additions and 1118 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

View File

@ -50,7 +50,7 @@
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="14.304427" inkscape:zoom="14.304427"
inkscape:cx="33.274902" inkscape:cx="33.274902"
inkscape:cy="30.161917" inkscape:cy="41.347265"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
showgrid="true" showgrid="true"
@ -63,7 +63,8 @@
units="px" units="px"
scale-x="2.1" scale-x="2.1"
inkscape:snap-to-guides="false" inkscape:snap-to-guides="false"
inkscape:snap-grids="false"> inkscape:snap-grids="false"
inkscape:snap-global="false">
<inkscape:grid <inkscape:grid
type="xygrid" type="xygrid"
id="grid815" id="grid815"
@ -78,7 +79,7 @@
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:type <dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title> <dc:title />
</cc:Work> </cc:Work>
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
@ -89,7 +90,7 @@
transform="translate(0,-280.06665)"> transform="translate(0,-280.06665)">
<g <g
id="g4582" id="g4582"
transform="matrix(0.63156765,0.13889911,-0.13885344,0.63177538,-0.50529,268.1154)" transform="matrix(0.61648821,0.13623838,-0.13553815,0.6196732,31.995696,300.23749)"
inkscape:export-filename="link.png" inkscape:export-filename="link.png"
inkscape:export-xdpi="15.926786" inkscape:export-xdpi="15.926786"
inkscape:export-ydpi="15.926786"> inkscape:export-ydpi="15.926786">
@ -133,7 +134,7 @@
inkscape:export-filename="config.png" inkscape:export-filename="config.png"
inkscape:export-xdpi="16.559999" inkscape:export-xdpi="16.559999"
inkscape:export-ydpi="16.559999" inkscape:export-ydpi="16.559999"
transform="matrix(0.53954693,0,0,0.52735129,-2.0235322,258.7025)"> transform="matrix(0.52573689,0,0,0.513409,30.847756,292.09585)">
<path <path
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
id="path4598" id="path4598"
@ -284,5 +285,44 @@
id="path5166" id="path5166"
d="m 30.429971,319.84339 c -3.380125,5.56722 -9.371125,5.74887 -12.902762,0" d="m 30.429971,319.84339 c -3.380125,5.56722 -9.371125,5.74887 -12.902762,0"
style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.96038949;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.96038949;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
<path
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m 33.869141,312.36502 v 1.50195 h -1.501953 v 1.5957 h 1.501953 v 1.50196 h 1.595703 v -1.50196 h 1.501953 v -1.5957 h -1.501953 v -1.50195 z"
id="rect860"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path865"
d="m 49.948079,312.36502 v 1.50195 h -1.501953 v 1.5957 h 1.501953 v 1.50196 h 1.595703 v -1.50196 h 1.501953 v -1.5957 h -1.501953 v -1.50195 z"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
<g
id="g4582-9"
transform="matrix(0.61648821,0.13623838,-0.13553815,0.6196732,0.09092866,268.4386)"
inkscape:export-filename="link.png"
inkscape:export-xdpi="15.926786"
inkscape:export-ydpi="15.926786">
<path
id="path4540-9"
d="m 52.110175,11.249997 c -2.182497,-2.09336 -5.682294,-2.0795701 -7.847077,0.03092 l -5.999358,5.848887 c -1.693669,1.651191 -2.053303,4.081962 -1.084529,6.064327 l 2.668997,-2.602056 c 0.06832,-0.475315 0.288771,-0.934614 0.666689,-1.303055 l 5.999358,-5.848887 c 0.927764,-0.904495 2.427677,-0.910404 3.363033,-0.01325 0.935356,0.897155 0.941467,2.347581 0.0137,3.252076 l -5.999358,5.848886 c -0.305037,0.297386 -0.672368,0.495758 -1.060703,0.598709 l -2.79438,2.724294 c 2.027594,0.834538 4.455047,0.445994 6.106241,-1.163787 l 5.999357,-5.848886 C 54.306929,16.727686 54.292669,13.34336 52.110175,11.25 Z"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.5892244;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
inkscape:connector-curvature="0" />
<path
id="path4542-4"
d="m 47.703334,18.314275 c -2.043073,-0.877257 -4.511855,-0.499459 -6.184325,1.131064 l -5.999358,5.848887 c -2.164785,2.11049 -2.150524,5.494815 0.03197,7.588174 2.182497,2.09336 5.682293,2.079573 7.847078,-0.03092 l 5.999358,-5.848887 c 1.67245,-1.630503 2.042985,-4.020862 1.11922,-5.989301 l -2.724165,2.655841 c -0.08761,0.429031 -0.302522,0.839174 -0.646213,1.174244 l -5.999357,5.848887 c -0.927764,0.904494 -2.427678,0.910405 -3.363034,0.01325 -0.935356,-0.897154 -0.941466,-2.34758 -0.0137,-3.252075 l 5.999358,-5.848887 c 0.343694,-0.335073 0.766059,-0.54623 1.209002,-0.634439 z"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.5892244;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
inkscape:connector-curvature="0" />
</g>
<g
id="g4645-4"
inkscape:export-filename="config.png"
inkscape:export-xdpi="16.559999"
inkscape:export-ydpi="16.559999"
transform="matrix(0.52573689,0,0,0.513409,-1.7560956,259.17843)">
<path
inkscape:connector-curvature="0"
id="path4598-6"
d="m 23.783078,44.110649 -4.508983,4.648736 -3.980261,-5.27284 a 12.770835,12.770835 0 0 0 -2.631282,1.045173 l 0.825522,6.441784 -6.571368,-0.17469 a 12.770835,12.770835 0 0 0 -0.7896172,2.557631 12.770835,12.770835 0 0 0 -0.027504,0.173796 l 5.5120272,3.347264 -4.1861363,4.972095 a 12.770835,12.770835 0 0 0 1.6563998,2.37002 l 5.9760855,-2.194035 1.267643,6.324612 a 12.770835,12.770835 0 0 0 2.907828,0.192046 l 1.997862,-6.001057 5.727797,2.948399 a 12.770835,12.770835 0 0 0 1.98019,-2.135962 l -3.455675,-5.317616 5.926699,-2.662342 a 12.770835,12.770835 0 0 0 -0.414249,-2.850168 l -6.383635,-0.620945 1.631047,-6.361785 a 12.770835,12.770835 0 0 0 -2.46039,-1.430116 z m -4.472442,8.529047 a 3.1927084,3.1927084 0 0 1 2.523332,3.744269 3.1927084,3.1927084 0 0 1 -3.744267,2.523336 3.1927084,3.1927084 0 0 1 -2.523335,-3.744269 3.1927084,3.1927084 0 0 1 3.74427,-2.523336 z"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.80446196;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
</g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

View File

@ -0,0 +1,8 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]
[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=1]
[resource]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 16, 0, 16, 15 )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 B

View File

@ -0,0 +1,8 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]
[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=1]
[resource]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 32, 0, 16, 16 )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

View File

@ -1,9 +1,22 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://addons/material_maker/nodes/custom.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/nodes/custom.gd" type="Script" id=1]
[ext_resource path="res://addons/material_maker/icons/edit.png" type="Texture" id=2] [ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2]
[ext_resource path="res://addons/material_maker/icons/load.png" type="Texture" id=3]
[ext_resource path="res://addons/material_maker/icons/save.png" type="Texture" id=4] [sub_resource type="AtlasTexture" id=1]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 16, 16, 15, 17 )
[sub_resource type="AtlasTexture" id=2]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 48, 16, 16, 16 )
[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 32, 16, 16, 16 )
[node name="Custom" type="GraphNode"] [node name="Custom" type="GraphNode"]
margin_left = 1.0 margin_left = 1.0
@ -25,27 +38,27 @@ model = null
[node name="CustomNodeButtons" type="HBoxContainer" parent="."] [node name="CustomNodeButtons" type="HBoxContainer" parent="."]
margin_left = 16.0 margin_left = 16.0
margin_top = 24.0 margin_top = 24.0
margin_right = 107.0 margin_right = 92.0
margin_bottom = 46.0 margin_bottom = 47.0
[node name="Edit" type="Button" parent="CustomNodeButtons"] [node name="Edit" type="Button" parent="CustomNodeButtons"]
margin_right = 27.0 margin_right = 27.0
margin_bottom = 22.0 margin_bottom = 23.0
icon = ExtResource( 2 ) icon = SubResource( 1 )
flat = true flat = true
[node name="Load" type="Button" parent="CustomNodeButtons"] [node name="Load" type="Button" parent="CustomNodeButtons"]
margin_left = 31.0 margin_left = 31.0
margin_right = 59.0 margin_right = 59.0
margin_bottom = 22.0 margin_bottom = 23.0
icon = ExtResource( 3 ) icon = SubResource( 2 )
flat = true flat = true
[node name="Save" type="Button" parent="CustomNodeButtons"] [node name="Save" type="Button" parent="CustomNodeButtons"]
margin_left = 63.0 margin_left = 63.0
margin_right = 91.0 margin_right = 76.0
margin_bottom = 22.0 margin_bottom = 23.0
icon = ExtResource( 4 ) icon = SubResource( 3 )
flat = true flat = true
[connection signal="pressed" from="CustomNodeButtons/Edit" to="." method="_on_Edit_pressed"] [connection signal="pressed" from="CustomNodeButtons/Edit" to="." method="_on_Edit_pressed"]
[connection signal="pressed" from="CustomNodeButtons/Load" to="." method="_on_Load_pressed"] [connection signal="pressed" from="CustomNodeButtons/Load" to="." method="_on_Load_pressed"]

View File

@ -15,11 +15,11 @@ func add_control(text, control):
control.connect("mouse_entered", self, "on_enter_widget", [ control ]) control.connect("mouse_entered", self, "on_enter_widget", [ control ])
control.connect("mouse_exited", self, "on_exit_widget", [ control ]) control.connect("mouse_exited", self, "on_exit_widget", [ control ])
var button = Button.new() var button = Button.new()
button.icon = preload("res://addons/material_maker/icons/link.png") button.icon = preload("res://addons/material_maker/icons/link.tres")
grid.add_child(button) grid.add_child(button)
button.connect("pressed", self, "_on_Link_pressed", [ index ]) button.connect("pressed", self, "_on_Link_pressed", [ index ])
button = Button.new() button = Button.new()
button.icon = preload("res://addons/material_maker/icons/remove.png") button.icon = preload("res://addons/material_maker/icons/remove.tres")
grid.add_child(button) grid.add_child(button)
button.connect("pressed", generator, "remove_parameter", [ index ]) button.connect("pressed", generator, "remove_parameter", [ index ])

View File

@ -1,16 +1,25 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://addons/material_maker/nodes/remote.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/nodes/remote.gd" type="Script" id=1]
[ext_resource path="res://addons/material_maker/icons/add_link.png" type="Texture" id=2] [ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2]
[ext_resource path="res://addons/material_maker/icons/add_config.png" type="Texture" id=3]
[sub_resource type="Theme" id=1] [sub_resource type="Theme" id=3]
[sub_resource type="AtlasTexture" id=2]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 48, 32, 16, 16 )
[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 32, 32, 16, 16 )
[node name="Remote" type="GraphNode"] [node name="Remote" type="GraphNode"]
margin_right = 95.0 margin_right = 95.0
margin_bottom = 52.0 margin_bottom = 52.0
mouse_filter = 1 mouse_filter = 1
theme = SubResource( 1 ) theme = SubResource( 3 )
title = "Remote" title = "Remote"
show_close = true show_close = true
slot/0/left_enabled = false slot/0/left_enabled = false
@ -45,14 +54,14 @@ margin_right = 28.0
margin_bottom = 22.0 margin_bottom = 22.0
hint_tooltip = "Add linked control" hint_tooltip = "Add linked control"
size_flags_horizontal = 0 size_flags_horizontal = 0
icon = ExtResource( 2 ) icon = SubResource( 2 )
[node name="AddConfig" type="Button" parent="HBoxContainer"] [node name="AddConfig" type="Button" parent="HBoxContainer"]
margin_left = 32.0 margin_left = 32.0
margin_right = 60.0 margin_right = 60.0
margin_bottom = 22.0 margin_bottom = 22.0
hint_tooltip = "Add configurations" hint_tooltip = "Add configurations"
icon = ExtResource( 3 ) icon = SubResource( 4 )
[connection signal="close_request" from="." to="." method="on_close_request"] [connection signal="close_request" from="." to="." method="on_close_request"]
[connection signal="offset_changed" from="." to="." method="on_offset_changed"] [connection signal="offset_changed" from="." to="." method="on_offset_changed"]
[connection signal="pressed" from="HBoxContainer/AddLink" to="." method="_on_AddLink_pressed"] [connection signal="pressed" from="HBoxContainer/AddLink" to="." method="_on_AddLink_pressed"]

View File

@ -1,122 +0,0 @@
tool
extends "res://addons/material_maker/widgets/linked_widgets/linked_control_base.gd"
var configurations = {}
var current = null
onready var button = null
const Types = preload("res://addons/material_maker/types/types.gd")
func _ready():
update_options()
func update_options():
# Seems "clear" might cause crashes, so we create a new button...
if button != null:
button.hide()
button.queue_free()
button = OptionButton.new()
button.connect("item_selected", self, "_on_item_selected")
button.connect("mouse_entered", self, "_on_mouse_entered")
button.connect("mouse_exited", self, "_on_mouse_exited")
add_child(button)
# Create list of configurations
var keys = configurations.keys()
keys.sort()
# if no configuration is selected, select the first one
if current == null and !keys.empty():
current = keys[0]
for c in keys:
button.add_item(c)
button.add_separator()
button.add_item("<add configuration>")
if current != null:
button.add_separator()
button.add_item("<update "+current+">")
button.add_item("<remove "+current+">")
for i in range(button.get_item_count()):
if button.get_item_text(i) == current:
button.selected = i
break
func add_linked(node, widget):
linked_widgets.append({ node=node, widget=widget })
func duplicate_value(value):
if typeof(value) == TYPE_OBJECT and value.has_method("duplicate"):
value = value.duplicate()
return value
func apply_configuration(i):
get_parent().get_parent().generator.set_parameter("param"+str(get_index()%4-1), i)
func do_update_configuration(name):
var configuration = []
for w in linked_widgets:
configuration.append({ node=w.node, widget=w.widget, value=duplicate_value(w.node.parameters[w.widget.name]) })
configurations[name] = configuration
current = name
update_options()
func update_configuration():
var dialog = preload("res://addons/material_maker/widgets/line_dialog.tscn").instance()
add_child(dialog)
dialog.set_texts("Configuration", "Enter a name for the new configuration")
dialog.connect("ok", self, "do_update_configuration", [])
dialog.popup_centered()
func _on_item_selected(ID):
var count = configurations.keys().size()
if ID >= 0 && ID < count:
current = button.get_item_text(ID)
update_options()
apply_configuration(ID)
elif ID == count+1:
button.selected = 0
update_configuration()
elif ID == count+3:
do_update_configuration(current)
else:
configurations.erase(current)
current = null
update_options()
func serialize():
var data = .serialize()
data.type = "config_control"
var data_configurations = {}
var keys = configurations.keys()
for k in keys:
var c = configurations[k]
var data_configuration = []
for e in c:
data_configuration.append({ node=e.node.name, widget=e.widget.name, value=Types.serialize_value(e.value) })
data_configurations[k] = data_configuration
data.configurations = data_configurations
return data
func deserialize(data):
.deserialize(data)
graph_edit = get_parent()
while graph_edit != null && !(graph_edit is GraphEdit):
graph_edit = graph_edit.get_parent()
if graph_edit == null:
return
var keys = data.configurations.keys()
for k in keys:
var c = data.configurations[k]
var configuration = []
for e in c:
var node = graph_edit.get_node("node_"+e.node)
var widget = null
for w in node.controls:
if w == e.widget:
widget = w
break
configuration.append({ node=node, widget=widget, value=Types.deserialize_value(e.value) })
configurations[k] = configuration
update_options()

View File

@ -1,22 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/material_maker/widgets/linked_widgets/config_control.gd" type="Script" id=1]
[node name="ConfigControl" type="VBoxContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
script = ExtResource( 1 )
_sections_unfolded = [ "Rect", "Size Flags" ]

View File

@ -1,107 +0,0 @@
tool
extends "res://addons/material_maker/widgets/linked_widgets/linked_control_base.gd"
var control = null
func add_linked(node, widget):
if linked_widgets.empty():
control = null
var type
if widget is SpinBox:
control = SpinBox.new()
type = "SpinBox"
elif widget is ColorPickerButton:
control = ColorPickerButton.new()
type = "ColorPickerButton"
elif widget is Control && widget.filename == "res://addons/material_maker/widgets/gradient_editor.tscn":
control = preload("res://addons/material_maker/widgets/gradient_editor.tscn").instance()
type = "GradientEditor"
elif widget is HSlider:
control = HSlider.new()
type = "HSlider"
elif widget is OptionButton:
control = OptionButton.new()
type = "OptionButton"
for i in range(widget.get_item_count()):
control.add_item(widget.get_item_text(i), widget.get_item_id(i))
if control != null:
add_child(control)
mirror(control, widget, type)
control.connect("mouse_entered", self, "_on_mouse_entered")
control.connect("mouse_exited", self, "_on_mouse_exited")
control.connect(WIDGETS[type].sig, self, WIDGETS[type].sig_handler)
else:
if !can_link_to(widget):
return
linked_widgets.append({ node=node, widget=widget })
func can_link_to(c):
if c == null:
return false
var widget_type = get_widget_type(c)
if control == null:
return widget_type != null
elif widget_type != get_widget_type(control):
return false
else:
for l in linked_widgets:
if l.widget == c:
return false
var winfo = WIDGETS[widget_type]
for a in winfo.attrs:
if c.get(a) != control.get(a):
return false
return true
func mirror(to, from, type):
var winfo = WIDGETS[type]
for a in winfo.attrs:
to.set(a, from.get(a))
to.set(winfo.value_attr, from.get(winfo.value_attr))
func update_shaders():
var graph_edit = get_parent()
while !(graph_edit is GraphEdit):
graph_edit = graph_edit.get_parent()
graph_edit.send_changed_signal()
func _on_value_changed(v):
for l in linked_widgets:
l.widget.value = v
var parent = l.widget.get_parent()
while !(parent is GraphNode):
parent = parent.get_parent()
parent.generator.set_parameter(l.widget.name, v)
update_shaders()
func _on_color_changed(c):
for l in linked_widgets:
l.widget.color = c
var parent = l.widget.get_parent()
while !(parent is GraphNode):
parent = parent.get_parent()
parent.generator.set_parameter(l.widget.name, c)
update_shaders()
func _on_item_selected(i):
for l in linked_widgets:
l.widget.selected = i
var parent = l.widget.get_parent()
while !(parent is GraphNode):
parent = parent.get_parent()
parent.generator.set_parameter(l.widget.name, i)
update_shaders()
func _on_gradient_updated(g):
for l in linked_widgets:
l.widget.value = g
var parent = l.widget.get_parent()
while !(parent is GraphNode):
parent = parent.get_parent()
parent.generator.set_parameter(l.widget.name, g)
update_shaders()
func serialize():
var data = .serialize()
data.type = "linked_control"
return data

View File

@ -1,22 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/material_maker/widgets/linked_widgets/linked_control.gd" type="Script" id=1]
[node name="LinkedControl" type="VBoxContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
script = ExtResource( 1 )
_sections_unfolded = [ "Rect", "Size Flags" ]

View File

@ -1,150 +0,0 @@
tool
extends VBoxContainer
var label = null
var buttons = null
var linked_widgets = []
var links = null
const Link = preload("res://addons/material_maker/widgets/linked_widgets/link.gd")
const WIDGETS = {
SpinBox={ attrs=[ "min_value", "max_value", "step" ], value_attr="value", sig="value_changed", sig_handler="_on_value_changed" },
HSlider={ attrs=[ "min_value", "max_value", "step" ], value_attr="value", sig="value_changed", sig_handler="_on_value_changed" },
ColorPickerButton={ attrs=[ "edit_alpha", ], value_attr="color", sig="color_changed", sig_handler="_on_color_changed" },
OptionButton={ attrs=[ ], value_attr="selected", sig="item_selected", sig_handler="_on_item_selected" },
GradientEditor={ attrs=[ ], value_attr="value", sig="updated", sig_handler="_on_gradient_updated" }
}
func get_widget_type(widget):
if widget is SpinBox:
return "SpinBox"
elif widget is ColorPickerButton:
return "ColorPickerButton"
elif widget is Control && widget.filename == "res://addons/material_maker/widgets/gradient_editor.tscn":
return "GradientEditor"
elif widget is HSlider:
return "HSlider"
elif widget is OptionButton:
return "OptionButton"
else:
return null
func _ready():
set_process_input(false)
func add_linked(node, widget):
pass
func can_link_to(c):
return c != null
func get_associated_controls():
label = preload("res://addons/material_maker/widgets/linked_widgets/editable_label.tscn").instance()
label.set_text("Unnamed")
buttons = preload("res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn").instance()
buttons.control = self
return { label=label, buttons=buttons }
func delete():
var parent = get_parent()
label.queue_free()
buttons.queue_free()
queue_free()
func _on_mouse_entered():
_on_mouse_exited()
get_graph_edit()
if graph_edit == null:
return
links = []
var viewport = get_viewport()
for w in linked_widgets:
var link = Link.new(graph_edit)
link.source = self
link.target = w.widget
links.append(link)
func _on_mouse_exited():
if links != null:
for l in links:
l.queue_free()
links = null
# Capture mouse to link to a control
var link = null
var graph_edit = null
var pointed_control = null
func get_graph_edit():
graph_edit = get_parent()
while graph_edit != null && !(graph_edit is GraphEdit):
graph_edit = graph_edit.get_parent()
func find_control(gp):
for c in graph_edit.get_children():
if c is GraphNode:
if c.get("controls") != null:
for w in c.controls:
var widget = c.controls[w]
if Rect2(widget.rect_global_position, widget.rect_size*widget.get_global_transform().get_scale()).has_point(gp):
return { node=c, widget=widget }
return null
func _input(event):
if event is InputEventKey:
if event.scancode == KEY_ESCAPE:
set_process_input(false)
link.queue_free()
link = null
elif event is InputEventMouseMotion:
var control = find_control(event.global_position)
link.end = event.global_position
link.target = control.widget if control != null && can_link_to(control.widget) else null
link.update()
elif event is InputEventMouseButton:
if event.pressed:
if event.button_index == BUTTON_LEFT:
var control = find_control(event.global_position)
if control != null:
add_linked(control.node, control.widget)
set_process_input(false)
link.queue_free()
link = null
get_tree().set_input_as_handled()
func pick_linked():
# Verify we are in a graph edit
get_graph_edit()
if graph_edit == null:
return
# Create line that will be shown when looking for a target
var viewport = get_viewport()
link = Link.new(graph_edit)
link.source = self
link.end = rect_global_position+0.5*rect_size*get_global_transform().get_scale()
set_process_input(true)
pointed_control = null
func serialize():
var data = { label=label.text, linked_widgets=[] }
for w in linked_widgets:
data.linked_widgets.append( { node=w.node.name, widget=w.widget.name } )
return data
func deserialize(data):
if data.has("label"):
label.text = data.label
if !data.has("linked_widgets"):
return
var graph_edit = get_parent()
while !(graph_edit is GraphEdit):
graph_edit = graph_edit.get_parent()
for w in data.linked_widgets:
var node = graph_edit.get_node(w.node)
if node != null && node.get("property_widgets") != null:
for widget in node.property_widgets:
if widget.name == w.widget:
add_linked(node, widget)

View File

@ -1,10 +0,0 @@
tool
extends HBoxContainer
var control = null
func _on_Link_pressed():
control.pick_linked()
func _on_Remove_pressed():
control.delete()

View File

@ -1,25 +0,0 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd" type="Script" id=1]
[ext_resource path="res://addons/material_maker/icons/link.png" type="Texture" id=2]
[ext_resource path="res://addons/material_maker/icons/remove.png" type="Texture" id=3]
[node name="Buttons" type="HBoxContainer"]
margin_right = 60.0
margin_bottom = 22.0
script = ExtResource( 1 )
[node name="Link" type="Button" parent="."]
margin_right = 28.0
margin_bottom = 22.0
hint_tooltip = "Link new parameter"
icon = ExtResource( 2 )
[node name="Remove" type="Button" parent="."]
margin_left = 32.0
margin_right = 60.0
margin_bottom = 22.0
hint_tooltip = "Delete this control"
icon = ExtResource( 3 )
[connection signal="pressed" from="Link" to="." method="_on_Link_pressed"]
[connection signal="pressed" from="Remove" to="." method="_on_Remove_pressed"]

View File

@ -1,159 +1,56 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/material_maker/widgets/node_editor/input.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/widgets/node_editor/input.gd" type="Script" id=1]
[ext_resource path="res://addons/material_maker/icons/minus.png" type="Texture" id=2] [ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2]
[node name="Parameter" type="HBoxContainer" index="0"] [sub_resource type="AtlasTexture" id=1]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 16, 16, 16 )
anchor_left = 0.0 [node name="Parameter" type="HBoxContainer"]
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 201.0 margin_right = 201.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="Delete" type="Button" parent="." index="0"] [node name="Delete" type="Button" parent="."]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 28.0 margin_right = 28.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 ) icon = SubResource( 1 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
icon = ExtResource( 2 )
flat = true flat = true
align = 1
[node name="Name" type="LineEdit" parent="." index="1"] [node name="Name" type="LineEdit" parent="."]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 32.0 margin_left = 32.0
margin_right = 102.0 margin_right = 102.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
hint_tooltip = "Input name" hint_tooltip = "Input name"
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 1
size_flags_vertical = 1
text = "name" text = "name"
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = false
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Hint", "Rect" ]
[node name="Label" type="LineEdit" parent="." index="2"] [node name="Label" type="LineEdit" parent="."]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 106.0 margin_left = 106.0
margin_right = 176.0 margin_right = 176.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
hint_tooltip = "Input Label" hint_tooltip = "Input Label"
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 1
size_flags_vertical = 1
text = "Label" text = "Label"
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = false
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Hint", "Rect" ]
[node name="Type" type="OptionButton" parent="." index="3"] [node name="Type" type="OptionButton" parent="."]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 180.0 margin_left = 180.0
margin_right = 282.0 margin_right = 284.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_min_size = Vector2( 102, 0 ) rect_min_size = Vector2( 102, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
hint_tooltip = "Input flag" hint_tooltip = "Input flag"
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
action_mode = 0
enabled_focus_mode = 2
shortcut = null
group = null
text = "GreyScale" text = "GreyScale"
flat = false
align = 0
items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, -1, null ] items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, -1, null ]
selected = 0 selected = 0
_sections_unfolded = [ "Focus", "Hint", "Rect" ]
[node name="Default" type="LineEdit" parent="." index="4"] [node name="Default" type="LineEdit" parent="."]
margin_left = 288.0
anchor_left = 0.0 margin_right = 358.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 286.0
margin_right = 356.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
hint_tooltip = "Default value" hint_tooltip = "Default value"
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
text = "0.0" text = "0.0"
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = false
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Hint", "Rect", "Size Flags" ]
[connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"] [connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"]

View File

@ -1,584 +1,193 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/material_maker/widgets/node_editor/node_editor.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/widgets/node_editor/node_editor.gd" type="Script" id=1]
[ext_resource path="res://addons/material_maker/icons/plus.png" type="Texture" id=2] [ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2]
[node name="NodeEditor" type="WindowDialog" index="0"] [sub_resource type="AtlasTexture" id=1]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 48, 0, 16, 16 )
anchor_left = 0.0 [node name="NodeEditor" type="WindowDialog"]
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 833.0 margin_right = 833.0
margin_bottom = 398.0 margin_bottom = 398.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
popup_exclusive = true popup_exclusive = true
window_title = "Node Editor" window_title = "Node Editor"
resizable = false
script = ExtResource( 1 ) script = ExtResource( 1 )
_sections_unfolded = [ "Popup" ]
[node name="Sizer" type="VBoxContainer" parent="." index="0"] [node name="Sizer" type="VBoxContainer" parent="."]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="Tabs" type="TabContainer" parent="Sizer" index="0"] [node name="Tabs" type="TabContainer" parent="Sizer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 833.0 margin_right = 833.0
margin_bottom = 374.0 margin_bottom = 374.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tab_align = 0 tab_align = 0
tabs_visible = true
_sections_unfolded = [ "Size Flags" ]
[node name="General" type="VBoxContainer" parent="Sizer/Tabs" index="0"] [node name="General" type="VBoxContainer" parent="Sizer/Tabs"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 4.0 margin_left = 4.0
margin_top = 32.0 margin_top = 32.0
margin_right = -4.0 margin_right = -4.0
margin_bottom = -4.0 margin_bottom = -4.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="Name" type="HBoxContainer" parent="Sizer/Tabs/General" index="0"] [node name="Name" type="HBoxContainer" parent="Sizer/Tabs/General"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="LabelName" type="Label" parent="Sizer/Tabs/General/Name" index="0"] [node name="LabelName" type="Label" parent="Sizer/Tabs/General/Name"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 5.0 margin_top = 5.0
margin_right = 42.0 margin_right = 42.0
margin_bottom = 19.0 margin_bottom = 19.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Name:" text = "Name:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags" ]
[node name="Name" type="LineEdit" parent="Sizer/Tabs/General/Name" index="1"] [node name="Name" type="LineEdit" parent="Sizer/Tabs/General/Name"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 46.0 margin_left = 46.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = false
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Size Flags" ]
[node name="LabelParameters" type="Label" parent="Sizer/Tabs/General" index="1"] [node name="LabelParameters" type="Label" parent="Sizer/Tabs/General"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 28.0 margin_top = 28.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 42.0 margin_bottom = 42.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Parameters:" text = "Parameters:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags" ]
[node name="Parameters" type="ScrollContainer" parent="Sizer/Tabs/General" index="2"] [node name="Parameters" type="ScrollContainer" parent="Sizer/Tabs/General"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 46.0 margin_top = 46.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 181.0 margin_bottom = 181.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
scroll_horizontal_enabled = false scroll_horizontal_enabled = false
scroll_horizontal = 0
scroll_vertical_enabled = true
scroll_vertical = 0
scroll_deadzone = 0
_sections_unfolded = [ "Size Flags" ]
[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Parameters" index="0"] [node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Parameters"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 22.0 margin_bottom = 22.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="AddParameter" type="Button" parent="Sizer/Tabs/General/Parameters/Sizer" index="0"] [node name="AddParameter" type="Button" parent="Sizer/Tabs/General/Parameters/Sizer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 28.0 margin_right = 28.0
margin_bottom = 22.0 margin_bottom = 22.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 1 icon = SubResource( 1 )
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
icon = ExtResource( 2 )
flat = true flat = true
align = 1
_sections_unfolded = [ "Size Flags" ]
[node name="LabelInputs" type="Label" parent="Sizer/Tabs/General" index="3"] [node name="LabelInputs" type="Label" parent="Sizer/Tabs/General"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 185.0 margin_top = 185.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 199.0 margin_bottom = 199.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Inputs:" text = "Inputs:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags" ]
[node name="Inputs" type="ScrollContainer" parent="Sizer/Tabs/General" index="4"] [node name="Inputs" type="ScrollContainer" parent="Sizer/Tabs/General"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 203.0 margin_top = 203.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 338.0 margin_bottom = 338.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
scroll_horizontal_enabled = false scroll_horizontal_enabled = false
scroll_horizontal = 0
scroll_vertical_enabled = true
scroll_vertical = 0
scroll_deadzone = 0
_sections_unfolded = [ "Scroll", "Size Flags" ]
[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Inputs" index="0"] [node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Inputs"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 22.0 margin_bottom = 22.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="AddInput" type="Button" parent="Sizer/Tabs/General/Inputs/Sizer" index="0"] [node name="AddInput" type="Button" parent="Sizer/Tabs/General/Inputs/Sizer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 28.0 margin_right = 28.0
margin_bottom = 22.0 margin_bottom = 22.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 1 icon = SubResource( 1 )
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
icon = ExtResource( 2 )
flat = true flat = true
align = 1
_sections_unfolded = [ "Size Flags" ]
[node name="Outputs" type="VBoxContainer" parent="Sizer/Tabs" index="1"]
[node name="Outputs" type="VBoxContainer" parent="Sizer/Tabs"]
visible = false visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 4.0 margin_left = 4.0
margin_top = 32.0 margin_top = 32.0
margin_right = -4.0 margin_right = -4.0
margin_bottom = -4.0 margin_bottom = -4.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="LabelOutputs" type="Label" parent="Sizer/Tabs/Outputs" index="0"] [node name="LabelOutputs" type="Label" parent="Sizer/Tabs/Outputs"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 14.0 margin_bottom = 14.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Outputs:" text = "Outputs:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags" ]
[node name="Outputs" type="ScrollContainer" parent="Sizer/Tabs/Outputs" index="1"] [node name="Outputs" type="ScrollContainer" parent="Sizer/Tabs/Outputs"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 18.0 margin_top = 18.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 338.0 margin_bottom = 338.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
scroll_horizontal_enabled = false scroll_horizontal_enabled = false
scroll_horizontal = 0
scroll_vertical_enabled = true
scroll_vertical = 0
scroll_deadzone = 0
_sections_unfolded = [ "Size Flags" ]
[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/Outputs/Outputs" index="0"] [node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/Outputs/Outputs"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 825.0 margin_right = 825.0
margin_bottom = 22.0 margin_bottom = 22.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="AddOutput" type="Button" parent="Sizer/Tabs/Outputs/Outputs/Sizer" index="0"] [node name="AddOutput" type="Button" parent="Sizer/Tabs/Outputs/Outputs/Sizer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 28.0 margin_right = 28.0
margin_bottom = 22.0 margin_bottom = 22.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 1 icon = SubResource( 1 )
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
icon = ExtResource( 2 )
flat = true flat = true
align = 1
_sections_unfolded = [ "Size Flags" ]
[node name="Global" type="TextEdit" parent="Sizer/Tabs" index="2"]
[node name="Global" type="TextEdit" parent="Sizer/Tabs"]
visible = false visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 4.0 margin_left = 4.0
margin_top = 32.0 margin_top = 32.0
margin_right = -4.0 margin_right = -4.0
margin_bottom = -4.0 margin_bottom = -4.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
text = ""
readonly = false
highlight_current_line = false
syntax_highlighting = false
show_line_numbers = false
highlight_all_occurrences = false
override_selected_font_color = false
context_menu_enabled = true
smooth_scrolling = false
v_scroll_speed = 80.0
hiding_enabled = 0
wrap_lines = false
caret_block_mode = false
caret_blink = false
caret_blink_speed = 0.65
caret_moving_by_right_click = true
[node name="Instance" type="TextEdit" parent="Sizer/Tabs" index="3"]
[node name="Instance" type="TextEdit" parent="Sizer/Tabs"]
visible = false visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 4.0 margin_left = 4.0
margin_top = 32.0 margin_top = 32.0
margin_right = -4.0 margin_right = -4.0
margin_bottom = -4.0 margin_bottom = -4.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
text = ""
readonly = false
highlight_current_line = false
syntax_highlighting = false
show_line_numbers = false
highlight_all_occurrences = false
override_selected_font_color = false
context_menu_enabled = true
smooth_scrolling = false
v_scroll_speed = 80.0
hiding_enabled = 0
wrap_lines = false
caret_block_mode = false
caret_blink = false
caret_blink_speed = 0.65
caret_moving_by_right_click = true
[node name="HBoxContainer" type="HBoxContainer" parent="Sizer" index="1"] [node name="HBoxContainer" type="HBoxContainer" parent="Sizer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 307.0 margin_left = 307.0
margin_top = 378.0 margin_top = 378.0
margin_right = 525.0 margin_right = 525.0
margin_bottom = 398.0 margin_bottom = 398.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="Apply" type="Button" parent="Sizer/HBoxContainer" index="0"] [node name="Apply" type="Button" parent="Sizer/HBoxContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 70.0 margin_right = 70.0
margin_bottom = 20.0 margin_bottom = 20.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Apply" text = "Apply"
flat = false
align = 1
[node name="OK" type="Button" parent="Sizer/HBoxContainer" index="1"] [node name="OK" type="Button" parent="Sizer/HBoxContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 74.0 margin_left = 74.0
margin_right = 144.0 margin_right = 144.0
margin_bottom = 20.0 margin_bottom = 20.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "OK" text = "OK"
flat = false
align = 1
[node name="Cancel" type="Button" parent="Sizer/HBoxContainer" index="2"] [node name="Cancel" type="Button" parent="Sizer/HBoxContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 148.0 margin_left = 148.0
margin_right = 218.0 margin_right = 218.0
margin_bottom = 20.0 margin_bottom = 20.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Cancel" text = "Cancel"
flat = false
align = 1
[connection signal="pressed" from="Sizer/Tabs/General/Parameters/Sizer/AddParameter" to="." method="_on_AddParameter_pressed"] [connection signal="pressed" from="Sizer/Tabs/General/Parameters/Sizer/AddParameter" to="." method="_on_AddParameter_pressed"]
[connection signal="pressed" from="Sizer/Tabs/General/Inputs/Sizer/AddInput" to="." method="_on_AddInput_pressed"] [connection signal="pressed" from="Sizer/Tabs/General/Inputs/Sizer/AddInput" to="." method="_on_AddInput_pressed"]
[connection signal="pressed" from="Sizer/Tabs/Outputs/Outputs/Sizer/AddOutput" to="." method="_on_AddOutput_pressed"] [connection signal="pressed" from="Sizer/Tabs/Outputs/Outputs/Sizer/AddOutput" to="." method="_on_AddOutput_pressed"]
[connection signal="pressed" from="Sizer/HBoxContainer/Apply" to="." method="_on_Apply_pressed"] [connection signal="pressed" from="Sizer/HBoxContainer/Apply" to="." method="_on_Apply_pressed"]
[connection signal="pressed" from="Sizer/HBoxContainer/OK" to="." method="_on_OK_pressed"] [connection signal="pressed" from="Sizer/HBoxContainer/OK" to="." method="_on_OK_pressed"]
[connection signal="pressed" from="Sizer/HBoxContainer/Cancel" to="." method="_on_Cancel_pressed"] [connection signal="pressed" from="Sizer/HBoxContainer/Cancel" to="." method="_on_Cancel_pressed"]

View File

@ -1,105 +1,40 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/material_maker/widgets/node_editor/output.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/widgets/node_editor/output.gd" type="Script" id=1]
[ext_resource path="res://addons/material_maker/icons/minus.png" type="Texture" id=2] [ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2]
[node name="Output" type="HBoxContainer" index="0"] [sub_resource type="AtlasTexture" id=1]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 16, 16, 16 )
anchor_left = 0.0 [node name="Output" type="HBoxContainer"]
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 201.0 margin_right = 201.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
script = ExtResource( 1 ) script = ExtResource( 1 )
_sections_unfolded = [ "Size Flags" ]
[node name="Delete" type="Button" parent="." index="0"] [node name="Delete" type="Button" parent="."]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 28.0 margin_right = 28.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 ) icon = SubResource( 1 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
icon = ExtResource( 2 )
flat = true flat = true
align = 1
[node name="Type" type="OptionButton" parent="." index="1"] [node name="Type" type="OptionButton" parent="."]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 32.0 margin_left = 32.0
margin_right = 134.0 margin_right = 136.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_min_size = Vector2( 102, 0 ) rect_min_size = Vector2( 102, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
hint_tooltip = "Input flag" hint_tooltip = "Input flag"
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
action_mode = 0
enabled_focus_mode = 2
shortcut = null
group = null
text = "GreyScale" text = "GreyScale"
flat = false
align = 0
items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, -1, null ] items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, -1, null ]
selected = 0 selected = 0
_sections_unfolded = [ "Focus", "Hint", "Rect" ]
[node name="Value" type="LineEdit" parent="." index="2"] [node name="Value" type="LineEdit" parent="."]
margin_left = 140.0
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 138.0
margin_right = 201.0 margin_right = 201.0
margin_bottom = 24.0 margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
hint_tooltip = "Default value" hint_tooltip = "Default value"
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 1
text = "0.0" text = "0.0"
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = false
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Hint", "Rect", "Size Flags" ]
[connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"] [connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"]

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=9 format=2] [gd_scene load_steps=10 format=2]
[ext_resource path="res://addons/material_maker/widgets/node_editor/parameter.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter.gd" type="Script" id=1]
[ext_resource path="res://addons/material_maker/icons/minus.png" type="Texture" id=2] [ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2]
[ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_float.tscn" type="PackedScene" id=3] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_float.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_size.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_size.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_enum.tscn" type="PackedScene" id=5] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_enum.tscn" type="PackedScene" id=5]
@ -9,6 +9,11 @@
[ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_color.tscn" type="PackedScene" id=7] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_color.tscn" type="PackedScene" id=7]
[ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_gradient.tscn" type="PackedScene" id=8] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_gradient.tscn" type="PackedScene" id=8]
[sub_resource type="AtlasTexture" id=1]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 16, 16, 16 )
[node name="Parameter" type="HBoxContainer"] [node name="Parameter" type="HBoxContainer"]
margin_right = 201.0 margin_right = 201.0
margin_bottom = 24.0 margin_bottom = 24.0
@ -16,39 +21,38 @@ script = ExtResource( 1 )
[node name="Delete" type="Button" parent="."] [node name="Delete" type="Button" parent="."]
margin_right = 28.0 margin_right = 28.0
margin_bottom = 30.0 margin_bottom = 24.0
icon = ExtResource( 2 ) icon = SubResource( 1 )
flat = true flat = true
[node name="Name" type="LineEdit" parent="."] [node name="Name" type="LineEdit" parent="."]
margin_left = 32.0 margin_left = 32.0
margin_right = 102.0 margin_right = 102.0
margin_bottom = 30.0 margin_bottom = 24.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
text = "name" text = "name"
[node name="Label" type="LineEdit" parent="."] [node name="Label" type="LineEdit" parent="."]
margin_left = 106.0 margin_left = 106.0
margin_right = 176.0 margin_right = 176.0
margin_bottom = 30.0 margin_bottom = 24.0
rect_min_size = Vector2( 70, 0 ) rect_min_size = Vector2( 70, 0 )
text = "Label" text = "Label"
[node name="Type" type="OptionButton" parent="."] [node name="Type" type="OptionButton" parent="."]
margin_left = 180.0 margin_left = 180.0
margin_right = 249.0 margin_right = 249.0
margin_bottom = 30.0 margin_bottom = 24.0
text = "float" text = "float"
items = [ "float", null, false, -1, null, "size", null, false, -1, null, "enum", null, false, -1, null, "boolean", null, false, -1, null, "color", null, false, -1, null ] items = [ "float", null, false, -1, null, "size", null, false, -1, null, "enum", null, false, -1, null, "boolean", null, false, -1, null, "color", null, false, -1, null, "gradient", null, false, -1, null ]
selected = 0 selected = 0
[node name="Types" type="HBoxContainer" parent="."] [node name="Types" type="HBoxContainer" parent="."]
margin_left = 253.0 margin_left = 253.0
margin_right = 800.0 margin_right = 800.0
margin_bottom = 30.0 margin_bottom = 24.0
[node name="float" parent="Types" instance=ExtResource( 3 )] [node name="float" parent="Types" instance=ExtResource( 3 )]
margin_bottom = 30.0
[node name="size" parent="Types" instance=ExtResource( 4 )] [node name="size" parent="Types" instance=ExtResource( 4 )]
visible = false visible = false