mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
Updated new UI and more refactoring
This commit is contained in:
parent
6f0eb8e8e1
commit
63685f8771
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,3 +14,5 @@ addons/procedural_material/models/models.dae
|
||||
addons/procedural_material/models/models.dae.import
|
||||
/examples/*.png
|
||||
/examples/*.import
|
||||
examples/input_image.png.import
|
||||
examples/input_image.png.import
|
||||
|
@ -1,6 +1,9 @@
|
||||
tool
|
||||
extends GraphEdit
|
||||
|
||||
var save_path = null
|
||||
|
||||
signal save_path_changed
|
||||
signal graph_changed
|
||||
|
||||
func _ready():
|
||||
@ -11,15 +14,12 @@ func get_source(node, port):
|
||||
if c.to == node && c.to_port == port:
|
||||
return { node=c.from, slot=c.from_port }
|
||||
|
||||
func add_node(node, position = null):
|
||||
func add_node(node, global_position = null):
|
||||
add_child(node)
|
||||
if position != null:
|
||||
node.offset = position
|
||||
if global_position != null:
|
||||
node.offset = (scroll_offset + global_position - rect_global_position) / zoom
|
||||
node.connect("close_request", self, "remove_node", [ node ])
|
||||
|
||||
func add_node_globalpos(node, global_position):
|
||||
add_node(node, (scroll_offset + global_position - rect_global_position) / zoom)
|
||||
|
||||
func remove_node(node):
|
||||
var node_name = node.name
|
||||
for c in get_connection_list():
|
||||
@ -39,22 +39,66 @@ func _on_GraphEdit_disconnection_request(from, from_slot, to, to_slot):
|
||||
disconnect_node(from, from_slot, to, to_slot)
|
||||
send_changed_signal();
|
||||
|
||||
# Global operations on graph
|
||||
|
||||
func update_tab_title():
|
||||
var title = "[unnamed]"
|
||||
if save_path != null:
|
||||
title = save_path.right(save_path.rfind("/")+1)
|
||||
get_parent().set_tab_title(get_index(), title)
|
||||
|
||||
func set_save_path(path):
|
||||
if path != save_path:
|
||||
save_path = path
|
||||
if get_parent() is TabContainer:
|
||||
update_tab_title()
|
||||
else:
|
||||
emit_signal("save_path_changed", self, path)
|
||||
|
||||
func clear_material():
|
||||
clear_connections()
|
||||
for c in get_children():
|
||||
if c is GraphNode:
|
||||
remove_child(c)
|
||||
c.free()
|
||||
send_changed_signal()
|
||||
|
||||
func new_material():
|
||||
clear_material()
|
||||
var node_type = load("res://addons/procedural_material/nodes/material.tscn")
|
||||
create_node({name="Material", type="material"})
|
||||
set_save_path(null)
|
||||
|
||||
func create_node(data, global_position = null):
|
||||
if !data.has("type"):
|
||||
return null
|
||||
var node_type = load("res://addons/procedural_material/nodes/"+data.type+".tscn")
|
||||
if node_type != null:
|
||||
var node = node_type.instance()
|
||||
add_node(node)
|
||||
do_send_changed_signal()
|
||||
if data.has("name") && !has_node(data.name):
|
||||
node.name = data.name
|
||||
else:
|
||||
var i = 0
|
||||
while true:
|
||||
var node_name = data.type+"_"+str(i)
|
||||
if !has_node(node_name):
|
||||
node.name = node_name
|
||||
break
|
||||
i += 1
|
||||
add_node(node, global_position)
|
||||
node.deserialize(data)
|
||||
send_changed_signal()
|
||||
|
||||
func load_file(filename):
|
||||
func load_file():
|
||||
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("*.ptex;Procedural textures file")
|
||||
dialog.connect("file_selected", self, "do_load_file")
|
||||
dialog.popup_centered()
|
||||
|
||||
func do_load_file(filename):
|
||||
var file = File.new()
|
||||
if file.open(filename, File.READ) != OK:
|
||||
return
|
||||
@ -62,19 +106,29 @@ func load_file(filename):
|
||||
file.close()
|
||||
clear_material()
|
||||
for n in data.nodes:
|
||||
if !n.has("type"):
|
||||
continue
|
||||
var node_type = load("res://addons/procedural_material/nodes/"+n.type+".tscn")
|
||||
if node_type != null:
|
||||
var node = node_type.instance()
|
||||
node.name = n.name
|
||||
add_node(node)
|
||||
node.deserialize(n)
|
||||
var node = create_node(n)
|
||||
for c in data.connections:
|
||||
connect_node(c.from, c.from_port, c.to, c.to_port)
|
||||
do_send_changed_signal()
|
||||
set_save_path(filename)
|
||||
send_changed_signal()
|
||||
|
||||
func save_file(filename):
|
||||
func save_file():
|
||||
if save_path != null:
|
||||
do_save_file(save_path)
|
||||
else:
|
||||
save_file_as()
|
||||
|
||||
func save_file_as():
|
||||
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("*.ptex;Procedural textures file")
|
||||
dialog.connect("file_selected", self, "do_save_file")
|
||||
dialog.popup_centered()
|
||||
|
||||
func do_save_file(filename):
|
||||
var data = { nodes = [] }
|
||||
for c in get_children():
|
||||
if c is GraphNode:
|
||||
@ -84,20 +138,34 @@ func save_file(filename):
|
||||
if file.open(filename, File.WRITE) == OK:
|
||||
file.store_string(to_json(data))
|
||||
file.close()
|
||||
set_save_path(filename)
|
||||
|
||||
func export_textures(size = 512):
|
||||
if save_path != null:
|
||||
var prefix = save_path.left(save_path.rfind("."))
|
||||
$GraphEdit/Material.export_textures(prefix)
|
||||
|
||||
func send_changed_signal():
|
||||
$Timer.stop()
|
||||
$Timer.start()
|
||||
|
||||
func do_send_changed_signal():
|
||||
emit_signal("graph_changed")
|
||||
|
||||
func can_drop_data(position, data):
|
||||
return typeof(data) == TYPE_DICTIONARY and data.has('type')
|
||||
|
||||
func drop_data(position, data):
|
||||
var node = create_node(data, get_global_transform().xform(position))
|
||||
return true
|
||||
|
||||
# Save shader to image, create image texture
|
||||
|
||||
func setup_material(shader_material, textures, shader_code):
|
||||
for k in textures.keys():
|
||||
shader_material.set_shader_param(k+"_tex", textures[k])
|
||||
shader_material.shader.code = shader_code
|
||||
|
||||
# Save shader to image
|
||||
|
||||
var render_queue = []
|
||||
|
||||
func render_to_viewport(node, size, method, args):
|
||||
|
@ -1,8 +1,7 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://addons/procedural_material/graph_edit.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/procedural_material/nodes/material.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/procedural_material/nodes/material.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="Theme" id=1]
|
||||
|
||||
@ -249,10 +248,8 @@ shader = SubResource( 2 )
|
||||
self_modulate = Color( 1, 1, 1, 0 )
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 718.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = true
|
||||
focus_mode = 2
|
||||
@ -268,75 +265,21 @@ zoom = 1.0
|
||||
script = ExtResource( 1 )
|
||||
_sections_unfolded = [ "Material", "Mouse", "Visibility" ]
|
||||
|
||||
[node name="Material" type="GraphNode" parent="." index="2" instance=ExtResource( 2 )]
|
||||
[node name="Material" parent="." index="0" instance=ExtResource( 2 )]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 111.0
|
||||
margin_bottom = 118.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
|
||||
theme = SubResource( 1 )
|
||||
title = "Material"
|
||||
offset = Vector2( 0, 0 )
|
||||
show_close = false
|
||||
resizable = false
|
||||
selected = false
|
||||
comment = false
|
||||
overlay = 0
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color( 0.5, 0.5, 1, 1 )
|
||||
slot/0/right_enabled = false
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color( 0.5, 0.5, 1, 1 )
|
||||
slot/1/left_enabled = true
|
||||
slot/1/left_type = 0
|
||||
slot/1/left_color = Color( 0.5, 0.5, 1, 1 )
|
||||
slot/1/right_enabled = false
|
||||
slot/1/right_type = 0
|
||||
slot/1/right_color = Color( 0.5, 0.5, 1, 1 )
|
||||
slot/2/left_enabled = true
|
||||
slot/2/left_type = 0
|
||||
slot/2/left_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
slot/2/right_enabled = false
|
||||
slot/2/right_type = 0
|
||||
slot/2/right_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
slot/3/left_enabled = true
|
||||
slot/3/left_type = 0
|
||||
slot/3/left_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
slot/3/right_enabled = false
|
||||
slot/3/right_type = 0
|
||||
slot/3/right_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
slot/4/left_enabled = true
|
||||
slot/4/left_type = 0
|
||||
slot/4/left_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
slot/4/right_enabled = false
|
||||
slot/4/right_type = 0
|
||||
slot/4/right_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
slot/5/left_enabled = true
|
||||
slot/5/left_type = 0
|
||||
slot/5/left_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
slot/5/right_enabled = false
|
||||
slot/5/right_type = 0
|
||||
slot/5/right_color = Color( 0.498039, 0.498039, 1, 1 )
|
||||
script = ExtResource( 3 )
|
||||
_sections_unfolded = [ "Anchor", "Margin", "Mouse", "Theme", "slot", "slot/2", "slot/3", "slot/4", "slot/5" ]
|
||||
|
||||
[node name="Timer" type="Timer" parent="." index="3"]
|
||||
[node name="Timer" type="Timer" parent="." index="1"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 0.1
|
||||
wait_time = 0.2
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="SaveViewport" type="Viewport" parent="." index="4"]
|
||||
[node name="SaveViewport" type="Viewport" parent="." index="2"]
|
||||
|
||||
arvr = false
|
||||
size = Vector2( 0, 0 )
|
||||
|
49
addons/procedural_material/library.gd
Normal file
49
addons/procedural_material/library.gd
Normal file
@ -0,0 +1,49 @@
|
||||
extends Tree
|
||||
|
||||
# class member variables go here, for example:
|
||||
# var a = 2
|
||||
# var b = "textvar"
|
||||
|
||||
func get_drag_data(position):
|
||||
var selected_item = get_selected()
|
||||
if selected_item != null:
|
||||
var data = selected_item.get_metadata(0)
|
||||
return data
|
||||
return null
|
||||
|
||||
|
||||
func _ready():
|
||||
var root = create_item()
|
||||
add_library("res://addons/procedural_material/material_library.json")
|
||||
|
||||
func add_library(filename):
|
||||
var root = get_root()
|
||||
var file = File.new()
|
||||
if file.open(filename, File.READ) != OK:
|
||||
return
|
||||
var lib = parse_json(file.get_as_text())
|
||||
file.close()
|
||||
for m in lib.lib:
|
||||
add_item(m, m.tree_item, root)
|
||||
|
||||
func add_item(item, item_name, item_parent):
|
||||
var slash_position = item_name.find("/")
|
||||
if slash_position == -1:
|
||||
var new_item = create_item(item_parent)
|
||||
new_item.set_text(0, item_name)
|
||||
new_item.set_metadata(0, item)
|
||||
return new_item
|
||||
else:
|
||||
var prefix = item_name.left(slash_position)
|
||||
var suffix = item_name.right(slash_position+1)
|
||||
var new_parent = null
|
||||
var c = item_parent.get_children()
|
||||
while c != null:
|
||||
if c.get_text(0) == prefix:
|
||||
new_parent = c
|
||||
break
|
||||
c = c.get_next()
|
||||
if new_parent == null:
|
||||
new_parent = create_item(item_parent)
|
||||
new_parent.set_text(0, prefix)
|
||||
return add_item(item, suffix, new_parent)
|
86
addons/procedural_material/main_window.gd
Normal file
86
addons/procedural_material/main_window.gd
Normal file
@ -0,0 +1,86 @@
|
||||
extends Panel
|
||||
|
||||
var current_tab = -1
|
||||
|
||||
const MENU = [
|
||||
{ menu="File", command="new_material", description="New material" },
|
||||
{ menu="File", command="load_material", description="Load material" },
|
||||
{ menu="File" },
|
||||
{ menu="File", command="save_material", description="Save material" },
|
||||
{ menu="File", command="save_material_as", description="Save material as..." },
|
||||
{ menu="File", command="save_all_materials", description="Save all materials..." },
|
||||
{ menu="File" },
|
||||
{ menu="File", command="export_material", description="Export material" },
|
||||
{ menu="File" },
|
||||
{ menu="File", command="close_material", description="Close material" },
|
||||
{ menu="File", command="exit", description="Exit" },
|
||||
{ menu="Help", command="about", description="About" }
|
||||
]
|
||||
|
||||
func _ready():
|
||||
for m in $VBoxContainer/Menu.get_children():
|
||||
create_menu(m.get_popup(), m.name)
|
||||
|
||||
func create_menu(menu, menu_name):
|
||||
menu.connect("id_pressed", self, "_on_PopupMenu_id_pressed")
|
||||
for i in MENU.size():
|
||||
if MENU[i].menu != menu_name:
|
||||
continue
|
||||
if MENU[i].has("submenu"):
|
||||
var submenu = PopupMenu.new()
|
||||
create_menu(submenu, MENU[i].submenu)
|
||||
menu.add_child(submenu)
|
||||
menu.add_submenu_item(MENU[i].description, submenu.get_name())
|
||||
elif MENU[i].has("description"):
|
||||
menu.add_item(MENU[i].description, i)
|
||||
else:
|
||||
menu.add_separator()
|
||||
return menu
|
||||
|
||||
func new_material():
|
||||
var graph_edit = preload("res://addons/procedural_material/graph_edit.tscn").instance()
|
||||
$VBoxContainer/HBoxContainer/Projects.add_child(graph_edit)
|
||||
$VBoxContainer/HBoxContainer/Projects.current_tab = graph_edit.get_index()
|
||||
graph_edit.update_tab_title()
|
||||
|
||||
func load_material():
|
||||
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("*.ptex;Procedural textures file")
|
||||
dialog.connect("file_selected", self, "do_load_material")
|
||||
dialog.popup_centered()
|
||||
|
||||
func do_load_material(filename):
|
||||
var graph_edit = preload("res://addons/procedural_material/graph_edit.tscn").instance()
|
||||
$VBoxContainer/HBoxContainer/Projects.add_child(graph_edit)
|
||||
$VBoxContainer/HBoxContainer/Projects.current_tab = graph_edit.get_index()
|
||||
graph_edit.do_load_file(filename)
|
||||
|
||||
func save_material():
|
||||
$VBoxContainer/HBoxContainer/Projects.get_current_tab_control().save_file()
|
||||
|
||||
func save_material_as():
|
||||
$VBoxContainer/HBoxContainer/Projects.get_current_tab_control().save_file_as()
|
||||
|
||||
func close_material():
|
||||
$VBoxContainer/HBoxContainer/Projects.get_current_tab_control().queue_free()
|
||||
|
||||
func exit():
|
||||
queue_free()
|
||||
|
||||
func _on_PopupMenu_id_pressed(id):
|
||||
var node_type = null
|
||||
if MENU[id].has("command"):
|
||||
call(MENU[id].command)
|
||||
|
||||
func update_preview():
|
||||
var material_node = $VBoxContainer/HBoxContainer/Projects.get_current_tab_control().get_node("Material")
|
||||
if material_node != null:
|
||||
material_node.update_materials($VBoxContainer/HBoxContainer/VBoxContainer/Preview.get_materials())
|
||||
|
||||
func _on_Projects_tab_changed(tab):
|
||||
$VBoxContainer/HBoxContainer/Projects.get_current_tab_control().connect("graph_changed", self, "update_preview")
|
||||
current_tab = tab
|
@ -1,8 +1,10 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/procedural_material/graph_edit.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/procedural_material/main_window.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/procedural_material/library.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/procedural_material/preview.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="PanelContainer" type="Panel"]
|
||||
[node name="MainWindow" type="Panel" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
@ -14,6 +16,7 @@ mouse_filter = 0
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource( 1 )
|
||||
_sections_unfolded = [ "Anchor", "Grow Direction", "Margin", "Rect", "Size Flags", "custom_constants" ]
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." index="0"]
|
||||
@ -47,7 +50,7 @@ size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
alignment = 0
|
||||
|
||||
[node name="FileMenu" type="MenuButton" parent="VBoxContainer/Menu" index="0"]
|
||||
[node name="File" type="MenuButton" parent="VBoxContainer/Menu" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
@ -71,7 +74,7 @@ flat = true
|
||||
align = 1
|
||||
items = [ ]
|
||||
|
||||
[node name="HelpMenu" type="MenuButton" parent="VBoxContainer/Menu" index="1"]
|
||||
[node name="Help" type="MenuButton" parent="VBoxContainer/Menu" index="1"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
@ -116,22 +119,58 @@ collapsed = false
|
||||
dragger_visibility = 0
|
||||
_sections_unfolded = [ "Size Flags" ]
|
||||
|
||||
[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer" index="0"]
|
||||
[node name="VBoxContainer" type="VSplitContainer" parent="VBoxContainer/HBoxContainer" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 100.0
|
||||
margin_right = 314.0
|
||||
margin_bottom = 696.0
|
||||
rect_min_size = Vector2( 100, 100 )
|
||||
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
|
||||
_sections_unfolded = [ "Rect" ]
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
split_offset = 0
|
||||
collapsed = false
|
||||
dragger_visibility = 0
|
||||
_sections_unfolded = [ "Size Flags" ]
|
||||
|
||||
[node name="Library" type="Tree" parent="VBoxContainer/HBoxContainer/VBoxContainer" index="0"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 314.0
|
||||
margin_bottom = 342.0
|
||||
rect_min_size = Vector2( 100, 100 )
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = true
|
||||
focus_mode = 2
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
columns = 1
|
||||
allow_reselect = false
|
||||
allow_rmb_select = false
|
||||
hide_folding = false
|
||||
hide_root = true
|
||||
drop_mode_flags = 0
|
||||
select_mode = 0
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Preview" parent="VBoxContainer/HBoxContainer/VBoxContainer" index="1" instance=ExtResource( 3 )]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_right = 0.0
|
||||
margin_left = 0.0
|
||||
margin_top = 354.0
|
||||
margin_right = 314.0
|
||||
margin_bottom = 696.0
|
||||
|
||||
[node name="Projects" type="TabContainer" parent="VBoxContainer/HBoxContainer" index="1"]
|
||||
|
||||
@ -139,26 +178,20 @@ anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 112.0
|
||||
margin_left = 326.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 696.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_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
tab_align = 0
|
||||
tabs_visible = true
|
||||
_sections_unfolded = [ "Size Flags" ]
|
||||
|
||||
[node name="blah" parent="VBoxContainer/HBoxContainer/Projects" index="0" instance=ExtResource( 1 )]
|
||||
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 4.0
|
||||
margin_top = 32.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
[connection signal="tab_changed" from="VBoxContainer/HBoxContainer/Projects" to="." method="_on_Projects_tab_changed"]
|
||||
|
||||
|
70
addons/procedural_material/material_library.json
Normal file
70
addons/procedural_material/material_library.json
Normal file
@ -0,0 +1,70 @@
|
||||
{"lib":[
|
||||
{
|
||||
"tree_item":"Generators/Image",
|
||||
"type":"image",
|
||||
"file_path":null
|
||||
},
|
||||
{
|
||||
"tree_item":"Generators/Pattern",
|
||||
"type":"pattern",
|
||||
"mix":0,
|
||||
"x_scale":4,
|
||||
"x_wave":0,
|
||||
"y_scale":4,
|
||||
"y_wave":0
|
||||
},
|
||||
{
|
||||
"tree_item":"Generators/Bricks",
|
||||
"type":"bricks",
|
||||
"bevel":0.1,
|
||||
"columns":3,
|
||||
"mortar":0.1,
|
||||
"row_offset":0.5,
|
||||
"rows":6
|
||||
},
|
||||
{
|
||||
"tree_item":"Generators/Perlin Noise",
|
||||
"type":"perlin",
|
||||
"iterations":3,
|
||||
"persistence":0.5,
|
||||
"scale_x":4,
|
||||
"scale_y":4
|
||||
},
|
||||
{
|
||||
"tree_item":"Generators/Voronoi Noise",
|
||||
"type":"voronoi",
|
||||
"intensity":1,
|
||||
"scale_x":4,
|
||||
"scale_y":4
|
||||
},
|
||||
{
|
||||
"tree_item":"Filters/Colorize",
|
||||
"type":"colorize",
|
||||
"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":1,"r":1}],
|
||||
"name":"colorize_0"
|
||||
},
|
||||
{
|
||||
"tree_item":"Filters/Blend",
|
||||
"type":"blend",
|
||||
"amount":0.5,
|
||||
"blend_type":0
|
||||
},
|
||||
{
|
||||
"tree_item":"Filters/Transform",
|
||||
"type":"transform",
|
||||
"rotate":0,
|
||||
"scale":1,
|
||||
"translate_x":0,
|
||||
"translate_y":0
|
||||
},
|
||||
{
|
||||
"tree_item":"Filters/Warp",
|
||||
"type":"warp",
|
||||
"amount":0.5
|
||||
},
|
||||
{
|
||||
"tree_item":"Filters/Normal map",
|
||||
"type":"normal_map",
|
||||
"amount":0.5
|
||||
}
|
||||
]}
|
@ -170,6 +170,7 @@ func serialize():
|
||||
return data
|
||||
|
||||
func deserialize(data):
|
||||
if data.has("node_position"):
|
||||
offset = Vector2(data.node_position.x, data.node_position.y)
|
||||
for w in property_widgets:
|
||||
var variable = w.name
|
||||
|
@ -29,5 +29,6 @@ func serialize():
|
||||
return data
|
||||
|
||||
func deserialize(data):
|
||||
if data.has("gradient"):
|
||||
$Control.deserialize(data.gradient)
|
||||
.deserialize(data)
|
||||
|
@ -12,7 +12,7 @@ func set_texture(path):
|
||||
if path != null:
|
||||
texture.load(path)
|
||||
$TextureButton.texture_normal = texture
|
||||
get_parent().get_parent().generate_shader()
|
||||
update_shaders()
|
||||
|
||||
func get_textures():
|
||||
var list = {}
|
||||
@ -47,5 +47,6 @@ func serialize():
|
||||
return data
|
||||
|
||||
func deserialize(data):
|
||||
if data.has("file_path"):
|
||||
set_texture(data.file_path)
|
||||
.deserialize(data)
|
||||
|
@ -12,8 +12,8 @@ anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_top = 1.0
|
||||
margin_right = 192.0
|
||||
margin_bottom = 79.0
|
||||
margin_right = 208.0
|
||||
margin_bottom = 100.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
@ -21,7 +21,7 @@ mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
theme = SubResource( 1 )
|
||||
title = "Sine"
|
||||
title = "Pattern"
|
||||
offset = Vector2( 0, 0 )
|
||||
show_close = true
|
||||
resizable = false
|
||||
@ -57,13 +57,13 @@ anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 16.0
|
||||
margin_top = 24.0
|
||||
margin_right = 177.0
|
||||
margin_right = 192.0
|
||||
margin_bottom = 44.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
mouse_default_cursor_shape = 0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
alignment = 0
|
||||
_sections_unfolded = [ "Size Flags" ]
|
||||
@ -75,7 +75,7 @@ anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_top = 3.0
|
||||
margin_right = 66.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 17.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
@ -94,8 +94,8 @@ anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 70.0
|
||||
margin_right = 161.0
|
||||
margin_left = 85.0
|
||||
margin_right = 176.0
|
||||
margin_bottom = 20.0
|
||||
rect_min_size = Vector2( 82, 0 )
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
@ -131,9 +131,10 @@ 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 = 3
|
||||
size_flags_vertical = 1
|
||||
alignment = 0
|
||||
_sections_unfolded = [ "Size Flags" ]
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer1" index="0"]
|
||||
|
||||
@ -225,7 +226,7 @@ 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 = 3
|
||||
size_flags_vertical = 1
|
||||
alignment = 0
|
||||
_sections_unfolded = [ "Rect", "Size Flags" ]
|
||||
|
@ -1,14 +1,13 @@
|
||||
tool
|
||||
extends Container
|
||||
|
||||
var save_path = null
|
||||
|
||||
var popup_menu = null
|
||||
var popup_position = Vector2(0, 0)
|
||||
var selected_node = null
|
||||
|
||||
var texture_preview_material = null
|
||||
|
||||
var preview_maximized = false
|
||||
|
||||
const MENU = [
|
||||
{ command="new_texture", description="New material" },
|
||||
{ command="load_texture", description="Load material" },
|
||||
@ -69,79 +68,57 @@ func _on_PopupMenu_id_pressed(id):
|
||||
if MENU[id].has("command"):
|
||||
call(MENU[id].command)
|
||||
elif MENU[id].has("name"):
|
||||
node_type = load("res://addons/procedural_material/nodes/"+MENU[id].name+".tscn")
|
||||
if node_type != null:
|
||||
var node = node_type.instance()
|
||||
var i = 0
|
||||
while true:
|
||||
var name = MENU[id].name+"_"+str(i)
|
||||
if !$GraphEdit.has_node(name):
|
||||
node.set_name(name)
|
||||
break
|
||||
i += 1
|
||||
$GraphEdit.add_node(node, popup_position)
|
||||
node.offset = ($GraphEdit.scroll_offset + popup_position - $GraphEdit.rect_global_position) / $GraphEdit.zoom
|
||||
$GraphEdit.create_node({type=MENU[id].name}, popup_position)
|
||||
|
||||
func set_save_path(path):
|
||||
save_path = path
|
||||
func set_save_path(graph_edit, path):
|
||||
if !Engine.editor_hint:
|
||||
if save_path != null:
|
||||
OS.set_window_title("Procedural textures (%s)" % save_path)
|
||||
if path != null:
|
||||
OS.set_window_title("Procedural textures (%s)" % path)
|
||||
else:
|
||||
OS.set_window_title("Procedural textures")
|
||||
|
||||
func new_texture():
|
||||
$GraphEdit.new_material()
|
||||
set_save_path(null)
|
||||
|
||||
func load_texture():
|
||||
selected_node = null
|
||||
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("*.ptex;Procedural textures file")
|
||||
dialog.connect("file_selected", self, "do_load_texture")
|
||||
dialog.popup_centered()
|
||||
|
||||
func do_load_texture(path):
|
||||
set_save_path(path)
|
||||
$GraphEdit.load_file(save_path)
|
||||
$GraphEdit.load_file()
|
||||
|
||||
func save_texture():
|
||||
if save_path != null:
|
||||
$GraphEdit.save_file(save_path)
|
||||
else:
|
||||
save_texture_as()
|
||||
$GraphEdit.save_file()
|
||||
|
||||
func save_texture_as():
|
||||
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("*.ptex;Procedural textures file")
|
||||
dialog.connect("file_selected", self, "do_save_texture")
|
||||
dialog.popup_centered()
|
||||
$GraphEdit.save_file_as()
|
||||
|
||||
func do_save_texture(path):
|
||||
set_save_path(path)
|
||||
$GraphEdit.save_file(save_path)
|
||||
func export_texture():
|
||||
$GraphEdit.export_textures()
|
||||
|
||||
func export_texture(size = 512):
|
||||
#$GraphEdit.export_texture(selected_node, "res://generated_image.png", size)
|
||||
var prefix = save_path.left(save_path.rfind("."))
|
||||
$GraphEdit/Material.export_textures(prefix)
|
||||
func get_selected_node():
|
||||
var rv = null
|
||||
for c in $GraphEdit.get_children():
|
||||
if c is GraphNode && c.selected:
|
||||
if rv != null:
|
||||
return null
|
||||
else:
|
||||
rv = c
|
||||
return rv
|
||||
|
||||
func generate_shader():
|
||||
var selected_node = get_selected_node()
|
||||
if $GraphEdit/Material != null:
|
||||
$GraphEdit/Material.update_materials($Preview/Preview.get_materials())
|
||||
if selected_node != null && selected_node is GraphNode:
|
||||
if selected_node != null:
|
||||
$GraphEdit.setup_material(texture_preview_material, selected_node.get_textures(), selected_node.generate_shader())
|
||||
|
||||
func _on_GraphEdit_node_selected(node):
|
||||
if selected_node != node && node is GraphNode:
|
||||
selected_node = node
|
||||
var selected_node = get_selected_node()
|
||||
if selected_node != null:
|
||||
$GraphEdit.setup_material(texture_preview_material, selected_node.get_textures(), selected_node.generate_shader())
|
||||
|
||||
func _on_SelectedPreview_gui_input(ev):
|
||||
if ev is InputEventMouseButton && ev.button_index == 1 && ev.doubleclick:
|
||||
if preview_maximized:
|
||||
$Preview/Preview/SelectedPreview/SelectedPreviewAnimation.play("minimize")
|
||||
else:
|
||||
$Preview/Preview/SelectedPreview/SelectedPreviewAnimation.play("maximize")
|
||||
preview_maximized = !preview_maximized
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,8 +1,6 @@
|
||||
tool
|
||||
extends ViewportContainer
|
||||
|
||||
var preview_maximized = false
|
||||
|
||||
const ENVIRONMENTS = [
|
||||
"experiment", "lobby", "night", "park", "schelde"
|
||||
]
|
||||
@ -14,14 +12,6 @@ func _ready():
|
||||
$ObjectRotate.play("rotate")
|
||||
_on_Environment_item_selected($Environment.selected)
|
||||
|
||||
func _on_SelectedPreview_gui_input(ev):
|
||||
if ev is InputEventMouseButton && ev.button_index == 1 && ev.doubleclick:
|
||||
if preview_maximized:
|
||||
$SelectedPreviewAnimation.play("minimize")
|
||||
else:
|
||||
$SelectedPreviewAnimation.play("maximize")
|
||||
preview_maximized = !preview_maximized
|
||||
|
||||
func _on_Environment_item_selected(id):
|
||||
$MaterialPreview/WorldEnvironment.environment.background_sky.panorama = load("res://addons/procedural_material/panoramas/"+ENVIRONMENTS[id]+".hdr")
|
||||
|
||||
@ -32,3 +22,7 @@ func _on_Model_item_selected(id):
|
||||
|
||||
func get_materials():
|
||||
return [ $MaterialPreview/Objects/Cube.get_surface_material(0) ]
|
||||
|
||||
|
||||
func _on_Preview_item_rect_changed():
|
||||
$MaterialPreview.size = rect_size
|
||||
|
395
addons/procedural_material/preview.tscn
Normal file
395
addons/procedural_material/preview.tscn
Normal file
File diff suppressed because one or more lines are too long
1
examples/dry_earth.ptex
Normal file
1
examples/dry_earth.ptex
Normal file
@ -0,0 +1 @@
|
||||
{"connections":[{"from":"perlin_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"voronoi_0","from_port":1,"to":"colorize_1","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":1},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"colorize_1","from_port":0,"to":"warp_0","to_port":0},{"from":"perlin_1","from_port":0,"to":"warp_0","to_port":1},{"from":"warp_0","from_port":0,"to":"blend_0","to_port":0},{"from":"perlin_1","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"Material","to_port":2},{"from":"colorize_3","from_port":0,"to":"Material","to_port":1},{"from":"perlin_1","from_port":0,"to":"colorize_3","to_port":0},{"from":"warp_0","from_port":0,"to":"colorize_4","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_4","from_port":0,"to":"blend_1","to_port":1},{"from":"blend_1","from_port":0,"to":"normal_map_0","to_port":0},{"from":"perlin_0","from_port":0,"to":"blend_1","to_port":0}],"nodes":[{"intensity":0.6,"name":"voronoi_0","node_position":{"x":-165,"y":-96.75},"scale_x":4,"scale_y":4,"type":"voronoi"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":0.081818,"r":1}],"name":"colorize_1","node_position":{"x":93,"y":-117.75},"type":"colorize"},{"iterations":3,"name":"perlin_1","node_position":{"x":-144,"y":50.25},"persistence":0.5,"scale_x":4,"scale_y":4,"type":"perlin"},{"gradient":[{"b":0.200277,"g":0.378784,"pos":0.254545,"r":0.557292},{"b":0.03776,"g":0.150513,"pos":0.663636,"r":0.25}],"name":"colorize_0","node_position":{"x":338,"y":-237.75},"type":"colorize"},{"iterations":10,"name":"perlin_0","node_position":{"x":56,"y":-361.75},"persistence":0.9,"scale_x":2,"scale_y":2,"type":"perlin"},{"name":"Material","node_position":{"x":786,"y":53},"type":"material"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0.15625,"g":0.15625,"pos":1,"r":0.15625}],"name":"colorize_3","node_position":{"x":465,"y":33.25},"type":"colorize"},{"gradient":[{"b":0.90625,"g":0.90625,"pos":0,"r":0.90625},{"b":0.890625,"g":0.890625,"pos":1,"r":0.890625}],"name":"colorize_2","node_position":{"x":454,"y":104.25},"type":"colorize"},{"amount":0.4,"blend_type":2,"name":"blend_0","node_position":{"x":541,"y":-82.75},"type":"blend"},{"amount":0.4,"name":"warp_0","node_position":{"x":264,"y":-13.75},"type":"warp"},{"amount":0.35,"name":"normal_map_0","node_position":{"x":652,"y":222.25},"type":"normal_map"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_4","node_position":{"x":228,"y":213.25},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_1","node_position":{"x":454,"y":226.25},"type":"blend"}]}
|
1
examples/floor1.ptex
Normal file
1
examples/floor1.ptex
Normal file
@ -0,0 +1 @@
|
||||
{"connections":[{"from":"bricks_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"perlin_0","from_port":0,"to":"warp_0","to_port":1},{"from":"colorize_0","from_port":0,"to":"warp_0","to_port":0},{"from":"bricks_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"transform_0","from_port":0,"to":"blend_0","to_port":0},{"from":"blend_0","from_port":0,"to":"blend_1","to_port":1},{"from":"transform_1","from_port":0,"to":"transform_2","to_port":0},{"from":"transform_1","from_port":0,"to":"blend_2","to_port":0},{"from":"transform_2","from_port":0,"to":"blend_2","to_port":1},{"from":"blend_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"colorize_3","from_port":0,"to":"transform_3","to_port":0},{"from":"blend_1","from_port":0,"to":"transform_1","to_port":0},{"from":"pattern_1","from_port":0,"to":"blend_0","to_port":1},{"from":"pattern_1","from_port":0,"to":"transform_0","to_port":0},{"from":"pattern_0","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_1","to_port":0},{"from":"colorize_1","from_port":0,"to":"normal_map_0","to_port":0},{"from":"warp_0","from_port":0,"to":"blend_3","to_port":0},{"from":"blend_3","from_port":0,"to":"Material","to_port":0},{"from":"colorize_0","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"blend_3","to_port":1},{"from":"transform_3","from_port":0,"to":"blend_3","to_port":2}],"nodes":[{"bevel":0.05,"columns":6,"mortar":0.05,"name":"bricks_0","node_position":{"x":22,"y":247},"row_offset":0,"rows":6,"type":"bricks"},{"iterations":3,"name":"perlin_0","node_position":{"x":295,"y":220},"persistence":0.5,"scale_x":4,"scale_y":4,"type":"perlin"},{"gradient":[{"b":0.406358,"g":0.500692,"pos":0.027273,"r":0.557292},{"b":0,"g":0.21875,"pos":0.127273,"r":1}],"name":"colorize_0","node_position":{"x":294,"y":83},"type":"colorize"},{"amount":1,"name":"normal_map_0","node_position":{"x":759,"y":424},"type":"normal_map"},{"name":"Material","node_position":{"x":916,"y":424},"type":"material"},{"mix":0,"name":"pattern_0","node_position":{"x":-840,"y":785},"type":"pattern","x_scale":2,"x_wave":0,"y_scale":1,"y_wave":0},{"name":"transform_0","node_position":{"x":-792,"y":930},"rotate":270,"scale":1,"translate_x":0,"translate_y":0,"type":"transform"},{"mix":0,"name":"pattern_1","node_position":{"x":-884,"y":1153},"type":"pattern","x_scale":1,"x_wave":2,"y_scale":1,"y_wave":2},{"amount":1,"blend_type":3,"name":"blend_0","node_position":{"x":-513,"y":1036},"type":"blend"},{"name":"transform_2","node_position":{"x":-189,"y":938},"rotate":90,"scale":1,"translate_x":0,"translate_y":0,"type":"transform"},{"amount":0.5,"blend_type":0,"name":"blend_2","node_position":{"x":41,"y":910},"type":"blend"},{"gradient":[{"b":0,"g":0,"pos":0.645455,"r":0},{"b":1,"g":1,"pos":0.781818,"r":1}],"name":"colorize_2","node_position":{"x":-572.181396,"y":751},"type":"colorize"},{"amount":1,"blend_type":2,"name":"blend_1","node_position":{"x":-393,"y":822},"type":"blend"},{"name":"transform_1","node_position":{"x":-185,"y":775},"rotate":0,"scale":1,"translate_x":-0.25,"translate_y":-0,"type":"transform"},{"gradient":[{"b":1,"g":1,"pos":0.309091,"r":1},{"b":0,"g":0,"pos":0.481818,"r":0}],"name":"colorize_3","node_position":{"x":47,"y":803},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_1","node_position":{"x":329,"y":383},"type":"colorize"},{"name":"transform_3","node_position":{"x":137,"y":618},"rotate":0,"scale":0.5,"translate_x":0,"translate_y":0,"type":"transform"},{"amount":0.2,"name":"warp_0","node_position":{"x":694,"y":155},"type":"warp"},{"amount":1,"blend_type":0,"name":"blend_3","node_position":{"x":876.976318,"y":196.25},"type":"blend"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0.489583},{"b":0,"g":0,"pos":1,"r":0.489583}],"name":"colorize_4","node_position":{"x":598.976318,"y":258.25},"type":"colorize"}]}
|
1
examples/grass with flowers.ptex
Normal file
1
examples/grass with flowers.ptex
Normal file
@ -0,0 +1 @@
|
||||
{"connections":[{"from":"perlin_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"voronoi_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":0},{"from":"colorize_1","from_port":0,"to":"blend_0","to_port":2},{"from":"perlin_0","from_port":0,"to":"normal_map_0","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_3","from_port":0,"to":"Material","to_port":1},{"from":"colorize_1","from_port":0,"to":"colorize_3","to_port":0},{"from":"colorize_3","from_port":0,"to":"Material","to_port":2},{"from":"voronoi_0","from_port":2,"to":"blend_0","to_port":1},{"from":"voronoi_0","from_port":0,"to":"colorize_2","to_port":0},{"from":"perlin_0","from_port":0,"to":"colorize_4","to_port":0},{"from":"blend_0","from_port":0,"to":"blend_1","to_port":0},{"from":"colorize_4","from_port":0,"to":"blend_1","to_port":1},{"from":"blend_1","from_port":0,"to":"Material","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_1","to_port":2}],"nodes":[{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_3","node_position":{"x":655,"y":93.25},"type":"colorize"},{"gradient":[{"b":0.15682,"g":0.734375,"pos":0.454545,"r":0.247062},{"b":0.112522,"g":0.317708,"pos":0.881818,"r":0.144582}],"name":"colorize_0","node_position":{"x":335,"y":-261.75},"type":"colorize"},{"iterations":9,"name":"perlin_0","node_position":{"x":-25,"y":-27.75},"persistence":0.8,"scale_x":6,"scale_y":6,"type":"perlin"},{"intensity":1,"name":"voronoi_0","node_position":{"x":269,"y":-104.75},"scale_x":14,"scale_y":14,"type":"voronoi"},{"name":"Material","node_position":{"x":996,"y":22},"type":"material"},{"amount":0.8,"name":"normal_map_0","node_position":{"x":494,"y":258.25},"type":"normal_map"},{"gradient":[{"b":0,"g":0,"pos":0.263636,"r":0},{"b":1,"g":1,"pos":0.436364,"r":1}],"name":"colorize_1","node_position":{"x":524,"y":-26.75},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0.118182,"r":0},{"b":1,"g":1,"pos":0.190909,"r":1}],"name":"colorize_2","node_position":{"x":413,"y":71.25},"type":"colorize"},{"gradient":[{"b":0,"g":0.96875,"pos":0,"r":1},{"b":0,"g":1,"pos":1,"r":1}],"name":"colorize_4","node_position":{"x":407,"y":-177.75},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":643,"y":-244.75},"type":"blend"},{"amount":0.5,"blend_type":0,"name":"blend_1","node_position":{"x":826,"y":-119.75},"type":"blend"}]}
|
1
examples/rock.ptex
Normal file
1
examples/rock.ptex
Normal file
@ -0,0 +1 @@
|
||||
{"connections":[{"from":"voronoi_0","from_port":0,"to":"blend_0","to_port":0},{"from":"voronoi_0","from_port":1,"to":"blend_0","to_port":1},{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":2},{"from":"blend_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"Material","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"perlin_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"colorize_1","from_port":0,"to":"Material","to_port":1},{"from":"perlin_0","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"Material","to_port":2},{"from":"perlin_0","from_port":0,"to":"normal_map_0","to_port":0}],"nodes":[{"name":"Material","node_position":{"x":768,"y":239},"type":"material"},{"intensity":1,"name":"voronoi_0","node_position":{"x":128,"y":394},"scale_x":4,"scale_y":4,"type":"voronoi"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":531,"y":432},"type":"normal_map"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0.260417,"g":0.260417,"pos":1,"r":0.260417}],"name":"colorize_1","node_position":{"x":533,"y":343},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":327,"y":411},"type":"blend"},{"gradient":[{"b":0.391927,"g":0.523519,"pos":0,"r":0.583333},{"b":0.240885,"g":0.276693,"pos":0.354545,"r":0.3125},{"b":0.391927,"g":0.523519,"pos":0.681818,"r":0.583333},{"b":0.240885,"g":0.276693,"pos":0.963636,"r":0.3125}],"name":"colorize_0","node_position":{"x":530,"y":171},"type":"colorize"},{"iterations":6,"name":"perlin_0","node_position":{"x":122,"y":191},"persistence":0.85,"scale_x":4,"scale_y":4,"type":"perlin"},{"gradient":[{"b":0.364583,"g":0.364583,"pos":0,"r":0.364583},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_2","node_position":{"x":526,"y":258},"type":"colorize"}]}
|
1
examples/stone_wall.ptex
Normal file
1
examples/stone_wall.ptex
Normal file
@ -0,0 +1 @@
|
||||
{"connections":[{"from":"Warp","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_0","to_port":2},{"from":"colorize_1","from_port":0,"to":"blend_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":1},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_2","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"Material","to_port":2},{"from":"colorize_2","from_port":0,"to":"colorize_5","to_port":0},{"from":"colorize_5","from_port":0,"to":"Material","to_port":1},{"from":"Bricks","from_port":0,"to":"Warp","to_port":0},{"from":"blend_1","from_port":0,"to":"colorize_1","to_port":0},{"from":"Bricks","from_port":1,"to":"blend_1","to_port":1},{"from":"Warp","from_port":0,"to":"blend_2","to_port":0},{"from":"Perlin","from_port":0,"to":"blend_2","to_port":1},{"from":"blend_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"blend_2","from_port":0,"to":"colorize_6","to_port":0},{"from":"colorize_6","from_port":0,"to":"normal_map_0","to_port":0},{"from":"Perlin","from_port":0,"to":"blend_1","to_port":0},{"from":"Perlin","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_3","from_port":0,"to":"Material","to_port":5},{"from":"perlin_0","from_port":0,"to":"Warp","to_port":1}],"nodes":[{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_5","node_position":{"x":837,"y":157},"type":"colorize"},{"amount":0.1,"name":"Warp","node_position":{"x":384,"y":10.75},"type":"warp"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_6","node_position":{"x":743,"y":291},"type":"colorize"},{"gradient":[{"b":0.119792,"g":0.119792,"pos":0,"r":0.119792},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_3","node_position":{"x":774,"y":400},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_2","node_position":{"x":536,"y":331},"type":"blend"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":0.063636,"r":1}],"name":"colorize_2","node_position":{"x":535.943665,"y":163},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":836.943726,"y":-71},"type":"blend"},{"gradient":[{"b":0.864583,"g":0.864583,"pos":0,"r":0.864583},{"b":0.854167,"g":0.854167,"pos":1,"r":0.854167}],"name":"colorize_4","node_position":{"x":708,"y":224},"type":"colorize"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":917,"y":273},"type":"normal_map"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_0","node_position":{"x":560.943665,"y":50},"type":"colorize"},{"iterations":4,"name":"perlin_0","node_position":{"x":92,"y":210},"persistence":0.75,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.5,"blend_type":6,"name":"blend_1","node_position":{"x":351,"y":244},"type":"blend"},{"bevel":0.2,"columns":3,"mortar":0.1,"name":"Bricks","node_position":{"x":107,"y":-27},"row_offset":0.5,"rows":6,"type":"bricks"},{"iterations":10,"name":"Perlin","node_position":{"x":102,"y":-195},"persistence":0.75,"scale_x":4,"scale_y":4,"type":"perlin"},{"name":"Material","node_position":{"x":1109,"y":161},"type":"material"},{"gradient":[{"b":0.557292,"g":0.557292,"pos":0,"r":0.557292},{"b":0.180664,"g":0.22934,"pos":0.2,"r":0.234375},{"b":0.60574,"g":0.694487,"pos":0.345455,"r":0.755208},{"b":0.144423,"g":0.184147,"pos":0.554545,"r":0.229167},{"b":0.447537,"g":0.553291,"pos":0.736364,"r":0.588542},{"b":0.212674,"g":0.236125,"pos":1,"r":0.291667}],"name":"colorize_1","node_position":{"x":561.943665,"y":-78},"type":"colorize"}]}
|
1
examples/wooden_floor.ptex
Normal file
1
examples/wooden_floor.ptex
Normal file
@ -0,0 +1 @@
|
||||
{"connections":[{"from":"bricks_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":0},{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":1},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"blend_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"colorize_1","from_port":0,"to":"normal_map_0","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"blend_0","from_port":0,"to":"Material","to_port":2},{"from":"colorize_2","from_port":0,"to":"Material","to_port":1},{"from":"blend_0","from_port":0,"to":"colorize_2","to_port":0}],"nodes":[{"name":"Material","node_position":{"x":1036,"y":14},"type":"material"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_2","node_position":{"x":862,"y":16.25},"type":"colorize"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":891,"y":82.25},"type":"normal_map"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_1","node_position":{"x":726,"y":100.25},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":660,"y":-20.75},"type":"blend"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0.213623,"g":0.391325,"pos":0.154545,"r":0.651042}],"name":"colorize_0","node_position":{"x":478,"y":-5.75},"type":"colorize"},{"bevel":0,"columns":1,"mortar":0.05,"name":"bricks_0","node_position":{"x":281,"y":-2.75},"row_offset":0.5,"rows":9,"type":"bricks"},{"iterations":7,"name":"perlin_0","node_position":{"x":391,"y":157.25},"persistence":0.75,"scale_x":4,"scale_y":20,"type":"perlin"}]}
|
@ -11,7 +11,7 @@ config_version=3
|
||||
[application]
|
||||
|
||||
config/name="Procedural textures"
|
||||
run/main_scene="res://addons/procedural_material/pm_editor.tscn"
|
||||
run/main_scene="res://addons/procedural_material/main_window.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
Loading…
Reference in New Issue
Block a user