mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
Updated custom node and associated editor
Custom nodes now support outputs and basic (float) parameters, and are serialized/deserialized correctly.
This commit is contained in:
parent
ee0bc96f30
commit
0d85cd5aef
@ -117,7 +117,7 @@ func create_nodes(data, position = null):
|
|||||||
return
|
return
|
||||||
if data.has("type"):
|
if data.has("type"):
|
||||||
var node = null
|
var node = null
|
||||||
if File.new().file_exists("res://addons/material_maker/nodes/"+data.type+".json"):
|
if File.new().file_exists("res://addons/material_maker/nodes/"+data.type+".mmn"):
|
||||||
node = preload("res://addons/material_maker/nodes/node_generic.gd").new()
|
node = preload("res://addons/material_maker/nodes/node_generic.gd").new()
|
||||||
node.model = data.type
|
node.model = data.type
|
||||||
else:
|
else:
|
||||||
|
@ -48,9 +48,9 @@
|
|||||||
borderopacity="1.0"
|
borderopacity="1.0"
|
||||||
inkscape:pageopacity="0.0"
|
inkscape:pageopacity="0.0"
|
||||||
inkscape:pageshadow="2"
|
inkscape:pageshadow="2"
|
||||||
inkscape:zoom="2.8"
|
inkscape:zoom="1.1274425"
|
||||||
inkscape:cx="161.54776"
|
inkscape:cx="116.41955"
|
||||||
inkscape:cy="928.95264"
|
inkscape:cy="914.64295"
|
||||||
inkscape:document-units="mm"
|
inkscape:document-units="mm"
|
||||||
inkscape:current-layer="layer1"
|
inkscape:current-layer="layer1"
|
||||||
showgrid="true"
|
showgrid="true"
|
||||||
@ -205,5 +205,70 @@
|
|||||||
id="rect874"
|
id="rect874"
|
||||||
style="opacity:1;fill:#afafaf;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
style="opacity:1;fill:#afafaf;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
</g>
|
</g>
|
||||||
|
<g
|
||||||
|
style="fill:#18ff09;fill-opacity:1"
|
||||||
|
transform="matrix(0.00708854,0.93703452,-0.93703452,-0.00708854,131.56263,7.7603075)"
|
||||||
|
id="g849"
|
||||||
|
inkscape:export-filename="plus.png"
|
||||||
|
inkscape:export-xdpi="16.531826"
|
||||||
|
inkscape:export-ydpi="16.531826">
|
||||||
|
<rect
|
||||||
|
ry="0"
|
||||||
|
y="8.604167"
|
||||||
|
x="10.583333"
|
||||||
|
height="26.458334"
|
||||||
|
width="5.2916665"
|
||||||
|
id="rect844"
|
||||||
|
style="opacity:1;fill:#18ff09;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
<rect
|
||||||
|
ry="0"
|
||||||
|
y="19.1875"
|
||||||
|
x="0"
|
||||||
|
height="5.2916665"
|
||||||
|
width="26.458332"
|
||||||
|
id="rect847"
|
||||||
|
style="opacity:1;fill:#18ff09;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="16.531826"
|
||||||
|
inkscape:export-xdpi="16.531826"
|
||||||
|
inkscape:export-filename="minus.png"
|
||||||
|
id="g856"
|
||||||
|
transform="matrix(0.00708854,0.93703452,-0.93703452,-0.00708854,162.38808,7.2064523)"
|
||||||
|
style="fill:#ff0909;fill-opacity:1">
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#ff0909;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
id="rect851"
|
||||||
|
width="5.2916665"
|
||||||
|
height="26.458334"
|
||||||
|
x="10.583333"
|
||||||
|
y="8.604167"
|
||||||
|
ry="0" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g868"
|
||||||
|
inkscape:export-filename="load.png"
|
||||||
|
inkscape:export-xdpi="13.499794"
|
||||||
|
inkscape:export-ydpi="13.499794">
|
||||||
|
<path
|
||||||
|
id="rect849"
|
||||||
|
transform="scale(0.26458333)"
|
||||||
|
d="M 330 152.51953 L 330 262.51953 L 420 262.51953 L 420 169.94531 L 402.57227 152.51953 L 330 152.51953 z "
|
||||||
|
style="opacity:1;fill:#ffed46;fill-opacity:1;stroke:#c7b115;stroke-width:3.77952761;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stroke-linejoin:round" />
|
||||||
|
<path
|
||||||
|
id="path855"
|
||||||
|
transform="scale(0.26458333)"
|
||||||
|
d="M 403 152.94727 L 403 169.51953 L 419.57422 169.51953 L 403 152.94727 z "
|
||||||
|
style="opacity:1;fill:#ffed46;fill-opacity:1;stroke:#c7b115;stroke-width:3.77952761;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stroke-linejoin:round" />
|
||||||
|
<rect
|
||||||
|
transform="rotate(-90)"
|
||||||
|
ry="2.5431327e-006"
|
||||||
|
y="84.666664"
|
||||||
|
x="-57.552082"
|
||||||
|
height="29.104166"
|
||||||
|
width="5.2916665"
|
||||||
|
id="rect863"
|
||||||
|
style="opacity:0;fill:#ffed46;fill-opacity:1;stroke:#c7b115;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||||
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 13 KiB |
BIN
addons/material_maker/icons/load.png
Normal file
BIN
addons/material_maker/icons/load.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 285 B |
BIN
addons/material_maker/icons/minus.png
Normal file
BIN
addons/material_maker/icons/minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 B |
BIN
addons/material_maker/icons/plus.png
Normal file
BIN
addons/material_maker/icons/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 298 B |
@ -210,6 +210,10 @@
|
|||||||
"tree_item":"Miscellaneous/Switch",
|
"tree_item":"Miscellaneous/Switch",
|
||||||
"type":"switch"
|
"type":"switch"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"tree_item":"Miscellaneous/Custom",
|
||||||
|
"type":"custom"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"tree_item":"Miscellaneous/Remote",
|
"tree_item":"Miscellaneous/Remote",
|
||||||
"type":"remote"
|
"type":"remote"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
[ext_resource path="res://addons/material_maker/widgets/tabs.gd" type="Script" id=4]
|
[ext_resource path="res://addons/material_maker/widgets/tabs.gd" type="Script" id=4]
|
||||||
[ext_resource path="res://addons/material_maker/renderer.tscn" type="PackedScene" id=5]
|
[ext_resource path="res://addons/material_maker/renderer.tscn" type="PackedScene" id=5]
|
||||||
|
|
||||||
[node name="MainWindow" type="Panel" index="0"]
|
[node name="MainWindow" type="Panel"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.0
|
anchor_top = 0.0
|
||||||
|
@ -2,7 +2,52 @@ tool
|
|||||||
extends "res://addons/material_maker/nodes/node_generic.gd"
|
extends "res://addons/material_maker/nodes/node_generic.gd"
|
||||||
|
|
||||||
func _on_Edit_pressed():
|
func _on_Edit_pressed():
|
||||||
pass # replace with function body
|
var edit_window = load("res://addons/material_maker/widgets/node_editor/node_editor.tscn").instance()
|
||||||
|
if model_data != null:
|
||||||
|
edit_window.set_model_data(model_data)
|
||||||
|
edit_window.connect("node_changed", self, "update_node")
|
||||||
|
add_child(edit_window)
|
||||||
|
edit_window.popup_centered()
|
||||||
|
|
||||||
|
func _on_Load_pressed():
|
||||||
|
var dialog = FileDialog.new()
|
||||||
|
add_child(dialog)
|
||||||
|
dialog.rect_min_size = Vector2(500, 500)
|
||||||
|
dialog.access = FileDialog.ACCESS_FILESYSTEM
|
||||||
|
dialog.mode = FileDialog.MODE_OPEN_FILE
|
||||||
|
dialog.add_filter("*.mmn;Material Maker Node")
|
||||||
|
dialog.connect("file_selected", self, "do_load_node")
|
||||||
|
dialog.popup_centered()
|
||||||
|
|
||||||
|
func do_load_node(file_name):
|
||||||
|
set_model(file_name)
|
||||||
|
|
||||||
func _on_Save_pressed():
|
func _on_Save_pressed():
|
||||||
pass # replace with function body
|
var dialog = FileDialog.new()
|
||||||
|
add_child(dialog)
|
||||||
|
dialog.rect_min_size = Vector2(500, 500)
|
||||||
|
dialog.access = FileDialog.ACCESS_FILESYSTEM
|
||||||
|
dialog.mode = FileDialog.MODE_SAVE_FILE
|
||||||
|
dialog.add_filter("*.mmn;Material Maker Node")
|
||||||
|
dialog.connect("file_selected", self, "do_save_node")
|
||||||
|
dialog.popup_centered()
|
||||||
|
|
||||||
|
func do_save_node(file_name):
|
||||||
|
var file = File.new()
|
||||||
|
if file.open(file_name, File.WRITE) == OK:
|
||||||
|
file.store_string(to_json(model_data))
|
||||||
|
file.close()
|
||||||
|
model = file_name
|
||||||
|
|
||||||
|
func deserialize(data):
|
||||||
|
if data.has("model_data"):
|
||||||
|
update_node(data.model_data)
|
||||||
|
.deserialize(data)
|
||||||
|
|
||||||
|
func serialize():
|
||||||
|
var file = model
|
||||||
|
model = "custom"
|
||||||
|
var return_value = .serialize()
|
||||||
|
model = file
|
||||||
|
return_value.model_data = model_data
|
||||||
|
return return_value
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=5 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://addons/material_maker/nodes/custom/custom.gd" type="Script" id=1]
|
[ext_resource path="res://addons/material_maker/nodes/custom/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/edit.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://addons/material_maker/icons/save.png" type="Texture" id=3]
|
[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]
|
||||||
|
|
||||||
[node name="Custom" type="GraphNode" index="0"]
|
[node name="Custom" type="GraphNode"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.0
|
anchor_top = 0.0
|
||||||
anchor_right = 0.0
|
anchor_right = 0.0
|
||||||
anchor_bottom = 0.0
|
anchor_bottom = 0.0
|
||||||
margin_left = 385.0
|
margin_left = 1.0
|
||||||
margin_top = 287.0
|
margin_top = 2.0
|
||||||
margin_right = 479.0
|
margin_right = 95.0
|
||||||
margin_bottom = 338.0
|
margin_bottom = 53.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
rect_clip_content = false
|
rect_clip_content = false
|
||||||
mouse_filter = 1
|
mouse_filter = 1
|
||||||
@ -34,6 +35,7 @@ slot/0/right_enabled = false
|
|||||||
slot/0/right_type = 0
|
slot/0/right_type = 0
|
||||||
slot/0/right_color = Color( 1, 1, 1, 1 )
|
slot/0/right_color = Color( 1, 1, 1, 1 )
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
model = null
|
||||||
|
|
||||||
[node name="CustomNodeButtons" type="HBoxContainer" parent="." index="0"]
|
[node name="CustomNodeButtons" type="HBoxContainer" parent="." index="0"]
|
||||||
|
|
||||||
@ -43,7 +45,7 @@ anchor_right = 0.0
|
|||||||
anchor_bottom = 0.0
|
anchor_bottom = 0.0
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 24.0
|
margin_top = 24.0
|
||||||
margin_right = 78.0
|
margin_right = 107.0
|
||||||
margin_bottom = 46.0
|
margin_bottom = 46.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
rect_clip_content = false
|
rect_clip_content = false
|
||||||
@ -76,7 +78,7 @@ icon = ExtResource( 2 )
|
|||||||
flat = true
|
flat = true
|
||||||
align = 1
|
align = 1
|
||||||
|
|
||||||
[node name="Save" type="Button" parent="CustomNodeButtons" index="1"]
|
[node name="Load" type="Button" parent="CustomNodeButtons" index="1"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.0
|
anchor_top = 0.0
|
||||||
@ -100,8 +102,34 @@ icon = ExtResource( 3 )
|
|||||||
flat = true
|
flat = true
|
||||||
align = 1
|
align = 1
|
||||||
|
|
||||||
|
[node name="Save" type="Button" parent="CustomNodeButtons" index="2"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 63.0
|
||||||
|
margin_right = 91.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 = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
icon = ExtResource( 4 )
|
||||||
|
flat = true
|
||||||
|
align = 1
|
||||||
|
|
||||||
[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/Save" to="." method="_on_Save_pressed"]
|
[connection signal="pressed" from="CustomNodeButtons/Save" to="." method="_on_Save_pressed"]
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ func set_model(m):
|
|||||||
var file = File.new()
|
var file = File.new()
|
||||||
var file_name = m
|
var file_name = m
|
||||||
if !file.file_exists(file_name):
|
if !file.file_exists(file_name):
|
||||||
file_name = "res://addons/material_maker/nodes/%s.json" % [ m ]
|
file_name = "res://addons/material_maker/nodes/%s.mmn" % [ m ]
|
||||||
if file.file_exists(file_name):
|
if file.file_exists(file_name):
|
||||||
if file.open(file_name, File.READ) != OK:
|
if file.open(file_name, File.READ) != OK:
|
||||||
return
|
return
|
||||||
@ -33,6 +33,16 @@ func update_node(data):
|
|||||||
return
|
return
|
||||||
if !data.has("name"):
|
if !data.has("name"):
|
||||||
return
|
return
|
||||||
|
# Clean node
|
||||||
|
parameters = {}
|
||||||
|
var custom_node_buttons = null
|
||||||
|
for c in get_children():
|
||||||
|
if c.name != "CustomNodeButtons":
|
||||||
|
remove_child(c)
|
||||||
|
c.queue_free()
|
||||||
|
else:
|
||||||
|
custom_node_buttons = c
|
||||||
|
# Rebuild node
|
||||||
title = data.name
|
title = data.name
|
||||||
model_data = data
|
model_data = data
|
||||||
uses_seed = false
|
uses_seed = false
|
||||||
@ -99,6 +109,8 @@ func update_node(data):
|
|||||||
set_slot(i, false, 0, color_right, enable_right, 0, color_right)
|
set_slot(i, false, 0, color_right, enable_right, 0, color_right)
|
||||||
else:
|
else:
|
||||||
model_data.outputs = []
|
model_data.outputs = []
|
||||||
|
if custom_node_buttons != null:
|
||||||
|
move_child(custom_node_buttons, get_child_count()-1)
|
||||||
|
|
||||||
func subst(string, uv = ""):
|
func subst(string, uv = ""):
|
||||||
string = string.replace("$(name)", name)
|
string = string.replace("$(name)", name)
|
||||||
|
8
addons/material_maker/widgets/node_editor/input.gd
Normal file
8
addons/material_maker/widgets/node_editor/input.gd
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
tool
|
||||||
|
extends HBoxContainer
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _on_Delete_pressed():
|
||||||
|
queue_free()
|
159
addons/material_maker/widgets/node_editor/input.tscn
Normal file
159
addons/material_maker/widgets/node_editor/input.tscn
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
[gd_scene load_steps=3 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/icons/minus.png" type="Texture" id=2]
|
||||||
|
|
||||||
|
[node name="Parameter" type="HBoxContainer"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 201.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 )
|
||||||
|
|
||||||
|
[node name="Delete" type="Button" parent="." index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 28.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 = 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
|
||||||
|
align = 1
|
||||||
|
|
||||||
|
[node name="Name" type="LineEdit" parent="." index="1"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 32.0
|
||||||
|
margin_right = 102.0
|
||||||
|
margin_bottom = 24.0
|
||||||
|
rect_min_size = Vector2( 70, 0 )
|
||||||
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
|
rect_clip_content = false
|
||||||
|
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"
|
||||||
|
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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 106.0
|
||||||
|
margin_right = 176.0
|
||||||
|
margin_bottom = 24.0
|
||||||
|
rect_min_size = Vector2( 70, 0 )
|
||||||
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
|
rect_clip_content = false
|
||||||
|
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"
|
||||||
|
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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 180.0
|
||||||
|
margin_right = 282.0
|
||||||
|
margin_bottom = 24.0
|
||||||
|
rect_min_size = Vector2( 102, 0 )
|
||||||
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
|
rect_clip_content = false
|
||||||
|
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"
|
||||||
|
flat = false
|
||||||
|
align = 0
|
||||||
|
items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null ]
|
||||||
|
selected = 0
|
||||||
|
_sections_unfolded = [ "Focus", "Hint", "Rect" ]
|
||||||
|
|
||||||
|
[node name="Default" type="LineEdit" parent="." index="4"]
|
||||||
|
|
||||||
|
anchor_left = 0.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
|
||||||
|
rect_min_size = Vector2( 70, 0 )
|
||||||
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
|
rect_clip_content = false
|
||||||
|
hint_tooltip = "Default value"
|
||||||
|
focus_mode = 2
|
||||||
|
mouse_filter = 0
|
||||||
|
mouse_default_cursor_shape = 1
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
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" ]
|
||||||
|
|
||||||
|
[connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"]
|
||||||
|
|
||||||
|
|
@ -1,16 +1,62 @@
|
|||||||
|
tool
|
||||||
extends WindowDialog
|
extends WindowDialog
|
||||||
|
|
||||||
var model_data
|
var model_data = null
|
||||||
|
|
||||||
func _init(data):
|
const ParameterEditor = preload("res://addons/material_maker/widgets/node_editor/parameter.tscn")
|
||||||
model_data = data
|
const InputEditor = preload("res://addons/material_maker/widgets/node_editor/input.tscn")
|
||||||
|
const OutputEditor = preload("res://addons/material_maker/widgets/node_editor/output.tscn")
|
||||||
|
|
||||||
func _ready():
|
signal node_changed
|
||||||
# Called when the node is added to the scene for the first time.
|
|
||||||
# Initialization here
|
|
||||||
pass
|
|
||||||
|
|
||||||
#func _process(delta):
|
func add_item(parent, scene):
|
||||||
# # Called every frame. Delta is time since last frame.
|
var object = scene.instance()
|
||||||
# # Update game logic here.
|
parent.add_child(object)
|
||||||
# pass
|
parent.move_child(object, parent.get_child_count()-2)
|
||||||
|
return object
|
||||||
|
|
||||||
|
func set_model_data(data):
|
||||||
|
if data.has("name"):
|
||||||
|
$Sizer/Tabs/General/Name/Name.text = data.name
|
||||||
|
if data.has("parameters"):
|
||||||
|
for p in data.parameters:
|
||||||
|
add_item($Sizer/Tabs/General/Parameters/Sizer, ParameterEditor).set_model_data(p)
|
||||||
|
if data.has("outputs"):
|
||||||
|
for o in data.outputs:
|
||||||
|
add_item($Sizer/Tabs/General/Outputs/Sizer, OutputEditor).set_model_data(o)
|
||||||
|
if data.has("global"):
|
||||||
|
$Sizer/Tabs/Global.text = data.global
|
||||||
|
if data.has("instance"):
|
||||||
|
$Sizer/Tabs/Instance.text = data.instance
|
||||||
|
|
||||||
|
func get_model_data():
|
||||||
|
var data = {
|
||||||
|
name=$Sizer/Tabs/General/Name/Name.text,
|
||||||
|
global=$Sizer/Tabs/Global.text,
|
||||||
|
instance=$Sizer/Tabs/Instance.text,
|
||||||
|
}
|
||||||
|
data.parameters = []
|
||||||
|
for p in $Sizer/Tabs/General/Parameters/Sizer.get_children():
|
||||||
|
if p.has_method("get_model_data"):
|
||||||
|
data.parameters.append(p.get_model_data())
|
||||||
|
data.outputs = []
|
||||||
|
for o in $Sizer/Tabs/General/Outputs/Sizer.get_children():
|
||||||
|
if o.has_method("get_model_data"):
|
||||||
|
data.outputs.append(o.get_model_data())
|
||||||
|
return data
|
||||||
|
|
||||||
|
func _on_AddParameter_pressed():
|
||||||
|
add_item($Sizer/Tabs/General/Parameters/Sizer, ParameterEditor)
|
||||||
|
|
||||||
|
func _on_AddInput_pressed():
|
||||||
|
add_item($Sizer/Tabs/General/Inputs/Sizer, InputEditor)
|
||||||
|
|
||||||
|
func _on_AddOutput_pressed():
|
||||||
|
add_item($Sizer/Tabs/General/Outputs/Sizer, OutputEditor)
|
||||||
|
|
||||||
|
func _on_OK_pressed():
|
||||||
|
emit_signal("node_changed", get_model_data())
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
func _on_Cancel_pressed():
|
||||||
|
queue_free()
|
||||||
|
@ -1,27 +1,29 @@
|
|||||||
[gd_scene load_steps=2 format=2]
|
[gd_scene load_steps=3 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]
|
||||||
|
|
||||||
[node name="NodeEditor" type="WindowDialog" index="0"]
|
[node name="NodeEditor" type="WindowDialog"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.0
|
anchor_top = 0.0
|
||||||
anchor_right = 0.0
|
anchor_right = 0.0
|
||||||
anchor_bottom = 0.0
|
anchor_bottom = 0.0
|
||||||
margin_right = 469.0
|
margin_right = 726.0
|
||||||
margin_bottom = 373.0
|
margin_bottom = 399.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
rect_clip_content = false
|
rect_clip_content = false
|
||||||
mouse_filter = 0
|
mouse_filter = 0
|
||||||
mouse_default_cursor_shape = 0
|
mouse_default_cursor_shape = 0
|
||||||
size_flags_horizontal = 1
|
size_flags_horizontal = 1
|
||||||
size_flags_vertical = 1
|
size_flags_vertical = 1
|
||||||
popup_exclusive = false
|
popup_exclusive = true
|
||||||
window_title = "Node Editor"
|
window_title = "Node Editor"
|
||||||
resizable = false
|
resizable = false
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
_sections_unfolded = [ "Popup" ]
|
||||||
|
|
||||||
[node name="Tabs" type="TabContainer" parent="." index="1"]
|
[node name="Sizer" type="VBoxContainer" parent="." index="0"]
|
||||||
|
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.0
|
anchor_top = 0.0
|
||||||
@ -29,15 +31,368 @@ anchor_right = 1.0
|
|||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
rect_pivot_offset = Vector2( 0, 0 )
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
rect_clip_content = false
|
rect_clip_content = false
|
||||||
|
mouse_filter = 1
|
||||||
|
mouse_default_cursor_shape = 0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
alignment = 0
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="Tabs" type="TabContainer" parent="Sizer" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 726.0
|
||||||
|
margin_bottom = 375.0
|
||||||
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
|
rect_clip_content = false
|
||||||
mouse_filter = 0
|
mouse_filter = 0
|
||||||
mouse_default_cursor_shape = 0
|
mouse_default_cursor_shape = 0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
tab_align = 0
|
||||||
|
tabs_visible = true
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="General" type="VBoxContainer" parent="Sizer/Tabs" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 4.0
|
||||||
|
margin_top = 32.0
|
||||||
|
margin_right = -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_horizontal = 1
|
||||||
size_flags_vertical = 1
|
size_flags_vertical = 1
|
||||||
tab_align = 0
|
alignment = 0
|
||||||
tabs_visible = true
|
|
||||||
|
|
||||||
[node name="Global" type="TextEdit" parent="Tabs" index="0"]
|
[node name="Name" type="HBoxContainer" parent="Sizer/Tabs/General" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 718.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_vertical = 1
|
||||||
|
alignment = 0
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="LabelName" type="Label" parent="Sizer/Tabs/General/Name" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = 42.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:"
|
||||||
|
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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 46.0
|
||||||
|
margin_right = 718.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_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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 28.0
|
||||||
|
margin_right = 718.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:"
|
||||||
|
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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 46.0
|
||||||
|
margin_right = 718.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_vertical = 3
|
||||||
|
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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 718.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_vertical = 1
|
||||||
|
alignment = 0
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="AddParameter" type="Button" parent="Sizer/Tabs/General/Parameters/Sizer" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 28.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_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
icon = ExtResource( 2 )
|
||||||
|
flat = true
|
||||||
|
align = 1
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="LabelInputs" type="Label" parent="Sizer/Tabs/General" index="3"]
|
||||||
|
|
||||||
|
visible = false
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 176.0
|
||||||
|
margin_right = 718.0
|
||||||
|
margin_bottom = 190.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:"
|
||||||
|
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"]
|
||||||
|
|
||||||
|
visible = false
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 139.0
|
||||||
|
margin_right = 718.0
|
||||||
|
margin_bottom = 228.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_vertical = 3
|
||||||
|
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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 718.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_vertical = 1
|
||||||
|
alignment = 0
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="AddInput" type="Button" parent="Sizer/Tabs/General/Inputs/Sizer" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 28.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_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
icon = ExtResource( 2 )
|
||||||
|
flat = true
|
||||||
|
align = 1
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="LabelOutputs" type="Label" parent="Sizer/Tabs/General" index="5"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 185.0
|
||||||
|
margin_right = 718.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 = "Outputs:"
|
||||||
|
percent_visible = 1.0
|
||||||
|
lines_skipped = 0
|
||||||
|
max_lines_visible = -1
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="Outputs" type="ScrollContainer" parent="Sizer/Tabs/General" index="6"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 203.0
|
||||||
|
margin_right = 718.0
|
||||||
|
margin_bottom = 339.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_vertical = 3
|
||||||
|
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/Outputs" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 718.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_vertical = 1
|
||||||
|
alignment = 0
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="AddOutput" type="Button" parent="Sizer/Tabs/General/Outputs/Sizer" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 28.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_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
icon = ExtResource( 2 )
|
||||||
|
flat = true
|
||||||
|
align = 1
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="Global" type="TextEdit" parent="Sizer/Tabs" index="1"]
|
||||||
|
|
||||||
|
visible = false
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.0
|
anchor_top = 0.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@ -70,4 +425,117 @@ caret_blink = false
|
|||||||
caret_blink_speed = 0.65
|
caret_blink_speed = 0.65
|
||||||
caret_moving_by_right_click = true
|
caret_moving_by_right_click = true
|
||||||
|
|
||||||
|
[node name="Instance" type="TextEdit" parent="Sizer/Tabs" index="2"]
|
||||||
|
|
||||||
|
visible = false
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 4.0
|
||||||
|
margin_top = 32.0
|
||||||
|
margin_right = -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
|
||||||
|
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"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 291.0
|
||||||
|
margin_top = 379.0
|
||||||
|
margin_right = 435.0
|
||||||
|
margin_bottom = 399.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_vertical = 1
|
||||||
|
alignment = 0
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="OK" type="Button" parent="Sizer/HBoxContainer" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 70.0
|
||||||
|
margin_bottom = 20.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"
|
||||||
|
flat = false
|
||||||
|
align = 1
|
||||||
|
|
||||||
|
[node name="Cancel" type="Button" parent="Sizer/HBoxContainer" index="1"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 74.0
|
||||||
|
margin_right = 144.0
|
||||||
|
margin_bottom = 20.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"
|
||||||
|
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/Inputs/Sizer/AddInput" to="." method="_on_AddInput_pressed"]
|
||||||
|
|
||||||
|
[connection signal="pressed" from="Sizer/Tabs/General/Outputs/Sizer/AddOutput" to="." method="_on_AddOutput_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"]
|
||||||
|
|
||||||
|
|
||||||
|
22
addons/material_maker/widgets/node_editor/output.gd
Normal file
22
addons/material_maker/widgets/node_editor/output.gd
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
tool
|
||||||
|
extends HBoxContainer
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func set_model_data(data):
|
||||||
|
if data.has("rgb"):
|
||||||
|
$Type.selected = 1
|
||||||
|
$Default.text = data.rgb
|
||||||
|
elif data.has("f"):
|
||||||
|
$Type.selected = 0
|
||||||
|
$Default.text = data.f
|
||||||
|
|
||||||
|
func get_model_data():
|
||||||
|
if $Type.selected == 1:
|
||||||
|
return { rgb=$Default.text }
|
||||||
|
else:
|
||||||
|
return { f=$Default.text }
|
||||||
|
|
||||||
|
func _on_Delete_pressed():
|
||||||
|
queue_free()
|
105
addons/material_maker/widgets/node_editor/output.tscn
Normal file
105
addons/material_maker/widgets/node_editor/output.tscn
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
[gd_scene load_steps=3 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/icons/minus.png" type="Texture" id=2]
|
||||||
|
|
||||||
|
[node name="Output" type="HBoxContainer"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 201.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_vertical = 1
|
||||||
|
alignment = 0
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
_sections_unfolded = [ "Size Flags" ]
|
||||||
|
|
||||||
|
[node name="Delete" type="Button" parent="." index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 28.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 = 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
|
||||||
|
align = 1
|
||||||
|
|
||||||
|
[node name="Type" type="OptionButton" parent="." index="1"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 32.0
|
||||||
|
margin_right = 134.0
|
||||||
|
margin_bottom = 24.0
|
||||||
|
rect_min_size = Vector2( 102, 0 )
|
||||||
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
|
rect_clip_content = false
|
||||||
|
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"
|
||||||
|
flat = false
|
||||||
|
align = 0
|
||||||
|
items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null ]
|
||||||
|
selected = 0
|
||||||
|
_sections_unfolded = [ "Focus", "Hint", "Rect" ]
|
||||||
|
|
||||||
|
[node name="Default" type="LineEdit" parent="." index="2"]
|
||||||
|
|
||||||
|
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_bottom = 24.0
|
||||||
|
rect_pivot_offset = Vector2( 0, 0 )
|
||||||
|
rect_clip_content = false
|
||||||
|
hint_tooltip = "Default value"
|
||||||
|
focus_mode = 2
|
||||||
|
mouse_filter = 0
|
||||||
|
mouse_default_cursor_shape = 1
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 1
|
||||||
|
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"]
|
||||||
|
|
||||||
|
|
60
addons/material_maker/widgets/node_editor/parameter.gd
Normal file
60
addons/material_maker/widgets/node_editor/parameter.gd
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
tool
|
||||||
|
extends HBoxContainer
|
||||||
|
|
||||||
|
const PARAMETER_TYPE = [ "float", "size", "enum", "boolean" ]
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func set_model_data(data):
|
||||||
|
if data.has("name"):
|
||||||
|
$Name.text = data.name
|
||||||
|
if data.has("label"):
|
||||||
|
$Label.text = data.label
|
||||||
|
if !data.has("type"):
|
||||||
|
return
|
||||||
|
for t in $Types.get_children():
|
||||||
|
t.visible = false
|
||||||
|
var w = null
|
||||||
|
if data.type == "float":
|
||||||
|
$Type.selected = 0
|
||||||
|
w = $Types/T0
|
||||||
|
if data.has("min"):
|
||||||
|
$Types/T0/Min.value = data.min
|
||||||
|
if data.has("max"):
|
||||||
|
$Types/T0/Max.value = data.max
|
||||||
|
if data.has("step"):
|
||||||
|
$Types/T0/Step.value = data.step
|
||||||
|
$Types/T0/SpinBox.pressed = ( data.has("widget") && data.widget == "spinbox" )
|
||||||
|
elif data.type == "size":
|
||||||
|
$Type.selected = 1
|
||||||
|
w = $Types/T1
|
||||||
|
elif data.type == "enum":
|
||||||
|
$Type.selected = 2
|
||||||
|
w = $Types/T2
|
||||||
|
elif data.type == "boolean":
|
||||||
|
$Type.selected = 3
|
||||||
|
w = $Types/T3
|
||||||
|
if w != null:
|
||||||
|
w.visible = true
|
||||||
|
|
||||||
|
func get_model_data():
|
||||||
|
var data = {
|
||||||
|
name=$Name.text,
|
||||||
|
label=$Label.text,
|
||||||
|
type=PARAMETER_TYPE[$Type.selected],
|
||||||
|
}
|
||||||
|
if $Type.selected == 0:
|
||||||
|
data.min = $Types/T0/Min.value
|
||||||
|
data.max = $Types/T0/Max.value
|
||||||
|
data.step = $Types/T0/Step.value
|
||||||
|
if $Types/T0/SpinBox.pressed:
|
||||||
|
data.widget = "spinbox"
|
||||||
|
return data
|
||||||
|
|
||||||
|
func _on_Delete_pressed():
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
func _on_OptionButton_item_selected(ID):
|
||||||
|
for c in $Types.get_children():
|
||||||
|
c.visible = "T"+str(ID) == c.name
|
498
addons/material_maker/widgets/node_editor/parameter.tscn
Normal file
498
addons/material_maker/widgets/node_editor/parameter.tscn
Normal file
@ -0,0 +1,498 @@
|
|||||||
|
[gd_scene load_steps=3 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/icons/minus.png" type="Texture" id=2]
|
||||||
|
|
||||||
|
[node name="Parameter" type="HBoxContainer" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 201.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 )
|
||||||
|
|
||||||
|
[node name="Delete" type="Button" parent="." index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 28.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 = 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
|
||||||
|
align = 1
|
||||||
|
|
||||||
|
[node name="Name" type="LineEdit" parent="." index="1"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 32.0
|
||||||
|
margin_right = 102.0
|
||||||
|
margin_bottom = 24.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 = 1
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
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 = [ "Rect" ]
|
||||||
|
|
||||||
|
[node name="Label" type="LineEdit" parent="." index="2"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 106.0
|
||||||
|
margin_right = 176.0
|
||||||
|
margin_bottom = 24.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 = 1
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
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 = [ "Rect" ]
|
||||||
|
|
||||||
|
[node name="Type" type="OptionButton" parent="." index="3"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 180.0
|
||||||
|
margin_right = 250.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 = 0
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
action_mode = 0
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
text = "Float"
|
||||||
|
flat = false
|
||||||
|
align = 0
|
||||||
|
items = [ "Float", null, false, 0, null, "Size", null, false, 1, null, "Enum", null, false, 2, null, "Boolean", null, false, 3, null ]
|
||||||
|
selected = 0
|
||||||
|
|
||||||
|
[node name="Types" type="HBoxContainer" parent="." index="4"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 254.0
|
||||||
|
margin_right = 669.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
|
||||||
|
|
||||||
|
[node name="T0" type="HBoxContainer" parent="Types" index="0"]
|
||||||
|
|
||||||
|
editor/display_folded = true
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 415.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
|
||||||
|
_sections_unfolded = [ "Visibility" ]
|
||||||
|
|
||||||
|
[node name="LabelMin" type="Label" parent="Types/T0" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = 28.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 = "Min:"
|
||||||
|
percent_visible = 1.0
|
||||||
|
lines_skipped = 0
|
||||||
|
max_lines_visible = -1
|
||||||
|
|
||||||
|
[node name="Min" type="SpinBox" parent="Types/T0" index="1"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 32.0
|
||||||
|
margin_right = 106.0
|
||||||
|
margin_bottom = 24.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
|
||||||
|
min_value = -65536.0
|
||||||
|
max_value = 65535.0
|
||||||
|
step = 0.0
|
||||||
|
page = 0.0
|
||||||
|
value = 0.0
|
||||||
|
exp_edit = false
|
||||||
|
rounded = false
|
||||||
|
editable = true
|
||||||
|
prefix = ""
|
||||||
|
suffix = ""
|
||||||
|
|
||||||
|
[node name="LabelMax" type="Label" parent="Types/T0" index="2"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 110.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = 140.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 = "Max:"
|
||||||
|
percent_visible = 1.0
|
||||||
|
lines_skipped = 0
|
||||||
|
max_lines_visible = -1
|
||||||
|
|
||||||
|
[node name="Max" type="SpinBox" parent="Types/T0" index="3"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 144.0
|
||||||
|
margin_right = 218.0
|
||||||
|
margin_bottom = 24.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
|
||||||
|
min_value = -65536.0
|
||||||
|
max_value = 65535.0
|
||||||
|
step = 0.0
|
||||||
|
page = 0.0
|
||||||
|
value = 0.0
|
||||||
|
exp_edit = false
|
||||||
|
rounded = false
|
||||||
|
editable = true
|
||||||
|
prefix = ""
|
||||||
|
suffix = ""
|
||||||
|
|
||||||
|
[node name="LabelStep" type="Label" parent="Types/T0" index="4"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 222.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = 254.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 = "Step:"
|
||||||
|
percent_visible = 1.0
|
||||||
|
lines_skipped = 0
|
||||||
|
max_lines_visible = -1
|
||||||
|
|
||||||
|
[node name="Step" type="SpinBox" parent="Types/T0" index="5"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 258.0
|
||||||
|
margin_right = 332.0
|
||||||
|
margin_bottom = 24.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
|
||||||
|
min_value = 0.0
|
||||||
|
max_value = 65535.0
|
||||||
|
step = 0.0
|
||||||
|
page = 0.0
|
||||||
|
value = 0.0
|
||||||
|
exp_edit = false
|
||||||
|
rounded = false
|
||||||
|
editable = true
|
||||||
|
prefix = ""
|
||||||
|
suffix = ""
|
||||||
|
|
||||||
|
[node name="SpinBox" type="CheckBox" parent="Types/T0" index="6"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 336.0
|
||||||
|
margin_right = 415.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 = 0
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
toggle_mode = true
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
text = "SpinBox"
|
||||||
|
flat = false
|
||||||
|
align = 0
|
||||||
|
|
||||||
|
[node name="T1" type="HBoxContainer" parent="Types" index="1"]
|
||||||
|
|
||||||
|
editor/display_folded = true
|
||||||
|
visible = false
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 148.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
|
||||||
|
|
||||||
|
[node name="LabelMin" type="Label" parent="Types/T1" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = 28.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 = "Min:"
|
||||||
|
percent_visible = 1.0
|
||||||
|
lines_skipped = 0
|
||||||
|
max_lines_visible = -1
|
||||||
|
|
||||||
|
[node name="Min" type="OptionButton" parent="Types/T1" index="1"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 32.0
|
||||||
|
margin_right = 71.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 = 0
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
action_mode = 0
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
flat = false
|
||||||
|
align = 0
|
||||||
|
items = [ ]
|
||||||
|
selected = -1
|
||||||
|
|
||||||
|
[node name="LabelMax" type="Label" parent="Types/T1" index="2"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 75.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = 105.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 = "Max:"
|
||||||
|
percent_visible = 1.0
|
||||||
|
lines_skipped = 0
|
||||||
|
max_lines_visible = -1
|
||||||
|
|
||||||
|
[node name="Max" type="OptionButton" parent="Types/T1" index="3"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_left = 109.0
|
||||||
|
margin_right = 148.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 = 0
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
action_mode = 0
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
flat = false
|
||||||
|
align = 0
|
||||||
|
items = [ ]
|
||||||
|
selected = -1
|
||||||
|
|
||||||
|
[node name="T2" type="HBoxContainer" parent="Types" index="2"]
|
||||||
|
|
||||||
|
editor/display_folded = true
|
||||||
|
visible = false
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 39.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
|
||||||
|
|
||||||
|
[node name="OptionButton" type="OptionButton" parent="Types/T2" index="0"]
|
||||||
|
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
margin_right = 39.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 = 0
|
||||||
|
size_flags_horizontal = 1
|
||||||
|
size_flags_vertical = 1
|
||||||
|
toggle_mode = false
|
||||||
|
action_mode = 0
|
||||||
|
enabled_focus_mode = 2
|
||||||
|
shortcut = null
|
||||||
|
group = null
|
||||||
|
flat = false
|
||||||
|
align = 0
|
||||||
|
items = [ ]
|
||||||
|
selected = -1
|
||||||
|
|
||||||
|
[node name="T3" type="HBoxContainer" parent="Types" index="3"]
|
||||||
|
|
||||||
|
visible = false
|
||||||
|
anchor_left = 0.0
|
||||||
|
anchor_top = 0.0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.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
|
||||||
|
|
||||||
|
[connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"]
|
||||||
|
|
||||||
|
[connection signal="item_selected" from="Type" to="." method="_on_OptionButton_item_selected"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user