Fixed generic node update and added weave generator

This commit is contained in:
RodZill4 2019-10-05 22:24:00 +02:00
parent 8651569f2b
commit 4cfd8fbc1e
2 changed files with 3 additions and 2 deletions

View File

@ -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()

View File

@ -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"}