diff --git a/addons/material_maker/engine/gen_base.gd b/addons/material_maker/engine/gen_base.gd index dbbf966..b7f818f 100644 --- a/addons/material_maker/engine/gen_base.gd +++ b/addons/material_maker/engine/gen_base.gd @@ -22,9 +22,15 @@ class OutputPort: func to_str(): return generator.name+"("+str(output_index)+")" +var position : Vector2 = Vector2(0, 0) +var parameters = {} + func get_seed(): return 0 +func get_type(): + return "generic" + func get_source(input_index : int): return get_parent().get_port_source(name, input_index) @@ -33,8 +39,8 @@ func get_input_shader(input_index : int): if source != null: return source.get_shader() -func get_shader(output_index : int): - return get_shader_code("UV", output_index); +func get_shader(output_index : int, context = MMGenContext.new()): + return get_shader_code("UV", output_index, context); # this will need an output index for switch func get_globals(): @@ -48,25 +54,25 @@ func get_globals(): list.append(g) return list -func get_shader_code(uv, slot = 0): - var rv - rv = _get_shader_code(uv, slot) - if !rv.has("f"): - if rv.has("rgb"): - rv.f = "(dot("+rv.rgb+", vec3(1.0))/3.0)" - elif rv.has("rgba"): - rv.f = "(dot("+rv.rgba+".rgb, vec3(1.0))/3.0)" - else: - rv.f = "0.0" - if !rv.has("rgb"): - if rv.has("rgba"): - rv.rgb = rv.rgba+".rgb" - else: - rv.rgb = "vec3("+rv.f+")" - if !rv.has("rgba"): - rv.rgba = "vec4("+rv.rgb+", 1.0)" - rv.globals = get_globals() +func get_shader_code(uv, slot = 0, context = MMGenContext.new()): + var rv = _get_shader_code(uv, slot, context) + if rv != null: + if !rv.has("f"): + if rv.has("rgb"): + rv.f = "(dot("+rv.rgb+", vec3(1.0))/3.0)" + elif rv.has("rgba"): + rv.f = "(dot("+rv.rgba+".rgb, vec3(1.0))/3.0)" + else: + rv.f = "0.0" + if !rv.has("rgb"): + if rv.has("rgba"): + rv.rgb = rv.rgba+".rgb" + else: + rv.rgb = "vec3("+rv.f+")" + if !rv.has("rgba"): + rv.rgba = "vec4("+rv.rgb+", 1.0)" + rv.globals = get_globals() return rv -func _get_shader_code(uv : String, output_index : int): +func _get_shader_code(uv : String, output_index : int, context = MMGenContext.new()): return null diff --git a/addons/material_maker/engine/gen_context.gd b/addons/material_maker/engine/gen_context.gd new file mode 100644 index 0000000..7555d1a --- /dev/null +++ b/addons/material_maker/engine/gen_context.gd @@ -0,0 +1,17 @@ +extends Object +class_name MMGenContext + +var variants : Dictionary = {} + +func has_variant(generator): + return variants.has(generator) + +func get_variant(generator, uv): + var rv = -1 + if variants.has(generator): + rv = variants[generator].find(uv) + if rv == -1: + variants[generator].push(uv) + else: + variants[generator] = [uv] + return rv diff --git a/addons/material_maker/engine/gen_material.gd b/addons/material_maker/engine/gen_material.gd index 0cc33cb..c071ed0 100644 --- a/addons/material_maker/engine/gen_material.gd +++ b/addons/material_maker/engine/gen_material.gd @@ -2,8 +2,6 @@ tool extends MMGenBase class_name MMGenMaterial -var parameters = {} - var texture_list var material : SpatialMaterial @@ -27,6 +25,9 @@ const ADDON_TEXTURE_LIST = [ { port=6, texture="depth_map" } ] +func get_type(): + return "material" + func _ready(): texture_list = TEXTURE_LIST if Engine.editor_hint: diff --git a/addons/material_maker/engine/gen_shader.gd b/addons/material_maker/engine/gen_shader.gd index 42502b4..93947ba 100644 --- a/addons/material_maker/engine/gen_shader.gd +++ b/addons/material_maker/engine/gen_shader.gd @@ -3,7 +3,6 @@ extends MMGenBase class_name MMGenShader var model_data = null -var parameters = {} var generated_variants = [] func set_model_data(data: Dictionary): @@ -32,7 +31,7 @@ func find_keyword_call(string, keyword): parenthesis_level -= 1 return "" -func replace_input(string, input, type, src, default): +func replace_input(string, context, input, type, src, default): var required_defs = "" var required_code = "" while true: @@ -74,7 +73,7 @@ func replace_variable(string, variable, value): string = string.right(keyword_size) return new_string -func subst(string, uv = ""): +func subst(string, context, uv = ""): var required_defs = "" var required_code = "" string = replace_variable(string, "name", name) @@ -103,21 +102,23 @@ func subst(string, uv = ""): for i in range(model_data.inputs.size()): var input = model_data.inputs[i] var source = get_source(i) - var result = replace_input(string, input.name, input.type, source, input.default) + var result = replace_input(string, context, input.name, input.type, source, input.default) string = result.string required_defs += result.defs required_code += result.code return { string=string, defs=required_defs, code=required_code } -func _get_shader_code(uv, slot = 0): +func _get_shader_code(uv, slot = 0, context = MMGenContext.new()): + if context == null: + context = {} var output_info = [ { field="rgba", type="vec4" }, { field="rgb", type="vec3" }, { field="f", type="float" } ] var rv = { defs="", code="" } var variant_string = uv+","+str(slot) if model_data != null and model_data.has("outputs") and model_data.outputs.size() > slot: var output = model_data.outputs[slot] rv.defs = "" - if model_data.has("instance") && generated_variants.empty(): - rv.defs += subst(model_data.instance).string + if model_data.has("instance") && !context.has_variant(self): + rv.defs += subst(model_data.instance, context).string for p in model_data.parameters: if p.type == "gradient": var g = parameters[p.name] @@ -125,13 +126,13 @@ func _get_shader_code(uv, slot = 0): g = MMGradient.new() g.deserialize(parameters[p.name]) rv.defs += g.get_shader(p.name+"_gradient_fct") - var variant_index = generated_variants.find(variant_string) + var variant_index = context.get_variant(self, variant_string) if variant_index == -1: - variant_index = generated_variants.size() + variant_index = context.get_variant(self, variant_string) generated_variants.append(variant_string) for t in output_info: if output.has(t.field): - var subst_output = subst(output[t.field], uv) + var subst_output = subst(output[t.field], context, uv) rv.defs += subst_output.defs rv.code += subst_output.code rv.code += "%s %s_%d_%d_%s = %s;\n" % [ t.type, name, slot, variant_index, t.field, subst_output.string ] diff --git a/addons/material_maker/engine/loader.gd b/addons/material_maker/engine/loader.gd index c85b46b..64adda6 100644 --- a/addons/material_maker/engine/loader.gd +++ b/addons/material_maker/engine/loader.gd @@ -18,24 +18,33 @@ func create_gen(data) -> MMGenBase: if g != null: generator.add_child(g) generator.connections = data.connections + elif data.has("model_data"): + generator = MMGenShader.new() + generator.set_model_data(data.model_data) elif data.has("type"): if data.type == "material": generator = MMGenMaterial.new() else: - generator = MMGenShader.new() - if data.type == "custom": - generator.set_model_data(data.model_data) + var file = File.new() + if file.open("res://addons/material_maker/library/"+data.type+".mml", File.READ) == OK: + var model_data = parse_json(file.get_as_text()) + print("loaded description "+data.type+".mml") + generator = create_gen(model_data) + file.close() + elif file.open("res://addons/material_maker/nodes/"+data.type+".mmn", File.READ) == OK: + generator = MMGenShader.new() + var model_data = parse_json(file.get_as_text()) + print("loaded description "+data.type+".mmn") + generator.set_model_data(model_data) + file.close() else: - var file = File.new() - if file.open("res://addons/material_maker/nodes/"+data.type+".mmn", File.READ) == OK: - var model_data = parse_json(file.get_as_text()) - print("loaded description "+data.type+".mmn") - generator.set_model_data(model_data) - file.close() - else: - print("Cannot find description for "+data.type) + print("Cannot find description for "+data.type) else: print(data) - if generator != null and data.has("parameters"): - generator.initialize(data) + if generator != null: + if data.has("node_position"): + generator.position.x = data.node_position.x + generator.position.y = data.node_position.y + if data.has("parameters"): + generator.initialize(data) return generator diff --git a/addons/material_maker/graph_edit.gd b/addons/material_maker/graph_edit.gd index 17034ae..c1e1572 100644 --- a/addons/material_maker/graph_edit.gd +++ b/addons/material_maker/graph_edit.gd @@ -5,9 +5,11 @@ var editor_interface = null var node_factory = null var renderer = null -var save_path = null +var save_path = null setget set_save_path var need_save = false +var generator = null + signal save_path_changed signal graph_changed @@ -141,48 +143,28 @@ func create_nodes(data, position = null): connect_node(names[c.from], c.from_port, "Material" if c.to == "Material" else names[c.to], c.to_port) return null -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 - var data = parse_json(file.get_as_text()) - file.close() +func load_file(filename): clear_material() - for n in data.nodes: - create_nodes(n) - for c in data.connections: - connect_node(c.from, c.from_port, c.to, c.to_port) - set_save_path(filename) - set_need_save(false) - center_view() + var loader = MMGenLoader.new() + generator = loader.load_gen(filename) + if generator != null: + add_child(generator) + for g in generator.get_children(): + print(g.get_type()) + var node = node_factory.create_node(g.get_type()) + if node != null: + node.name = "node_"+g.name + add_node(node) + node.generator = g + node.offset = g.position + if generator.get("connections") != null: + for c in generator.connections: + .connect_node("node_"+c.from, c.from_port, "node_"+c.to, c.to_port) + set_save_path(filename) + set_need_save(false) + center_view() -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): +func save_file(filename): var data = { nodes = [] } for c in get_children(): if c is GraphNode: @@ -270,7 +252,7 @@ func center_view(): func send_changed_signal(): set_need_save(true) - $Timer.start() + #$Timer.start() func do_send_changed_signal(): emit_signal("graph_changed") diff --git a/addons/material_maker/graph_edit.tscn b/addons/material_maker/graph_edit.tscn index 3d9f9ed..f00404f 100644 --- a/addons/material_maker/graph_edit.tscn +++ b/addons/material_maker/graph_edit.tscn @@ -1,54 +1,30 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://addons/material_maker/graph_edit.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/nodes/material/material.tscn" type="PackedScene" id=2] +[ext_resource path="res://addons/material_maker/nodes/material.tscn" type="PackedScene" id=2] [sub_resource type="Theme" id=1] - -[node name="GraphEdit" type="GraphEdit" index="0"] - +[node name="GraphEdit" type="GraphEdit"] self_modulate = Color( 1, 1, 1, 0 ) -anchor_left = 0.0 -anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 1.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = true -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 right_disconnects = true -scroll_offset = Vector2( -458.75, -292.25 ) -snap_distance = 20 +scroll_offset = Vector2( -325, -250 ) use_snap = false -zoom = 1.0 script = ExtResource( 1 ) -_sections_unfolded = [ "Material", "Mouse", "Visibility" ] -[node name="Material" parent="." index="0" instance=ExtResource( 2 )] - -margin_left = 658.75 -margin_top = 292.25 -margin_right = 888.75 -margin_bottom = 512.25 +[node name="Material" parent="." instance=ExtResource( 2 )] +margin_left = 525.0 +margin_top = 250.0 +margin_right = 755.0 +margin_bottom = 470.0 theme = SubResource( 1 ) offset = Vector2( 200, 0 ) -_sections_unfolded = [ "Anchor", "Margin", "Mouse", "Theme", "slot", "slot/0", "slot/1", "slot/2", "slot/3", "slot/4", "slot/5" ] -[node name="Timer" type="Timer" parent="." index="1"] - -process_mode = 1 +[node name="Timer" type="Timer" parent="."] wait_time = 0.2 one_shot = true -autostart = false - [connection signal="connection_request" from="." to="." method="connect_node"] - [connection signal="disconnection_request" from="." to="." method="disconnect_node"] - [connection signal="timeout" from="Timer" to="." method="do_send_changed_signal"] - - diff --git a/addons/material_maker/main_window.gd b/addons/material_maker/main_window.gd index d7e5c79..7b25a61 100644 --- a/addons/material_maker/main_window.gd +++ b/addons/material_maker/main_window.gd @@ -7,6 +7,8 @@ var recent_files_submenu = null var editor_interface = null var current_tab = null +onready var renderer = $Renderer + const MENU = [ { menu="File", command="new_material", description="New material" }, { menu="File", command="load_material", shortcut="Control+O", description="Load material" }, @@ -140,7 +142,6 @@ func load_material(): dialog.access = FileDialog.ACCESS_FILESYSTEM dialog.mode = FileDialog.MODE_OPEN_FILES dialog.add_filter("*.ptex;Procedural textures file") - #dialog.connect("file_selected", self, "do_load_material") dialog.connect("files_selected", self, "do_load_materials") dialog.popup_centered() @@ -150,10 +151,8 @@ func do_load_materials(filenames): func do_load_material(filename): var graph_edit = $VBoxContainer/HBoxContainer/Projects.get_current_tab_control() - var node_count = 0 - if graph_edit == null: - node_count = 123 # So test below succeeds... - else: + var node_count = 2 # So test below succeeds if graph_edit is null... + if graph_edit != null: for c in graph_edit.get_children(): if c is GraphNode: node_count += 1 @@ -161,18 +160,28 @@ func do_load_material(filename): break if node_count > 1: graph_edit = new_pane() - graph_edit.do_load_file(filename) + graph_edit.load_file(filename) add_recent(filename) func save_material(): var graph_edit = $VBoxContainer/HBoxContainer/Projects.get_current_tab_control() if graph_edit != null: - graph_edit.save_file() - + if graph_edit.save_path != null: + graph_edit.save_file(graph_edit.save_path) + else: + save_material_as() + func save_material_as(): var graph_edit = $VBoxContainer/HBoxContainer/Projects.get_current_tab_control() if graph_edit != null: - graph_edit.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", graph_edit, "save_file") + dialog.popup_centered() func close_material(): $VBoxContainer/HBoxContainer/Projects.close_tab() @@ -298,7 +307,17 @@ func update_preview_2d(node = null): node = n break if node != null: - graph_edit.renderer.setup_material(preview.get_2d_material(), node.get_textures(), node.generate_shader()) + print(node.name) + var source = node.generator.get_shader(0) + if source != null: + var shader : String = renderer.generate_shader(source) + var status = renderer.render_shader(shader, {}, 1024) + while status is GDScriptFunctionState: + status = yield(status, "completed") + var image = renderer.get_texture().get_data() + var tex = ImageTexture.new() + tex.create_from_image(image) + preview.set_2d(tex) func _on_Projects_tab_changed(tab): var new_tab = $VBoxContainer/HBoxContainer/Projects.get_current_tab_control() diff --git a/addons/material_maker/main_window.tscn b/addons/material_maker/main_window.tscn index 835eb56..1ee2d32 100644 --- a/addons/material_maker/main_window.tscn +++ b/addons/material_maker/main_window.tscn @@ -4,7 +4,7 @@ [ext_resource path="res://addons/material_maker/library.gd" type="Script" id=2] [ext_resource path="res://addons/material_maker/preview.tscn" type="PackedScene" id=3] [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/engine/renderer.tscn" type="PackedScene" id=5] [ext_resource path="res://addons/material_maker/node_factory.gd" type="Script" id=6] [node name="MainWindow" type="Panel"] @@ -96,12 +96,6 @@ tab_align = 0 tab_close_display_policy = 1 [node name="Renderer" parent="." instance=ExtResource( 5 )] -handle_input_locally = false -msaa = 0 -hdr = true -disable_3d = true -usage = 0 -debug_path = "D:/Dev/mmdebug_" [node name="NodeFactory" type="Node" parent="."] script = ExtResource( 6 ) diff --git a/addons/material_maker/new.ptex b/addons/material_maker/new.ptex new file mode 100644 index 0000000..4d41f06 --- /dev/null +++ b/addons/material_maker/new.ptex @@ -0,0 +1 @@ +{"connections":[],"nodes":[{"name":"Material","node_position":{"x":307,"y":-53},"parameters":{"albedo_color":{"a":1,"b":1,"g":1,"r":1,"type":"Color"},"ao_light_affect":1,"depth_scale":1,"emission_energy":1,"metallic":1,"normal_scale":1,"resolution":1,"roughness":1},"type":"material"}]} \ No newline at end of file diff --git a/addons/material_maker/node_factory.gd b/addons/material_maker/node_factory.gd index 90e8032..f37f2cf 100644 --- a/addons/material_maker/node_factory.gd +++ b/addons/material_maker/node_factory.gd @@ -12,7 +12,7 @@ func create_node(type): node = preload("res://addons/material_maker/nodes/node_generic.gd").new() node.model = type else: - var node_type = load("res://addons/material_maker/nodes/"+type+"/"+type+".tscn") + var node_type = load("res://addons/material_maker/nodes/"+type+".tscn") if node_type != null: node = node_type.instance() return node diff --git a/addons/material_maker/nodes/custom/custom.gd b/addons/material_maker/nodes/custom.gd similarity index 100% rename from addons/material_maker/nodes/custom/custom.gd rename to addons/material_maker/nodes/custom.gd diff --git a/addons/material_maker/nodes/custom/custom.tscn b/addons/material_maker/nodes/custom.tscn similarity index 94% rename from addons/material_maker/nodes/custom/custom.tscn rename to addons/material_maker/nodes/custom.tscn index 20f190a..d9e6ba0 100644 --- a/addons/material_maker/nodes/custom/custom.tscn +++ b/addons/material_maker/nodes/custom.tscn @@ -1,6 +1,6 @@ [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.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/load.png" type="Texture" id=3] [ext_resource path="res://addons/material_maker/icons/save.png" type="Texture" id=4] diff --git a/addons/material_maker/nodes/generic.gd b/addons/material_maker/nodes/generic.gd new file mode 100644 index 0000000..31723f4 --- /dev/null +++ b/addons/material_maker/nodes/generic.gd @@ -0,0 +1,134 @@ +extends GraphNode + +var generator = null setget set_generator + +var uses_seed : bool = false + +var parameters = {} +var model_data = {} + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func set_generator(g): + generator = g + update_node(g.model_data) + +func initialize_properties(p): + pass + +func update_node(data): + print("node_generic.update_node") + if typeof(data) != TYPE_DICTIONARY: + return + if !data.has("name"): + 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 + model_data = data + uses_seed = false + if model_data.has("instance") and model_data.instance.find("$(seed)"): + uses_seed = true + if model_data.has("parameters") and typeof(model_data.parameters) == TYPE_ARRAY: + var control_list = [] + var sizer = null + for p in model_data.parameters: + if !p.has("name") or !p.has("type"): + continue + var control = null + if p.type == "float": + if p.has("widget") and p.widget == "spinbox": + control = SpinBox.new() + else: + control = HSlider.new() + control.min_value = p.min + control.max_value = p.max + control.step = 0 if !p.has("step") else p.step + if p.has("default"): + control.value = p.default + control.rect_min_size.x = 80 + parameters[p.name] = 0.5*(p.min+p.max) + elif p.type == "size": + control = OptionButton.new() + for i in range(p.first, p.last+1): + var s = pow(2, i) + control.add_item("%dx%d" % [ s, s ]) + control.selected = 0 if !p.has("default") else p.default-p.first + elif p.type == "enum": + control = OptionButton.new() + for i in range(p.values.size()): + var value = p.values[i] + control.add_item(value.name) + control.selected = 0 if !p.has("default") else p.default + elif p.type == "boolean": + control = CheckBox.new() + elif p.type == "color": + control = ColorPickerButton.new() + elif p.type == "gradient": + control = preload("res://addons/material_maker/widgets/gradient_editor.tscn").instance() + if control != null: + var label = p.name + control.name = label + control_list.append(control) + if p.has("label"): + label = p.label + if sizer == null or label != "nonewline": + sizer = HBoxContainer.new() + sizer.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL + add_child(sizer) + if label != "" && label != "nonewline": + var label_widget = Label.new() + label_widget.text = label + label_widget.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL + sizer.add_child(label_widget) + control.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL + sizer.add_child(control) + initialize_properties(control_list) + else: + model_data.parameters = [] + if model_data.has("inputs") and typeof(model_data.inputs) == TYPE_ARRAY: + for i in range(model_data.inputs.size()): + var input = model_data.inputs[i] + var enable_left = false + var color_left = Color(0.5, 0.5, 0.5) + if typeof(input) == TYPE_DICTIONARY: + if input.type == "rgb": + enable_left = true + color_left = Color(0.5, 0.5, 1.0) + elif input.type == "rgba": + enable_left = true + color_left = Color(0.0, 0.5, 0.0, 0.5) + else: + enable_left = true + set_slot(i, enable_left, 0, color_left, false, 0, Color()) + else: + model_data.inputs = [] + if model_data.has("outputs") and typeof(model_data.outputs) == TYPE_ARRAY: + for i in range(model_data.outputs.size()): + var output = model_data.outputs[i] + var enable_right = false + var color_right = Color(0.5, 0.5, 0.5) + if typeof(output) == TYPE_DICTIONARY: + if output.has("rgb"): + enable_right = true + color_right = Color(0.5, 0.5, 1.0) + elif output.has("rgba"): + enable_right = true + color_right = Color(0.0, 0.5, 0.0, 0.5) + elif output.has("f"): + enable_right = true + set_slot(i, is_slot_enabled_left(i), get_slot_type_left(i), get_slot_color_left(i), enable_right, 0, color_right) + else: + model_data.outputs = [] + if custom_node_buttons != null: + move_child(custom_node_buttons, get_child_count()-1) diff --git a/addons/material_maker/nodes/generic.tscn b/addons/material_maker/nodes/generic.tscn new file mode 100644 index 0000000..3bdc771 --- /dev/null +++ b/addons/material_maker/nodes/generic.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/material_maker/nodes/generic.gd" type="Script" id=1] + +[node name="Generic" type="GraphNode"] +margin_right = 82.0 +margin_bottom = 29.0 +title = "Generic" +show_close = true +script = ExtResource( 1 ) diff --git a/addons/material_maker/nodes/material/material.gd b/addons/material_maker/nodes/material.gd similarity index 99% rename from addons/material_maker/nodes/material/material.gd rename to addons/material_maker/nodes/material.gd index bee9320..79a497b 100644 --- a/addons/material_maker/nodes/material/material.gd +++ b/addons/material_maker/nodes/material.gd @@ -1,6 +1,8 @@ tool extends "res://addons/material_maker/node_base.gd" +var generator = null + var texture_list var current_material_list = [] diff --git a/addons/material_maker/nodes/material/material.tscn b/addons/material_maker/nodes/material.tscn similarity index 99% rename from addons/material_maker/nodes/material/material.tscn rename to addons/material_maker/nodes/material.tscn index d52981b..3f4b924 100644 --- a/addons/material_maker/nodes/material/material.tscn +++ b/addons/material_maker/nodes/material.tscn @@ -1,12 +1,10 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://addons/material_maker/nodes/material/material.gd" type="Script" id=1] +[ext_resource path="res://addons/material_maker/nodes/material.gd" type="Script" id=1] [sub_resource type="Theme" id=1] - [node name="Material" type="GraphNode" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -79,7 +77,6 @@ script = ExtResource( 1 ) _sections_unfolded = [ "Theme", "slot", "slot/0", "slot/1", "slot/2", "slot/5", "slot/7" ] [node name="resolution" type="OptionButton" parent="." index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -107,7 +104,6 @@ items = [ "256x256", null, false, 0, null, "512x512", null, false, 1, null, "102 selected = 1 [node name="Albedo" type="HBoxContainer" parent="." index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -125,7 +121,6 @@ size_flags_vertical = 1 alignment = 0 [node name="Label" type="Label" parent="Albedo" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -146,7 +141,6 @@ max_lines_visible = -1 _sections_unfolded = [ "Size Flags" ] [node name="albedo_color" type="ColorPickerButton" parent="Albedo" index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -173,7 +167,6 @@ edit_alpha = false _sections_unfolded = [ "Rect", "Size Flags" ] [node name="Metallic" type="HBoxContainer" parent="." index="2"] - editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 @@ -192,7 +185,6 @@ size_flags_vertical = 1 alignment = 0 [node name="Label" type="Label" parent="Metallic" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -213,7 +205,6 @@ max_lines_visible = -1 _sections_unfolded = [ "Size Flags" ] [node name="metallic" type="SpinBox" parent="Metallic" index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -240,7 +231,6 @@ suffix = "" _sections_unfolded = [ "Rect" ] [node name="Roughness" type="HBoxContainer" parent="." index="3"] - editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 @@ -259,7 +249,6 @@ size_flags_vertical = 1 alignment = 0 [node name="Label" type="Label" parent="Roughness" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -280,7 +269,6 @@ max_lines_visible = -1 _sections_unfolded = [ "Size Flags" ] [node name="roughness" type="SpinBox" parent="Roughness" index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -307,7 +295,6 @@ suffix = "" _sections_unfolded = [ "Rect" ] [node name="Emission" type="HBoxContainer" parent="." index="4"] - editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 @@ -326,7 +313,6 @@ size_flags_vertical = 1 alignment = 0 [node name="Label" type="Label" parent="Emission" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -347,7 +333,6 @@ max_lines_visible = -1 _sections_unfolded = [ "Size Flags" ] [node name="emission_energy" type="SpinBox" parent="Emission" index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -374,7 +359,6 @@ suffix = "" _sections_unfolded = [ "Rect" ] [node name="NormalMap" type="HBoxContainer" parent="." index="5"] - editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 @@ -393,7 +377,6 @@ size_flags_vertical = 1 alignment = 0 [node name="Label" type="Label" parent="NormalMap" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -414,7 +397,6 @@ max_lines_visible = -1 _sections_unfolded = [ "Size Flags" ] [node name="normal_scale" type="SpinBox" parent="NormalMap" index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -441,7 +423,6 @@ suffix = "" _sections_unfolded = [ "Rect" ] [node name="AmbientOcclusion" type="HBoxContainer" parent="." index="6"] - editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 @@ -460,7 +441,6 @@ size_flags_vertical = 1 alignment = 0 [node name="Label" type="Label" parent="AmbientOcclusion" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -481,7 +461,6 @@ max_lines_visible = -1 _sections_unfolded = [ "Size Flags" ] [node name="ao_light_affect" type="SpinBox" parent="AmbientOcclusion" index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -508,7 +487,6 @@ suffix = "" _sections_unfolded = [ "Rect" ] [node name="DepthMap" type="HBoxContainer" parent="." index="7"] - editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 @@ -527,7 +505,6 @@ size_flags_vertical = 1 alignment = 0 [node name="Label" type="Label" parent="DepthMap" index="0"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -548,7 +525,6 @@ max_lines_visible = -1 _sections_unfolded = [ "Size Flags" ] [node name="depth_scale" type="SpinBox" parent="DepthMap" index="1"] - anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -573,5 +549,3 @@ editable = true prefix = "" suffix = "" _sections_unfolded = [ "Rect" ] - - diff --git a/addons/material_maker/preview.gd b/addons/material_maker/preview.gd index 142817f..8d23fd3 100644 --- a/addons/material_maker/preview.gd +++ b/addons/material_maker/preview.gd @@ -29,9 +29,9 @@ func _on_Model_item_selected(id): func get_materials(): return [ $MaterialPreview/Objects/Cube.get_surface_material(0), $MaterialPreview/Objects/Sphere.get_surface_material(0) ] - -func get_2d_material(): - return $Preview2D.material + +func set_2d(tex: Texture): + $Preview2D.material.set_shader_param("tex", tex) func _on_Preview_resized(): if preview_maximized: diff --git a/addons/material_maker/preview.tscn b/addons/material_maker/preview.tscn index d8b9881..f84c456 100644 --- a/addons/material_maker/preview.tscn +++ b/addons/material_maker/preview.tscn @@ -1,13 +1,11 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=14 format=2] [ext_resource path="res://addons/material_maker/preview.gd" type="Script" id=1] [ext_resource path="res://addons/material_maker/panoramas/park.hdr" type="Texture" id=2] +[ext_resource path="res://icon.png" type="Texture" id=3] [sub_resource type="Animation" id=1] - -length = 1.0 loop = true -step = 0.1 tracks/0/type = "value" tracks/0/path = NodePath("MaterialPreview/Objects:rotation_degrees") tracks/0/interp = 1 @@ -22,9 +20,6 @@ tracks/0/keys = { } [sub_resource type="ArrayMesh" id=2] - -blend_shape_mode = 1 -custom_aabb = AABB( 0, 0, 0, 0, 0, 0 ) surfaces/0 = { "aabb": AABB( -1, -1, -1, 2.00001, 2, 2 ), "array_data": PoolByteArray( 0, 60, 0, 188, 255, 187, 0, 60, 0, 129, 0, 0, 126, 0, 0, 129, 252, 59, 251, 59, 0, 188, 0, 188, 255, 59, 0, 60, 0, 129, 0, 0, 127, 0, 0, 129, 4, 18, 60, 25, 0, 60, 0, 188, 0, 60, 0, 60, 0, 129, 0, 0, 127, 0, 0, 129, 252, 59, 60, 25, 255, 187, 0, 188, 0, 188, 0, 60, 0, 129, 0, 0, 127, 0, 0, 129, 4, 18, 251, 59, 0, 60, 0, 60, 255, 187, 0, 60, 0, 127, 0, 0, 0, 0, 129, 129, 252, 59, 251, 59, 0, 188, 0, 60, 255, 59, 0, 60, 0, 127, 0, 0, 0, 0, 129, 129, 4, 18, 60, 25, 255, 187, 0, 60, 0, 188, 0, 60, 0, 127, 0, 0, 0, 0, 129, 129, 252, 59, 60, 25, 255, 59, 0, 60, 0, 60, 0, 60, 0, 127, 0, 0, 0, 0, 129, 129, 4, 18, 251, 59, 0, 60, 0, 188, 255, 187, 0, 60, 127, 0, 0, 0, 0, 0, 129, 129, 252, 59, 251, 59, 255, 59, 0, 60, 0, 60, 0, 60, 127, 0, 0, 0, 0, 0, 129, 129, 4, 18, 60, 25, 0, 60, 0, 60, 255, 187, 0, 60, 127, 0, 0, 0, 0, 0, 129, 129, 252, 59, 60, 25, 0, 60, 0, 188, 0, 60, 0, 60, 127, 0, 0, 0, 0, 0, 129, 129, 4, 18, 251, 59, 0, 60, 0, 188, 0, 60, 0, 60, 0, 0, 127, 0, 127, 0, 0, 129, 252, 59, 251, 59, 0, 188, 0, 60, 255, 59, 0, 60, 0, 0, 127, 0, 127, 0, 0, 129, 4, 18, 60, 25, 255, 59, 0, 60, 0, 60, 0, 60, 0, 0, 127, 0, 127, 0, 0, 129, 252, 59, 60, 25, 0, 188, 0, 188, 255, 59, 0, 60, 0, 0, 127, 0, 126, 0, 0, 129, 4, 18, 251, 59, 0, 188, 0, 188, 255, 59, 0, 60, 129, 0, 0, 0, 0, 0, 127, 129, 252, 59, 251, 59, 255, 187, 0, 60, 0, 188, 0, 60, 129, 0, 0, 0, 0, 0, 126, 129, 4, 18, 60, 25, 0, 188, 0, 60, 255, 59, 0, 60, 129, 0, 0, 0, 0, 0, 127, 129, 252, 59, 60, 25, 255, 187, 0, 188, 0, 188, 0, 60, 129, 0, 0, 0, 0, 0, 127, 129, 4, 18, 251, 59, 0, 60, 0, 60, 255, 187, 0, 60, 0, 0, 129, 0, 129, 0, 0, 129, 4, 18, 60, 25, 255, 187, 0, 188, 0, 188, 0, 60, 0, 0, 129, 0, 130, 0, 0, 129, 252, 59, 251, 59, 0, 60, 0, 188, 255, 187, 0, 60, 0, 0, 129, 0, 129, 0, 0, 129, 4, 18, 251, 59, 255, 187, 0, 60, 0, 188, 0, 60, 0, 0, 129, 0, 129, 0, 0, 129, 252, 59, 60, 25 ), @@ -37,42 +32,10 @@ surfaces/0 = { "skeleton_aabb": [ ], "vertex_count": 24 } -_sections_unfolded = [ "surface_1" ] [sub_resource type="SpatialMaterial" id=3] - -render_priority = 0 -flags_transparent = false -flags_unshaded = false -flags_vertex_lighting = false -flags_no_depth_test = false -flags_use_point_size = false -flags_world_triplanar = false -flags_fixed_size = false -flags_albedo_tex_force_srgb = false -vertex_color_use_as_albedo = false -vertex_color_is_srgb = false -params_diffuse_mode = 0 -params_specular_mode = 0 -params_blend_mode = 0 -params_cull_mode = 0 -params_depth_draw_mode = 0 -params_line_width = 1.0 -params_point_size = 1.0 -params_billboard_mode = 0 -params_grow = false -params_use_alpha_scissor = false -albedo_color = Color( 1, 1, 1, 1 ) metallic = 1.0 metallic_specular = 1.0 -metallic_texture_channel = 0 -roughness = 1.0 -roughness_texture_channel = 0 -emission_enabled = false -normal_enabled = false -rim_enabled = false -clearcoat_enabled = false -anisotropy_enabled = false ao_enabled = true ao_light_affect = 0.0 ao_on_uv2 = false @@ -82,26 +45,10 @@ depth_scale = 0.5 depth_deep_parallax = true depth_min_layers = 8 depth_max_layers = 32 -subsurf_scatter_enabled = false -transmission_enabled = false -refraction_enabled = false -detail_enabled = false -uv1_scale = Vector3( 1, 1, 1 ) -uv1_offset = Vector3( 0, 0, 0 ) -uv1_triplanar = false -uv1_triplanar_sharpness = 1.0 -uv2_scale = Vector3( 1, 1, 1 ) -uv2_offset = Vector3( 0, 0, 0 ) -uv2_triplanar = false -uv2_triplanar_sharpness = 1.0 -proximity_fade_enable = false -distance_fade_enable = false -_sections_unfolded = [ "Ambient Occlusion", "Depth" ] +depth_flip_tangent = false +depth_flip_binormal = false [sub_resource type="ArrayMesh" id=4] - -blend_shape_mode = 1 -custom_aabb = AABB( 0, 0, 0, 0, 0, 0 ) surfaces/0 = { "aabb": AABB( -1, -1, -1, 2, 2, 2 ), "array_data": PoolByteArray( 0, 0, 0, 188, 0, 188, 0, 60, 0, 172, 162, 0, 129, 0, 0, 129, 201, 58, 209, 59, 31, 54, 0, 60, 100, 187, 0, 60, 36, 84, 169, 0, 139, 0, 208, 129, 73, 57, 198, 37, 0, 0, 0, 60, 0, 188, 0, 60, 0, 84, 162, 0, 129, 0, 0, 129, 201, 58, 198, 37, 31, 54, 0, 188, 100, 187, 0, 60, 36, 172, 169, 0, 139, 0, 208, 129, 73, 57, 209, 59, 168, 57, 0, 60, 168, 185, 0, 60, 67, 84, 189, 0, 167, 0, 167, 129, 147, 55, 198, 37, 168, 57, 0, 188, 168, 185, 0, 60, 67, 172, 189, 0, 167, 0, 167, 129, 147, 55, 209, 59, 100, 59, 0, 60, 31, 182, 0, 60, 87, 84, 220, 0, 208, 0, 139, 129, 147, 52, 198, 37, 100, 59, 0, 188, 31, 182, 0, 60, 87, 172, 220, 0, 208, 0, 139, 129, 147, 52, 209, 59, 0, 60, 0, 60, 0, 0, 0, 60, 94, 84, 0, 0, 0, 0, 130, 129, 77, 46, 198, 37, 0, 60, 0, 188, 0, 0, 0, 60, 94, 172, 0, 0, 0, 0, 129, 129, 77, 46, 209, 59, 100, 59, 0, 60, 31, 54, 0, 60, 87, 84, 36, 0, 48, 0, 139, 129, 178, 173, 198, 37, 100, 59, 0, 188, 31, 54, 0, 60, 87, 172, 36, 0, 48, 0, 139, 129, 178, 173, 209, 59, 168, 57, 0, 60, 168, 57, 0, 60, 67, 84, 67, 0, 89, 0, 167, 129, 108, 180, 198, 37, 168, 57, 0, 188, 168, 57, 0, 60, 67, 172, 67, 0, 89, 0, 167, 129, 108, 180, 209, 59, 31, 54, 0, 60, 100, 59, 0, 60, 36, 84, 87, 0, 117, 0, 208, 129, 108, 183, 198, 37, 31, 54, 0, 188, 100, 59, 0, 60, 36, 172, 87, 0, 117, 0, 208, 129, 108, 183, 209, 59, 0, 0, 0, 60, 0, 60, 0, 60, 0, 84, 94, 0, 127, 0, 0, 129, 54, 185, 198, 37, 0, 0, 0, 188, 0, 60, 0, 60, 0, 172, 94, 0, 127, 0, 0, 129, 54, 185, 209, 59, 31, 182, 0, 60, 100, 59, 0, 60, 220, 84, 87, 0, 117, 0, 48, 129, 182, 186, 198, 37, 31, 182, 0, 188, 100, 59, 0, 60, 220, 172, 87, 0, 117, 0, 48, 129, 182, 186, 209, 59, 168, 185, 0, 60, 168, 57, 0, 60, 189, 84, 67, 0, 89, 0, 89, 129, 27, 188, 198, 37, 168, 185, 0, 188, 168, 57, 0, 60, 189, 172, 67, 0, 89, 0, 89, 129, 27, 188, 209, 59, 100, 187, 0, 60, 31, 54, 0, 60, 169, 84, 36, 0, 48, 0, 117, 129, 219, 188, 198, 37, 100, 187, 0, 188, 31, 54, 0, 60, 169, 172, 36, 0, 48, 0, 117, 129, 219, 188, 209, 59, 0, 188, 0, 60, 0, 0, 0, 60, 162, 84, 0, 0, 11, 12, 125, 129, 155, 189, 198, 37, 0, 188, 0, 188, 0, 0, 0, 60, 162, 172, 0, 0, 11, 244, 125, 129, 155, 189, 209, 59, 0, 188, 0, 188, 0, 0, 0, 60, 162, 172, 0, 0, 245, 12, 125, 129, 100, 62, 209, 59, 100, 187, 0, 60, 31, 182, 0, 60, 169, 84, 220, 0, 208, 0, 117, 129, 164, 61, 198, 37, 0, 188, 0, 60, 0, 0, 0, 60, 162, 84, 0, 0, 245, 244, 125, 129, 100, 62, 198, 37, 100, 187, 0, 188, 31, 182, 0, 60, 169, 172, 220, 0, 208, 0, 117, 129, 164, 61, 209, 59, 168, 185, 0, 60, 168, 185, 0, 60, 189, 84, 189, 0, 167, 0, 89, 129, 228, 60, 198, 37, 168, 185, 0, 188, 168, 185, 0, 60, 189, 172, 189, 0, 167, 0, 89, 129, 228, 60, 209, 59, 31, 54, 0, 60, 100, 187, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 81, 57, 138, 43, 31, 182, 0, 60, 100, 187, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 201, 52, 138, 43, 0, 0, 0, 60, 0, 188, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 181, 55, 198, 37, 168, 185, 0, 60, 168, 185, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 157, 48, 50, 49, 100, 187, 0, 60, 31, 182, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 56, 41, 19, 53, 0, 188, 0, 60, 0, 0, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 140, 28, 0, 56, 100, 187, 0, 60, 31, 54, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 56, 41, 118, 57, 168, 185, 0, 60, 168, 57, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 157, 48, 179, 58, 31, 182, 0, 60, 100, 59, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 201, 52, 135, 59, 0, 0, 0, 60, 0, 60, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 181, 55, 209, 59, 31, 54, 0, 60, 100, 59, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 81, 57, 135, 59, 168, 57, 0, 60, 168, 57, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 142, 58, 179, 58, 100, 59, 0, 60, 31, 54, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 98, 59, 118, 57, 0, 60, 0, 60, 0, 0, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 172, 59, 0, 56, 100, 59, 0, 60, 31, 182, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 98, 59, 19, 53, 168, 57, 0, 60, 168, 185, 0, 60, 0, 127, 0, 0, 127, 0, 0, 129, 142, 58, 50, 49, 31, 182, 0, 60, 100, 187, 0, 60, 220, 84, 169, 0, 139, 0, 48, 129, 36, 60, 198, 37, 31, 182, 0, 188, 100, 187, 0, 60, 220, 172, 169, 0, 139, 0, 48, 129, 36, 60, 209, 59, 0, 0, 0, 188, 0, 188, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 181, 55, 198, 37, 168, 57, 0, 188, 168, 185, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 142, 58, 50, 49, 31, 54, 0, 188, 100, 187, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 81, 57, 138, 43, 100, 59, 0, 188, 31, 182, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 98, 59, 19, 53, 0, 60, 0, 188, 0, 0, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 172, 59, 0, 56, 100, 59, 0, 188, 31, 54, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 98, 59, 118, 57, 168, 57, 0, 188, 168, 57, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 142, 58, 179, 58, 31, 54, 0, 188, 100, 59, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 81, 57, 135, 59, 0, 0, 0, 188, 0, 60, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 181, 55, 209, 59, 31, 182, 0, 188, 100, 59, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 201, 52, 135, 59, 168, 185, 0, 188, 168, 57, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 157, 48, 179, 58, 100, 187, 0, 188, 31, 54, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 56, 41, 118, 57, 0, 188, 0, 188, 0, 0, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 140, 28, 0, 56, 100, 187, 0, 188, 31, 182, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 56, 41, 19, 53, 168, 185, 0, 188, 168, 185, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 157, 48, 50, 49, 31, 182, 0, 188, 100, 187, 0, 60, 0, 129, 0, 0, 127, 0, 0, 127, 201, 52, 138, 43 ), @@ -113,51 +60,14 @@ surfaces/0 = { "skeleton_aabb": [ ], "vertex_count": 66 } -_sections_unfolded = [ "surface_1" ] [sub_resource type="SphereMesh" id=5] - -custom_aabb = AABB( 0, 0, 0, 0, 0, 0 ) radius = 1.5 height = 3.0 -radial_segments = 64 -rings = 32 -is_hemisphere = false [sub_resource type="SpatialMaterial" id=6] - -render_priority = 0 -flags_transparent = false -flags_unshaded = false -flags_vertex_lighting = false -flags_no_depth_test = false -flags_use_point_size = false -flags_world_triplanar = false -flags_fixed_size = false -flags_albedo_tex_force_srgb = false -vertex_color_use_as_albedo = false -vertex_color_is_srgb = false -params_diffuse_mode = 0 -params_specular_mode = 0 -params_blend_mode = 0 -params_cull_mode = 0 -params_depth_draw_mode = 0 -params_line_width = 1.0 -params_point_size = 1.0 -params_billboard_mode = 0 -params_grow = false -params_use_alpha_scissor = false -albedo_color = Color( 1, 1, 1, 1 ) metallic = 1.0 metallic_specular = 1.0 -metallic_texture_channel = 0 -roughness = 1.0 -roughness_texture_channel = 0 -emission_enabled = false -normal_enabled = false -rim_enabled = false -clearcoat_enabled = false -anisotropy_enabled = false ao_enabled = true ao_light_affect = 0.0 ao_on_uv2 = false @@ -167,373 +77,118 @@ depth_scale = 0.5 depth_deep_parallax = true depth_min_layers = 8 depth_max_layers = 32 -subsurf_scatter_enabled = false -transmission_enabled = false -refraction_enabled = false -detail_enabled = false +depth_flip_tangent = false +depth_flip_binormal = false uv1_scale = Vector3( -5, -5, 5 ) -uv1_offset = Vector3( 0, 0, 0 ) -uv1_triplanar = false -uv1_triplanar_sharpness = 1.0 -uv2_scale = Vector3( 1, 1, 1 ) -uv2_offset = Vector3( 0, 0, 0 ) -uv2_triplanar = false -uv2_triplanar_sharpness = 1.0 -proximity_fade_enable = false -distance_fade_enable = false -_sections_unfolded = [ "Ambient Occlusion", "Depth", "UV1" ] [sub_resource type="PanoramaSky" id=7] - radiance_size = 2 panorama = ExtResource( 2 ) [sub_resource type="Environment" id=8] - background_mode = 2 background_sky = SubResource( 7 ) -background_sky_custom_fov = 0.0 -background_color = Color( 0, 0, 0, 1 ) -background_energy = 1.0 -background_canvas_max_layer = 0 -ambient_light_color = Color( 0, 0, 0, 1 ) -ambient_light_energy = 1.0 -ambient_light_sky_contribution = 1.0 -fog_enabled = false -fog_color = Color( 0.5, 0.6, 0.7, 1 ) -fog_sun_color = Color( 1, 0.9, 0.7, 1 ) -fog_sun_amount = 0.0 -fog_depth_enabled = true -fog_depth_begin = 10.0 -fog_depth_curve = 1.0 -fog_transmit_enabled = false -fog_transmit_curve = 1.0 -fog_height_enabled = false -fog_height_min = 0.0 -fog_height_max = 100.0 -fog_height_curve = 1.0 -tonemap_mode = 0 -tonemap_exposure = 1.0 -tonemap_white = 1.0 -auto_exposure_enabled = false -auto_exposure_scale = 0.4 -auto_exposure_min_luma = 0.05 -auto_exposure_max_luma = 8.0 -auto_exposure_speed = 0.5 -ss_reflections_enabled = false -ss_reflections_max_steps = 64 -ss_reflections_fade_in = 0.15 -ss_reflections_fade_out = 2.0 -ss_reflections_depth_tolerance = 0.2 -ss_reflections_roughness = true -ssao_enabled = false -ssao_radius = 1.0 -ssao_intensity = 1.0 -ssao_radius2 = 0.0 -ssao_intensity2 = 1.0 -ssao_bias = 0.01 -ssao_light_affect = 0.0 -ssao_color = Color( 0, 0, 0, 1 ) -ssao_quality = 0 -ssao_blur = 3 -ssao_edge_sharpness = 4.0 -dof_blur_far_enabled = false -dof_blur_far_distance = 10.0 -dof_blur_far_transition = 5.0 -dof_blur_far_amount = 0.1 -dof_blur_far_quality = 1 -dof_blur_near_enabled = false -dof_blur_near_distance = 2.0 -dof_blur_near_transition = 1.0 -dof_blur_near_amount = 0.1 -dof_blur_near_quality = 1 -glow_enabled = false -glow_levels/1 = false -glow_levels/2 = false -glow_levels/3 = true -glow_levels/4 = false -glow_levels/5 = true -glow_levels/6 = false -glow_levels/7 = false -glow_intensity = 0.8 -glow_strength = 1.0 -glow_bloom = 0.0 -glow_blend_mode = 2 -glow_hdr_threshold = 1.0 -glow_hdr_scale = 2.0 -glow_bicubic_upscale = false -adjustment_enabled = false -adjustment_brightness = 1.0 -adjustment_contrast = 1.0 -adjustment_saturation = 1.0 -_sections_unfolded = [ "Background" ] [sub_resource type="Shader" id=9] - code = "shader_type canvas_item; -" + +uniform sampler2D tex; + +void fragment() { + COLOR = texture(tex, UV); +}" [sub_resource type="ShaderMaterial" id=10] - -render_priority = 0 shader = SubResource( 9 ) +shader_param/tex = ExtResource( 3 ) [node name="Preview" type="ViewportContainer"] - anchor_left = 1.0 -anchor_top = 0.0 anchor_right = 1.0 -anchor_bottom = 0.0 margin_left = -398.0 margin_top = 3.0 margin_right = -3.0 margin_bottom = 373.0 rect_min_size = Vector2( 200, 200 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false mouse_filter = 2 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 stretch = true -stretch_shrink = 1 script = ExtResource( 1 ) -_sections_unfolded = [ "Anchor", "Grow Direction", "Margin", "Mouse", "Rect", "Size Flags" ] -[node name="ObjectRotate" type="AnimationPlayer" parent="." index="0"] - -root_node = NodePath("..") +[node name="ObjectRotate" type="AnimationPlayer" parent="."] autoplay = "rotate" -playback_process_mode = 1 -playback_default_blend_time = 0.0 playback_speed = 0.1 anims/rotate = SubResource( 1 ) -blend_times = [ ] -_sections_unfolded = [ "Playback Options" ] -[node name="MaterialPreview" type="Viewport" parent="." index="1"] - -arvr = false +[node name="MaterialPreview" type="Viewport" parent="."] size = Vector2( 395, 370 ) own_world = true -world = null -transparent_bg = false -msaa = 0 -hdr = true -disable_3d = false -usage = 2 -debug_draw = 0 -render_target_v_flip = false +handle_input_locally = false render_target_clear_mode = 1 render_target_update_mode = 3 -audio_listener_enable_2d = false -audio_listener_enable_3d = false -physics_object_picking = false -gui_disable_input = false -gui_snap_controls_to_pixels = true -shadow_atlas_size = 0 -shadow_atlas_quad_0 = 2 -shadow_atlas_quad_1 = 2 -shadow_atlas_quad_2 = 3 -shadow_atlas_quad_3 = 4 -_sections_unfolded = [ "GUI", "Render Target" ] -[node name="Objects" type="Spatial" parent="MaterialPreview" index="0"] +[node name="Objects" type="Spatial" parent="MaterialPreview"] +transform = Transform( -0.956327, 0, -0.292284, 0, 1, 0, 0.292284, 0, -0.956327, 0, 0, 0 ) -transform = Transform( 0.999464, 0, 0.0326148, 0, 1, 0, -0.0326148, 0, 0.999464, 0, 0, 0 ) -_sections_unfolded = [ "Transform" ] - -[node name="Cube" type="MeshInstance" parent="MaterialPreview/Objects" index="0"] - -layers = 1 -material_override = null -cast_shadow = 1 -extra_cull_margin = 0.0 -use_in_baked_light = false -lod_min_distance = 0.0 -lod_min_hysteresis = 0.0 -lod_max_distance = 0.0 -lod_max_hysteresis = 0.0 +[node name="Cube" type="MeshInstance" parent="MaterialPreview/Objects"] mesh = SubResource( 2 ) -skeleton = NodePath("..") material/0 = SubResource( 3 ) -_sections_unfolded = [ "Geometry", "Transform", "material" ] - -[node name="Cylinder" type="MeshInstance" parent="MaterialPreview/Objects" index="1"] +[node name="Cylinder" type="MeshInstance" parent="MaterialPreview/Objects"] visible = false -layers = 1 -material_override = null -cast_shadow = 1 -extra_cull_margin = 0.0 -use_in_baked_light = false -lod_min_distance = 0.0 -lod_min_hysteresis = 0.0 -lod_max_distance = 0.0 -lod_max_hysteresis = 0.0 mesh = SubResource( 4 ) -skeleton = NodePath("..") material/0 = SubResource( 3 ) -_sections_unfolded = [ "Geometry", "Transform", "material" ] - -[node name="Sphere" type="MeshInstance" parent="MaterialPreview/Objects" index="2"] +[node name="Sphere" type="MeshInstance" parent="MaterialPreview/Objects"] visible = false -layers = 1 -material_override = null -cast_shadow = 1 -extra_cull_margin = 0.0 -use_in_baked_light = false -lod_min_distance = 0.0 -lod_min_hysteresis = 0.0 -lod_max_distance = 0.0 -lod_max_hysteresis = 0.0 mesh = SubResource( 5 ) -skeleton = NodePath("..") material/0 = SubResource( 6 ) -_sections_unfolded = [ "Geometry", "Transform", "material" ] - -[node name="OmniLight" type="OmniLight" parent="MaterialPreview" index="1"] +[node name="OmniLight" type="OmniLight" parent="MaterialPreview"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.04729, 1.80471, -2.51024 ) -layers = 1 -light_color = Color( 1, 1, 1, 1 ) -light_energy = 1.0 -light_indirect_energy = 1.0 -light_negative = false -light_specular = 0.5 -light_bake_mode = 1 -light_cull_mask = -1 -shadow_enabled = false -shadow_color = Color( 0, 0, 0, 1 ) -shadow_bias = 0.15 -shadow_contact = 0.0 -shadow_reverse_cull_face = false -editor_only = false omni_range = 6.46518 -omni_attenuation = 1.0 -omni_shadow_mode = 1 -omni_shadow_detail = 1 -_sections_unfolded = [ "Shadow" ] - -[node name="Camera" type="Camera" parent="MaterialPreview" index="2"] +[node name="Camera" type="Camera" parent="MaterialPreview"] transform = Transform( 1, 0, 0, 0, 0.766044, 0.642787, 0, -0.642787, 0.766044, 0, 1.83022, 2.2549 ) -keep_aspect = 1 -cull_mask = 1048575 environment = SubResource( 8 ) -h_offset = 0.0 -v_offset = 0.0 -doppler_tracking = 0 -projection = 0 current = true -fov = 70.0 -size = 1.0 -near = 0.05 -far = 100.0 -_sections_unfolded = [ "Transform" ] - -[node name="WorldEnvironment" type="WorldEnvironment" parent="MaterialPreview" index="3"] +[node name="WorldEnvironment" type="WorldEnvironment" parent="MaterialPreview"] environment = SubResource( 8 ) -[node name="Config" type="HBoxContainer" parent="." index="2"] - -anchor_left = 0.0 -anchor_top = 0.0 +[node name="Config" type="HBoxContainer" parent="."] anchor_right = 1.0 -anchor_bottom = 0.0 margin_bottom = 20.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="Model" type="OptionButton" parent="Config" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Model" type="OptionButton" parent="Config"] margin_right = 100.0 margin_bottom = 20.0 rect_min_size = Vector2( 100, 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 = "Cube" -flat = false -align = 0 items = [ "Cube", null, false, 0, null, "Cylinder", null, false, 1, null, "Sphere", null, false, 2, null ] selected = 0 -_sections_unfolded = [ "Margin", "Rect" ] -[node name="Environment" type="OptionButton" parent="Config" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Environment" type="OptionButton" parent="Config"] margin_left = 104.0 margin_right = 204.0 margin_bottom = 20.0 rect_min_size = Vector2( 100, 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 = "Park" -flat = false -align = 0 items = [ "Experiment", null, false, 0, null, "Lobby", null, false, 1, null, "Night", null, false, 2, null, "Park", null, false, 3, null, "Schelde", null, false, 4, null ] selected = 3 -_sections_unfolded = [ "Rect" ] - -[node name="Preview2D" type="ColorRect" parent="." index="3"] +[node name="Preview2D" type="ColorRect" parent="."] material = SubResource( 10 ) -anchor_left = 0.0 anchor_top = 1.0 -anchor_right = 0.0 anchor_bottom = 1.0 margin_top = -64.0 margin_right = 64.0 rect_min_size = Vector2( 64, 64 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 0 size_flags_vertical = 8 -color = Color( 1, 1, 1, 1 ) -_sections_unfolded = [ "Anchor", "Material", "Mouse", "Rect", "Size Flags" ] - [connection signal="resized" from="." to="." method="_on_Preview_resized"] - [connection signal="item_selected" from="Config/Model" to="." method="_on_Model_item_selected"] - [connection signal="item_selected" from="Config/Environment" to="." method="_on_Environment_item_selected"] - [connection signal="gui_input" from="Preview2D" to="." method="_on_Preview2D_gui_input"] - - diff --git a/addons/material_maker/window_dialog.tscn b/addons/material_maker/window_dialog.tscn index 0d2b9de..f70fdb5 100644 --- a/addons/material_maker/window_dialog.tscn +++ b/addons/material_maker/window_dialog.tscn @@ -3,24 +3,10 @@ [ext_resource path="res://addons/material_maker/main_window.tscn" type="PackedScene" id=1] [node name="WindowDialog" type="WindowDialog"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 margin_right = 1124.0 margin_bottom = 619.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 popup_exclusive = true window_title = "Material Maker" resizable = true -_sections_unfolded = [ "Popup" ] - -[node name="MainWindow" parent="." index="1" instance=ExtResource( 1 )] - +[node name="MainWindow" parent="." instance=ExtResource( 1 )] diff --git a/export_presets.cfg b/export_presets.cfg index a33c086..5fbff90 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -8,13 +8,18 @@ export_filter="resources" export_files=PoolStringArray( "res://addons/material_maker/common.shader", "res://addons/material_maker/graph_edit.gd", "res://addons/material_maker/graph_edit.tscn", "res://addons/material_maker/icons/add.png", "res://addons/material_maker/icons/add_config.png", "res://addons/material_maker/icons/add_link.png", "res://addons/material_maker/icons/config.png", "res://addons/material_maker/icons/edit.png", "res://addons/material_maker/icons/icon.png", "res://addons/material_maker/icons/link.png", "res://addons/material_maker/icons/load.png", "res://addons/material_maker/icons/minus.png", "res://addons/material_maker/icons/plus.png", "res://addons/material_maker/icons/remove.png", "res://addons/material_maker/icons/save.png", "res://addons/material_maker/library.gd", "res://addons/material_maker/main_window.gd", "res://addons/material_maker/main_window.tscn", "res://addons/material_maker/node_base.gd", "res://addons/material_maker/node_factory.gd", "res://addons/material_maker/nodes/adjust_hsv.gd", "res://addons/material_maker/nodes/adjust_hsv.tscn", "res://addons/material_maker/nodes/adjust_hsv/adjust_hsv.gd", "res://addons/material_maker/nodes/adjust_hsv/adjust_hsv.tscn", "res://addons/material_maker/nodes/blend.gd", "res://addons/material_maker/nodes/blend.tscn", "res://addons/material_maker/nodes/blend/blend.gd", "res://addons/material_maker/nodes/blend/blend.tscn", "res://addons/material_maker/nodes/blur.gd", "res://addons/material_maker/nodes/blur.tscn", "res://addons/material_maker/nodes/blur/blur.gd", "res://addons/material_maker/nodes/blur/blur.tscn", "res://addons/material_maker/nodes/bricks.gd", "res://addons/material_maker/nodes/bricks.tscn", "res://addons/material_maker/nodes/bricks/bricks.gd", "res://addons/material_maker/nodes/bricks/bricks.tscn", "res://addons/material_maker/nodes/colorize.gd", "res://addons/material_maker/nodes/colorize.tscn", "res://addons/material_maker/nodes/colorize/colorize.gd", "res://addons/material_maker/nodes/colorize/colorize.tscn", "res://addons/material_maker/nodes/combine.gd", "res://addons/material_maker/nodes/combine.tscn", "res://addons/material_maker/nodes/combine/combine.gd", "res://addons/material_maker/nodes/combine/combine.tscn", "res://addons/material_maker/nodes/comment.gd", "res://addons/material_maker/nodes/comment.tscn", "res://addons/material_maker/nodes/comment/comment.gd", "res://addons/material_maker/nodes/comment/comment.tscn", "res://addons/material_maker/nodes/compound.tscn", "res://addons/material_maker/nodes/custom/custom.gd", "res://addons/material_maker/nodes/custom/custom.tscn", "res://addons/material_maker/nodes/decompose.gd", "res://addons/material_maker/nodes/decompose.tscn", "res://addons/material_maker/nodes/decompose/decompose.gd", "res://addons/material_maker/nodes/decompose/decompose.tscn", "res://addons/material_maker/nodes/emboss.gd", "res://addons/material_maker/nodes/emboss.tscn", "res://addons/material_maker/nodes/emboss/emboss.gd", "res://addons/material_maker/nodes/emboss/emboss.tscn", "res://addons/material_maker/nodes/export.gd", "res://addons/material_maker/nodes/export.tscn", "res://addons/material_maker/nodes/export/export.gd", "res://addons/material_maker/nodes/export/export.tscn", "res://addons/material_maker/nodes/godot_logo.png", "res://addons/material_maker/nodes/image.gd", "res://addons/material_maker/nodes/image.tscn", "res://addons/material_maker/nodes/image/godot_logo.png", "res://addons/material_maker/nodes/image/image.gd", "res://addons/material_maker/nodes/image/image.tscn", "res://addons/material_maker/nodes/material.gd", "res://addons/material_maker/nodes/material.tscn", "res://addons/material_maker/nodes/material/material.gd", "res://addons/material_maker/nodes/material/material.tscn", "res://addons/material_maker/nodes/node_generic.gd", "res://addons/material_maker/nodes/noise.gd", "res://addons/material_maker/nodes/noise.tscn", "res://addons/material_maker/nodes/noise/noise.gd", "res://addons/material_maker/nodes/noise/noise.tscn", "res://addons/material_maker/nodes/normal_map.gd", "res://addons/material_maker/nodes/normal_map.tscn", "res://addons/material_maker/nodes/normal_map/normal_map.gd", "res://addons/material_maker/nodes/normal_map/normal_map.tscn", "res://addons/material_maker/nodes/pattern.gd", "res://addons/material_maker/nodes/pattern.tscn", "res://addons/material_maker/nodes/pattern/pattern.gd", "res://addons/material_maker/nodes/pattern/pattern.tscn", "res://addons/material_maker/nodes/perlin.gd", "res://addons/material_maker/nodes/perlin.tscn", "res://addons/material_maker/nodes/perlin/perlin.gd", "res://addons/material_maker/nodes/perlin/perlin.tscn", "res://addons/material_maker/nodes/remote.gd", "res://addons/material_maker/nodes/remote.tscn", "res://addons/material_maker/nodes/remote/remote.gd", "res://addons/material_maker/nodes/remote/remote.tscn", "res://addons/material_maker/nodes/shape/shape.gd", "res://addons/material_maker/nodes/shape/shape.tscn", "res://addons/material_maker/nodes/switch.gd", "res://addons/material_maker/nodes/switch.tscn", "res://addons/material_maker/nodes/switch/switch.gd", "res://addons/material_maker/nodes/switch/switch.tscn", "res://addons/material_maker/nodes/transform.gd", "res://addons/material_maker/nodes/transform.tscn", "res://addons/material_maker/nodes/transform/transform.gd", "res://addons/material_maker/nodes/transform/transform.tscn", "res://addons/material_maker/nodes/uniform.gd", "res://addons/material_maker/nodes/uniform.tscn", "res://addons/material_maker/nodes/uniform/uniform.gd", "res://addons/material_maker/nodes/uniform/uniform.tscn", "res://addons/material_maker/nodes/voronoi.gd", "res://addons/material_maker/nodes/voronoi.tscn", "res://addons/material_maker/nodes/voronoi/voronoi.gd", "res://addons/material_maker/nodes/voronoi/voronoi.tscn", "res://addons/material_maker/nodes/warp.gd", "res://addons/material_maker/nodes/warp.tscn", "res://addons/material_maker/nodes/warp/warp.gd", "res://addons/material_maker/nodes/warp/warp.tscn", "res://addons/material_maker/panoramas/experiment.hdr", "res://addons/material_maker/panoramas/lobby.hdr", "res://addons/material_maker/panoramas/night.hdr", "res://addons/material_maker/panoramas/park.hdr", "res://addons/material_maker/panoramas/schelde.hdr", "res://addons/material_maker/pm_editor.gd", "res://addons/material_maker/pm_editor.tscn", "res://addons/material_maker/preview.gd", "res://addons/material_maker/preview.tscn", "res://addons/material_maker/renderer.gd", "res://addons/material_maker/renderer.tscn", "res://addons/material_maker/types/gradient.gd", "res://addons/material_maker/types/types.gd", "res://addons/material_maker/widgets/about.gd", "res://addons/material_maker/widgets/about.tscn", "res://addons/material_maker/widgets/facebook.png", "res://addons/material_maker/widgets/github.png", "res://addons/material_maker/widgets/gradient_editor.gd", "res://addons/material_maker/widgets/gradient_editor.tscn", "res://addons/material_maker/widgets/icon.png", "res://addons/material_maker/widgets/line_dialog.gd", "res://addons/material_maker/widgets/line_dialog.tscn", "res://addons/material_maker/widgets/linked_widgets/config_control.gd", "res://addons/material_maker/widgets/linked_widgets/config_control.tscn", "res://addons/material_maker/widgets/linked_widgets/editable_label.gd", "res://addons/material_maker/widgets/linked_widgets/editable_label.tscn", "res://addons/material_maker/widgets/linked_widgets/link.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control.tscn", "res://addons/material_maker/widgets/linked_widgets/linked_control_base.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn", "res://addons/material_maker/widgets/node_editor.tscn", "res://addons/material_maker/widgets/node_editor/enum_editor.gd", "res://addons/material_maker/widgets/node_editor/enum_editor.tscn", "res://addons/material_maker/widgets/node_editor/input.gd", "res://addons/material_maker/widgets/node_editor/input.tscn", "res://addons/material_maker/widgets/node_editor/node_editor.gd", "res://addons/material_maker/widgets/node_editor/node_editor.tscn", "res://addons/material_maker/widgets/node_editor/output.gd", "res://addons/material_maker/widgets/node_editor/output.tscn", "res://addons/material_maker/widgets/node_editor/parameter.gd", "res://addons/material_maker/widgets/node_editor/parameter.tscn", "res://addons/material_maker/widgets/node_editor/parameter_boolean.gd", "res://addons/material_maker/widgets/node_editor/parameter_boolean.tscn", "res://addons/material_maker/widgets/node_editor/parameter_color.gd", "res://addons/material_maker/widgets/node_editor/parameter_color.tscn", "res://addons/material_maker/widgets/node_editor/parameter_enum.gd", "res://addons/material_maker/widgets/node_editor/parameter_enum.tscn", "res://addons/material_maker/widgets/node_editor/parameter_float.gd", "res://addons/material_maker/widgets/node_editor/parameter_float.tscn", "res://addons/material_maker/widgets/node_editor/parameter_size.gd", "res://addons/material_maker/widgets/node_editor/parameter_size.tscn", "res://addons/material_maker/widgets/tabs.gd", "res://addons/material_maker/widgets/text_dialog.gd", "res://addons/material_maker/widgets/text_dialog.tscn", "res://addons/material_maker/widgets/twitter.png", "res://addons/material_maker/widgets/youtube.png", "res://addons/material_maker/window_dialog.tscn", "res://icon.png" ) include_filter="*.json,*.mmn,res://addons/material_maker/library/base/*.png" exclude_filter="*.ptex" +export_path="D:/Dev/material_maker.exe" patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" [preset.0.options] +texture_format/bptc=false texture_format/s3tc=true texture_format/etc=true texture_format/etc2=true +texture_format/no_bptc_fallbacks=true binary_format/64_bits=true custom_template/release="" custom_template/debug="" @@ -37,13 +42,18 @@ export_filter="resources" export_files=PoolStringArray( "res://addons/material_maker/common.shader", "res://addons/material_maker/graph_edit.gd", "res://addons/material_maker/graph_edit.tscn", "res://addons/material_maker/icons/add.png", "res://addons/material_maker/icons/add_config.png", "res://addons/material_maker/icons/add_link.png", "res://addons/material_maker/icons/config.png", "res://addons/material_maker/icons/edit.png", "res://addons/material_maker/icons/icon.png", "res://addons/material_maker/icons/link.png", "res://addons/material_maker/icons/load.png", "res://addons/material_maker/icons/minus.png", "res://addons/material_maker/icons/plus.png", "res://addons/material_maker/icons/remove.png", "res://addons/material_maker/icons/save.png", "res://addons/material_maker/library.gd", "res://addons/material_maker/main_window.gd", "res://addons/material_maker/main_window.tscn", "res://addons/material_maker/node_base.gd", "res://addons/material_maker/node_factory.gd", "res://addons/material_maker/nodes/adjust_hsv.gd", "res://addons/material_maker/nodes/adjust_hsv.tscn", "res://addons/material_maker/nodes/adjust_hsv/adjust_hsv.gd", "res://addons/material_maker/nodes/adjust_hsv/adjust_hsv.tscn", "res://addons/material_maker/nodes/blend.gd", "res://addons/material_maker/nodes/blend.tscn", "res://addons/material_maker/nodes/blend/blend.gd", "res://addons/material_maker/nodes/blend/blend.tscn", "res://addons/material_maker/nodes/blur.gd", "res://addons/material_maker/nodes/blur.tscn", "res://addons/material_maker/nodes/blur/blur.gd", "res://addons/material_maker/nodes/blur/blur.tscn", "res://addons/material_maker/nodes/bricks.gd", "res://addons/material_maker/nodes/bricks.tscn", "res://addons/material_maker/nodes/bricks/bricks.gd", "res://addons/material_maker/nodes/bricks/bricks.tscn", "res://addons/material_maker/nodes/colorize.gd", "res://addons/material_maker/nodes/colorize.tscn", "res://addons/material_maker/nodes/colorize/colorize.gd", "res://addons/material_maker/nodes/colorize/colorize.tscn", "res://addons/material_maker/nodes/combine.gd", "res://addons/material_maker/nodes/combine.tscn", "res://addons/material_maker/nodes/combine/combine.gd", "res://addons/material_maker/nodes/combine/combine.tscn", "res://addons/material_maker/nodes/comment.gd", "res://addons/material_maker/nodes/comment.tscn", "res://addons/material_maker/nodes/comment/comment.gd", "res://addons/material_maker/nodes/comment/comment.tscn", "res://addons/material_maker/nodes/compound.tscn", "res://addons/material_maker/nodes/custom/custom.gd", "res://addons/material_maker/nodes/custom/custom.tscn", "res://addons/material_maker/nodes/decompose.gd", "res://addons/material_maker/nodes/decompose.tscn", "res://addons/material_maker/nodes/decompose/decompose.gd", "res://addons/material_maker/nodes/decompose/decompose.tscn", "res://addons/material_maker/nodes/emboss.gd", "res://addons/material_maker/nodes/emboss.tscn", "res://addons/material_maker/nodes/emboss/emboss.gd", "res://addons/material_maker/nodes/emboss/emboss.tscn", "res://addons/material_maker/nodes/export.gd", "res://addons/material_maker/nodes/export.tscn", "res://addons/material_maker/nodes/export/export.gd", "res://addons/material_maker/nodes/export/export.tscn", "res://addons/material_maker/nodes/godot_logo.png", "res://addons/material_maker/nodes/image.gd", "res://addons/material_maker/nodes/image.tscn", "res://addons/material_maker/nodes/image/godot_logo.png", "res://addons/material_maker/nodes/image/image.gd", "res://addons/material_maker/nodes/image/image.tscn", "res://addons/material_maker/nodes/material.gd", "res://addons/material_maker/nodes/material.tscn", "res://addons/material_maker/nodes/material/material.gd", "res://addons/material_maker/nodes/material/material.tscn", "res://addons/material_maker/nodes/node_generic.gd", "res://addons/material_maker/nodes/noise.gd", "res://addons/material_maker/nodes/noise.tscn", "res://addons/material_maker/nodes/noise/noise.gd", "res://addons/material_maker/nodes/noise/noise.tscn", "res://addons/material_maker/nodes/normal_map.gd", "res://addons/material_maker/nodes/normal_map.tscn", "res://addons/material_maker/nodes/normal_map/normal_map.gd", "res://addons/material_maker/nodes/normal_map/normal_map.tscn", "res://addons/material_maker/nodes/pattern.gd", "res://addons/material_maker/nodes/pattern.tscn", "res://addons/material_maker/nodes/pattern/pattern.gd", "res://addons/material_maker/nodes/pattern/pattern.tscn", "res://addons/material_maker/nodes/perlin.gd", "res://addons/material_maker/nodes/perlin.tscn", "res://addons/material_maker/nodes/perlin/perlin.gd", "res://addons/material_maker/nodes/perlin/perlin.tscn", "res://addons/material_maker/nodes/remote.gd", "res://addons/material_maker/nodes/remote.tscn", "res://addons/material_maker/nodes/remote/remote.gd", "res://addons/material_maker/nodes/remote/remote.tscn", "res://addons/material_maker/nodes/shape/shape.gd", "res://addons/material_maker/nodes/shape/shape.tscn", "res://addons/material_maker/nodes/switch.gd", "res://addons/material_maker/nodes/switch.tscn", "res://addons/material_maker/nodes/switch/switch.gd", "res://addons/material_maker/nodes/switch/switch.tscn", "res://addons/material_maker/nodes/transform.gd", "res://addons/material_maker/nodes/transform.tscn", "res://addons/material_maker/nodes/transform/transform.gd", "res://addons/material_maker/nodes/transform/transform.tscn", "res://addons/material_maker/nodes/uniform.gd", "res://addons/material_maker/nodes/uniform.tscn", "res://addons/material_maker/nodes/uniform/uniform.gd", "res://addons/material_maker/nodes/uniform/uniform.tscn", "res://addons/material_maker/nodes/voronoi.gd", "res://addons/material_maker/nodes/voronoi.tscn", "res://addons/material_maker/nodes/voronoi/voronoi.gd", "res://addons/material_maker/nodes/voronoi/voronoi.tscn", "res://addons/material_maker/nodes/warp.gd", "res://addons/material_maker/nodes/warp.tscn", "res://addons/material_maker/nodes/warp/warp.gd", "res://addons/material_maker/nodes/warp/warp.tscn", "res://addons/material_maker/panoramas/experiment.hdr", "res://addons/material_maker/panoramas/lobby.hdr", "res://addons/material_maker/panoramas/night.hdr", "res://addons/material_maker/panoramas/park.hdr", "res://addons/material_maker/panoramas/schelde.hdr", "res://addons/material_maker/pm_editor.gd", "res://addons/material_maker/pm_editor.tscn", "res://addons/material_maker/preview.gd", "res://addons/material_maker/preview.tscn", "res://addons/material_maker/renderer.gd", "res://addons/material_maker/renderer.tscn", "res://addons/material_maker/types/gradient.gd", "res://addons/material_maker/types/types.gd", "res://addons/material_maker/widgets/about.gd", "res://addons/material_maker/widgets/about.tscn", "res://addons/material_maker/widgets/facebook.png", "res://addons/material_maker/widgets/github.png", "res://addons/material_maker/widgets/gradient_editor.gd", "res://addons/material_maker/widgets/gradient_editor.tscn", "res://addons/material_maker/widgets/icon.png", "res://addons/material_maker/widgets/line_dialog.gd", "res://addons/material_maker/widgets/line_dialog.tscn", "res://addons/material_maker/widgets/linked_widgets/config_control.gd", "res://addons/material_maker/widgets/linked_widgets/config_control.tscn", "res://addons/material_maker/widgets/linked_widgets/editable_label.gd", "res://addons/material_maker/widgets/linked_widgets/editable_label.tscn", "res://addons/material_maker/widgets/linked_widgets/link.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control.tscn", "res://addons/material_maker/widgets/linked_widgets/linked_control_base.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn", "res://addons/material_maker/widgets/node_editor.tscn", "res://addons/material_maker/widgets/node_editor/enum_editor.gd", "res://addons/material_maker/widgets/node_editor/enum_editor.tscn", "res://addons/material_maker/widgets/node_editor/input.gd", "res://addons/material_maker/widgets/node_editor/input.tscn", "res://addons/material_maker/widgets/node_editor/node_editor.gd", "res://addons/material_maker/widgets/node_editor/node_editor.tscn", "res://addons/material_maker/widgets/node_editor/output.gd", "res://addons/material_maker/widgets/node_editor/output.tscn", "res://addons/material_maker/widgets/node_editor/parameter.gd", "res://addons/material_maker/widgets/node_editor/parameter.tscn", "res://addons/material_maker/widgets/node_editor/parameter_boolean.gd", "res://addons/material_maker/widgets/node_editor/parameter_boolean.tscn", "res://addons/material_maker/widgets/node_editor/parameter_color.gd", "res://addons/material_maker/widgets/node_editor/parameter_color.tscn", "res://addons/material_maker/widgets/node_editor/parameter_enum.gd", "res://addons/material_maker/widgets/node_editor/parameter_enum.tscn", "res://addons/material_maker/widgets/node_editor/parameter_float.gd", "res://addons/material_maker/widgets/node_editor/parameter_float.tscn", "res://addons/material_maker/widgets/node_editor/parameter_size.gd", "res://addons/material_maker/widgets/node_editor/parameter_size.tscn", "res://addons/material_maker/widgets/tabs.gd", "res://addons/material_maker/widgets/text_dialog.gd", "res://addons/material_maker/widgets/text_dialog.tscn", "res://addons/material_maker/widgets/twitter.png", "res://addons/material_maker/widgets/youtube.png", "res://addons/material_maker/window_dialog.tscn", "res://icon.png" ) include_filter="*.json,*.mmn,res://addons/material_maker/library/base/*.png" exclude_filter="*.ptex" +export_path="" patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" [preset.1.options] +texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false +texture_format/no_bptc_fallbacks=true binary_format/64_bits=true custom_template/release="" custom_template/debug="" diff --git a/project.godot b/project.godot index 5c9962d..7bbdcd1 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/material_maker/engine/gen_buffer.gd" }, { +"base": "Object", +"class": "MMGenContext", +"language": "GDScript", +"path": "res://addons/material_maker/engine/gen_context.gd" +}, { "base": "MMGenBase", "class": "MMGenConvolution", "language": "GDScript", @@ -57,6 +62,7 @@ _global_script_classes=[ { _global_script_class_icons={ "MMGenBase": "", "MMGenBuffer": "", +"MMGenContext": "", "MMGenConvolution": "", "MMGenGraph": "", "MMGenLoader": "",