mirror of
https://github.com/Relintai/material-maker.git
synced 2025-02-07 01:25:55 +01:00
Moved io types definition (with conversions and preview) to a json file
This commit is contained in:
parent
f1ff09dcc4
commit
a811f3400f
@ -37,17 +37,6 @@ var parameters = {}
|
|||||||
var seed_locked : bool = false
|
var seed_locked : bool = false
|
||||||
var seed_value : int = 0
|
var seed_value : int = 0
|
||||||
|
|
||||||
const PORT_TYPE_NAMES : Array = [ "f", "rgb", "rgba", "sdf2d", "sdf3d" ]
|
|
||||||
|
|
||||||
const PORT_TYPES : Dictionary = {
|
|
||||||
f = { label="Greyscale", type="float", paramdefs="vec2 uv", params="uv", slot_type=0, color=Color(0.5, 0.5, 0.5) },
|
|
||||||
rgb = { label="Color", type="vec3", paramdefs="vec2 uv", params="uv", slot_type=0, color=Color(0.5, 0.5, 1.0) },
|
|
||||||
rgba = { label="RGBA", type="vec4", paramdefs="vec2 uv", params="uv", slot_type=0, color=Color(0.0, 0.5, 0.0, 0.5) },
|
|
||||||
sdf2d = { label="SDF2D", type="float", paramdefs="vec2 uv", params="uv", slot_type=1, color=Color(1.0, 0.5, 0.0) },
|
|
||||||
sdf3d = { label="SDF3D", type="float", paramdefs="vec3 p", params="p", slot_type=2, color=Color(1.0, 0.0, 0.0) },
|
|
||||||
any = { slot_type=42, color=Color(1.0, 1.0, 1.0) }
|
|
||||||
}
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
init_parameters()
|
init_parameters()
|
||||||
|
|
||||||
@ -165,7 +154,7 @@ func get_input_shader(input_index : int) -> Dictionary:
|
|||||||
func get_shader(output_index : int, context) -> Dictionary:
|
func get_shader(output_index : int, context) -> Dictionary:
|
||||||
return get_shader_code("UV", output_index, context)
|
return get_shader_code("UV", output_index, context)
|
||||||
|
|
||||||
func generate_preview_shader(src_code) -> String:
|
func generate_preview_shader(src_code, type) -> String:
|
||||||
var code
|
var code
|
||||||
code = "shader_type canvas_item;\n"
|
code = "shader_type canvas_item;\n"
|
||||||
code += "render_mode blend_disabled;\n"
|
code += "render_mode blend_disabled;\n"
|
||||||
@ -181,55 +170,11 @@ func generate_preview_shader(src_code) -> String:
|
|||||||
for g in src_code.globals:
|
for g in src_code.globals:
|
||||||
code += g
|
code += g
|
||||||
var shader_code = src_code.defs
|
var shader_code = src_code.defs
|
||||||
if src_code.has("rgba"):
|
if src_code.has(type):
|
||||||
shader_code += "\nvoid fragment() {\n"
|
var preview_code : String = mm_io_types.types[type].preview
|
||||||
shader_code += "vec2 uv = UV;\n"
|
preview_code = preview_code.replace("$(code)", src_code.code)
|
||||||
shader_code += src_code.code
|
preview_code = preview_code.replace("$(value)", src_code[type])
|
||||||
shader_code += "COLOR = "+src_code.rgba+";\n"
|
shader_code += preview_code
|
||||||
shader_code += "}\n"
|
|
||||||
elif src_code.has("sdf2d"):
|
|
||||||
shader_code += "\nvoid fragment() {\n"
|
|
||||||
shader_code += "vec2 uv = UV;\n"
|
|
||||||
shader_code += src_code.code
|
|
||||||
shader_code += "float d = "+src_code.sdf2d+";\n"
|
|
||||||
shader_code += "vec3 col = vec3(cos(d*min(256, preview_size)));\n"
|
|
||||||
shader_code += "col *= clamp(1.0-d*d, 0.0, 1.0);\n"
|
|
||||||
shader_code += "col *= vec3(1.0, vec2(step(-0.015, d)));\n"
|
|
||||||
shader_code += "col *= vec3(vec2(step(d, 0.015)), 1.0);\n"
|
|
||||||
shader_code += "COLOR = vec4(col, 1.0);\n"
|
|
||||||
shader_code += "}\n"
|
|
||||||
elif src_code.has("sdf3d"):
|
|
||||||
shader_code += "\nfloat calcdist(vec3 uv) {\n"
|
|
||||||
shader_code += src_code.code
|
|
||||||
shader_code += "return min("+src_code.sdf3d+", uv.z);\n"
|
|
||||||
shader_code += "}\n"
|
|
||||||
shader_code += "float raymarch(vec3 ro, vec3 rd) {\n"
|
|
||||||
shader_code += "float d=0.0;\n"
|
|
||||||
shader_code += "for (int i = 0; i < 50; i++) {\n"
|
|
||||||
shader_code += "vec3 p = ro + rd*d;\n"
|
|
||||||
shader_code += "float dstep = calcdist(p);\n"
|
|
||||||
shader_code += "d += dstep;\n"
|
|
||||||
shader_code += "if (dstep < 0.0001) break;\n"
|
|
||||||
shader_code += "}\n"
|
|
||||||
shader_code += "return d;\n"
|
|
||||||
shader_code += "}\n"
|
|
||||||
shader_code += "vec3 normal(vec3 p) {\n"
|
|
||||||
shader_code += " float d = calcdist(p);\n"
|
|
||||||
shader_code += " float e = .0001;\n"
|
|
||||||
shader_code += " vec3 n = d - vec3(calcdist(p-vec3(e, 0.0, 0.0)), calcdist(p-vec3(0.0, e, 0.0)), calcdist(p-vec3(0.0, 0.0, e)));\n"
|
|
||||||
shader_code += " return normalize(n);\n"
|
|
||||||
shader_code += "}\n"
|
|
||||||
shader_code += "\nvoid fragment() {\n"
|
|
||||||
shader_code += "vec2 uv = UV-vec2(0.5);\n"
|
|
||||||
shader_code += "vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));\n"
|
|
||||||
shader_code += "vec3 n = normal(p);\n"
|
|
||||||
shader_code += "vec3 l = vec3(5.0, 5.0, 10.0);\n"
|
|
||||||
shader_code += "vec3 ld = normalize(l-p);\n"
|
|
||||||
shader_code += "float o = step(p.z, 0.001);\n"
|
|
||||||
shader_code += "float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);\n"
|
|
||||||
shader_code += "float light = 0.3+0.7*dot(n, ld)*shadow;\n"
|
|
||||||
shader_code += "COLOR = vec4(vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light, 1.0);\n"
|
|
||||||
shader_code += "}\n"
|
|
||||||
#print("GENERATED SHADER:\n"+shader_code)
|
#print("GENERATED SHADER:\n"+shader_code)
|
||||||
code += shader_code
|
code += shader_code
|
||||||
return code
|
return code
|
||||||
@ -243,11 +188,11 @@ func render(output_index : int, size : int, preview : bool = false) -> Object:
|
|||||||
source = { defs="", code="", textures={}, rgba="vec4(0.0)" }
|
source = { defs="", code="", textures={}, rgba="vec4(0.0)" }
|
||||||
var shader : String
|
var shader : String
|
||||||
if preview:
|
if preview:
|
||||||
|
var output_type = "rgba"
|
||||||
var outputs = get_output_defs()
|
var outputs = get_output_defs()
|
||||||
if outputs.size() > output_index:
|
if outputs.size() > output_index:
|
||||||
var output = outputs[output_index]
|
output_type = outputs[output_index].type
|
||||||
print(output)
|
shader = generate_preview_shader(source, output_type)
|
||||||
shader = generate_preview_shader(source)
|
|
||||||
else:
|
else:
|
||||||
shader = mm_renderer.generate_shader(source)
|
shader = mm_renderer.generate_shader(source)
|
||||||
var result = mm_renderer.render_shader(shader, source.textures, size)
|
var result = mm_renderer.render_shader(shader, source.textures, size)
|
||||||
@ -259,20 +204,15 @@ func get_shader_code(uv : String, output_index : int, context : MMGenContext) ->
|
|||||||
var rv = _get_shader_code(uv, output_index, context)
|
var rv = _get_shader_code(uv, output_index, context)
|
||||||
while rv is GDScriptFunctionState:
|
while rv is GDScriptFunctionState:
|
||||||
rv = yield(rv, "completed")
|
rv = yield(rv, "completed")
|
||||||
if !rv.empty():
|
if rv.has("type"):
|
||||||
if !rv.has("f"):
|
if mm_io_types.types[rv.type].has("convert"):
|
||||||
if rv.has("rgb"):
|
for c in mm_io_types.types[rv.type].convert:
|
||||||
rv.f = "(dot("+rv.rgb+", vec3(1.0))/3.0)"
|
if !rv.has(c.type):
|
||||||
elif rv.has("rgba"):
|
var expr = c.expr.replace("$(value)", rv[rv.type])
|
||||||
rv.f = "(dot("+rv.rgba+".rgb, vec3(1.0))/3.0)"
|
rv[c.type] = expr
|
||||||
if !rv.has("rgb"):
|
else:
|
||||||
if rv.has("rgba"):
|
print("Missing type for node ")
|
||||||
rv.rgb = rv.rgba+".rgb"
|
print(rv)
|
||||||
elif rv.has("f"):
|
|
||||||
rv.rgb = "vec3("+rv.f+")"
|
|
||||||
if !rv.has("rgba"):
|
|
||||||
if rv.has("rgb"):
|
|
||||||
rv.rgba = "vec4("+rv.rgb+", 1.0)"
|
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
func _get_shader_code(__, __, __) -> Dictionary:
|
func _get_shader_code(__, __, __) -> Dictionary:
|
||||||
|
@ -174,6 +174,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) -
|
|||||||
for t in src_code.textures.keys():
|
for t in src_code.textures.keys():
|
||||||
rv.textures[t] = src_code.textures[t]
|
rv.textures[t] = src_code.textures[t]
|
||||||
rv[convolution_params.output_type] = "%s_%d" % [ genname, variant_index ]
|
rv[convolution_params.output_type] = "%s_%d" % [ genname, variant_index ]
|
||||||
|
rv.type = convolution_params.output_type
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ func set_port_name(i : int, n : String) -> void:
|
|||||||
ports[i].name = n
|
ports[i].name = n
|
||||||
|
|
||||||
func set_port_type(i : int, t : String) -> void:
|
func set_port_type(i : int, t : String) -> void:
|
||||||
print(t)
|
|
||||||
ports[i].type = t
|
ports[i].type = t
|
||||||
emit_signal("parameter_changed", "__update_all__", null)
|
emit_signal("parameter_changed", "__update_all__", null)
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ func set_shader_model(data: Dictionary) -> void:
|
|||||||
for i in range(shader_model.outputs.size()):
|
for i in range(shader_model.outputs.size()):
|
||||||
var output = shader_model.outputs[i]
|
var output = shader_model.outputs[i]
|
||||||
var output_code = ""
|
var output_code = ""
|
||||||
for f in PORT_TYPES.keys():
|
for f in mm_io_types.types.keys():
|
||||||
if output.has(f):
|
if output.has(f):
|
||||||
shader_model.outputs[i].type = f
|
shader_model.outputs[i].type = f
|
||||||
output_code = output[f]
|
output_code = output[f]
|
||||||
@ -260,7 +260,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) -
|
|||||||
var input = shader_model.inputs[i]
|
var input = shader_model.inputs[i]
|
||||||
if input.has("function") and input.function:
|
if input.has("function") and input.function:
|
||||||
var source = get_source(i)
|
var source = get_source(i)
|
||||||
var string = "$%s(%s)" % [ input.name, PORT_TYPES[input.type].params ]
|
var string = "$%s(%s)" % [ input.name, mm_io_types.types[input.type].params ]
|
||||||
var local_context = MMGenContext.new(context)
|
var local_context = MMGenContext.new(context)
|
||||||
var result = replace_input(string, local_context, input.name, input.type, source, input.default)
|
var result = replace_input(string, local_context, input.name, input.type, source, input.default)
|
||||||
while result is GDScriptFunctionState:
|
while result is GDScriptFunctionState:
|
||||||
@ -274,7 +274,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) -
|
|||||||
# Add textures
|
# Add textures
|
||||||
for t in result.textures.keys():
|
for t in result.textures.keys():
|
||||||
rv.textures[t] = result.textures[t]
|
rv.textures[t] = result.textures[t]
|
||||||
rv.defs += "%s %s_input_%s(%s) {\n" % [ PORT_TYPES[input.type].type, genname, input.name, PORT_TYPES[input.type].paramdefs ]
|
rv.defs += "%s %s_input_%s(%s) {\n" % [ mm_io_types.types[input.type].type, genname, input.name, mm_io_types.types[input.type].paramdefs ]
|
||||||
rv.defs += "%s\n" % result.code
|
rv.defs += "%s\n" % result.code
|
||||||
rv.defs += "return %s;\n}\n" % result.string
|
rv.defs += "return %s;\n}\n" % result.string
|
||||||
if shader_model.has("instance"):
|
if shader_model.has("instance"):
|
||||||
@ -307,7 +307,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) -
|
|||||||
var variant_index = context.get_variant(self, variant_string)
|
var variant_index = context.get_variant(self, variant_string)
|
||||||
if variant_index == -1:
|
if variant_index == -1:
|
||||||
variant_index = context.get_variant(self, variant_string)
|
variant_index = context.get_variant(self, variant_string)
|
||||||
for f in PORT_TYPES.keys():
|
for f in mm_io_types.types.keys():
|
||||||
if output.has(f):
|
if output.has(f):
|
||||||
var subst_output = subst(output[f], context, uv)
|
var subst_output = subst(output[f], context, uv)
|
||||||
while subst_output is GDScriptFunctionState:
|
while subst_output is GDScriptFunctionState:
|
||||||
@ -320,12 +320,13 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) -
|
|||||||
rv.defs += subst_output.defs
|
rv.defs += subst_output.defs
|
||||||
# Add generated code
|
# Add generated code
|
||||||
rv.code += subst_output.code
|
rv.code += subst_output.code
|
||||||
rv.code += "%s %s_%d_%d_%s = %s;\n" % [ PORT_TYPES[f].type, genname, output_index, variant_index, f, subst_output.string ]
|
rv.code += "%s %s_%d_%d_%s = %s;\n" % [ mm_io_types.types[f].type, genname, output_index, variant_index, f, subst_output.string ]
|
||||||
for t in subst_output.textures.keys():
|
for t in subst_output.textures.keys():
|
||||||
rv.textures[t] = subst_output.textures[t]
|
rv.textures[t] = subst_output.textures[t]
|
||||||
for f in PORT_TYPES.keys():
|
for f in mm_io_types.types.keys():
|
||||||
if output.has(f):
|
if output.has(f):
|
||||||
rv[f] = "%s_%d_%d_%s" % [ genname, output_index, variant_index, f ]
|
rv[f] = "%s_%d_%d_%s" % [ genname, output_index, variant_index, f ]
|
||||||
|
rv.type = output.type
|
||||||
if shader_model.has("global") && rv.globals.find(shader_model.global) == -1:
|
if shader_model.has("global") && rv.globals.find(shader_model.global) == -1:
|
||||||
rv.globals.push_back(shader_model.global)
|
rv.globals.push_back(shader_model.global)
|
||||||
return rv
|
return rv
|
||||||
|
@ -13,7 +13,7 @@ func get_output_defs() -> Array:
|
|||||||
|
|
||||||
func _get_shader_code_lod(uv : String, output_index : int, context : MMGenContext, lod : float = 0.0) -> Dictionary:
|
func _get_shader_code_lod(uv : String, output_index : int, context : MMGenContext, lod : float = 0.0) -> Dictionary:
|
||||||
var genname = "o"+str(get_instance_id())
|
var genname = "o"+str(get_instance_id())
|
||||||
var rv = { globals=[], defs="", code="" }
|
var rv = { globals=[], defs="", code="", type="rgba" }
|
||||||
var texture_name = genname+"_tex"
|
var texture_name = genname+"_tex"
|
||||||
var variant_index = context.get_variant(self, uv)
|
var variant_index = context.get_variant(self, uv)
|
||||||
if variant_index == -1:
|
if variant_index == -1:
|
||||||
|
22
addons/material_maker/engine/io_types.gd
Normal file
22
addons/material_maker/engine/io_types.gd
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
tool
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
var type_names : Array = []
|
||||||
|
var types : Dictionary = {}
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
var file = File.new()
|
||||||
|
if file.open("res://addons/material_maker/nodes/io_types.mmt", File.READ) != OK:
|
||||||
|
print("Cannot read types")
|
||||||
|
return false
|
||||||
|
var type_list = parse_json(file.get_as_text())
|
||||||
|
file.close()
|
||||||
|
for t in type_list:
|
||||||
|
if t.has("label"):
|
||||||
|
type_names.push_back(t.name)
|
||||||
|
var c = t.color
|
||||||
|
t.color = Color(c.r, c.g, c.b, c.a)
|
||||||
|
if file.open("res://addons/material_maker/nodes/preview_"+t.name+".shader", File.READ) == OK:
|
||||||
|
t.preview = file.get_as_text()
|
||||||
|
file.close()
|
||||||
|
types[t.name] = t
|
@ -3,9 +3,6 @@ extends Node
|
|||||||
|
|
||||||
const STD_GENDEF_PATH = "res://addons/material_maker/nodes"
|
const STD_GENDEF_PATH = "res://addons/material_maker/nodes"
|
||||||
|
|
||||||
func _ready():
|
|
||||||
print("loader ready!")
|
|
||||||
|
|
||||||
func generator_name_from_path(path : String) -> String:
|
func generator_name_from_path(path : String) -> String:
|
||||||
for p in [ STD_GENDEF_PATH, OS.get_executable_path().get_base_dir()+"/generators" ]:
|
for p in [ STD_GENDEF_PATH, OS.get_executable_path().get_base_dir()+"/generators" ]:
|
||||||
print(p)
|
print(p)
|
||||||
|
79
addons/material_maker/nodes/io_types.mmt
Normal file
79
addons/material_maker/nodes/io_types.mmt
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name":"f",
|
||||||
|
"label":"Greyscale",
|
||||||
|
"type":"float",
|
||||||
|
"paramdefs":"vec2 uv",
|
||||||
|
"params":"uv",
|
||||||
|
"slot_type":0,
|
||||||
|
"convert":[
|
||||||
|
{ "type":"rgb", "expr":"vec3($(value))" },
|
||||||
|
{ "type":"rgba", "expr":"vec4(vec3($(value)), 1.0)" }
|
||||||
|
],
|
||||||
|
"color":{ "r":0.5, "g":0.5, "b":0.5, "a":1.0 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"rgb",
|
||||||
|
"label":"Color",
|
||||||
|
"type":"vec3",
|
||||||
|
"paramdefs":"vec2 uv",
|
||||||
|
"params":"uv",
|
||||||
|
"slot_type":0,
|
||||||
|
"convert":[
|
||||||
|
{ "type":"f", "expr":"(dot($(value), vec3(1.0))/3.0)" },
|
||||||
|
{ "type":"rgba", "expr":"vec4($(value), 1.0)" }
|
||||||
|
],
|
||||||
|
"color":{ "r":0.5, "g":0.5, "b":1.0, "a":1.0 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"rgba",
|
||||||
|
"label":"RGBA",
|
||||||
|
"type":"vec4",
|
||||||
|
"paramdefs":"vec2 uv",
|
||||||
|
"params":"uv",
|
||||||
|
"slot_type":0,
|
||||||
|
"convert":[
|
||||||
|
{ "type":"f", "expr":"(dot(($(value)).rgb, vec3(1.0))/3.0)" },
|
||||||
|
{ "type":"rgb ", "expr":"(($(value)).rgb)" }
|
||||||
|
],
|
||||||
|
"color":{ "r":0.0, "g":0.5, "b":0.0, "a":0.5 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"sdf2d",
|
||||||
|
"label":"SDF2D",
|
||||||
|
"type":"float",
|
||||||
|
"paramdefs":"vec2 uv",
|
||||||
|
"params":"uv",
|
||||||
|
"slot_type":1,
|
||||||
|
"color":{ "r":1.0, "g":0.5, "b":0.0, "a":1.0 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"sdf3d",
|
||||||
|
"label":"SDF3D",
|
||||||
|
"type":"float",
|
||||||
|
"paramdefs":"vec3 p",
|
||||||
|
"params":"p",
|
||||||
|
"slot_type":2,
|
||||||
|
"convert":[
|
||||||
|
{ "type":"sdf3dc", "expr":"vec2($(value)).rgb, 0.0)" }
|
||||||
|
],
|
||||||
|
"color":{ "r":0.5, "g":0.0, "b":0.0, "a":1.0 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"sdf3dc",
|
||||||
|
"label":"SDF3D-C",
|
||||||
|
"type":"vec2",
|
||||||
|
"paramdefs":"vec3 p",
|
||||||
|
"params":"p",
|
||||||
|
"slot_type":2,
|
||||||
|
"convert":[
|
||||||
|
{ "type":"sdf3d", "expr":"($(value)).x" }
|
||||||
|
],
|
||||||
|
"color":{ "r":1.0, "g":0.0, "b":0.0, "a":1.0 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"any",
|
||||||
|
"slot_type":42,
|
||||||
|
"color":{ "r":1.0, "g":1.0, "b":1.0, "a":1.0 }
|
||||||
|
}
|
||||||
|
]
|
5
addons/material_maker/nodes/preview_f.shader
Normal file
5
addons/material_maker/nodes/preview_f.shader
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
void fragment() {
|
||||||
|
vec2 uv = UV;
|
||||||
|
$(code)
|
||||||
|
COLOR = vec4(vec3($(value)), 1.0);
|
||||||
|
}
|
5
addons/material_maker/nodes/preview_rgb.shader
Normal file
5
addons/material_maker/nodes/preview_rgb.shader
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
void fragment() {
|
||||||
|
vec2 uv = UV;
|
||||||
|
$(code)
|
||||||
|
COLOR = vec4($(value), 1.0);
|
||||||
|
}
|
5
addons/material_maker/nodes/preview_rgba.shader
Normal file
5
addons/material_maker/nodes/preview_rgba.shader
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
void fragment() {
|
||||||
|
vec2 uv = UV;
|
||||||
|
$(code)
|
||||||
|
COLOR = $(value);
|
||||||
|
}
|
10
addons/material_maker/nodes/preview_sdf2d.shader
Normal file
10
addons/material_maker/nodes/preview_sdf2d.shader
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
void fragment() {
|
||||||
|
vec2 uv = UV;
|
||||||
|
$(code)
|
||||||
|
float d = $(value);
|
||||||
|
vec3 col = vec3(cos(d*min(256, preview_size)));
|
||||||
|
col *= clamp(1.0-d*d, 0.0, 1.0);
|
||||||
|
col *= vec3(1.0, vec2(step(-0.015, d)));
|
||||||
|
col *= vec3(vec2(step(d, 0.015)), 1.0);
|
||||||
|
COLOR = vec4(col, 1.0);
|
||||||
|
}
|
33
addons/material_maker/nodes/preview_sdf3d.shader
Normal file
33
addons/material_maker/nodes/preview_sdf3d.shader
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
float calcdist(vec3 uv) {
|
||||||
|
$(code)
|
||||||
|
return min($(value), uv.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
float raymarch(vec3 ro, vec3 rd) {
|
||||||
|
float d=0.0;
|
||||||
|
for (int i = 0; i < 50; i++) {
|
||||||
|
vec3 p = ro + rd*d;
|
||||||
|
float dstep = calcdist(p);
|
||||||
|
d += dstep;
|
||||||
|
if (dstep < 0.0001) break;
|
||||||
|
}
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
vec3 normal(vec3 p) {
|
||||||
|
float d = calcdist(p);
|
||||||
|
float e = .0001;
|
||||||
|
vec3 n = d - vec3(calcdist(p-vec3(e, 0.0, 0.0)), calcdist(p-vec3(0.0, e, 0.0)), calcdist(p-vec3(0.0, 0.0, e)));
|
||||||
|
return normalize(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
vec2 uv = UV-vec2(0.5);
|
||||||
|
vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));
|
||||||
|
vec3 n = normal(p);
|
||||||
|
vec3 l = vec3(5.0, 5.0, 10.0);
|
||||||
|
vec3 ld = normalize(l-p);
|
||||||
|
float o = step(p.z, 0.001);
|
||||||
|
float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);
|
||||||
|
float light = 0.3+0.7*dot(n, ld)*shadow;
|
||||||
|
COLOR = vec4(vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light, 1.0);
|
||||||
|
}
|
45
addons/material_maker/nodes/preview_sdf3dc.shader
Normal file
45
addons/material_maker/nodes/preview_sdf3dc.shader
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
vec2 calcdist(vec3 uv) {
|
||||||
|
$(code)
|
||||||
|
vec2 v = $(value);
|
||||||
|
return vec2(min(v.x, uv.z), v.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec2 raymarch(vec3 ro, vec3 rd) {
|
||||||
|
float d=0.0;
|
||||||
|
float color;
|
||||||
|
for (int i = 0; i < 50; i++) {
|
||||||
|
vec3 p = ro + rd*d;
|
||||||
|
vec2 dstep = calcdist(p);
|
||||||
|
d += dstep.x;
|
||||||
|
if (dstep.x < 0.0001) {
|
||||||
|
color = dstep.y;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return vec2(d, color);
|
||||||
|
}
|
||||||
|
vec3 normal(vec3 p) {
|
||||||
|
float d = calcdist(p).x;
|
||||||
|
float e = .0001;
|
||||||
|
vec3 n = d - vec3(calcdist(p-vec3(e, 0.0, 0.0)).x, calcdist(p-vec3(0.0, e, 0.0)).x, calcdist(p-vec3(0.0, 0.0, e)).x);
|
||||||
|
return normalize(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 rm_color(float c) {
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(vec3(c) + K.xyz) * 6.0 - K.www);
|
||||||
|
return 1.0 * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
vec2 uv = UV-vec2(0.5);
|
||||||
|
vec2 rm = raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0));
|
||||||
|
vec3 p = vec3(uv, 2.0-rm.x);
|
||||||
|
vec3 n = normal(p);
|
||||||
|
vec3 l = vec3(5.0, 5.0, 10.0);
|
||||||
|
vec3 ld = normalize(l-p);
|
||||||
|
float o = step(p.z, 0.001);
|
||||||
|
float shadow = 1.0-0.75*step(raymarch(l, -ld).x, length(l-p)-0.01);
|
||||||
|
float light = 0.3+0.7*dot(n, ld)*shadow;
|
||||||
|
COLOR = vec4(mix(rm_color(fract(rm.y)), vec3(0.9), o)*light, 1.0);
|
||||||
|
}
|
@ -23,7 +23,7 @@ signal graph_changed
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
OS.low_processor_usage_mode = true
|
OS.low_processor_usage_mode = true
|
||||||
center_view()
|
center_view()
|
||||||
for t in range(5):
|
for t in range(41):
|
||||||
add_valid_connection_type(t, 42)
|
add_valid_connection_type(t, 42)
|
||||||
add_valid_connection_type(42, t)
|
add_valid_connection_type(42, t)
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@ custom_styles/bg = SubResource( 1 )
|
|||||||
right_disconnects = true
|
right_disconnects = true
|
||||||
use_snap = false
|
use_snap = false
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="."]
|
[node name="Timer" type="Timer" parent="."]
|
||||||
wait_time = 0.2
|
wait_time = 0.2
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
[gd_resource type="AtlasTexture" load_steps=2 format=2]
|
[gd_resource type="AtlasTexture" load_steps=2 format=2]
|
||||||
|
|
||||||
[sub_resource type="StreamTexture" id=1]
|
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=1]
|
||||||
flags = 4
|
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
flags = 4
|
flags = 4
|
||||||
atlas = SubResource( 1 )
|
atlas = ExtResource( 1 )
|
||||||
region = Rect2( 80, 32, 16, 16 )
|
region = Rect2( 80, 32, 16, 16 )
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
[gd_resource type="AtlasTexture" load_steps=2 format=2]
|
[gd_resource type="AtlasTexture" load_steps=2 format=2]
|
||||||
|
|
||||||
[sub_resource type="StreamTexture" id=1]
|
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=1]
|
||||||
flags = 4
|
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
flags = 4
|
flags = 4
|
||||||
atlas = SubResource( 1 )
|
atlas = ExtResource( 1 )
|
||||||
region = Rect2( 64, 32, 16, 16 )
|
region = Rect2( 64, 32, 16, 16 )
|
||||||
|
@ -177,8 +177,8 @@ func update_node() -> void:
|
|||||||
var type_left = 0
|
var type_left = 0
|
||||||
if typeof(input) == TYPE_DICTIONARY:
|
if typeof(input) == TYPE_DICTIONARY:
|
||||||
enable_left = true
|
enable_left = true
|
||||||
color_left = MMGenBase.PORT_TYPES[input.type].color
|
color_left = mm_io_types.types[input.type].color
|
||||||
type_left = MMGenBase.PORT_TYPES[input.type].slot_type
|
type_left = mm_io_types.types[input.type].slot_type
|
||||||
set_slot(i, enable_left, type_left, color_left, false, 0, Color())
|
set_slot(i, enable_left, type_left, color_left, false, 0, Color())
|
||||||
var hsizer : HBoxContainer = HBoxContainer.new()
|
var hsizer : HBoxContainer = HBoxContainer.new()
|
||||||
hsizer.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL
|
hsizer.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL
|
||||||
@ -251,8 +251,8 @@ func update_node() -> void:
|
|||||||
assert(typeof(output) == TYPE_DICTIONARY)
|
assert(typeof(output) == TYPE_DICTIONARY)
|
||||||
assert(output.has("type"))
|
assert(output.has("type"))
|
||||||
enable_right = true
|
enable_right = true
|
||||||
color_right = MMGenBase.PORT_TYPES[output.type].color
|
color_right = mm_io_types.types[output.type].color
|
||||||
type_right = MMGenBase.PORT_TYPES[output.type].slot_type
|
type_right = mm_io_types.types[output.type].slot_type
|
||||||
set_slot(i, is_slot_enabled_left(i), get_slot_type_left(i), get_slot_color_left(i), enable_right, type_right, color_right)
|
set_slot(i, is_slot_enabled_left(i), get_slot_type_left(i), get_slot_color_left(i), enable_right, type_right, color_right)
|
||||||
var hsizer : HBoxContainer
|
var hsizer : HBoxContainer
|
||||||
while i >= get_child_count():
|
while i >= get_child_count():
|
||||||
|
@ -22,7 +22,7 @@ func update_node() -> void:
|
|||||||
title = generator.get_type_name()
|
title = generator.get_type_name()
|
||||||
var color = Color(0.0, 0.5, 0.0, 0.5)
|
var color = Color(0.0, 0.5, 0.0, 0.5)
|
||||||
for p in generator.get_io_defs():
|
for p in generator.get_io_defs():
|
||||||
color = MMGenBase.PORT_TYPES[p.type].color
|
color = mm_io_types.types[p.type].color
|
||||||
set_slot(get_child_count(), generator.name != "gen_inputs", 0, color, generator.name != "gen_outputs", 0, color)
|
set_slot(get_child_count(), generator.name != "gen_inputs", 0, color, generator.name != "gen_outputs", 0, color)
|
||||||
var port : Control
|
var port : Control
|
||||||
if generator.is_editable():
|
if generator.is_editable():
|
||||||
|
@ -4,7 +4,7 @@ func set_label(l : String) -> void:
|
|||||||
$Name.set_text(l)
|
$Name.set_text(l)
|
||||||
|
|
||||||
func set_type(t : String) -> void:
|
func set_type(t : String) -> void:
|
||||||
$Type.selected = MMGenBase.PORT_TYPE_NAMES.find(t)
|
$Type.selected = mm_io_types.type_names.find(t)
|
||||||
|
|
||||||
func update_up_down_button() -> void:
|
func update_up_down_button() -> void:
|
||||||
var parent = get_parent()
|
var parent = get_parent()
|
||||||
@ -17,7 +17,7 @@ func _on_Name_label_changed(new_label) -> void:
|
|||||||
get_parent().generator.set_port_name(get_index(), new_label)
|
get_parent().generator.set_port_name(get_index(), new_label)
|
||||||
|
|
||||||
func _on_Type_item_selected(ID) -> void:
|
func _on_Type_item_selected(ID) -> void:
|
||||||
get_parent().generator.set_port_type(get_index(), MMGenBase.PORT_TYPE_NAMES[ID])
|
get_parent().generator.set_port_type(get_index(), mm_io_types.type_names[ID])
|
||||||
|
|
||||||
func _on_Delete_pressed() -> void:
|
func _on_Delete_pressed() -> void:
|
||||||
get_parent().generator.delete_port(get_index())
|
get_parent().generator.delete_port(get_index())
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
tool
|
tool
|
||||||
extends HBoxContainer
|
extends HBoxContainer
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
$Type.clear()
|
||||||
|
for tn in mm_io_types.type_names:
|
||||||
|
var t = mm_io_types.types[tn]
|
||||||
|
$Type.add_item(t.label)
|
||||||
|
|
||||||
func update_up_down_button() -> void:
|
func update_up_down_button() -> void:
|
||||||
var parent = get_parent()
|
var parent = get_parent()
|
||||||
if parent == null:
|
if parent == null:
|
||||||
@ -11,31 +17,13 @@ func update_up_down_button() -> void:
|
|||||||
func set_model_data(data) -> void:
|
func set_model_data(data) -> void:
|
||||||
$Name.text = data.name
|
$Name.text = data.name
|
||||||
$Label.text = data.label
|
$Label.text = data.label
|
||||||
if data.type == "rgb":
|
$Type.selected = mm_io_types.type_names.find(data.type)
|
||||||
$Type.selected = 1
|
|
||||||
elif data.type == "rgba":
|
|
||||||
$Type.selected = 2
|
|
||||||
elif data.type == "sdf2d":
|
|
||||||
$Type.selected = 3
|
|
||||||
elif data.type == "sdf3d":
|
|
||||||
$Type.selected = 4
|
|
||||||
else:
|
|
||||||
$Type.selected = 0
|
|
||||||
$Default.text = data.default
|
$Default.text = data.default
|
||||||
$Function.pressed = data.has("function") and data.function
|
$Function.pressed = data.has("function") and data.function
|
||||||
|
|
||||||
func get_model_data() -> Dictionary:
|
func get_model_data() -> Dictionary:
|
||||||
var data = { name=$Name.text, label=$Label.text, default=$Default.text }
|
var data = { name=$Name.text, label=$Label.text, default=$Default.text }
|
||||||
if $Type.selected == 1:
|
data.type = mm_io_types.type_names[$Type.selected]
|
||||||
data.type = "rgb"
|
|
||||||
elif $Type.selected == 2:
|
|
||||||
data.type = "rgba"
|
|
||||||
elif $Type.selected == 3:
|
|
||||||
data.type = "sdf2d"
|
|
||||||
elif $Type.selected == 4:
|
|
||||||
data.type = "sdf3d"
|
|
||||||
else:
|
|
||||||
data.type = "f"
|
|
||||||
if $Function.pressed:
|
if $Function.pressed:
|
||||||
data.function = true
|
data.function = true
|
||||||
return data
|
return data
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
[ext_resource path="res://material_maker/widgets/node_editor/input.gd" type="Script" id=1]
|
[ext_resource path="res://material_maker/widgets/node_editor/input.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=2]
|
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=2]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=1]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
flags = 4
|
flags = 4
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
@ -63,17 +61,17 @@ text = "Label"
|
|||||||
|
|
||||||
[node name="Type" type="OptionButton" parent="."]
|
[node name="Type" type="OptionButton" parent="."]
|
||||||
margin_left = 236.0
|
margin_left = 236.0
|
||||||
margin_right = 340.0
|
margin_right = 338.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
rect_min_size = Vector2( 102, 0 )
|
rect_min_size = Vector2( 102, 0 )
|
||||||
hint_tooltip = "Input flag"
|
hint_tooltip = "Input flag"
|
||||||
text = "GreyScale"
|
text = "Greyscale"
|
||||||
items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null ]
|
items = [ "Greyscale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null, "SDF3D-C", null, false, 5, null ]
|
||||||
selected = 0
|
selected = 0
|
||||||
|
|
||||||
[node name="Default" type="LineEdit" parent="."]
|
[node name="Default" type="LineEdit" parent="."]
|
||||||
margin_left = 344.0
|
margin_left = 342.0
|
||||||
margin_right = 414.0
|
margin_right = 412.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
rect_min_size = Vector2( 70, 0 )
|
rect_min_size = Vector2( 70, 0 )
|
||||||
hint_tooltip = "Default value"
|
hint_tooltip = "Default value"
|
||||||
@ -81,8 +79,8 @@ size_flags_horizontal = 3
|
|||||||
text = "0.0"
|
text = "0.0"
|
||||||
|
|
||||||
[node name="Function" type="CheckBox" parent="."]
|
[node name="Function" type="CheckBox" parent="."]
|
||||||
margin_left = 418.0
|
margin_left = 416.0
|
||||||
margin_right = 501.0
|
margin_right = 499.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
text = "Function"
|
text = "Function"
|
||||||
[connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"]
|
[connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"]
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
tool
|
tool
|
||||||
extends HBoxContainer
|
extends HBoxContainer
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
$Type.clear()
|
||||||
|
for tn in mm_io_types.type_names:
|
||||||
|
var t = mm_io_types.types[tn]
|
||||||
|
$Type.add_item(t.label)
|
||||||
|
|
||||||
func update_up_down_button() -> void:
|
func update_up_down_button() -> void:
|
||||||
var parent = get_parent()
|
var parent = get_parent()
|
||||||
if parent == null:
|
if parent == null:
|
||||||
@ -9,33 +15,13 @@ func update_up_down_button() -> void:
|
|||||||
$Down.disabled = (get_index() == get_parent().get_child_count()-2)
|
$Down.disabled = (get_index() == get_parent().get_child_count()-2)
|
||||||
|
|
||||||
func set_model_data(data) -> void:
|
func set_model_data(data) -> void:
|
||||||
if data.has("rgb"):
|
for i in range(mm_io_types.type_names.size()):
|
||||||
$Type.selected = 1
|
if data.has(mm_io_types.type_names[i]):
|
||||||
$Value.text = data.rgb
|
$Type.selected = i
|
||||||
elif data.has("rgba"):
|
$Value.text = data[mm_io_types.type_names[i]]
|
||||||
$Type.selected = 2
|
|
||||||
$Value.text = data.rgba
|
|
||||||
elif data.has("sdf2d"):
|
|
||||||
$Type.selected = 3
|
|
||||||
$Value.text = data.sdf2d
|
|
||||||
elif data.has("sdf3d"):
|
|
||||||
$Type.selected = 4
|
|
||||||
$Value.text = data.sdf3d
|
|
||||||
elif data.has("f"):
|
|
||||||
$Type.selected = 0
|
|
||||||
$Value.text = data.f
|
|
||||||
|
|
||||||
func get_model_data() -> Dictionary:
|
func get_model_data() -> Dictionary:
|
||||||
if $Type.selected == 1:
|
return { mm_io_types.type_names[$Type.selected]:$Value.text }
|
||||||
return { rgb=$Value.text }
|
|
||||||
elif $Type.selected == 2:
|
|
||||||
return { rgba=$Value.text }
|
|
||||||
elif $Type.selected == 3:
|
|
||||||
return { sdf2d=$Value.text }
|
|
||||||
elif $Type.selected == 4:
|
|
||||||
return { sdf3d=$Value.text }
|
|
||||||
else:
|
|
||||||
return { f=$Value.text }
|
|
||||||
|
|
||||||
func _on_Delete_pressed() -> void:
|
func _on_Delete_pressed() -> void:
|
||||||
var p = get_parent()
|
var p = get_parent()
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
[ext_resource path="res://material_maker/widgets/node_editor/output.gd" type="Script" id=1]
|
[ext_resource path="res://material_maker/widgets/node_editor/output.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=2]
|
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=2]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=1]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
flags = 4
|
flags = 4
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
@ -55,17 +53,17 @@ flat = true
|
|||||||
|
|
||||||
[node name="Type" type="OptionButton" parent="."]
|
[node name="Type" type="OptionButton" parent="."]
|
||||||
margin_left = 88.0
|
margin_left = 88.0
|
||||||
margin_right = 192.0
|
margin_right = 190.0
|
||||||
margin_bottom = 25.0
|
margin_bottom = 25.0
|
||||||
rect_min_size = Vector2( 102, 0 )
|
rect_min_size = Vector2( 102, 0 )
|
||||||
hint_tooltip = "Input flag"
|
hint_tooltip = "Input flag"
|
||||||
text = "GreyScale"
|
text = "Greyscale"
|
||||||
items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null ]
|
items = [ "Greyscale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null, "SDF3D-C", null, false, 5, null ]
|
||||||
selected = 0
|
selected = 0
|
||||||
|
|
||||||
[node name="Value" type="LineEdit" parent="."]
|
[node name="Value" type="LineEdit" parent="."]
|
||||||
margin_left = 196.0
|
margin_left = 194.0
|
||||||
margin_right = 290.0
|
margin_right = 288.0
|
||||||
margin_bottom = 25.0
|
margin_bottom = 25.0
|
||||||
hint_tooltip = "Default value"
|
hint_tooltip = "Default value"
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
@ -51,14 +51,14 @@ func _on_EnumValues_item_selected(id) -> void:
|
|||||||
if id >= 0 and id < enum_values.size():
|
if id >= 0 and id < enum_values.size():
|
||||||
enum_current = id
|
enum_current = id
|
||||||
elif id == ENUM_EDIT:
|
elif id == ENUM_EDIT:
|
||||||
var dialog = load("res://addons/material_maker/widgets/node_editor/enum_editor.tscn").instance()
|
var dialog = load("res://material_maker/widgets/node_editor/enum_editor.tscn").instance()
|
||||||
var v = enum_values[enum_current]
|
var v = enum_values[enum_current]
|
||||||
add_child(dialog)
|
add_child(dialog)
|
||||||
dialog.set_value(v.name, v.value)
|
dialog.set_value(v.name, v.value)
|
||||||
dialog.connect("ok", self, "update_enum_value", [ enum_current ])
|
dialog.connect("ok", self, "update_enum_value", [ enum_current ])
|
||||||
dialog.popup_centered()
|
dialog.popup_centered()
|
||||||
elif id == ENUM_ADD:
|
elif id == ENUM_ADD:
|
||||||
var dialog = load("res://addons/material_maker/widgets/node_editor/enum_editor.tscn").instance()
|
var dialog = load("res://material_maker/widgets/node_editor/enum_editor.tscn").instance()
|
||||||
add_child(dialog)
|
add_child(dialog)
|
||||||
dialog.connect("ok", self, "update_enum_value", [ -1 ])
|
dialog.connect("ok", self, "update_enum_value", [ -1 ])
|
||||||
dialog.popup_centered()
|
dialog.popup_centered()
|
||||||
|
@ -183,6 +183,7 @@ config/release="0.8"
|
|||||||
|
|
||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
|
mm_io_types="*res://addons/material_maker/engine/io_types.gd"
|
||||||
mm_loader="*res://addons/material_maker/engine/loader.gd"
|
mm_loader="*res://addons/material_maker/engine/loader.gd"
|
||||||
mm_renderer="*res://addons/material_maker/engine/renderer.tscn"
|
mm_renderer="*res://addons/material_maker/engine/renderer.tscn"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user