From 4cfd8fbc1e3a9efa1a8110ef30394389ea6b6863 Mon Sep 17 00:00:00 2001 From: RodZill4 Date: Sat, 5 Oct 2019 22:24:00 +0200 Subject: [PATCH] Fixed generic node update and added weave generator --- addons/material_maker/nodes/generic.gd | 4 ++-- addons/material_maker/nodes/weave.mmg | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 addons/material_maker/nodes/weave.mmg diff --git a/addons/material_maker/nodes/generic.gd b/addons/material_maker/nodes/generic.gd index 5ddcf98..4ea439d 100644 --- a/addons/material_maker/nodes/generic.gd +++ b/addons/material_maker/nodes/generic.gd @@ -147,8 +147,8 @@ func update_node(): preview_timer.stop() remove_child(preview_timer) for c in get_children(): - c.queue_free() - yield(get_tree(), "idle_frame") + remove_child(c) + c.free() rect_size = Vector2(0, 0) # Rebuild node title = generator.get_type_name() diff --git a/addons/material_maker/nodes/weave.mmg b/addons/material_maker/nodes/weave.mmg new file mode 100644 index 0000000..aab2d1d --- /dev/null +++ b/addons/material_maker/nodes/weave.mmg @@ -0,0 +1 @@ +{"name":"weave","node_position":{"x":0,"y":0},"parameters":{"columns":4,"rows":4},"shader_model":{"global":"float weave(vec2 uv) {\n\tvec2 v = sin(3.1415892*vec2(uv.x+floor(uv.y), 1.0+uv.y+floor(uv.x)));\n\treturn max(v.x, v.y)*0.5+0.5;\n}","inputs":[],"instance":"","name":"Weave","outputs":[{"f":"weave(vec2($columns, $rows)*$uv)","type":"f"}],"parameters":[{"default":0,"label":"","max":32,"min":2,"name":"rows","step":1,"type":"float","widget":"spinbox"},{"default":0,"label":"","max":32,"min":2,"name":"columns","step":1,"type":"float","widget":"spinbox"}]},"type":"shader"} \ No newline at end of file