diff --git a/addons/material_maker/engine/gen_base.gd b/addons/material_maker/engine/gen_base.gd index e787b08..74798f8 100644 --- a/addons/material_maker/engine/gen_base.gd +++ b/addons/material_maker/engine/gen_base.gd @@ -7,6 +7,7 @@ Base class for texture generators, that defines their API """ signal parameter_changed +signal output_changed(index) class InputPort: var generator : MMGenBase = null @@ -49,6 +50,9 @@ func can_be_deleted() -> bool: func toggle_editable() -> bool: return false +func is_template() -> bool: + return model != null + func is_editable() -> bool: return false @@ -117,6 +121,7 @@ func notify_output_change(output_index : int) -> void: var targets = get_targets(output_index) for target in targets: target.generator.source_changed(target.input_index) + emit_signal("output_changed", output_index) func source_changed(__) -> void: emit_signal("parameter_changed", "__input_changed__", 0) diff --git a/addons/material_maker/engine/gen_graph.gd b/addons/material_maker/engine/gen_graph.gd index 8136463..cd26cd0 100644 --- a/addons/material_maker/engine/gen_graph.gd +++ b/addons/material_maker/engine/gen_graph.gd @@ -10,7 +10,13 @@ var editable : bool = false var transmits_seed : bool = true signal connections_changed(removed_connections, added_connections) +signal hierarchy_changed +func emit_hierarchy_changed(): + var top = self + while top.get_parent() != null and top.get_parent().get_script() == get_script(): + top = top.get_parent() + top.emit_signal("hierarchy_changed") func fix_remotes() -> void: for c in get_children(): @@ -111,6 +117,8 @@ func add_generator(generator : MMGenBase) -> bool: name = generator.name + "_" + str(index) generator.name = name add_child(generator) + if generator.get_script() == get_script(): + emit_hierarchy_changed() return true func remove_generator(generator : MMGenBase) -> bool: @@ -123,6 +131,8 @@ func remove_generator(generator : MMGenBase) -> bool: connections = new_connections remove_child(generator) fix_remotes() + if generator.get_script() == get_script(): + emit_hierarchy_changed() generator.queue_free() return true @@ -130,8 +140,10 @@ func replace_generator(old : MMGenBase, new : MMGenBase) -> void: new.name = old.name new.position = old.position remove_child(old) - old.free() add_child(new) + if old.get_script() == get_script() or new.get_script() == get_script(): + emit_hierarchy_changed() + old.free() func get_connected_inputs(generator) -> Array: var rv : Array = [] @@ -312,10 +324,11 @@ func create_subgraph(gens : Array) -> MMGenGraph: if !found_remote: var gen_parameters = remote_script.new() gen_parameters.name = "gen_parameters" - gen_parameters.position = Vector2(center.x - 200, upper_bound-300) + gen_parameters.position = Vector2(center.x-200, upper_bound-300) new_graph.add_child(gen_parameters) fix_remotes() new_graph.fix_remotes() + emit_hierarchy_changed() return new_graph diff --git a/addons/material_maker/engine/loader.gd b/addons/material_maker/engine/loader.gd index 10f7ec4..0aa9eeb 100644 --- a/addons/material_maker/engine/loader.gd +++ b/addons/material_maker/engine/loader.gd @@ -82,7 +82,7 @@ func create_gen(data) -> MMGenBase: if generator == null and data.has("type"): if types.has(data.type): generator = types[data.type].new() - else: + elif predefined_generators.has(data.type): generator = create_gen(predefined_generators[data.type]) if generator == null: print("Cannot find description for "+data.type) diff --git a/material_maker/doc/images/create_node_menu.gif b/material_maker/doc/images/create_node_menu.gif new file mode 100644 index 0000000..b037e9d Binary files /dev/null and b/material_maker/doc/images/create_node_menu.gif differ diff --git a/material_maker/doc/images/editable_node.png b/material_maker/doc/images/editable_node.png index dd719ea..a164cc3 100644 Binary files a/material_maker/doc/images/editable_node.png and b/material_maker/doc/images/editable_node.png differ diff --git a/material_maker/doc/images/node_3d_box.png b/material_maker/doc/images/node_3d_box.png index d62260d..276bb07 100644 Binary files a/material_maker/doc/images/node_3d_box.png and b/material_maker/doc/images/node_3d_box.png differ diff --git a/material_maker/doc/images/node_3d_sdf_color.png b/material_maker/doc/images/node_3d_sdf_color.png index 431b5ee..b929c2b 100644 Binary files a/material_maker/doc/images/node_3d_sdf_color.png and b/material_maker/doc/images/node_3d_sdf_color.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_boolean.png b/material_maker/doc/images/node_3d_sdf_operators_boolean.png index 98be274..c32445c 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_boolean.png and b/material_maker/doc/images/node_3d_sdf_operators_boolean.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_circlerepeat.png b/material_maker/doc/images/node_3d_sdf_operators_circlerepeat.png index 464af2b..491ba06 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_circlerepeat.png and b/material_maker/doc/images/node_3d_sdf_operators_circlerepeat.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_elongation.png b/material_maker/doc/images/node_3d_sdf_operators_elongation.png index f3a29e2..fe5a247 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_elongation.png and b/material_maker/doc/images/node_3d_sdf_operators_elongation.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_extrusion.png b/material_maker/doc/images/node_3d_sdf_operators_extrusion.png index 4075bfc..66e5086 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_extrusion.png and b/material_maker/doc/images/node_3d_sdf_operators_extrusion.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_morph.png b/material_maker/doc/images/node_3d_sdf_operators_morph.png index af66bc7..ae930cb 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_morph.png and b/material_maker/doc/images/node_3d_sdf_operators_morph.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_repeat.png b/material_maker/doc/images/node_3d_sdf_operators_repeat.png index 11a2778..14bac6c 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_repeat.png and b/material_maker/doc/images/node_3d_sdf_operators_repeat.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_revolution.png b/material_maker/doc/images/node_3d_sdf_operators_revolution.png index 5b6c20a..d3db145 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_revolution.png and b/material_maker/doc/images/node_3d_sdf_operators_revolution.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_rounded.png b/material_maker/doc/images/node_3d_sdf_operators_rounded.png index 7b668f5..bc03e24 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_rounded.png and b/material_maker/doc/images/node_3d_sdf_operators_rounded.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_smoothboolean.png b/material_maker/doc/images/node_3d_sdf_operators_smoothboolean.png index 2086e88..330b6a6 100644 Binary files a/material_maker/doc/images/node_3d_sdf_operators_smoothboolean.png and b/material_maker/doc/images/node_3d_sdf_operators_smoothboolean.png differ diff --git a/material_maker/doc/images/node_3d_sdf_render.png b/material_maker/doc/images/node_3d_sdf_render.png index 2b564d3..b9b2dae 100644 Binary files a/material_maker/doc/images/node_3d_sdf_render.png and b/material_maker/doc/images/node_3d_sdf_render.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_box.png b/material_maker/doc/images/node_3d_sdf_shapes_box.png index b16d867..04d8818 100644 Binary files a/material_maker/doc/images/node_3d_sdf_shapes_box.png and b/material_maker/doc/images/node_3d_sdf_shapes_box.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_capsule.png b/material_maker/doc/images/node_3d_sdf_shapes_capsule.png index ca0e322..68bdedf 100644 Binary files a/material_maker/doc/images/node_3d_sdf_shapes_capsule.png and b/material_maker/doc/images/node_3d_sdf_shapes_capsule.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_cone.png b/material_maker/doc/images/node_3d_sdf_shapes_cone.png index 230631c..e56afaf 100644 Binary files a/material_maker/doc/images/node_3d_sdf_shapes_cone.png and b/material_maker/doc/images/node_3d_sdf_shapes_cone.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_cylinder.png b/material_maker/doc/images/node_3d_sdf_shapes_cylinder.png index b6db531..9f6815f 100644 Binary files a/material_maker/doc/images/node_3d_sdf_shapes_cylinder.png and b/material_maker/doc/images/node_3d_sdf_shapes_cylinder.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_sphere.png b/material_maker/doc/images/node_3d_sdf_shapes_sphere.png index a6ab5b5..54aedc5 100644 Binary files a/material_maker/doc/images/node_3d_sdf_shapes_sphere.png and b/material_maker/doc/images/node_3d_sdf_shapes_sphere.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_torus.png b/material_maker/doc/images/node_3d_sdf_shapes_torus.png index 51df11e..87483f7 100644 Binary files a/material_maker/doc/images/node_3d_sdf_shapes_torus.png and b/material_maker/doc/images/node_3d_sdf_shapes_torus.png differ diff --git a/material_maker/doc/images/node_3d_sdf_transforms_rotate.png b/material_maker/doc/images/node_3d_sdf_transforms_rotate.png index 9cee4c5..b2821b4 100644 Binary files a/material_maker/doc/images/node_3d_sdf_transforms_rotate.png and b/material_maker/doc/images/node_3d_sdf_transforms_rotate.png differ diff --git a/material_maker/doc/images/node_3d_sdf_transforms_scale.png b/material_maker/doc/images/node_3d_sdf_transforms_scale.png index 66276ee..99a6f94 100644 Binary files a/material_maker/doc/images/node_3d_sdf_transforms_scale.png and b/material_maker/doc/images/node_3d_sdf_transforms_scale.png differ diff --git a/material_maker/doc/images/node_3d_sdf_transforms_translate.png b/material_maker/doc/images/node_3d_sdf_transforms_translate.png index a24b9cd..d004575 100644 Binary files a/material_maker/doc/images/node_3d_sdf_transforms_translate.png and b/material_maker/doc/images/node_3d_sdf_transforms_translate.png differ diff --git a/material_maker/doc/images/node_3d_sphere.png b/material_maker/doc/images/node_3d_sphere.png index 0c0cd7f..e2145c1 100644 Binary files a/material_maker/doc/images/node_3d_sphere.png and b/material_maker/doc/images/node_3d_sphere.png differ diff --git a/material_maker/doc/images/node_3d_texture_apply.png b/material_maker/doc/images/node_3d_texture_apply.png index 93a8092..5e3e8ed 100644 Binary files a/material_maker/doc/images/node_3d_texture_apply.png and b/material_maker/doc/images/node_3d_texture_apply.png differ diff --git a/material_maker/doc/images/node_3d_texture_blend.png b/material_maker/doc/images/node_3d_texture_blend.png index 1f9d6c8..8edbc98 100644 Binary files a/material_maker/doc/images/node_3d_texture_blend.png and b/material_maker/doc/images/node_3d_texture_blend.png differ diff --git a/material_maker/doc/images/node_3d_texture_colorize.png b/material_maker/doc/images/node_3d_texture_colorize.png index 154e7b7..18bc4b7 100644 Binary files a/material_maker/doc/images/node_3d_texture_colorize.png and b/material_maker/doc/images/node_3d_texture_colorize.png differ diff --git a/material_maker/doc/images/node_3d_texture_distort.png b/material_maker/doc/images/node_3d_texture_distort.png index f84f571..ec32aed 100644 Binary files a/material_maker/doc/images/node_3d_texture_distort.png and b/material_maker/doc/images/node_3d_texture_distort.png differ diff --git a/material_maker/doc/images/node_3d_texture_fbm.png b/material_maker/doc/images/node_3d_texture_fbm.png index 6d76100..f451be5 100644 Binary files a/material_maker/doc/images/node_3d_texture_fbm.png and b/material_maker/doc/images/node_3d_texture_fbm.png differ diff --git a/material_maker/doc/images/node_3d_texture_from2d.png b/material_maker/doc/images/node_3d_texture_from2d.png index 951ff93..9f3c33a 100644 Binary files a/material_maker/doc/images/node_3d_texture_from2d.png and b/material_maker/doc/images/node_3d_texture_from2d.png differ diff --git a/material_maker/doc/images/node_3d_texture_pattern.png b/material_maker/doc/images/node_3d_texture_pattern.png index b9a7e47..9e7433d 100644 Binary files a/material_maker/doc/images/node_3d_texture_pattern.png and b/material_maker/doc/images/node_3d_texture_pattern.png differ diff --git a/material_maker/doc/images/node_3d_texture_rotate.png b/material_maker/doc/images/node_3d_texture_rotate.png index d04338f..8ee2750 100644 Binary files a/material_maker/doc/images/node_3d_texture_rotate.png and b/material_maker/doc/images/node_3d_texture_rotate.png differ diff --git a/material_maker/doc/images/node_3d_texture_select.png b/material_maker/doc/images/node_3d_texture_select.png index d46aafc..a3e19f3 100644 Binary files a/material_maker/doc/images/node_3d_texture_select.png and b/material_maker/doc/images/node_3d_texture_select.png differ diff --git a/material_maker/doc/images/node_example.png b/material_maker/doc/images/node_example.png index 1036477..21a230e 100644 Binary files a/material_maker/doc/images/node_example.png and b/material_maker/doc/images/node_example.png differ diff --git a/material_maker/doc/images/node_filter_adjusthsv.png b/material_maker/doc/images/node_filter_adjusthsv.png index 25d01ce..f5e316a 100644 Binary files a/material_maker/doc/images/node_filter_adjusthsv.png and b/material_maker/doc/images/node_filter_adjusthsv.png differ diff --git a/material_maker/doc/images/node_filter_blend.png b/material_maker/doc/images/node_filter_blend.png index cf5f98f..16dff88 100644 Binary files a/material_maker/doc/images/node_filter_blend.png and b/material_maker/doc/images/node_filter_blend.png differ diff --git a/material_maker/doc/images/node_filter_blur.png b/material_maker/doc/images/node_filter_blur.png index 399a74c..6d18671 100644 Binary files a/material_maker/doc/images/node_filter_blur.png and b/material_maker/doc/images/node_filter_blur.png differ diff --git a/material_maker/doc/images/node_filter_blur_directional.png b/material_maker/doc/images/node_filter_blur_directional.png index b90b3a5..83589d0 100644 Binary files a/material_maker/doc/images/node_filter_blur_directional.png and b/material_maker/doc/images/node_filter_blur_directional.png differ diff --git a/material_maker/doc/images/node_filter_brightnesscontrast.png b/material_maker/doc/images/node_filter_brightnesscontrast.png index d762c4c..497769b 100644 Binary files a/material_maker/doc/images/node_filter_brightnesscontrast.png and b/material_maker/doc/images/node_filter_brightnesscontrast.png differ diff --git a/material_maker/doc/images/node_filter_colorize.png b/material_maker/doc/images/node_filter_colorize.png index 22f36e5..7f930b5 100644 Binary files a/material_maker/doc/images/node_filter_colorize.png and b/material_maker/doc/images/node_filter_colorize.png differ diff --git a/material_maker/doc/images/node_filter_colorize_invert.png b/material_maker/doc/images/node_filter_colorize_invert.png index 75eabd1..9749664 100644 Binary files a/material_maker/doc/images/node_filter_colorize_invert.png and b/material_maker/doc/images/node_filter_colorize_invert.png differ diff --git a/material_maker/doc/images/node_filter_colorize_rainbow.png b/material_maker/doc/images/node_filter_colorize_rainbow.png index 0e8db05..ddf9975 100644 Binary files a/material_maker/doc/images/node_filter_colorize_rainbow.png and b/material_maker/doc/images/node_filter_colorize_rainbow.png differ diff --git a/material_maker/doc/images/node_filter_combine.png b/material_maker/doc/images/node_filter_combine.png index 0189b8e..92b734e 100644 Binary files a/material_maker/doc/images/node_filter_combine.png and b/material_maker/doc/images/node_filter_combine.png differ diff --git a/material_maker/doc/images/node_filter_decompose.png b/material_maker/doc/images/node_filter_decompose.png index ff0ffef..d55cf22 100644 Binary files a/material_maker/doc/images/node_filter_decompose.png and b/material_maker/doc/images/node_filter_decompose.png differ diff --git a/material_maker/doc/images/node_filter_edge_detect.png b/material_maker/doc/images/node_filter_edge_detect.png index 9f7f30e..3530149 100644 Binary files a/material_maker/doc/images/node_filter_edge_detect.png and b/material_maker/doc/images/node_filter_edge_detect.png differ diff --git a/material_maker/doc/images/node_filter_edge_detect_axis_aligned.png b/material_maker/doc/images/node_filter_edge_detect_axis_aligned.png index 06d8f09..4038d43 100644 Binary files a/material_maker/doc/images/node_filter_edge_detect_axis_aligned.png and b/material_maker/doc/images/node_filter_edge_detect_axis_aligned.png differ diff --git a/material_maker/doc/images/node_filter_edge_detect_diagonal.png b/material_maker/doc/images/node_filter_edge_detect_diagonal.png index 4b2cbd6..6233a61 100644 Binary files a/material_maker/doc/images/node_filter_edge_detect_diagonal.png and b/material_maker/doc/images/node_filter_edge_detect_diagonal.png differ diff --git a/material_maker/doc/images/node_filter_emboss.png b/material_maker/doc/images/node_filter_emboss.png index 020fea3..2c85f44 100644 Binary files a/material_maker/doc/images/node_filter_emboss.png and b/material_maker/doc/images/node_filter_emboss.png differ diff --git a/material_maker/doc/images/node_filter_greyscale.png b/material_maker/doc/images/node_filter_greyscale.png index c9c2987..d90189d 100644 Binary files a/material_maker/doc/images/node_filter_greyscale.png and b/material_maker/doc/images/node_filter_greyscale.png differ diff --git a/material_maker/doc/images/node_filter_invert.png b/material_maker/doc/images/node_filter_invert.png index 9084982..c109043 100644 Binary files a/material_maker/doc/images/node_filter_invert.png and b/material_maker/doc/images/node_filter_invert.png differ diff --git a/material_maker/doc/images/node_filter_normal_map.png b/material_maker/doc/images/node_filter_normal_map.png index 638909f..4819e7f 100644 Binary files a/material_maker/doc/images/node_filter_normal_map.png and b/material_maker/doc/images/node_filter_normal_map.png differ diff --git a/material_maker/doc/images/node_filter_occlusion.png b/material_maker/doc/images/node_filter_occlusion.png index b7e8ee1..a230f92 100644 Binary files a/material_maker/doc/images/node_filter_occlusion.png and b/material_maker/doc/images/node_filter_occlusion.png differ diff --git a/material_maker/doc/images/node_filter_quantize.png b/material_maker/doc/images/node_filter_quantize.png index 501e6b3..1b836a3 100644 Binary files a/material_maker/doc/images/node_filter_quantize.png and b/material_maker/doc/images/node_filter_quantize.png differ diff --git a/material_maker/doc/images/node_filter_sharpen.png b/material_maker/doc/images/node_filter_sharpen.png index 0d19d98..f41104b 100644 Binary files a/material_maker/doc/images/node_filter_sharpen.png and b/material_maker/doc/images/node_filter_sharpen.png differ diff --git a/material_maker/doc/images/node_filter_swapchannels.png b/material_maker/doc/images/node_filter_swapchannels.png index a4e4073..6ff91a5 100644 Binary files a/material_maker/doc/images/node_filter_swapchannels.png and b/material_maker/doc/images/node_filter_swapchannels.png differ diff --git a/material_maker/doc/images/node_miscellaneous_buffer.png b/material_maker/doc/images/node_miscellaneous_buffer.png index 2e1b15c..a8f255e 100644 Binary files a/material_maker/doc/images/node_miscellaneous_buffer.png and b/material_maker/doc/images/node_miscellaneous_buffer.png differ diff --git a/material_maker/doc/images/node_miscellaneous_comment.png b/material_maker/doc/images/node_miscellaneous_comment.png index 3270c92..87d73cd 100644 Binary files a/material_maker/doc/images/node_miscellaneous_comment.png and b/material_maker/doc/images/node_miscellaneous_comment.png differ diff --git a/material_maker/doc/images/node_miscellaneous_custom_shader.png b/material_maker/doc/images/node_miscellaneous_custom_shader.png index 0a760fe..c349f81 100644 Binary files a/material_maker/doc/images/node_miscellaneous_custom_shader.png and b/material_maker/doc/images/node_miscellaneous_custom_shader.png differ diff --git a/material_maker/doc/images/node_miscellaneous_debug.png b/material_maker/doc/images/node_miscellaneous_debug.png index b246446..4b53c08 100644 Binary files a/material_maker/doc/images/node_miscellaneous_debug.png and b/material_maker/doc/images/node_miscellaneous_debug.png differ diff --git a/material_maker/doc/images/node_miscellaneous_export.png b/material_maker/doc/images/node_miscellaneous_export.png index 64de408..797099c 100644 Binary files a/material_maker/doc/images/node_miscellaneous_export.png and b/material_maker/doc/images/node_miscellaneous_export.png differ diff --git a/material_maker/doc/images/node_miscellaneous_remote.png b/material_maker/doc/images/node_miscellaneous_remote.png index 976fc93..634a34a 100644 Binary files a/material_maker/doc/images/node_miscellaneous_remote.png and b/material_maker/doc/images/node_miscellaneous_remote.png differ diff --git a/material_maker/doc/images/node_miscellaneous_switch.png b/material_maker/doc/images/node_miscellaneous_switch.png index fbae589..274d40d 100644 Binary files a/material_maker/doc/images/node_miscellaneous_switch.png and b/material_maker/doc/images/node_miscellaneous_switch.png differ diff --git a/material_maker/doc/images/node_noise.png b/material_maker/doc/images/node_noise.png index 51cfd2c..fa839aa 100644 Binary files a/material_maker/doc/images/node_noise.png and b/material_maker/doc/images/node_noise.png differ diff --git a/material_maker/doc/images/node_noise_color.png b/material_maker/doc/images/node_noise_color.png index 61535ae..418b462 100644 Binary files a/material_maker/doc/images/node_noise_color.png and b/material_maker/doc/images/node_noise_color.png differ diff --git a/material_maker/doc/images/node_noise_fbm.png b/material_maker/doc/images/node_noise_fbm.png index aa405ec..838577a 100644 Binary files a/material_maker/doc/images/node_noise_fbm.png and b/material_maker/doc/images/node_noise_fbm.png differ diff --git a/material_maker/doc/images/node_noise_perlin.png b/material_maker/doc/images/node_noise_perlin.png index 34c96b0..dd66231 100644 Binary files a/material_maker/doc/images/node_noise_perlin.png and b/material_maker/doc/images/node_noise_perlin.png differ diff --git a/material_maker/doc/images/node_noise_perlin_color.png b/material_maker/doc/images/node_noise_perlin_color.png index debba7b..3acde2a 100644 Binary files a/material_maker/doc/images/node_noise_perlin_color.png and b/material_maker/doc/images/node_noise_perlin_color.png differ diff --git a/material_maker/doc/images/node_noise_perlin_warp1.png b/material_maker/doc/images/node_noise_perlin_warp1.png index a5117ff..a0d5ed7 100644 Binary files a/material_maker/doc/images/node_noise_perlin_warp1.png and b/material_maker/doc/images/node_noise_perlin_warp1.png differ diff --git a/material_maker/doc/images/node_noise_perlin_warp2.png b/material_maker/doc/images/node_noise_perlin_warp2.png index 2e93eba..cbd3ed8 100644 Binary files a/material_maker/doc/images/node_noise_perlin_warp2.png and b/material_maker/doc/images/node_noise_perlin_warp2.png differ diff --git a/material_maker/doc/images/node_noise_voronoi.png b/material_maker/doc/images/node_noise_voronoi.png index acb8888..ed60be9 100644 Binary files a/material_maker/doc/images/node_noise_voronoi.png and b/material_maker/doc/images/node_noise_voronoi.png differ diff --git a/material_maker/doc/images/node_pattern_beehive.png b/material_maker/doc/images/node_pattern_beehive.png index 8635b95..2ce4618 100644 Binary files a/material_maker/doc/images/node_pattern_beehive.png and b/material_maker/doc/images/node_pattern_beehive.png differ diff --git a/material_maker/doc/images/node_pattern_bricks.png b/material_maker/doc/images/node_pattern_bricks.png index a554ad6..3778a0e 100644 Binary files a/material_maker/doc/images/node_pattern_bricks.png and b/material_maker/doc/images/node_pattern_bricks.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_basketweave.png b/material_maker/doc/images/node_pattern_bricks_basketweave.png index f6f2686..269e296 100644 Binary files a/material_maker/doc/images/node_pattern_bricks_basketweave.png and b/material_maker/doc/images/node_pattern_bricks_basketweave.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_herringbone.png b/material_maker/doc/images/node_pattern_bricks_herringbone.png index 4c16846..4ed490e 100644 Binary files a/material_maker/doc/images/node_pattern_bricks_herringbone.png and b/material_maker/doc/images/node_pattern_bricks_herringbone.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_spanishbond.png b/material_maker/doc/images/node_pattern_bricks_spanishbond.png index a881006..5e5aa3d 100644 Binary files a/material_maker/doc/images/node_pattern_bricks_spanishbond.png and b/material_maker/doc/images/node_pattern_bricks_spanishbond.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_tiles.png b/material_maker/doc/images/node_pattern_bricks_tiles.png index c237d38..9a2c53f 100644 Binary files a/material_maker/doc/images/node_pattern_bricks_tiles.png and b/material_maker/doc/images/node_pattern_bricks_tiles.png differ diff --git a/material_maker/doc/images/node_pattern_fibers.png b/material_maker/doc/images/node_pattern_fibers.png index 0ec5f9b..688b8d6 100644 Binary files a/material_maker/doc/images/node_pattern_fibers.png and b/material_maker/doc/images/node_pattern_fibers.png differ diff --git a/material_maker/doc/images/node_pattern_generic.png b/material_maker/doc/images/node_pattern_generic.png index 6e0d8cc..f896d1a 100644 Binary files a/material_maker/doc/images/node_pattern_generic.png and b/material_maker/doc/images/node_pattern_generic.png differ diff --git a/material_maker/doc/images/node_pattern_generic_checkerboard.png b/material_maker/doc/images/node_pattern_generic_checkerboard.png index b9597be..8903913 100644 Binary files a/material_maker/doc/images/node_pattern_generic_checkerboard.png and b/material_maker/doc/images/node_pattern_generic_checkerboard.png differ diff --git a/material_maker/doc/images/node_pattern_runes.png b/material_maker/doc/images/node_pattern_runes.png index 452a49e..8afd385 100644 Binary files a/material_maker/doc/images/node_pattern_runes.png and b/material_maker/doc/images/node_pattern_runes.png differ diff --git a/material_maker/doc/images/node_pattern_scratches.png b/material_maker/doc/images/node_pattern_scratches.png index 4db13f8..96282a7 100644 Binary files a/material_maker/doc/images/node_pattern_scratches.png and b/material_maker/doc/images/node_pattern_scratches.png differ diff --git a/material_maker/doc/images/node_pattern_truchet.png b/material_maker/doc/images/node_pattern_truchet.png index 9da9aef..ab037fd 100644 Binary files a/material_maker/doc/images/node_pattern_truchet.png and b/material_maker/doc/images/node_pattern_truchet.png differ diff --git a/material_maker/doc/images/node_pattern_weave.png b/material_maker/doc/images/node_pattern_weave.png index c4ea665..bcb2b15 100644 Binary files a/material_maker/doc/images/node_pattern_weave.png and b/material_maker/doc/images/node_pattern_weave.png differ diff --git a/material_maker/doc/images/node_simple_gradient.png b/material_maker/doc/images/node_simple_gradient.png index 212a337..3795d69 100644 Binary files a/material_maker/doc/images/node_simple_gradient.png and b/material_maker/doc/images/node_simple_gradient.png differ diff --git a/material_maker/doc/images/node_simple_gradient_circular.png b/material_maker/doc/images/node_simple_gradient_circular.png index 4bacd89..ac0c8a9 100644 Binary files a/material_maker/doc/images/node_simple_gradient_circular.png and b/material_maker/doc/images/node_simple_gradient_circular.png differ diff --git a/material_maker/doc/images/node_simple_gradient_radial.png b/material_maker/doc/images/node_simple_gradient_radial.png index c4716d9..6c3e739 100644 Binary files a/material_maker/doc/images/node_simple_gradient_radial.png and b/material_maker/doc/images/node_simple_gradient_radial.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdannularshape.png b/material_maker/doc/images/node_simple_sdf_operators_sdannularshape.png index 1493dd1..ba33ce7 100644 Binary files a/material_maker/doc/images/node_simple_sdf_operators_sdannularshape.png and b/material_maker/doc/images/node_simple_sdf_operators_sdannularshape.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdboolean.png b/material_maker/doc/images/node_simple_sdf_operators_sdboolean.png index a35b5fb..384922e 100644 Binary files a/material_maker/doc/images/node_simple_sdf_operators_sdboolean.png and b/material_maker/doc/images/node_simple_sdf_operators_sdboolean.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdmorph.png b/material_maker/doc/images/node_simple_sdf_operators_sdmorph.png index a508f7a..8c80092 100644 Binary files a/material_maker/doc/images/node_simple_sdf_operators_sdmorph.png and b/material_maker/doc/images/node_simple_sdf_operators_sdmorph.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdroundedshape.png b/material_maker/doc/images/node_simple_sdf_operators_sdroundedshape.png index 500fe2c..ffaae87 100644 Binary files a/material_maker/doc/images/node_simple_sdf_operators_sdroundedshape.png and b/material_maker/doc/images/node_simple_sdf_operators_sdroundedshape.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdsmoothboolean.png b/material_maker/doc/images/node_simple_sdf_operators_sdsmoothboolean.png index 0fd83f1..59aca22 100644 Binary files a/material_maker/doc/images/node_simple_sdf_operators_sdsmoothboolean.png and b/material_maker/doc/images/node_simple_sdf_operators_sdsmoothboolean.png differ diff --git a/material_maker/doc/images/node_simple_sdf_sdshow.png b/material_maker/doc/images/node_simple_sdf_sdshow.png index ae69b3e..d269556 100644 Binary files a/material_maker/doc/images/node_simple_sdf_sdshow.png and b/material_maker/doc/images/node_simple_sdf_sdshow.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdarc.png b/material_maker/doc/images/node_simple_sdf_shapes_sdarc.png index d9244d4..a82ee68 100644 Binary files a/material_maker/doc/images/node_simple_sdf_shapes_sdarc.png and b/material_maker/doc/images/node_simple_sdf_shapes_sdarc.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdbox.png b/material_maker/doc/images/node_simple_sdf_shapes_sdbox.png index c32215e..c34f1f2 100644 Binary files a/material_maker/doc/images/node_simple_sdf_shapes_sdbox.png and b/material_maker/doc/images/node_simple_sdf_shapes_sdbox.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdcircle.png b/material_maker/doc/images/node_simple_sdf_shapes_sdcircle.png index bfc95cf..da666ae 100644 Binary files a/material_maker/doc/images/node_simple_sdf_shapes_sdcircle.png and b/material_maker/doc/images/node_simple_sdf_shapes_sdcircle.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdline.png b/material_maker/doc/images/node_simple_sdf_shapes_sdline.png index 87ddc9c..e7e6833 100644 Binary files a/material_maker/doc/images/node_simple_sdf_shapes_sdline.png and b/material_maker/doc/images/node_simple_sdf_shapes_sdline.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdrhombus.png b/material_maker/doc/images/node_simple_sdf_shapes_sdrhombus.png index c4fbf70..82bb3c1 100644 Binary files a/material_maker/doc/images/node_simple_sdf_shapes_sdrhombus.png and b/material_maker/doc/images/node_simple_sdf_shapes_sdrhombus.png differ diff --git a/material_maker/doc/images/node_simple_sdf_transforms_rotate.png b/material_maker/doc/images/node_simple_sdf_transforms_rotate.png index 251b6ed..2d5847f 100644 Binary files a/material_maker/doc/images/node_simple_sdf_transforms_rotate.png and b/material_maker/doc/images/node_simple_sdf_transforms_rotate.png differ diff --git a/material_maker/doc/images/node_simple_sdf_transforms_scale.png b/material_maker/doc/images/node_simple_sdf_transforms_scale.png index 6f4e5f9..172c192 100644 Binary files a/material_maker/doc/images/node_simple_sdf_transforms_scale.png and b/material_maker/doc/images/node_simple_sdf_transforms_scale.png differ diff --git a/material_maker/doc/images/node_simple_sdf_transforms_translate.png b/material_maker/doc/images/node_simple_sdf_transforms_translate.png index baeed70..b673ea8 100644 Binary files a/material_maker/doc/images/node_simple_sdf_transforms_translate.png and b/material_maker/doc/images/node_simple_sdf_transforms_translate.png differ diff --git a/material_maker/doc/images/node_simple_shape.png b/material_maker/doc/images/node_simple_shape.png index 55cafd0..f601c2b 100644 Binary files a/material_maker/doc/images/node_simple_shape.png and b/material_maker/doc/images/node_simple_shape.png differ diff --git a/material_maker/doc/images/node_simple_shape_circle.png b/material_maker/doc/images/node_simple_shape_circle.png index 173412f..63fd8db 100644 Binary files a/material_maker/doc/images/node_simple_shape_circle.png and b/material_maker/doc/images/node_simple_shape_circle.png differ diff --git a/material_maker/doc/images/node_simple_shape_curved_star.png b/material_maker/doc/images/node_simple_shape_curved_star.png index 39dabee..14ea00e 100644 Binary files a/material_maker/doc/images/node_simple_shape_curved_star.png and b/material_maker/doc/images/node_simple_shape_curved_star.png differ diff --git a/material_maker/doc/images/node_simple_shape_rays.png b/material_maker/doc/images/node_simple_shape_rays.png index b2fbde8..d8dda0b 100644 Binary files a/material_maker/doc/images/node_simple_shape_rays.png and b/material_maker/doc/images/node_simple_shape_rays.png differ diff --git a/material_maker/doc/images/node_simple_shape_star.png b/material_maker/doc/images/node_simple_shape_star.png index 8e56573..c18ced6 100644 Binary files a/material_maker/doc/images/node_simple_shape_star.png and b/material_maker/doc/images/node_simple_shape_star.png differ diff --git a/material_maker/doc/images/node_simple_uniform.png b/material_maker/doc/images/node_simple_uniform.png index a9dbc54..6b9b1ca 100644 Binary files a/material_maker/doc/images/node_simple_uniform.png and b/material_maker/doc/images/node_simple_uniform.png differ diff --git a/material_maker/doc/images/node_simple_uniform_greyscale.png b/material_maker/doc/images/node_simple_uniform_greyscale.png index 0f4dd4b..aef86f4 100644 Binary files a/material_maker/doc/images/node_simple_uniform_greyscale.png and b/material_maker/doc/images/node_simple_uniform_greyscale.png differ diff --git a/material_maker/doc/images/node_transform.png b/material_maker/doc/images/node_transform.png index 7f9f8da..414f47c 100644 Binary files a/material_maker/doc/images/node_transform.png and b/material_maker/doc/images/node_transform.png differ diff --git a/material_maker/doc/images/node_transform_circlemap.png b/material_maker/doc/images/node_transform_circlemap.png index ad89f23..36a046e 100644 Binary files a/material_maker/doc/images/node_transform_circlemap.png and b/material_maker/doc/images/node_transform_circlemap.png differ diff --git a/material_maker/doc/images/node_transform_customuv.png b/material_maker/doc/images/node_transform_customuv.png index 4f0677c..c5ee3b5 100644 Binary files a/material_maker/doc/images/node_transform_customuv.png and b/material_maker/doc/images/node_transform_customuv.png differ diff --git a/material_maker/doc/images/node_transform_kaleidoscope.png b/material_maker/doc/images/node_transform_kaleidoscope.png index a980894..3deb402 100644 Binary files a/material_maker/doc/images/node_transform_kaleidoscope.png and b/material_maker/doc/images/node_transform_kaleidoscope.png differ diff --git a/material_maker/doc/images/node_transform_mirror.png b/material_maker/doc/images/node_transform_mirror.png index 86cae76..f92137e 100644 Binary files a/material_maker/doc/images/node_transform_mirror.png and b/material_maker/doc/images/node_transform_mirror.png differ diff --git a/material_maker/doc/images/node_transform_splatter.png b/material_maker/doc/images/node_transform_splatter.png index 6ffe833..9c667ff 100644 Binary files a/material_maker/doc/images/node_transform_splatter.png and b/material_maker/doc/images/node_transform_splatter.png differ diff --git a/material_maker/doc/images/node_transform_splatter_color.png b/material_maker/doc/images/node_transform_splatter_color.png index 6ec2e3e..aa95abe 100644 Binary files a/material_maker/doc/images/node_transform_splatter_color.png and b/material_maker/doc/images/node_transform_splatter_color.png differ diff --git a/material_maker/doc/images/node_transform_tile2x2.png b/material_maker/doc/images/node_transform_tile2x2.png index cc182f6..6f3a353 100644 Binary files a/material_maker/doc/images/node_transform_tile2x2.png and b/material_maker/doc/images/node_transform_tile2x2.png differ diff --git a/material_maker/doc/images/node_transform_tiler.png b/material_maker/doc/images/node_transform_tiler.png index 3d0d7bd..62df34e 100644 Binary files a/material_maker/doc/images/node_transform_tiler.png and b/material_maker/doc/images/node_transform_tiler.png differ diff --git a/material_maker/doc/images/node_transform_tiler_color.png b/material_maker/doc/images/node_transform_tiler_color.png index f6a104b..3898355 100644 Binary files a/material_maker/doc/images/node_transform_tiler_color.png and b/material_maker/doc/images/node_transform_tiler_color.png differ diff --git a/material_maker/doc/images/node_transform_warp.png b/material_maker/doc/images/node_transform_warp.png index 39175ef..7f5d1b2 100644 Binary files a/material_maker/doc/images/node_transform_warp.png and b/material_maker/doc/images/node_transform_warp.png differ diff --git a/material_maker/doc/images/node_workflow_applymap.png b/material_maker/doc/images/node_workflow_applymap.png index e836f4c..55bffe7 100644 Binary files a/material_maker/doc/images/node_workflow_applymap.png and b/material_maker/doc/images/node_workflow_applymap.png differ diff --git a/material_maker/doc/images/node_workflow_createmap.png b/material_maker/doc/images/node_workflow_createmap.png index da63591..6ae550e 100644 Binary files a/material_maker/doc/images/node_workflow_createmap.png and b/material_maker/doc/images/node_workflow_createmap.png differ diff --git a/material_maker/doc/images/node_workflow_materials_marble.png b/material_maker/doc/images/node_workflow_materials_marble.png index b42d314..7442f18 100644 Binary files a/material_maker/doc/images/node_workflow_materials_marble.png and b/material_maker/doc/images/node_workflow_materials_marble.png differ diff --git a/material_maker/doc/images/node_workflow_materials_metal.png b/material_maker/doc/images/node_workflow_materials_metal.png index 25b7f83..d53e8da 100644 Binary files a/material_maker/doc/images/node_workflow_materials_metal.png and b/material_maker/doc/images/node_workflow_materials_metal.png differ diff --git a/material_maker/doc/images/node_workflow_materials_template.png b/material_maker/doc/images/node_workflow_materials_template.png index 9a80f72..c072947 100644 Binary files a/material_maker/doc/images/node_workflow_materials_template.png and b/material_maker/doc/images/node_workflow_materials_template.png differ diff --git a/material_maker/doc/images/node_workflow_materials_wood.png b/material_maker/doc/images/node_workflow_materials_wood.png index d8d105e..0d6f0e2 100644 Binary files a/material_maker/doc/images/node_workflow_materials_wood.png and b/material_maker/doc/images/node_workflow_materials_wood.png differ diff --git a/material_maker/doc/images/node_workflow_mix.png b/material_maker/doc/images/node_workflow_mix.png index aace12f..2c05a6a 100644 Binary files a/material_maker/doc/images/node_workflow_mix.png and b/material_maker/doc/images/node_workflow_mix.png differ diff --git a/material_maker/doc/images/node_workflow_mixmap.png b/material_maker/doc/images/node_workflow_mixmap.png index 07fec0d..b29d25f 100644 Binary files a/material_maker/doc/images/node_workflow_mixmap.png and b/material_maker/doc/images/node_workflow_mixmap.png differ diff --git a/material_maker/doc/images/node_workflow_output.png b/material_maker/doc/images/node_workflow_output.png index f7e702e..db8918c 100644 Binary files a/material_maker/doc/images/node_workflow_output.png and b/material_maker/doc/images/node_workflow_output.png differ diff --git a/material_maker/doc/images/random_node.png b/material_maker/doc/images/random_node.png index 1372260..bf5ada5 100644 Binary files a/material_maker/doc/images/random_node.png and b/material_maker/doc/images/random_node.png differ diff --git a/material_maker/doc/images/screenshot.png b/material_maker/doc/images/screenshot.png index 653b92b..363af77 100644 Binary files a/material_maker/doc/images/screenshot.png and b/material_maker/doc/images/screenshot.png differ diff --git a/material_maker/doc/nodes_common.rst b/material_maker/doc/nodes_common.rst index ac58b5f..74c7366 100644 --- a/material_maker/doc/nodes_common.rst +++ b/material_maker/doc/nodes_common.rst @@ -24,18 +24,20 @@ connected to several node inputs. Each node output (and input) can be: * a **3D signed distance function** (shown in red) +* a **3D texture** (shown in fuchia) + Greyscale, color and RGBA inputs and outputs can be connected to each other and will automatically be converted when required. 2D signed distance functions have a specific preview that shows the associated signed distance -field. They can be converted into greyscale images using the `sdShow node`. +field. They can be converted into greyscale images using the `sdShow` node. -3D signed distance functions have a specific preview that shows the lit 3Dscene. They can be -converted into a greyscale height map and a color normal map using the `Render node`. +3D signed distance functions have a specific preview that shows the lit 3D scene. They can be +converted into a greyscale height map and a color normal map using the `Render` node. -Next to the output, an (open or closed) eye icon indicates that a preview is available. Clicking -on it will show the preview at the bottom of the node. When a node has several outputs, only -one of them can be previewed at a time. +Clicking on an output slot it will show the corresponding preview at the bottom of the node. +When a node has several outputs, only one of them can be previewed at a time. The previewed +output slot will has a circle around it, and clicking it again will hide the preview. Inputs ^^^^^^ diff --git a/material_maker/doc/user_interface.rst b/material_maker/doc/user_interface.rst index ebf1b33..bd91b38 100644 --- a/material_maker/doc/user_interface.rst +++ b/material_maker/doc/user_interface.rst @@ -4,22 +4,30 @@ User interface Overview -------- -Material Maker mainly consists of 3 panes: +Material Maker mainly consists of 5 panes: -* The top left pane is the library, that contains all available nodes that can be used +* The Project pane (located in the center) contains the graph editors where materials are + described for current projects + +* The Library pane (by default in the top left corner) contains all available nodes that can be used to create materials. Library items are shown in a tree view -* The bottom left pane is the preview, that shows at the same time the current material - applied to a sample mesh in a sample environment, and the texture generated by the +* The Hierarchy pane (by default in the bottom left corner) shows the hierarchy of node groups + of the current material graph + +* The 2D preview pane (by default in the top right corner) shows the first texture generated by the currently selected node -* The right pane contains the graph editors where materials are described for current - projects +* The 3D preview pane (by default in the bottom right corner) shows the current material + applied to a sample mesh in a sample environment + +The 4 panes on the sides of the user interface can be moved around by dragging their title to their +desired location and hidden using the **View -> Panes** First steps with the user interface ----------------------------------- -When opening Material Maker, a new empty project is created and shown in the right pane. +When opening Material Maker, a new empty project is created and shown in the center pane. An empty project simply consists of a material node where textures for all elements of the material should be connected. @@ -30,15 +38,20 @@ item, a preview or a simple description will be displayed while dragging. .. image:: images/create_node.gif :align: center -Selecting this new node (by clicking on it) shows it in the preview pane. The very small -2d preview of the preview pane can be maximized by double clicking on it. This will hide -the 3d preview but is useful when working on the different textures of the material. +An alternate method to create a node is to show the library menu using the space bar +in the Project pane, and select a node from the list. The library menu will also be +shown when connecting a node output into an empty space in the graph (in this case, +the newly created node will be connected automatically). + +.. image:: images/create_node_menu.gif + :align: center + +Selecting this new node (by clicking on it) shows it in the 2D preview pane. To connect a node output to an input of another node, simply drag one to the other. For example we can drag the first output of the Bricks node to the albedo input of the Materials node. This will automatically assign the simple Bricks texture to the -albedo element of the material, and the 3d preview will immediately be updated (if -you maximized the 2d preview it can be minimized by double-clicking on it again). +albedo element of the material, and the 3D preview will immediately be updated. Nodes can also be disconnected by dragging a connected input away from its node. @@ -90,7 +103,8 @@ Material navigation .. |graph_up_button| image:: images/graph_up_button.png In the top right corner of the graph pane, the graph navigation button -|graph_navigation_button| can be used to show a tree view of the material. +|graph_navigation_button| can be used to show a tree view of the +material (this is only useful when the Hierarchy pane is not visible). Double clicking on an item in this tree will show it in the graph view. When a subgraph is shown in the graph pane, additional items are visible in @@ -117,10 +131,20 @@ or group of nodes can easily be shared using this format. The contents of the clipboard can be pasted into a graph using the **Edit -> Paste** menu or the **Control+V** keyboard shortcut. +Selected items can also be duplicated using the **Edit -> Duplicate** +menu or the **Control+D** keyboard shortcut. This operation does not affect +the clipboard. + +Background 2D preview +^^^^^^^^^^^^^^^^^^^^^ + +The bottom left "bricks" button can be used to show a 2D preview in the background +of the graph view. + Background 3D preview ^^^^^^^^^^^^^^^^^^^^^ -The bottom left ("cube") button can be used to show a 3D preview in the background +The bottom left "cube" button can be used to show a 3D preview in the background of the graph view. The blue/red arrows icon is used to rotate the object or the view, and other controls are similar to the 3D preview. @@ -139,15 +163,20 @@ give focus to the search field using the **Control+F** keyboard shortcut. .. image:: images/library_filter.gif :align: center -Preview pane ------------- +Hierarchy pane +-------------- -The preview pane has tabs for a 2D preview and the 3D preview. +The hierarchy pane shows the hierarchy of groups of the current material graph. +It shows the name as well as a preview of a number of outputs (for 0 to 3), +that can be configured by right clicking on the pane. -2D preview -^^^^^^^^^^ +Double clicking on a group in the hierarchy shows the contents of the corresponding group +in the Graph pane. -The 2D preview shows a tiled preview of the first output of the selected +2D Preview pane +--------------- + +The 2D preview pane shows a tiled preview of the first output of the selected node. The animated dashed lines show the bounds of the texture, so it is easy to check that the texture wraps correctly. @@ -157,8 +186,8 @@ easy to check that the texture wraps correctly. Depending on the selected node, controls can be shown and they can me moved around to modify the associated parameters. -3D preview -^^^^^^^^^^ +3D Preview pane +--------------- The 3D preview pane shows a 3D preview of the current material. @@ -184,10 +213,11 @@ forward or backward). Main menu --------- -The main menu is organized in 4 sections: +The main menu bar is organized in 5 menus: * the *File* menu contains actions to create, load, save and export materials * the *Edit* menu has common edit actions cut, copy and paste +* the *View* menu contains actions to customize the graphial user interface * the *Tools* menu has actions to add items to the user library * the *Help* menu can be used to find more information and submit feedback about the software @@ -239,6 +269,8 @@ View menu * *Reset zoom* Resets the zoom level of the current material graph view +* the *Panes* submenu can be used to show or hide all side panes + Tools menu ^^^^^^^^^^ diff --git a/material_maker/examples/beehive.ptex b/material_maker/examples/beehive.ptex index c8e3bc2..da4fb9b 100644 --- a/material_maker/examples/beehive.ptex +++ b/material_maker/examples/beehive.ptex @@ -1,82 +1,34 @@ { "connections": [ { - "from": "colorize_2", - "from_port": 0, - "to": "blend", - "to_port": 0 - }, - { - "from": "colorize", - "from_port": 0, - "to": "blend", - "to_port": 1 - }, - { - "from": "normal_map", + "from": "graph", "from_port": 0, "to": "Material", "to_port": 4 }, { - "from": "blend", - "from_port": 0, - "to": "normal_map", - "to_port": 0 - }, - { - "from": "blend", - "from_port": 0, - "to": "colorize_3", - "to_port": 0 - }, - { - "from": "colorize_3", - "from_port": 0, + "from": "graph", + "from_port": 1, "to": "Material", "to_port": 6 }, { - "from": "uniform_greyscale", - "from_port": 0, + "from": "graph", + "from_port": 2, "to": "Material", "to_port": 1 }, { - "from": "colorize_4", - "from_port": 0, + "from": "graph", + "from_port": 3, "to": "Material", "to_port": 2 }, { - "from": "colorize_5", - "from_port": 0, + "from": "graph", + "from_port": 4, "to": "Material", "to_port": 0 - }, - { - "from": "blend", - "from_port": 0, - "to": "colorize_5", - "to_port": 0 - }, - { - "from": "blend", - "from_port": 0, - "to": "colorize_4", - "to_port": 0 - }, - { - "from": "beehive_2", - "from_port": 0, - "to": "colorize_2", - "to_port": 0 - }, - { - "from": "beehive_2", - "from_port": 1, - "to": "colorize", - "to_port": 0 } ], "label": "Graph", @@ -89,8 +41,8 @@ { "name": "Material", "node_position": { - "x": 134, - "y": -22 + "x": -28, + "y": -37 }, "parameters": { "albedo_color": { @@ -112,227 +64,465 @@ "type": "material" }, { - "name": "colorize", + "connections": [ + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "graph", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "graph", + "from_port": 0, + "to": "colorize_3", + "to_port": 0 + }, + { + "from": "colorize_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "colorize_4", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "colorize_5", + "from_port": 0, + "to": "gen_outputs", + "to_port": 4 + }, + { + "from": "graph", + "from_port": 0, + "to": "colorize_5", + "to_port": 0 + }, + { + "from": "graph", + "from_port": 0, + "to": "colorize_4", + "to_port": 0 + } + ], + "label": "Graph", + "name": "graph", "node_position": { - "x": -489.5, - "y": 20 + "x": -353.865601, + "y": 6.860606 }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ + "nodes": [ + { + "name": "colorize_5", + "node_position": { + "x": -240.009644, + "y": -136 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0.068034, + "pos": 0, + "r": 0.098958 + }, + { + "a": 1, + "b": 0, + "g": 0.6875, + "pos": 0.881818, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "colorize_4", + "node_position": { + "x": -245.009644, + "y": 15 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0.65625, + "g": 0.65625, + "pos": 0.518182, + "r": 0.65625 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.890909, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -246.009644, + "y": -55.5 + }, + "parameters": { + "color": 0.16 + }, + "type": "uniform_greyscale" + }, + { + "name": "colorize_3", + "node_position": { + "x": -244.009644, + "y": 233.5 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "normal_map", + "node_position": { + "x": -235.009644, + "y": 96 + }, + "parameters": { + "param0": 11, + "param1": 1.02, + "param2": 0, + "param4": 1 + }, + "type": "normal_map" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -802.009644, + "y": 6.860606 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 64.990356, + "y": 6.860606 + }, + "parameters": { + + }, + "ports": [ { - "a": 1, - "b": 0, - "g": 0, - "pos": 0, - "r": 0 + "name": "port0", + "type": "rgba" }, { - "a": 1, - "b": 0.225431, - "g": 0.225431, - "pos": 0.583818, - "r": 0.225431 + "name": "port1", + "type": "rgba" }, { - "a": 1, - "b": 0.96875, - "g": 0.96875, - "pos": 0.672727, - "r": 0.96875 + "name": "port2", + "type": "f" + }, + { + "name": "port3", + "type": "rgba" + }, + { + "name": "port4", + "type": "rgba" } ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "colorize_2", - "node_position": { - "x": -493.5, - "y": -42 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -553.865601, + "y": -452.254547 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] + }, + { + "connections": [ { - "a": 1, - "b": 1, - "g": 1, - "pos": 0, - "r": 1 + "from": "colorize_2", + "from_port": 0, + "to": "blend", + "to_port": 0 }, { - "a": 1, - "b": 0.947917, - "g": 0.947917, - "pos": 0.049912, - "r": 0.947917 + "from": "colorize", + "from_port": 0, + "to": "blend", + "to_port": 1 }, { - "a": 1, - "b": 0.115584, - "g": 0.115584, - "pos": 0.106977, - "r": 0.115584 + "from": "blend", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 }, { - "a": 1, - "b": 0, - "g": 0, - "pos": 0.290909, - "r": 0 + "from": "blend", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "beehive_2", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "beehive_2", + "from_port": 1, + "to": "colorize", + "to_port": 0 } ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "blend", - "node_position": { - "x": -528.009644, - "y": 89 - }, - "parameters": { - "amount": 1, - "blend_type": 9 - }, - "type": "blend" - }, - { - "name": "normal_map", - "node_position": { - "x": -138.009644, - "y": 78 - }, - "parameters": { - "amount": 0.5, - "param0": 11, - "param1": 1.02, - "param2": 0, - "param3": 0, - "param4": 1, - "size": 4 - }, - "type": "normal_map" - }, - { - "name": "colorize_3", - "node_position": { - "x": -132.009644, - "y": 208.5 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ + "label": "Graph", + "name": "graph", + "node_position": { + "x": -514.685547, + "y": 2.186363 + }, + "nodes": [ { - "a": 1, - "b": 1, - "g": 1, - "pos": 0, - "r": 1 + "name": "colorize", + "node_position": { + "x": -510.5, + "y": 45 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0.225431, + "g": 0.225431, + "pos": 0.583818, + "r": 0.225431 + }, + { + "a": 1, + "b": 0.96875, + "g": 0.96875, + "pos": 0.672727, + "r": 0.96875 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" }, { - "a": 1, - "b": 0, - "g": 0, - "pos": 1, - "r": 0 - } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "uniform_greyscale", - "node_position": { - "x": -98.009644, - "y": -64.5 - }, - "parameters": { - "color": 0.16 - }, - "type": "uniform_greyscale" - }, - { - "name": "colorize_4", - "node_position": { - "x": -153.009644, - "y": 10 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ - { - "a": 1, - "b": 0.65625, - "g": 0.65625, - "pos": 0.518182, - "r": 0.65625 + "name": "colorize_2", + "node_position": { + "x": -510.5, + "y": -26 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0.947917, + "g": 0.947917, + "pos": 0.049912, + "r": 0.947917 + }, + { + "a": 1, + "b": 0.115584, + "g": 0.115584, + "pos": 0.106977, + "r": 0.115584 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.290909, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" }, { - "a": 1, - "b": 0, - "g": 0, - "pos": 0.890909, - "r": 0 - } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "colorize_5", - "node_position": { - "x": -106.009644, - "y": -151 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ - { - "a": 1, - "b": 0, - "g": 0.068034, - "pos": 0, - "r": 0.098958 + "name": "blend", + "node_position": { + "x": -523.009644, + "y": 117 + }, + "parameters": { + "amount": 1, + "blend_type": 9 + }, + "seed_value": -12215, + "type": "blend" }, { - "a": 1, - "b": 0, - "g": 0.6875, - "pos": 0.881818, - "r": 1 + "name": "beehive_2", + "node_position": { + "x": -514.732483, + "y": -127.254547 + }, + "parameters": { + "sx": 20, + "sy": 12 + }, + "type": "beehive" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -823.009644, + "y": 2.186363 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -210.5, + "y": 2.186363 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -714.685547, + "y": -427.254547 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] } ], - "type": "Gradient" + "parameters": { + + }, + "type": "graph" } - }, - "type": "colorize" - }, - { - "name": "beehive_2", - "node_position": { - "x": -496.732483, - "y": -162.254547 - }, + ], "parameters": { - "sx": 20, - "sy": 12 + }, - "type": "beehive" + "type": "graph" } ], "parameters": { diff --git a/material_maker/examples/bricks.ptex b/material_maker/examples/bricks.ptex index b709f71..7702a7e 100644 --- a/material_maker/examples/bricks.ptex +++ b/material_maker/examples/bricks.ptex @@ -96,18 +96,6 @@ "to": "Material", "to_port": 5 }, - { - "from": "uniform_0", - "from_port": 0, - "to": "combine_0", - "to_port": 0 - }, - { - "from": "colorize_4", - "from_port": 0, - "to": "combine_0", - "to_port": 1 - }, { "from": "colorize_1", "from_port": 0, @@ -207,7 +195,6 @@ "emission_energy": 1, "metallic": 1, "normal_scale": 1, - "resolution": 1, "roughness": 1, "size": 11, "subsurf_scatter_strength": 0 @@ -241,8 +228,8 @@ { "name": "colorize_2", "node_position": { - "x": 544.943665, - "y": 159 + "x": 533.943665, + "y": 141 }, "parameters": { "gradient": { @@ -271,8 +258,8 @@ { "name": "uniform_0", "node_position": { - "x": 764, - "y": 164 + "x": 760, + "y": 156 }, "parameters": { "color": { @@ -285,24 +272,6 @@ }, "type": "uniform" }, - { - "name": "combine_0", - "node_position": { - "x": 896, - "y": 86 - }, - "parameters": { - "color": { - "a": 1, - "b": 1, - "g": 1, - "r": 1, - "type": "Color" - }, - "name": 0 - }, - "type": "combine" - }, { "name": "colorize_4", "node_position": { @@ -396,8 +365,8 @@ { "name": "colorize_1", "node_position": { - "x": 406.943665, - "y": -80 + "x": 383.943665, + "y": -76 }, "parameters": { "gradient": { @@ -454,8 +423,8 @@ { "name": "blend_1", "node_position": { - "x": 316, - "y": 217 + "x": 288, + "y": 203 }, "parameters": { "amount": 0.5, @@ -485,8 +454,7 @@ }, "parameters": { "amount": 0.04, - "eps": 0.045, - "epsilon": 0 + "eps": 0.045 }, "type": "warp" }, @@ -506,8 +474,8 @@ { "name": "_2_2", "node_position": { - "x": 244.467804, - "y": -350.036743 + "x": 243.467804, + "y": -299.036743 }, "parameters": { "param1": 0, @@ -976,24 +944,21 @@ } ], "parameters": { - + "param0": 0 }, "type": "graph" }, { "name": "normal_map_2", "node_position": { - "x": 986.357788, - "y": 281.520294 + "x": 974.357788, + "y": 284.520294 }, "parameters": { - "amount": 0.5, "param0": 11, "param1": 1.02, "param2": 0, - "param3": 0, - "param4": 0, - "size": 4 + "param4": 0 }, "type": "normal_map" } diff --git a/material_maker/examples/mandala.ptex b/material_maker/examples/mandala.ptex index 36ecd3e..d097a6b 100644 --- a/material_maker/examples/mandala.ptex +++ b/material_maker/examples/mandala.ptex @@ -101,8 +101,8 @@ { "name": "Material", "node_position": { - "x": -465, - "y": 71 + "x": -433, + "y": 1 }, "parameters": { "albedo_color": { @@ -160,8 +160,8 @@ { "name": "colorize_4", "node_position": { - "x": -43.577881, - "y": 5.555542 + "x": -56.577881, + "y": 46.555542 }, "parameters": { "gradient": { @@ -228,17 +228,14 @@ { "name": "normal_map", "node_position": { - "x": -54.577881, - "y": -82.444458 + "x": -47.577881, + "y": -84.444458 }, "parameters": { - "amount": 0.5, "param0": 11, "param1": 0.995, "param2": 0, - "param3": 0, - "param4": 1, - "size": 4 + "param4": 1 }, "type": "normal_map" } @@ -250,18 +247,6 @@ }, { "connections": [ - { - "from": "shape", - "from_port": 0, - "to": "transform", - "to_port": 0 - }, - { - "from": "transform", - "from_port": 0, - "to": "transform_2", - "to_port": 0 - }, { "from": "transform_2", "from_port": 0, @@ -279,50 +264,40 @@ "from_port": 0, "to": "gen_outputs", "to_port": 0 + }, + { + "from": "shape", + "from_port": 0, + "to": "transform_2", + "to_port": 0 } ], "label": "Grid", "name": "graph_2", "node_position": { - "x": -888.524597, - "y": -77 + "x": -927.524597, + "y": 38 }, "nodes": [ { "name": "shape", "node_position": { - "x": -549.5, - "y": -97.5 + "x": -539.5, + "y": 27.5 }, "parameters": { "edge": 1, - "radius": 1, + "radius": 1.2, "shape": 1, "sides": 8 }, "type": "shape" }, - { - "name": "transform", - "node_position": { - "x": -580.5, - "y": 118.5 - }, - "parameters": { - "repeat": false, - "rotate": 0, - "scale_x": 1.2, - "scale_y": 1.2, - "translate_x": 0, - "translate_y": 0 - }, - "type": "transform" - }, { "name": "transform_2", "node_position": { - "x": -579.5, - "y": 312 + "x": -581.5, + "y": 153 }, "parameters": { "repeat": true, @@ -418,8 +393,8 @@ { "name": "gen_outputs", "node_position": { - "x": -55.5, - "y": 225 + "x": -56.5, + "y": 223 }, "parameters": { @@ -436,6 +411,7 @@ "parameters": { }, + "seed_value": -27638, "type": "graph" }, { @@ -462,15 +438,15 @@ "label": "Frame", "name": "graph_3", "node_position": { - "x": -919.184326, - "y": 75.568512 + "x": -928.184326, + "y": 93.568512 }, "nodes": [ { "name": "colorize_4", "node_position": { - "x": -558.307007, - "y": 443.205566 + "x": -559.307007, + "y": 442.205566 }, "parameters": { "gradient": { @@ -543,7 +519,7 @@ { "name": "pattern", "node_position": { - "x": -580.623047, + "x": -581.623047, "y": 274.5 }, "parameters": { @@ -558,8 +534,8 @@ { "name": "gen_outputs", "node_position": { - "x": -258.307007, - "y": 364.568512 + "x": -314.307007, + "y": 448.568512 }, "parameters": { @@ -576,13 +552,14 @@ "parameters": { }, + "seed_value": -53251, "type": "graph" }, { "name": "transform", "node_position": { - "x": -1138.172852, - "y": 24.856049 + "x": -1258.172852, + "y": -68.143951 }, "parameters": { "repeat": true, @@ -597,8 +574,8 @@ { "name": "colorize", "node_position": { - "x": -1127.944092, - "y": 216.956055 + "x": -1232.944092, + "y": 121.956055 }, "parameters": { "gradient": { @@ -642,8 +619,8 @@ "label": "Flower1", "name": "graph_5", "node_position": { - "x": -1105.223755, - "y": -43.758514 + "x": -1216.223755, + "y": -332.758514 }, "nodes": [ { @@ -731,8 +708,8 @@ { "name": "shape", "node_position": { - "x": -580.281982, - "y": 291.324799 + "x": -583.281982, + "y": 248.324799 }, "parameters": { "edge": 1, @@ -746,7 +723,7 @@ "name": "pattern", "node_position": { "x": -646.281982, - "y": 452.324799 + "y": 447.324799 }, "parameters": { "mix": 0, @@ -804,8 +781,8 @@ { "name": "transform", "node_position": { - "x": -630.912109, - "y": 611.324829 + "x": -633.912109, + "y": 619.324829 }, "parameters": { "repeat": false, @@ -820,8 +797,8 @@ { "name": "gen_outputs", "node_position": { - "x": 113.718018, - "y": 533.074829 + "x": 146.718018, + "y": 576.074829 }, "parameters": { @@ -837,8 +814,8 @@ { "name": "colorize_2", "node_position": { - "x": -599.834045, - "y": 394.574799 + "x": -604.834045, + "y": 380.574799 }, "parameters": { "gradient": { @@ -874,8 +851,8 @@ { "name": "blend", "node_position": { - "x": -142.870667, - "y": 465.158081 + "x": -106.870667, + "y": 476.158081 }, "parameters": { "amount": 1, @@ -886,8 +863,8 @@ { "name": "colorize_3", "node_position": { - "x": -346.870667, - "y": 413.158081 + "x": -352.870667, + "y": 451.158081 }, "parameters": { "gradient": { @@ -916,8 +893,8 @@ { "name": "pattern_2", "node_position": { - "x": -364.870667, - "y": 744.158081 + "x": -368.870667, + "y": 749.158081 }, "parameters": { "mix": 0, @@ -968,8 +945,8 @@ { "name": "blend_2", "node_position": { - "x": -141.870667, - "y": 561.158081 + "x": -106.870667, + "y": 576.158081 }, "parameters": { "amount": 1, @@ -980,8 +957,8 @@ { "name": "mirror", "node_position": { - "x": -316.870667, - "y": 611.158081 + "x": -315.870667, + "y": 605.158081 }, "parameters": { "direction": 1, @@ -1089,12 +1066,12 @@ { "name": "shape", "node_position": { - "x": -604.145874, - "y": 279.741486 + "x": -607.145874, + "y": 269.741486 }, "parameters": { "edge": 1, - "radius": 0.264981, + "radius": 0.3, "shape": 0, "sides": 6 }, @@ -1166,7 +1143,7 @@ }, "parameters": { "param0": 7, - "param1": 0.264981 + "param1": 0.3 }, "type": "remote", "widgets": [ @@ -1236,7 +1213,6 @@ }, "parameters": { "count": 7, - "direction": 0, "offset": 0 }, "type": "kaleidoscope" @@ -1244,7 +1220,7 @@ ], "parameters": { "param0": 7, - "param1": 0.264981 + "param1": 0.3 }, "type": "graph" } @@ -1252,13 +1228,14 @@ "parameters": { }, + "seed_value": 53876, "type": "graph" }, { "name": "transform_2", "node_position": { - "x": -1063.855835, - "y": 370.619873 + "x": -1083.855835, + "y": 514.619873 }, "parameters": { "repeat": false, @@ -1273,8 +1250,8 @@ { "name": "transform_2_2", "node_position": { - "x": -832.475098, - "y": 370.055542 + "x": -1083.475098, + "y": 325.055542 }, "parameters": { "repeat": true, @@ -1304,8 +1281,8 @@ "label": "Flower2", "name": "graph_7", "node_position": { - "x": -952.17395, - "y": 292.142639 + "x": -1032.17395, + "y": 704.142639 }, "nodes": [ { @@ -1393,8 +1370,8 @@ { "name": "shape", "node_position": { - "x": -552.281982, - "y": 258.324799 + "x": -554.281982, + "y": 225.324799 }, "parameters": { "edge": 1, @@ -1422,8 +1399,8 @@ { "name": "colorize", "node_position": { - "x": -575.912109, - "y": 518.324829 + "x": -577.912109, + "y": 523.324829 }, "parameters": { "gradient": { @@ -1473,8 +1450,8 @@ { "name": "transform", "node_position": { - "x": -602.912109, - "y": 578.324829 + "x": -605.912109, + "y": 590.324829 }, "parameters": { "repeat": false, @@ -1506,8 +1483,8 @@ { "name": "colorize_2", "node_position": { - "x": -571.834045, - "y": 361.574799 + "x": -572.834045, + "y": 352.574799 }, "parameters": { "gradient": { @@ -1637,8 +1614,8 @@ { "name": "blend_2", "node_position": { - "x": -117.870667, - "y": 536.158081 + "x": -118.870667, + "y": 546.158081 }, "parameters": { "amount": 1, @@ -1725,8 +1702,8 @@ { "name": "transform_2", "node_position": { - "x": -651.912109, - "y": 396.324829 + "x": -650.912109, + "y": 409.324829 }, "parameters": { "repeat": false, @@ -1883,12 +1860,11 @@ { "name": "kaleidoscope", "node_position": { - "x": -612.808228, - "y": 591.706787 + "x": -611.808228, + "y": 604.706787 }, "parameters": { "count": 4, - "direction": 0, "offset": 0 }, "type": "kaleidoscope" @@ -1903,8 +1879,8 @@ { "name": "gen_outputs", "node_position": { - "x": -177.034424, - "y": 596.142639 + "x": -181.034424, + "y": 593.142639 }, "parameters": { @@ -1921,6 +1897,7 @@ "parameters": { }, + "seed_value": -30264, "type": "graph" }, { @@ -1991,7 +1968,7 @@ "name": "blend", "node_position": { "x": 14.376953, - "y": 246.5 + "y": 232.5 }, "parameters": { "amount": 1, @@ -2002,8 +1979,8 @@ { "name": "blend_3", "node_position": { - "x": 14.710419, - "y": 426.119873 + "x": 13.710419, + "y": 441.119873 }, "parameters": { "amount": 1, @@ -2061,13 +2038,14 @@ "parameters": { }, + "seed_value": -31817, "type": "graph" }, { "name": "colorize_2", "node_position": { - "x": -819.609863, - "y": 296.695862 + "x": -1057.609863, + "y": 261.695862 }, "parameters": { "gradient": { @@ -2096,8 +2074,8 @@ { "name": "perlin", "node_position": { - "x": -730.287415, - "y": -51.888901 + "x": -743.287415, + "y": -212.888901 }, "parameters": { "iterations": 7, @@ -2110,8 +2088,8 @@ { "name": "colorize_3", "node_position": { - "x": -494.287415, - "y": -28.888901 + "x": -714.287415, + "y": -86.888901 }, "parameters": { "gradient": { @@ -2140,8 +2118,8 @@ { "name": "transform_3", "node_position": { - "x": -1369.070557, - "y": 25.255157 + "x": -1256.070557, + "y": -258.744843 }, "parameters": { "repeat": false, diff --git a/material_maker/examples/materials.ptex b/material_maker/examples/materials.ptex index 4ebbeea..ea6ec45 100644 --- a/material_maker/examples/materials.ptex +++ b/material_maker/examples/materials.ptex @@ -327,8 +327,8 @@ "label": "Wood simple", "name": "graph_2", "node_position": { - "x": -1260.345703, - "y": -185.932098 + "x": -823.345703, + "y": -124.932098 }, "nodes": [ { @@ -556,7 +556,6 @@ "y": -49 }, "parameters": { - "Randomness": 0.5, "angle": 0, "layers": 5, "length": 0.02, @@ -696,8 +695,7 @@ }, "parameters": { "amount": 0.04, - "eps": 0.03, - "epsilon": 0 + "eps": 0.03 }, "shader_model": { "global": "", @@ -896,14 +894,7 @@ "y": -117.463135 }, "parameters": { - "color": { - "a": 1, - "b": 1, - "g": 1, - "r": 1, - "type": "Color" - }, - "name": 0 + }, "type": "combine" }, @@ -931,13 +922,10 @@ "y": 4.536865 }, "parameters": { - "amount": 0.5, "param0": 10, "param1": 1, "param2": 0, - "param3": 0, - "param4": 0, - "size": 4 + "param4": 0 }, "type": "normal_map" } @@ -1177,8 +1165,7 @@ "parameters": { "amount": 1, "format": 0, - "size": 11, - "type": 0 + "size": 11 }, "shader_model": { "code": "", @@ -1248,12 +1235,9 @@ "y": -29.916687 }, "parameters": { - "amount": 0.5, "param0": 11, "param1": 1, - "param2": 0, - "param3": 1, - "size": 4 + "param2": 0 }, "type": "remote", "widgets": [ @@ -1336,12 +1320,9 @@ } ], "parameters": { - "amount": 0.5, "param0": 11, "param1": 1, - "param2": 0, - "param3": 1, - "size": 4 + "param2": 0 }, "type": "graph" }, @@ -1527,7 +1508,6 @@ }, "parameters": { "param0": 10, - "param1": 50, "param2": 1 }, "type": "remote", @@ -1689,7 +1669,6 @@ ], "parameters": { "param0": 10, - "param1": 50, "param2": 1 }, "type": "graph" @@ -1799,7 +1778,6 @@ }, "parameters": { "param0": 0.25, - "param1": 10, "param2": 1 }, "type": "remote", @@ -1831,7 +1809,6 @@ ], "parameters": { "param0": 0.25, - "param1": 10, "param2": 1 }, "type": "graph" @@ -1884,8 +1861,8 @@ "label": "Metal", "name": "graph_2_2", "node_position": { - "x": -1257.244629, - "y": -432.490662 + "x": -820.244629, + "y": -371.490662 }, "nodes": [ { @@ -1962,14 +1939,7 @@ "y": -176.48642 }, "parameters": { - "color": { - "a": 1, - "b": 1, - "g": 1, - "r": 1, - "type": "Color" - }, - "name": 0 + }, "type": "combine" }, @@ -2211,8 +2181,8 @@ { "name": "switch", "node_position": { - "x": -670.527832, - "y": -352.071716 + "x": -512.527832, + "y": -343.071716 }, "parameters": { "choices": 3, @@ -2305,8 +2275,8 @@ "label": "Marble", "name": "graph_3_3_2", "node_position": { - "x": -1254.027832, - "y": -320.571716 + "x": -812.027832, + "y": -250.571716 }, "nodes": [ { @@ -2560,14 +2530,7 @@ "y": 39.197388 }, "parameters": { - "color": { - "a": 1, - "b": 1, - "g": 1, - "r": 1, - "type": "Color" - }, - "name": 0 + }, "type": "combine" }, @@ -2589,13 +2552,10 @@ "y": 186.780701 }, "parameters": { - "amount": 0.5, "param0": 11, "param1": 2, "param2": 0, - "param3": 0, - "param4": 0, - "size": 4 + "param4": 0 }, "type": "normal_map" }, @@ -2623,7 +2583,6 @@ "y": 149.637848 }, "parameters": { - "Randomness": 0.5, "angle": -1, "layers": 10, "length": 0.05, @@ -2900,8 +2859,8 @@ { "name": "uniform_greyscale", "node_position": { - "x": -486.94574, - "y": -385.608154 + "x": -539.94574, + "y": -423.608154 }, "parameters": { "color": 1 diff --git a/material_maker/examples/pile_of_bricks.ptex b/material_maker/examples/pile_of_bricks.ptex index d28e5eb..521c969 100644 --- a/material_maker/examples/pile_of_bricks.ptex +++ b/material_maker/examples/pile_of_bricks.ptex @@ -169,7 +169,7 @@ "name": "uniform", "node_position": { "x": 467.5, - "y": 84 + "y": 78 }, "parameters": { "color": { @@ -189,14 +189,9 @@ "y": -156 }, "parameters": { - "a": 0, "r": 0.3, "rx": 6, - "ry": 6, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 + "ry": 6 }, "type": "sdf3d_repeat" }, @@ -207,28 +202,18 @@ "y": 72 }, "parameters": { - "a": 0, - "s": 0.25, - "x": 0.35, - "y": 0, - "z": 0 + "s": 0.25 }, "type": "sdf3d_scale" }, { "name": "sdf3d_boolean_3", "node_position": { - "x": -16.214783, - "y": -56 + "x": -6.214783, + "y": -55 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdf3d_boolean" }, @@ -332,13 +317,7 @@ "y": -118 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 1 }, "type": "sdf3d_boolean" }, @@ -362,13 +341,7 @@ "y": -168.333344 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 1 }, "type": "sdf3d_boolean" }, @@ -430,14 +403,9 @@ "y": -52.060181 }, "parameters": { - "a": 0, "r": 0.3, "rx": 6, - "ry": 6, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 + "ry": 6 }, "type": "sdf3d_repeat" }, @@ -461,14 +429,9 @@ "y": 259.034729 }, "parameters": { - "a": 0, "r": 0.3, "rx": 6, - "ry": 6, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 + "ry": 6 }, "type": "sdf3d_repeat" }, @@ -479,14 +442,9 @@ "y": 155.09491 }, "parameters": { - "a": 0, "r": 0.3, "rx": 6, - "ry": 6, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 + "ry": 6 }, "type": "sdf3d_repeat" }, @@ -510,30 +468,18 @@ "y": 251.09491 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdf3d_boolean" }, { "name": "sdf3d_boolean_3_3", "node_position": { - "x": 183.957428, - "y": 120.689819 + "x": 195.957428, + "y": 116.689819 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdf3d_boolean" }, @@ -553,8 +499,8 @@ { "name": "sdf3d_translate_3_2_3", "node_position": { - "x": -19.542572, - "y": 10.189819 + "x": -26.542572, + "y": 18.189819 }, "parameters": { "x": 0.04, @@ -566,8 +512,8 @@ { "name": "raymarching", "node_position": { - "x": 187.457397, - "y": 303.189819 + "x": 184.457397, + "y": 297.189819 }, "parameters": { @@ -575,17 +521,321 @@ "type": "raymarching" }, { + "connections": [ + { + "from": "buffer", + "from_port": 0, + "to": "blurx_convolution", + "to_port": 0 + }, + { + "from": "buffer_2", + "from_port": 0, + "to": "blurx_convolution_2", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "buffer", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "blurx_convolution", + "from_port": 0, + "to": "buffer_2", + "to_port": 0 + }, + { + "from": "blurx_convolution_2", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "buffer", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Occlusion", "name": "occlusion", "node_position": { "x": 410.234558, - "y": 303.189819 + "y": 289.189819 }, + "nodes": [ + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(x/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 50, + "y": 0 + }, + "name": "blurx_convolution", + "node_position": { + "x": -407.5, + "y": -192.5 + }, + "parameters": { + "sigma": 50, + "size": 9 + }, + "type": "convolution" + }, + { + "name": "buffer_2", + "node_position": { + "x": -404.875, + "y": -116.625 + }, + "parameters": { + "lod": 0, + "size": 9 + }, + "type": "buffer" + }, + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(y/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 0, + "y": 50 + }, + "name": "blurx_convolution_2", + "node_position": { + "x": -407.125, + "y": -44.375 + }, + "parameters": { + "sigma": 50, + "size": 9 + }, + "type": "convolution" + }, + { + "name": "buffer", + "node_position": { + "x": -408.25, + "y": -265.75 + }, + "parameters": { + "lod": 0, + "size": 9 + }, + "type": "buffer" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -447.666626, + "y": -370.666656 + }, + "parameters": { + "param0": 9, + "param2": 5.2 + }, + "type": "remote", + "widgets": [ + { + "label": "Grid size:", + "linked_widgets": [ + { + "node": "buffer", + "widget": "size" + }, + { + "node": "blurx_convolution", + "widget": "size" + }, + { + "node": "buffer_2", + "widget": "size" + }, + { + "node": "blurx_convolution_2", + "widget": "size" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Strength", + "linked_widgets": [ + { + "node": "_2", + "widget": "g" + } + ], + "name": "param2", + "type": "linked_control" + } + ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -585.666626, + "y": -112.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 55.547607, + "y": -133.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "blend", + "node_position": { + "x": -420.79895, + "y": 27.16272 + }, + "parameters": { + "amount": 1, + "blend_type": 11 + }, + "type": "blend" + }, + { + "name": "colorize", + "node_position": { + "x": -167.79895, + "y": -178.83728 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "_2", + "node_position": { + "x": -134.403687, + "y": -110.29187 + }, + "parameters": { + "g": 5.2 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "", + "outputs": [ + { + "f": "pow($in($uv), $g)", + "type": "f" + } + ], + "parameters": [ + { + "default": 1, + "label": "", + "max": 2, + "min": 0, + "name": "g", + "step": 0.1, + "type": "float" + } + ] + }, + "type": "shader" + } + ], "parameters": { "param0": 9, - "param1": 50, "param2": 5.2 }, - "type": "occlusion" + "type": "graph" }, { "name": "colorize", diff --git a/material_maker/examples/skulls.ptex b/material_maker/examples/skulls.ptex index 424f826..21fd35c 100644 --- a/material_maker/examples/skulls.ptex +++ b/material_maker/examples/skulls.ptex @@ -30,36 +30,6 @@ "to": "Material", "to_port": 5 }, - { - "from": "sdf3d_scale", - "from_port": 0, - "to": "sdf3d_scale_2", - "to_port": 0 - }, - { - "from": "sdf3d_scale_2", - "from_port": 0, - "to": "sdf3d_boolean_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4", - "from_port": 0, - "to": "sdf3d_boolean_2", - "to_port": 1 - }, - { - "from": "sdf3d_scale", - "from_port": 0, - "to": "sdf3d_repeat", - "to_port": 0 - }, - { - "from": "sdf3d_repeat", - "from_port": 0, - "to": "sdf3d_translate_4", - "to_port": 0 - }, { "from": "perlin", "from_port": 0, @@ -85,59 +55,11 @@ "to_port": 0 }, { - "from": "graph_2", - "from_port": 0, - "to": "sdf3d_scale_3", - "to_port": 0 - }, - { - "from": "sdf3d_scale_3", - "from_port": 0, - "to": "sdf3d_repeat_2", - "to_port": 0 - }, - { - "from": "sdf3d_boolean_2", + "from": "graph", "from_port": 0, "to": "sdf3d_boolean_2_2", "to_port": 0 }, - { - "from": "sdf3d_repeat_2", - "from_port": 0, - "to": "sdf3d_translate_4_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_2", - "from_port": 0, - "to": "sdf3d_boolean_2_2", - "to_port": 1 - }, - { - "from": "sdf3d_repeat_2_2", - "from_port": 0, - "to": "sdf3d_translate_4_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_scale_3", - "from_port": 0, - "to": "sdf3d_repeat_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_boolean_2_2", - "from_port": 0, - "to": "sdf3d_boolean_2_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_2_2", - "from_port": 0, - "to": "sdf3d_boolean_2_2_2", - "to_port": 1 - }, { "from": "blend_2", "from_port": 0, @@ -162,12 +84,6 @@ "to": "blend_2", "to_port": 2 }, - { - "from": "graph_3", - "from_port": 0, - "to": "sdf3d_scale", - "to_port": 0 - }, { "from": "buffer", "from_port": 0, @@ -216,12 +132,6 @@ "to": "blend", "to_port": 2 }, - { - "from": "sdf3d_boolean_2_2_2", - "from_port": 0, - "to": "raymarching", - "to_port": 0 - }, { "from": "raymarching", "from_port": 0, @@ -233,6 +143,18 @@ "from_port": 1, "to": "blend_2", "to_port": 0 + }, + { + "from": "graph_3", + "from_port": 0, + "to": "sdf3d_boolean_2_2", + "to_port": 1 + }, + { + "from": "sdf3d_boolean_2_2", + "from_port": 0, + "to": "raymarching", + "to_port": 0 } ], "label": "Graph", @@ -245,8 +167,8 @@ { "name": "Material", "node_position": { - "x": 390, - "y": 1354 + "x": 356, + "y": 1343 }, "parameters": { "albedo_color": { @@ -270,8 +192,8 @@ { "name": "perlin", "node_position": { - "x": -385.399658, - "y": 1196.349854 + "x": -404.399658, + "y": 1199.349854 }, "parameters": { "iterations": 5, @@ -284,8 +206,8 @@ { "name": "colorize", "node_position": { - "x": -347.399658, - "y": 1342.349976 + "x": -371.399658, + "y": 1324.349976 }, "parameters": { "gradient": { @@ -314,8 +236,8 @@ { "name": "colorize_2", "node_position": { - "x": -126.553131, - "y": 1179.272949 + "x": -120, + "y": 1180 }, "parameters": { "gradient": { @@ -344,8 +266,8 @@ { "name": "uniform_greyscale", "node_position": { - "x": 138.446899, - "y": 1239.272949 + "x": 122.446899, + "y": 1231.272949 }, "parameters": { "color": 0.31 @@ -355,8 +277,8 @@ { "name": "colorize_3", "node_position": { - "x": 38.446899, - "y": 1686.272949 + "x": 45.446899, + "y": 1704.272949 }, "parameters": { "gradient": { @@ -382,154 +304,23 @@ }, "type": "colorize" }, - { - "name": "sdf3d_scale", - "node_position": { - "x": -994.911377, - "y": 1248.772949 - }, - "parameters": { - "a": 0, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_scale" - }, - { - "name": "sdf3d_scale_2", - "node_position": { - "x": -811.183411, - "y": 1198.851807 - }, - "parameters": { - "a": 0, - "r": 0.25, - "rx": 4, - "ry": 4, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 - }, - "shader_model": { - "code": "", - "global": "vec3 repeat(vec3 p, vec3 r, float seed, float randomness) {\n\tvec3 a = (rand3(floor(mod((p.xy+0.5*r.xy)/r.xy, 1.0/r.xy)+vec2(seed)))-0.5)*6.28*randomness;\n\tp = mod(p+0.5*r,r)-0.5*r;\n\tvec3 rv;\n\tfloat c;\n\tfloat s;\n\tc = cos(a.x);\n\ts = sin(a.x);\n\trv.x = p.x;\n\trv.y = p.y*c+p.z*s;\n\trv.z = -p.y*s+p.z*c;\n\tc = cos(a.y);\n\ts = sin(a.y);\n\tp.x = rv.x*c+rv.z*s;\n\tp.y = rv.y;\n\tp.z = -rv.x*s+rv.z*c;\n\tc = cos(a.z);\n\ts = sin(a.z);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "sdf3d" - } - ], - "instance": "", - "name": "Repeat", - "outputs": [ - { - "sdf3d": "$in(repeat($uv, vec3(1.0/$rx, 1.0/$ry, 0.0), $seed, $r))", - "type": "sdf3d" - } - ], - "parameters": [ - { - "default": 4, - "label": "X", - "max": 32, - "min": 1, - "name": "rx", - "step": 1, - "type": "float" - }, - { - "default": 4, - "label": "Y", - "max": 32, - "min": 1, - "name": "ry", - "step": 1, - "type": "float" - }, - { - "default": 0.5, - "label": "R", - "max": 1, - "min": 0, - "name": "r", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" - }, { "name": "occlusion", "node_position": { - "x": 12.088623, - "y": 1608.272949 + "x": 19.088623, + "y": 1626.272949 }, "parameters": { "param0": 10, - "param1": 50, "param2": 15 }, "type": "occlusion" }, - { - "name": "sdf3d_translate_4", - "node_position": { - "x": -813.195313, - "y": 1400.797363 - }, - "parameters": { - "x": 0.4, - "y": 0.35, - "z": 0 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_boolean_2", - "node_position": { - "x": -622.79303, - "y": 1304.297363 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_boolean" - }, - { - "name": "sdf3d_repeat", - "node_position": { - "x": -812.79303, - "y": 1300.297363 - }, - "parameters": { - "a": 0, - "r": 0.25, - "rx": 4, - "ry": 4, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_repeat" - }, { "name": "colorize_4", "node_position": { - "x": -128.79303, - "y": 1246.013184 + "x": -120, + "y": 1246 }, "parameters": { "gradient": { @@ -558,8 +349,8 @@ { "name": "colorize_5", "node_position": { - "x": -147.127869, - "y": 1324.013184 + "x": -120.127869, + "y": 1312.013184 }, "parameters": { "gradient": { @@ -588,8 +379,8 @@ { "name": "blend", "node_position": { - "x": 126.872131, - "y": 1141.013184 + "x": 117.872131, + "y": 1129.013184 }, "parameters": { "amount": 0.5, @@ -597,464 +388,14 @@ }, "type": "blend" }, - { - "name": "sdf3d_repeat_2", - "node_position": { - "x": -931.880676, - "y": 1576.431152 - }, - "parameters": { - "a": 0, - "r": 0.46, - "rx": 4, - "ry": 4, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_repeat" - }, - { - "connections": [ - { - "from": "sdf3d_sphere_2", - "from_port": 0, - "to": "sdf3d_translate_4_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_sphere_2_2", - "from_port": 0, - "to": "sdf3d_translate_4_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_2_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3", - "to_port": 1 - }, - { - "from": "sdf3d_smoothboolean_3", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2", - "to_port": 0 - }, - { - "from": "sdf3d_sphere_2_2_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2", - "to_port": 1 - }, - { - "from": "sdf3d_sphere_2_2_3", - "from_port": 0, - "to": "sdf3d_translate_4_2_3", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3_2", - "from_port": 0, - "to": "sdf3d_boolean_2_2", - "to_port": 1 - }, - { - "from": "sdf3d_translate_4_2_3", - "from_port": 0, - "to": "sdf3d_boolean_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_boolean_2_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - } - ], - "label": "Bone", - "name": "graph_2", - "node_position": { - "x": -1109.480713, - "y": 1577.556274 - }, - "nodes": [ - { - "name": "sdf3d_translate_4_2_2", - "node_position": { - "x": -935.880676, - "y": 1383.431152 - }, - "parameters": { - "x": -0.03, - "y": -0.22, - "z": 0 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_sphere_2", - "node_position": { - "x": -930.880676, - "y": 1327.931152 - }, - "parameters": { - "r": 0.03 - }, - "type": "sdf3d_sphere" - }, - { - "name": "sdf3d_sphere_2_2_2", - "node_position": { - "x": -937.880676, - "y": 1638.431152 - }, - "parameters": { - "h": 0.4, - "r": 0.025 - }, - "shader_model": { - "code": "vec3 $(name_uv)_p = $uv;\n$(name_uv)_p.y -= clamp($(name_uv)_p.y, -0.5*$h, 0.5*$h);\n", - "global": "", - "inputs": [ - - ], - "instance": "", - "name": "Sphere", - "outputs": [ - { - "sdf3d": "length($(name_uv)_p)-$r", - "type": "sdf3d" - } - ], - "parameters": [ - { - "default": 0.5, - "label": "H", - "max": 1, - "min": 0, - "name": "h", - "step": 0.01, - "type": "float" - }, - { - "default": 0.1, - "label": "R", - "max": 0.5, - "min": 0, - "name": "r", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "sdf3d_smoothboolean_3_2", - "node_position": { - "x": -744.380676, - "y": 1604.931152 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.02, - "op": 0, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_smoothboolean" - }, - { - "name": "sdf3d_smoothboolean_3", - "node_position": { - "x": -744.880676, - "y": 1527.931152 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.01, - "op": 0, - "r": 0.3, - "w": 0.28 - }, - "shader_model": { - "code": "", - "global": "float sdf3SmoothUnion(float d1, float d2, float k) {\n float h = clamp(0.5+0.5*(d2-d1)/k, 0.0, 1.0);\n return mix(d2, d1, h)-k*h*(1.0-h);\n}\n\nfloat sdf3SmoothSubtraction( float d1, float d2, float k ) {\n float h = clamp(0.5-0.5*(d2+d1)/k, 0.0, 1.0);\n return mix( d2, -d1, h )+k*h*(1.0-h);\n}\n\nfloat sdf3SmoothIntersection( float d1, float d2, float k ) {\n float h = clamp(0.5-0.5*(d2-d1)/k, 0.0, 1.0);\n return mix(d2, d1, h)+k*h*(1.0-h);\n}\n", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in1", - "type": "sdf3d" - }, - { - "default": "0.0", - "label": "", - "name": "in2", - "type": "sdf3d" - } - ], - "instance": "", - "name": "sdSmoothBoolean", - "outputs": [ - { - "sdf3d": "sdf3Smooth$op($in1($uv), $in2($uv), $k)", - "type": "sdf3d" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "name": "op", - "type": "enum", - "values": [ - { - "name": "Union", - "value": "Union" - }, - { - "name": "Subtraction", - "value": "Subtraction" - }, - { - "name": "Intersection", - "value": "Intersection" - } - ] - }, - { - "default": 0, - "label": "", - "max": 1, - "min": 0, - "name": "k", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "sdf3d_sphere_2_2", - "node_position": { - "x": -929.880676, - "y": 1483.431152 - }, - "parameters": { - "r": 0.04 - }, - "type": "sdf3d_sphere" - }, - { - "name": "sdf3d_translate_4_2", - "node_position": { - "x": -934.880676, - "y": 1534.431152 - }, - "parameters": { - "x": 0.02, - "y": -0.25, - "z": 0 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_translate_4_2_3", - "node_position": { - "x": -936.380676, - "y": 1792.181152 - }, - "parameters": { - "x": -0.04, - "y": 0.21, - "z": 0 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_sphere_2_2_3", - "node_position": { - "x": -931.380676, - "y": 1741.181152 - }, - "parameters": { - "r": 0.06 - }, - "type": "sdf3d_sphere" - }, - { - "name": "sdf3d_boolean_2_2", - "node_position": { - "x": -747.380676, - "y": 1680.681152 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 1, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_boolean" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -1237.880615, - "y": 1568.556274 - }, - "parameters": { - - }, - "ports": [ - - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": -447.380676, - "y": 1568.556274 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "sdf3d" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -1079.480713, - "y": 1027.931152 - }, - "parameters": { - - }, - "type": "remote", - "widgets": [ - - ] - } - ], - "parameters": { - - }, - "type": "graph" - }, - { - "name": "sdf3d_scale_3", - "node_position": { - "x": -1130.764893, - "y": 1621.628418 - }, - "parameters": { - "a": 0, - "s": 0.4, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_scale" - }, { "name": "sdf3d_boolean_2_2", "node_position": { - "x": -546.264893, - "y": 1515.128418 + "x": -716.264893, + "y": 1477.128418 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_boolean" - }, - { - "name": "sdf3d_translate_4_2", - "node_position": { - "x": -753.844666, - "y": 1576.628418 - }, - "parameters": { - "x": 0.35, - "y": 0.52, - "z": 0.02 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_repeat_2_2", - "node_position": { - "x": -936.362671, - "y": 1681.529785 - }, - "parameters": { - "a": 0, - "r": 0.5, - "rx": 4, - "ry": 4, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_repeat" - }, - { - "name": "sdf3d_translate_4_2_2", - "node_position": { - "x": -753.32666, - "y": 1681.727051 - }, - "parameters": { - "x": 0.51, - "y": 0.38, - "z": 0.02 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_boolean_2_2_2", - "node_position": { - "x": -546.344666, - "y": 1580.128418 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdf3d_boolean" }, @@ -1065,21 +406,18 @@ "y": 1392.238892 }, "parameters": { - "amount": 0.5, "param0": 11, "param1": 1.02, "param2": 0, - "param3": 0, - "param4": 1, - "size": 4 + "param4": 1 }, "type": "normal_map" }, { "name": "blend_2", "node_position": { - "x": 23.85556, - "y": 1485.238892 + "x": 30.85556, + "y": 1522.238892 }, "parameters": { "amount": 1, @@ -1117,481 +455,884 @@ }, "type": "colorize" }, + { + "name": "buffer", + "node_position": { + "x": -382.830994, + "y": 1550.222534 + }, + "parameters": { + "lod": 0, + "size": 11 + }, + "type": "buffer" + }, + { + "name": "blend_3", + "node_position": { + "x": 116.334427, + "y": 1285.834595 + }, + "parameters": { + "amount": 1, + "blend_type": 3 + }, + "type": "blend" + }, + { + "name": "raymarching", + "node_position": { + "x": -563.992065, + "y": 1480.176514 + }, + "parameters": { + + }, + "type": "raymarching" + }, { "connections": [ { - "from": "sdf3d_sphere_2", + "from": "sdf3d_scale", "from_port": 0, - "to": "sdf3d_translate_4", + "to": "sdf3d_scale_2", "to_port": 0 }, { - "from": "sdf3d_translate_4_2", + "from": "sdf3d_scale_2", "from_port": 0, - "to": "sdf3d_smoothboolean_3", + "to": "sdf3d_boolean_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4", + "from_port": 0, + "to": "sdf3d_boolean_2", "to_port": 1 }, { "from": "sdf3d_scale", "from_port": 0, - "to": "sdf3d_translate_4_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2", - "to_port": 1 - }, - { - "from": "sdf3d_translate_4_2_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2", - "to_port": 0 - }, - { - "from": "sdf3d_sphere_2_2", - "from_port": 0, - "to": "sdf3d_translate_4_3", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_3", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_2", - "to_port": 1 - }, - { - "from": "sdf3d_sphere_2_2_2", - "from_port": 0, - "to": "sdf3d_translate_4_3_2", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3_2_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_3", - "to_port": 1 - }, - { - "from": "sdf3d_translate_4_3_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_3", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3_2_3", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_3_2", - "to_port": 1 - }, - { - "from": "sdf3d_box_2", - "from_port": 0, - "to": "sdf3d_rotate_2", - "to_port": 0 - }, - { - "from": "sdf3d_rotate_2", - "from_port": 0, - "to": "sdf3d_translate_4_3_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_3_2_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_3_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_3_2_2_2", - "from_port": 0, "to": "sdf3d_repeat", "to_port": 0 }, - { - "from": "sdf3d_rotate_2_2_2", - "from_port": 0, - "to": "sdf3d_translate_4_3_2_2_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_cylinder", - "from_port": 0, - "to": "sdf3d_translate_4_2", - "to_port": 0 - }, - { - "from": "sdf3d_cylinder", - "from_port": 0, - "to": "sdf3d_scale", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3_3", - "from_port": 0, - "to": "sdf3d_smoothboolean_3", - "to_port": 0 - }, - { - "from": "sdf3d_sphere_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_3", - "to_port": 1 - }, - { - "from": "sdf3d_translate_4", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_3", - "to_port": 0 - }, - { - "from": "sdf3d_box_2_2", - "from_port": 0, - "to": "sdf3d_rotate_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_box_2_2", - "from_port": 0, - "to": "sdf3d_translate_4_3_2_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3_2_3_2", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_3_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_smoothboolean_3_2_3_2_2", - "from_port": 0, - "to": "sdf3d_translate_4_3_3", - "to_port": 0 - }, - { - "from": "sdf3d_sphere_2_3", - "from_port": 0, - "to": "sdf3d_translate_4_3_2_2_2_3", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_3_2_2_2_3", - "from_port": 0, - "to": "sdf3d_boolean", - "to_port": 0 - }, - { - "from": "sdf3d_boolean", - "from_port": 0, - "to": "sdf3d_rotate_2_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_4_3_2_2_2_2", - "from_port": 0, - "to": "sdroundedshape", - "to_port": 0 - }, - { - "from": "sdroundedshape", - "from_port": 0, - "to": "sdf3d_smoothboolean_3_2_3_2_2", - "to_port": 1 - }, { "from": "sdf3d_repeat", "from_port": 0, - "to": "sdf3d_rotate_2_2_3", + "to": "sdf3d_translate_4", "to_port": 0 }, { - "from": "sdf3d_rotate_2_2_3", - "from_port": 0, - "to": "sdf3d_boolean", - "to_port": 1 - }, - { - "from": "sdf3d_translate_4_3_3", + "from": "sdf3d_boolean_2", "from_port": 0, "to": "gen_outputs", "to_port": 0 + }, + { + "from": "graph_3", + "from_port": 0, + "to": "sdf3d_scale", + "to_port": 0 } ], - "label": "Skull", - "name": "graph_3", + "label": "Skulls", + "name": "graph", "node_position": { - "x": -960.932495, - "y": 1204.712646 + "x": -875.801453, + "y": 1470.12146 }, "nodes": [ - { - "name": "sdf3d_smoothboolean_3", - "node_position": { - "x": -841.989258, - "y": 938.422729 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.04, - "op": 0, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_smoothboolean" - }, { "name": "sdf3d_translate_4", "node_position": { - "x": -1309.989258, - "y": 736.422729 + "x": -987.195313, + "y": 1473.797363 }, "parameters": { - "x": 0.52, - "y": -0.22, + "x": 0.4, + "y": 0.35, "z": 0 }, "type": "sdf3d_translate" }, { - "name": "sdf3d_smoothboolean_3_2", + "connections": [ + { + "from": "sdf3d_sphere_2", + "from_port": 0, + "to": "sdf3d_translate_4", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3", + "to_port": 1 + }, + { + "from": "sdf3d_scale", + "from_port": 0, + "to": "sdf3d_translate_4_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2", + "to_port": 1 + }, + { + "from": "sdf3d_translate_4_2_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2", + "to_port": 0 + }, + { + "from": "sdf3d_sphere_2_2", + "from_port": 0, + "to": "sdf3d_translate_4_3", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_3", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_2", + "to_port": 1 + }, + { + "from": "sdf3d_sphere_2_2_2", + "from_port": 0, + "to": "sdf3d_translate_4_3_2", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3_2_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_3", + "to_port": 1 + }, + { + "from": "sdf3d_translate_4_3_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_3", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3_2_3", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_3_2", + "to_port": 1 + }, + { + "from": "sdf3d_box_2", + "from_port": 0, + "to": "sdf3d_rotate_2", + "to_port": 0 + }, + { + "from": "sdf3d_rotate_2", + "from_port": 0, + "to": "sdf3d_translate_4_3_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_3_2_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_3_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_3_2_2_2", + "from_port": 0, + "to": "sdf3d_repeat", + "to_port": 0 + }, + { + "from": "sdf3d_rotate_2_2_2", + "from_port": 0, + "to": "sdf3d_translate_4_3_2_2_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_cylinder", + "from_port": 0, + "to": "sdf3d_translate_4_2", + "to_port": 0 + }, + { + "from": "sdf3d_cylinder", + "from_port": 0, + "to": "sdf3d_scale", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3_3", + "from_port": 0, + "to": "sdf3d_smoothboolean_3", + "to_port": 0 + }, + { + "from": "sdf3d_sphere_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_3", + "to_port": 1 + }, + { + "from": "sdf3d_translate_4", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_3", + "to_port": 0 + }, + { + "from": "sdf3d_box_2_2", + "from_port": 0, + "to": "sdf3d_rotate_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_box_2_2", + "from_port": 0, + "to": "sdf3d_translate_4_3_2_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3_2_3_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_3_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3_2_3_2_2", + "from_port": 0, + "to": "sdf3d_translate_4_3_3", + "to_port": 0 + }, + { + "from": "sdf3d_sphere_2_3", + "from_port": 0, + "to": "sdf3d_translate_4_3_2_2_2_3", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_3_2_2_2_3", + "from_port": 0, + "to": "sdf3d_boolean", + "to_port": 0 + }, + { + "from": "sdf3d_boolean", + "from_port": 0, + "to": "sdf3d_rotate_2_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_3_2_2_2_2", + "from_port": 0, + "to": "sdroundedshape", + "to_port": 0 + }, + { + "from": "sdroundedshape", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2_3_2_2", + "to_port": 1 + }, + { + "from": "sdf3d_repeat", + "from_port": 0, + "to": "sdf3d_rotate_2_2_3", + "to_port": 0 + }, + { + "from": "sdf3d_rotate_2_2_3", + "from_port": 0, + "to": "sdf3d_boolean", + "to_port": 1 + }, + { + "from": "sdf3d_translate_4_3_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Skull", + "name": "graph_3", "node_position": { - "x": -629.489258, - "y": 873.422729 + "x": -1141.932495, + "y": 1276.712646 }, + "nodes": [ + { + "name": "sdf3d_smoothboolean_3", + "node_position": { + "x": -841.989258, + "y": 938.422729 + }, + "parameters": { + "k": 0.04, + "op": 0 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_translate_4", + "node_position": { + "x": -1309.989258, + "y": 736.422729 + }, + "parameters": { + "x": 0.52, + "y": -0.22, + "z": 0 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_smoothboolean_3_2", + "node_position": { + "x": -629.489258, + "y": 873.422729 + }, + "parameters": { + "k": 0.17, + "op": 1 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_sphere_2_2", + "node_position": { + "x": -830.318359, + "y": 1023.672852 + }, + "parameters": { + "r": 0.07 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_translate_4_3", + "node_position": { + "x": -834.318359, + "y": 1078.672852 + }, + "parameters": { + "x": 0.13, + "y": -0.04, + "z": 0.18 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_sphere_2_2_2", + "node_position": { + "x": -831.318359, + "y": 1179.672852 + }, + "parameters": { + "r": 0.08 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_sphere_2", + "node_position": { + "x": -1297.989258, + "y": 844.922729 + }, + "parameters": { + "r": 0.28 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_box_2", + "node_position": { + "x": -855.193726, + "y": 1338.172852 + }, + "parameters": { + "r": 0, + "sx": 0.05, + "sy": 0.05, + "sz": 0.05 + }, + "type": "sdf3d_box" + }, + { + "name": "sdf3d_translate_4_3_2", + "node_position": { + "x": -834.318359, + "y": 1232.672852 + }, + "parameters": { + "x": 0.12, + "y": -0.03, + "z": 0.18 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_rotate_2", + "node_position": { + "x": -839.193726, + "y": 1471.172852 + }, + "parameters": { + "ax": -30, + "ay": 45, + "az": 0 + }, + "type": "sdf3d_rotate" + }, + { + "name": "sdf3d_translate_4_3_2_2", + "node_position": { + "x": -835.193726, + "y": 1573.172852 + }, + "parameters": { + "x": 0, + "y": 0.11, + "z": 0.19 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_smoothboolean_3_2_3", + "node_position": { + "x": -623.818359, + "y": 1236.172852 + }, + "parameters": { + "k": 0.09, + "op": 1 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_smoothboolean_3_2_2", + "node_position": { + "x": -622.818359, + "y": 1073.172852 + }, + "parameters": { + "k": 0.15, + "op": 0 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_translate_4_2_2", + "node_position": { + "x": -832.989258, + "y": 826.922729 + }, + "parameters": { + "x": 0, + "y": 0.24, + "z": 0.01 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_scale", + "node_position": { + "x": -823.989258, + "y": 776.422729 + }, + "parameters": { + "s": 0.48 + }, + "type": "sdf3d_scale" + }, + { + "name": "sdf3d_smoothboolean_3_2_3_2", + "node_position": { + "x": -602.693726, + "y": 1454.672852 + }, + "parameters": { + "k": 0.03, + "op": 1 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_translate_4_2", + "node_position": { + "x": -1141.989258, + "y": 1070.922729 + }, + "parameters": { + "x": 0, + "y": 0.21, + "z": 0.08 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_translate_4_3_3", + "node_position": { + "x": -363.318359, + "y": 1762.672852 + }, + "parameters": { + + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Mirror", + "outputs": [ + { + "sdf3d": "$in(vec3(abs($uv.x), $uv.y, $uv.z))", + "type": "sdf3d" + } + ], + "parameters": [ + + ] + }, + "type": "shader" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1375.989258, + "y": 1121.935181 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -194.318359, + "y": 1767.935181 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "sdf3d" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -1028.995361, + "y": 476.422729 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] + }, + { + "name": "sdf3d_translate_4_3_2_2_2", + "node_position": { + "x": -1172.482544, + "y": 1931.119385 + }, + "parameters": { + "x": 0, + "y": 0.14, + "z": 0 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_rotate_2_2", + "node_position": { + "x": -1172.482544, + "y": 1829.119385 + }, + "parameters": { + "ax": 0, + "ay": 0, + "az": 45 + }, + "type": "sdf3d_rotate" + }, + { + "name": "sdf3d_repeat", + "node_position": { + "x": -1166.482544, + "y": 2035.119385 + }, + "parameters": { + "c": 15 + }, + "shader_model": { + "code": "", + "global": "vec3 circle_repeat_transform(vec3 p, float count) {\n\tfloat r = 6.28/count;\n\tfloat pa = atan(p.x, p.y);\n\tfloat a = mod(pa+0.5*r, r)-0.5*r;\n\tvec3 rv;\n\tfloat c = cos(a-pa);\n\tfloat s = sin(a-pa);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Circle Repeat", + "outputs": [ + { + "sdf3d": "$in(circle_repeat_transform($uv, $c))", + "type": "sdf3d" + } + ], + "parameters": [ + { + "default": 4, + "label": "", + "max": 32, + "min": 1, + "name": "c", + "step": 1, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_rotate_2_2_2", + "node_position": { + "x": -791.235718, + "y": 1859.869385 + }, + "parameters": { + "ax": -90, + "ay": 0, + "az": 0 + }, + "type": "sdf3d_rotate" + }, + { + "name": "sdf3d_translate_4_3_2_2_2_2", + "node_position": { + "x": -788.235718, + "y": 1967.869385 + }, + "parameters": { + "x": 0, + "y": 0.315, + "z": 0.08 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_cylinder", + "node_position": { + "x": -1161, + "y": 994.5 + }, + "parameters": { + "l": 0.06, + "r": 0.15 + }, + "type": "sdf3d_cylinder" + }, + { + "name": "sdf3d_smoothboolean_3_3", + "node_position": { + "x": -1104.305908, + "y": 815.75 + }, + "parameters": { + "k": 0.1, + "op": 1 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_box_2_2", + "node_position": { + "x": -1190.880981, + "y": 1701 + }, + "parameters": { + "r": 0, + "sx": 0.01, + "sy": 0.01, + "sz": 0.015 + }, + "type": "sdf3d_box" + }, + { + "name": "sdf3d_smoothboolean_3_2_3_2_2", + "node_position": { + "x": -562.468933, + "y": 1761.75 + }, + "parameters": { + "k": 0.05, + "op": 0 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_sphere_2_3", + "node_position": { + "x": -1165.397095, + "y": 2204.25 + }, + "parameters": { + "r": 0.28 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_translate_4_3_2_2_2_3", + "node_position": { + "x": -1175.397095, + "y": 2261.5 + }, + "parameters": { + "x": 0, + "y": 0.28, + "z": 0 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_boolean", + "node_position": { + "x": -990.397095, + "y": 2076 + }, + "parameters": { + "op": 2 + }, + "type": "sdf3d_boolean" + }, + { + "name": "sdroundedshape", + "node_position": { + "x": -794.225342, + "y": 2070.75 + }, + "parameters": { + "r": 0.01 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Rounded", + "outputs": [ + { + "sdf3d": "$in($uv)-$r", + "type": "sdf3d" + } + ], + "parameters": [ + { + "default": 0, + "label": "", + "max": 1, + "min": 0, + "name": "r", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_rotate_2_2_3", + "node_position": { + "x": -1172.268311, + "y": 2085.75 + }, + "parameters": { + "ax": 0, + "ay": 0, + "az": 11 + }, + "type": "sdf3d_rotate" + } + ], "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.17, - "op": 1, - "r": 0.3, - "w": 0.28 + }, - "type": "sdf3d_smoothboolean" - }, - { - "name": "sdf3d_sphere_2_2", - "node_position": { - "x": -830.318359, - "y": 1023.672852 - }, - "parameters": { - "r": 0.07 - }, - "type": "sdf3d_sphere" - }, - { - "name": "sdf3d_translate_4_3", - "node_position": { - "x": -834.318359, - "y": 1078.672852 - }, - "parameters": { - "x": 0.13, - "y": -0.04, - "z": 0.18 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_sphere_2_2_2", - "node_position": { - "x": -831.318359, - "y": 1179.672852 - }, - "parameters": { - "r": 0.08 - }, - "type": "sdf3d_sphere" - }, - { - "name": "sdf3d_sphere_2", - "node_position": { - "x": -1297.989258, - "y": 844.922729 - }, - "parameters": { - "r": 0.28 - }, - "type": "sdf3d_sphere" - }, - { - "name": "sdf3d_box_2", - "node_position": { - "x": -855.193726, - "y": 1338.172852 - }, - "parameters": { - "r": 0, - "sx": 0.05, - "sy": 0.05, - "sz": 0.05 - }, - "type": "sdf3d_box" - }, - { - "name": "sdf3d_translate_4_3_2", - "node_position": { - "x": -834.318359, - "y": 1232.672852 - }, - "parameters": { - "x": 0.12, - "y": -0.03, - "z": 0.18 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_rotate_2", - "node_position": { - "x": -839.193726, - "y": 1471.172852 - }, - "parameters": { - "a": 0, - "ax": -30, - "ay": 45, - "az": 0, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_rotate" - }, - { - "name": "sdf3d_translate_4_3_2_2", - "node_position": { - "x": -835.193726, - "y": 1573.172852 - }, - "parameters": { - "x": 0, - "y": 0.11, - "z": 0.19 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_smoothboolean_3_2_3", - "node_position": { - "x": -623.818359, - "y": 1236.172852 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.09, - "op": 1, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_smoothboolean" - }, - { - "name": "sdf3d_smoothboolean_3_2_2", - "node_position": { - "x": -622.818359, - "y": 1073.172852 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.15, - "op": 0, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_smoothboolean" - }, - { - "name": "sdf3d_translate_4_2_2", - "node_position": { - "x": -832.989258, - "y": 826.922729 - }, - "parameters": { - "x": 0, - "y": 0.24, - "z": 0.01 - }, - "type": "sdf3d_translate" + "type": "graph" }, { "name": "sdf3d_scale", "node_position": { - "x": -823.989258, - "y": 776.422729 + "x": -1151.911377, + "y": 1325.772949 }, "parameters": { - "a": 0, - "s": 0.48, - "x": 0.35, - "y": 0, - "z": 0 + "s": 0.3 }, "type": "sdf3d_scale" }, { - "name": "sdf3d_smoothboolean_3_2_3_2", + "name": "sdf3d_boolean_2", "node_position": { - "x": -602.693726, - "y": 1454.672852 + "x": -793.79303, + "y": 1373.297363 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.03, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 0 }, - "type": "sdf3d_smoothboolean" + "type": "sdf3d_boolean" }, { - "name": "sdf3d_translate_4_2", + "name": "sdf3d_scale_2", "node_position": { - "x": -1141.989258, - "y": 1070.922729 + "x": -985.183411, + "y": 1271.851807 }, "parameters": { - "x": 0, - "y": 0.21, - "z": 0.08 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_translate_4_3_3", - "node_position": { - "x": -363.318359, - "y": 1762.672852 - }, - "parameters": { - "x": 0.15, - "y": 0, - "z": 0.18 + "r": 0.25, + "rx": 4, + "ry": 4 }, "shader_model": { "code": "", - "global": "", + "global": "vec3 repeat(vec3 p, vec3 r, float seed, float randomness) {\n\tvec3 a = (rand3(floor(mod((p.xy+0.5*r.xy)/r.xy, 1.0/r.xy)+vec2(seed)))-0.5)*6.28*randomness;\n\tp = mod(p+0.5*r,r)-0.5*r;\n\tvec3 rv;\n\tfloat c;\n\tfloat s;\n\tc = cos(a.x);\n\ts = sin(a.x);\n\trv.x = p.x;\n\trv.y = p.y*c+p.z*s;\n\trv.z = -p.y*s+p.z*c;\n\tc = cos(a.y);\n\ts = sin(a.y);\n\tp.x = rv.x*c+rv.z*s;\n\tp.y = rv.y;\n\tp.z = -rv.x*s+rv.z*c;\n\tc = cos(a.z);\n\ts = sin(a.z);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n", "inputs": [ { "default": "0.0", @@ -1601,24 +1342,63 @@ } ], "instance": "", - "name": "Mirror", + "name": "Repeat", "outputs": [ { - "sdf3d": "$in(vec3(abs($uv.x), $uv.y, $uv.z))", + "sdf3d": "$in(repeat($uv, vec3(1.0/$rx, 1.0/$ry, 0.0), $seed, $r))", "type": "sdf3d" } ], "parameters": [ - + { + "default": 4, + "label": "X", + "max": 32, + "min": 1, + "name": "rx", + "step": 1, + "type": "float" + }, + { + "default": 4, + "label": "Y", + "max": 32, + "min": 1, + "name": "ry", + "step": 1, + "type": "float" + }, + { + "default": 0.5, + "label": "R", + "max": 1, + "min": 0, + "name": "r", + "step": 0.01, + "type": "float" + } ] }, "type": "shader" }, + { + "name": "sdf3d_repeat", + "node_position": { + "x": -986.79303, + "y": 1373.297363 + }, + "parameters": { + "r": 0.25, + "rx": 4, + "ry": 4 + }, + "type": "sdf3d_repeat" + }, { "name": "gen_inputs", "node_position": { - "x": -1375.989258, - "y": 1121.935181 + "x": -1451.911377, + "y": 1349.12146 }, "parameters": { @@ -1631,8 +1411,8 @@ { "name": "gen_outputs", "node_position": { - "x": -194.318359, - "y": 1767.935181 + "x": -493.79303, + "y": 1349.12146 }, "parameters": { @@ -1640,7 +1420,7 @@ "ports": [ { "name": "port0", - "type": "sdf3d" + "type": "sdf3dc" } ], "type": "ios" @@ -1648,8 +1428,8 @@ { "name": "gen_parameters", "node_position": { - "x": -1028.995361, - "y": 476.422729 + "x": -1207.801514, + "y": 971.851807 }, "parameters": { @@ -1658,288 +1438,6 @@ "widgets": [ ] - }, - { - "name": "sdf3d_translate_4_3_2_2_2", - "node_position": { - "x": -1172.482544, - "y": 1931.119385 - }, - "parameters": { - "x": 0, - "y": 0.14, - "z": 0 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_rotate_2_2", - "node_position": { - "x": -1172.482544, - "y": 1829.119385 - }, - "parameters": { - "a": 0, - "ax": 0, - "ay": 0, - "az": 45, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_rotate" - }, - { - "name": "sdf3d_repeat", - "node_position": { - "x": -1166.482544, - "y": 2035.119385 - }, - "parameters": { - "a": 0, - "c": 15, - "r": 0.24, - "rx": 4, - "ry": 4, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 - }, - "shader_model": { - "code": "", - "global": "vec3 circle_repeat_transform(vec3 p, float count) {\n\tfloat r = 6.28/count;\n\tfloat pa = atan(p.x, p.y);\n\tfloat a = mod(pa+0.5*r, r)-0.5*r;\n\tvec3 rv;\n\tfloat c = cos(a-pa);\n\tfloat s = sin(a-pa);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "sdf3d" - } - ], - "instance": "", - "name": "Circle Repeat", - "outputs": [ - { - "sdf3d": "$in(circle_repeat_transform($uv, $c))", - "type": "sdf3d" - } - ], - "parameters": [ - { - "default": 4, - "label": "", - "max": 32, - "min": 1, - "name": "c", - "step": 1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "sdf3d_rotate_2_2_2", - "node_position": { - "x": -791.235718, - "y": 1859.869385 - }, - "parameters": { - "a": 0, - "ax": -90, - "ay": 0, - "az": 0, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_rotate" - }, - { - "name": "sdf3d_translate_4_3_2_2_2_2", - "node_position": { - "x": -788.235718, - "y": 1967.869385 - }, - "parameters": { - "x": 0, - "y": 0.315, - "z": 0.08 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_cylinder", - "node_position": { - "x": -1161, - "y": 994.5 - }, - "parameters": { - "l": 0.06, - "r": 0.15, - "sx": 0.25, - "sy": 0.25, - "sz": 0.5 - }, - "type": "sdf3d_cylinder" - }, - { - "name": "sdf3d_smoothboolean_3_3", - "node_position": { - "x": -1104.305908, - "y": 815.75 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.1, - "op": 1, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_smoothboolean" - }, - { - "name": "sdf3d_box_2_2", - "node_position": { - "x": -1190.880981, - "y": 1701 - }, - "parameters": { - "r": 0, - "sx": 0.01, - "sy": 0.01, - "sz": 0.015 - }, - "type": "sdf3d_box" - }, - { - "name": "sdf3d_smoothboolean_3_2_3_2_2", - "node_position": { - "x": -562.468933, - "y": 1761.75 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.05, - "op": 0, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_smoothboolean" - }, - { - "name": "sdf3d_sphere_2_3", - "node_position": { - "x": -1165.397095, - "y": 2204.25 - }, - "parameters": { - "r": 0.28 - }, - "type": "sdf3d_sphere" - }, - { - "name": "sdf3d_translate_4_3_2_2_2_3", - "node_position": { - "x": -1175.397095, - "y": 2261.5 - }, - "parameters": { - "x": 0, - "y": 0.28, - "z": 0 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_boolean", - "node_position": { - "x": -990.397095, - "y": 2076 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 2, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_boolean" - }, - { - "name": "sdroundedshape", - "node_position": { - "x": -794.225342, - "y": 2070.75 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.15, - "op": 0, - "r": 0.01, - "w": 0.28 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "sdf3d" - } - ], - "instance": "", - "name": "Rounded", - "outputs": [ - { - "sdf3d": "$in($uv)-$r", - "type": "sdf3d" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "max": 1, - "min": 0, - "name": "r", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "sdf3d_rotate_2_2_3", - "node_position": { - "x": -1172.268311, - "y": 2085.75 - }, - "parameters": { - "a": 0, - "ax": 0, - "ay": 0, - "az": 11, - "x": 0.35, - "y": 0, - "z": 0 - }, - "type": "sdf3d_rotate" } ], "parameters": { @@ -1948,39 +1446,519 @@ "type": "graph" }, { - "name": "buffer", + "connections": [ + { + "from": "graph_2", + "from_port": 0, + "to": "sdf3d_scale_3", + "to_port": 0 + }, + { + "from": "sdf3d_scale_3", + "from_port": 0, + "to": "sdf3d_repeat_2", + "to_port": 0 + }, + { + "from": "sdf3d_repeat_2", + "from_port": 0, + "to": "sdf3d_translate_4_2", + "to_port": 0 + }, + { + "from": "sdf3d_repeat_2_2", + "from_port": 0, + "to": "sdf3d_translate_4_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_scale_3", + "from_port": 0, + "to": "sdf3d_repeat_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_2_2", + "from_port": 0, + "to": "sdf3d_boolean_2_2_2", + "to_port": 1 + }, + { + "from": "sdf3d_translate_4_2", + "from_port": 0, + "to": "sdf3d_boolean_2_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_boolean_2_2_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Bones", + "name": "graph_3", "node_position": { - "x": -353.830994, - "y": 1560.222534 - }, - "parameters": { - "lod": 0, - "size": 11 - }, - "type": "buffer" - }, - { - "name": "blend_3", - "node_position": { - "x": 84.334427, - "y": 1296.834595 - }, - "parameters": { - "amount": 1, - "blend_type": 3 - }, - "type": "blend" - }, - { - "name": "raymarching", - "node_position": { - "x": -371.992065, - "y": 1466.176514 + "x": -876.000732, + "y": 1520.518677 }, + "nodes": [ + { + "name": "sdf3d_boolean_2_2_2", + "node_position": { + "x": -727.344666, + "y": 1629.128418 + }, + "parameters": { + "op": 0 + }, + "type": "sdf3d_boolean" + }, + { + "name": "sdf3d_translate_4_2_2", + "node_position": { + "x": -904.32666, + "y": 1690.727051 + }, + "parameters": { + "x": 0.51, + "y": 0.38, + "z": 0.02 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_repeat_2_2", + "node_position": { + "x": -1087.362671, + "y": 1690.529785 + }, + "parameters": { + "r": 0.5, + "rx": 4, + "ry": 4 + }, + "type": "sdf3d_repeat" + }, + { + "name": "sdf3d_translate_4_2", + "node_position": { + "x": -904.844666, + "y": 1585.628418 + }, + "parameters": { + "x": 0.35, + "y": 0.52, + "z": 0.02 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_scale_3", + "node_position": { + "x": -1281.764893, + "y": 1630.628418 + }, + "parameters": { + "s": 0.4 + }, + "type": "sdf3d_scale" + }, + { + "connections": [ + { + "from": "sdf3d_sphere_2", + "from_port": 0, + "to": "sdf3d_translate_4_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_sphere_2_2", + "from_port": 0, + "to": "sdf3d_translate_4_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_2_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3", + "to_port": 0 + }, + { + "from": "sdf3d_translate_4_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3", + "to_port": 1 + }, + { + "from": "sdf3d_smoothboolean_3", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2", + "to_port": 0 + }, + { + "from": "sdf3d_sphere_2_2_2", + "from_port": 0, + "to": "sdf3d_smoothboolean_3_2", + "to_port": 1 + }, + { + "from": "sdf3d_sphere_2_2_3", + "from_port": 0, + "to": "sdf3d_translate_4_2_3", + "to_port": 0 + }, + { + "from": "sdf3d_smoothboolean_3_2", + "from_port": 0, + "to": "sdf3d_boolean_2_2", + "to_port": 1 + }, + { + "from": "sdf3d_translate_4_2_3", + "from_port": 0, + "to": "sdf3d_boolean_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_boolean_2_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Bone", + "name": "graph_2", + "node_position": { + "x": -1263.480713, + "y": 1580.556274 + }, + "nodes": [ + { + "name": "sdf3d_translate_4_2_2", + "node_position": { + "x": -935.880676, + "y": 1383.431152 + }, + "parameters": { + "x": -0.03, + "y": -0.22, + "z": 0 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_sphere_2", + "node_position": { + "x": -930.880676, + "y": 1327.931152 + }, + "parameters": { + "r": 0.03 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_sphere_2_2_2", + "node_position": { + "x": -937.880676, + "y": 1638.431152 + }, + "parameters": { + "h": 0.4, + "r": 0.025 + }, + "shader_model": { + "code": "vec3 $(name_uv)_p = $uv;\n$(name_uv)_p.y -= clamp($(name_uv)_p.y, -0.5*$h, 0.5*$h);\n", + "global": "", + "inputs": [ + + ], + "instance": "", + "name": "Sphere", + "outputs": [ + { + "sdf3d": "length($(name_uv)_p)-$r", + "type": "sdf3d" + } + ], + "parameters": [ + { + "default": 0.5, + "label": "H", + "max": 1, + "min": 0, + "name": "h", + "step": 0.01, + "type": "float" + }, + { + "default": 0.1, + "label": "R", + "max": 0.5, + "min": 0, + "name": "r", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_smoothboolean_3_2", + "node_position": { + "x": -744.380676, + "y": 1604.931152 + }, + "parameters": { + "k": 0.02, + "op": 0 + }, + "type": "sdf3d_smoothboolean" + }, + { + "name": "sdf3d_smoothboolean_3", + "node_position": { + "x": -744.880676, + "y": 1527.931152 + }, + "parameters": { + "k": 0.01, + "op": 0 + }, + "shader_model": { + "code": "", + "global": "float sdf3SmoothUnion(float d1, float d2, float k) {\n float h = clamp(0.5+0.5*(d2-d1)/k, 0.0, 1.0);\n return mix(d2, d1, h)-k*h*(1.0-h);\n}\n\nfloat sdf3SmoothSubtraction( float d1, float d2, float k ) {\n float h = clamp(0.5-0.5*(d2+d1)/k, 0.0, 1.0);\n return mix( d2, -d1, h )+k*h*(1.0-h);\n}\n\nfloat sdf3SmoothIntersection( float d1, float d2, float k ) {\n float h = clamp(0.5-0.5*(d2-d1)/k, 0.0, 1.0);\n return mix(d2, d1, h)+k*h*(1.0-h);\n}\n", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in1", + "type": "sdf3d" + }, + { + "default": "0.0", + "label": "", + "name": "in2", + "type": "sdf3d" + } + ], + "instance": "", + "name": "sdSmoothBoolean", + "outputs": [ + { + "sdf3d": "sdf3Smooth$op($in1($uv), $in2($uv), $k)", + "type": "sdf3d" + } + ], + "parameters": [ + { + "default": 0, + "label": "", + "name": "op", + "type": "enum", + "values": [ + { + "name": "Union", + "value": "Union" + }, + { + "name": "Subtraction", + "value": "Subtraction" + }, + { + "name": "Intersection", + "value": "Intersection" + } + ] + }, + { + "default": 0, + "label": "", + "max": 1, + "min": 0, + "name": "k", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_sphere_2_2", + "node_position": { + "x": -929.880676, + "y": 1483.431152 + }, + "parameters": { + "r": 0.04 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_translate_4_2", + "node_position": { + "x": -934.880676, + "y": 1534.431152 + }, + "parameters": { + "x": 0.02, + "y": -0.25, + "z": 0 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_translate_4_2_3", + "node_position": { + "x": -936.380676, + "y": 1792.181152 + }, + "parameters": { + "x": -0.04, + "y": 0.21, + "z": 0 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_sphere_2_2_3", + "node_position": { + "x": -931.380676, + "y": 1741.181152 + }, + "parameters": { + "r": 0.06 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_boolean_2_2", + "node_position": { + "x": -747.380676, + "y": 1680.681152 + }, + "parameters": { + "op": 1 + }, + "type": "sdf3d_boolean" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1237.880615, + "y": 1568.556274 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -447.380676, + "y": 1568.556274 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "sdf3d" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -1079.480713, + "y": 1027.931152 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] + } + ], + "parameters": { + + }, + "type": "graph" + }, + { + "name": "sdf3d_repeat_2", + "node_position": { + "x": -1082.880615, + "y": 1585.431152 + }, + "parameters": { + "r": 0.46, + "rx": 4, + "ry": 4 + }, + "type": "sdf3d_repeat" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1581.764893, + "y": 1627.518677 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -427.344666, + "y": 1627.518677 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "sdf3dc" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -1236.000732, + "y": 1280.556274 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] + } + ], "parameters": { }, - "type": "raymarching" + "type": "graph" } ], "parameters": { diff --git a/material_maker/examples/stone_wall.ptex b/material_maker/examples/stone_wall.ptex index 315036c..2a57d1a 100644 --- a/material_maker/examples/stone_wall.ptex +++ b/material_maker/examples/stone_wall.ptex @@ -72,12 +72,6 @@ "to": "colorize_4", "to_port": 0 }, - { - "from": "voronoi_0", - "from_port": 1, - "to": "colorize_5", - "to_port": 0 - }, { "from": "blend_0", "from_port": 0, @@ -158,52 +152,6 @@ "y": 0 }, "nodes": [ - { - "name": "voronoi_0", - "node_position": { - "x": -288, - "y": -107 - }, - "parameters": { - "intensity": 1, - "randomness": 1, - "scale_x": 8, - "scale_y": 8, - "stretch_x": 1, - "stretch_y": 1 - }, - "type": "voronoi" - }, - { - "name": "colorize_5", - "node_position": { - "x": -104, - "y": -87 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ - { - "a": 1, - "b": 0, - "g": 0, - "pos": 0.027273, - "r": 0 - }, - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.1, - "r": 1 - } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, { "name": "colorize_0", "node_position": { @@ -237,8 +185,8 @@ { "name": "perlin_0", "node_position": { - "x": 13, - "y": 218 + "x": -72, + "y": 250 }, "parameters": { "iterations": 4, @@ -321,8 +269,8 @@ { "name": "Perlin", "node_position": { - "x": 74, - "y": -255 + "x": -66, + "y": -133 }, "parameters": { "iterations": 8, @@ -440,7 +388,6 @@ "emission_energy": 1, "metallic": 1, "normal_scale": 1, - "resolution": 1, "roughness": 1, "size": 11, "subsurf_scatter_strength": 0 @@ -454,14 +401,7 @@ "y": -22.258774 }, "parameters": { - "color": { - "a": 1, - "b": 1, - "g": 1, - "r": 1, - "type": "Color" - }, - "name": 0 + }, "type": "combine" }, @@ -532,13 +472,10 @@ "y": 211.716217 }, "parameters": { - "amount": 0.5, "param0": 11, "param1": 0.79, "param2": 0, - "param3": 0, - "param4": 1, - "size": 4 + "param4": 1 }, "type": "normal_map" }, @@ -550,8 +487,7 @@ }, "parameters": { "amount": 0.05, - "eps": 0.05, - "epsilon": 0 + "eps": 0.05 }, "type": "warp" }, @@ -570,8 +506,8 @@ { "name": "Bricks", "node_position": { - "x": -56, - "y": -6 + "x": -61, + "y": 2 }, "parameters": { "bevel": 0.15, diff --git a/material_maker/graph_edit.gd b/material_maker/graph_edit.gd index 456569a..49d39e2 100644 --- a/material_maker/graph_edit.gd +++ b/material_maker/graph_edit.gd @@ -21,6 +21,7 @@ onready var button_transmits_seed : Button = $GraphUI/SubGraphUI/ButtonTransmits signal save_path_changed signal graph_changed +signal view_updated func _ready() -> void: OS.low_processor_usage_mode = true @@ -151,6 +152,7 @@ func update_view(g) -> void: button_transmits_seed.pressed = generator.transmits_seed else: button_transmits_seed.visible = false + emit_signal("view_updated", generator) func clear_material() -> void: @@ -385,9 +387,18 @@ func _on_GraphEdit_gui_input(event) -> void: call_deferred("check_last_selected") func request_popup(from, from_slot, release_position) -> void: - node_popup.rect_global_position = get_global_mouse_position() - node_popup.show() - node_popup.set_quick_connect(from, from_slot) + # Check if the connector was actually dragged + var node : GraphNode = get_node(from) + var node_transform : Transform2D = node.get_global_transform() + var output_position = node_transform.xform(node.get_connection_output_position(from_slot)/node_transform.get_scale()) + if (get_global_mouse_position()-output_position).length() < 20: + # Tell the node its connector was clicked + node.on_clicked_output(from_slot) + else: + # Request the popup + node_popup.rect_global_position = get_global_mouse_position() + node_popup.show() + node_popup.set_quick_connect(from, from_slot) func check_last_selected() -> void: if last_selected != null and !(is_instance_valid(last_selected) and last_selected.selected): diff --git a/material_maker/icons/icons.svg b/material_maker/icons/icons.svg index a43e0c6..ab74fb5 100644 --- a/material_maker/icons/icons.svg +++ b/material_maker/icons/icons.svg @@ -55,9 +55,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="10.114758" - inkscape:cx="100.19195" - inkscape:cy="20.027892" + inkscape:zoom="40.459032" + inkscape:cx="12.31719" + inkscape:cy="41.781829" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -593,5 +593,17 @@ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.15158939px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="m 114.33714,336.4547 v 5.90037 z m 8.55274,0 v 5.90037 z m -17.10352,0.12943 v 5.90037 z" id="path920" /> + diff --git a/material_maker/icons/output_preview.tres b/material_maker/icons/output_preview.tres new file mode 100644 index 0000000..348fb74 --- /dev/null +++ b/material_maker/icons/output_preview.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 0, 80, 16, 16 ) diff --git a/material_maker/library.tscn b/material_maker/library.tscn index 39e8f1b..c165b32 100644 --- a/material_maker/library.tscn +++ b/material_maker/library.tscn @@ -4,15 +4,18 @@ [ext_resource path="res://material_maker/library.gd" type="Script" id=2] [node name="Library" type="VBoxContainer"] -margin_right = 352.0 -margin_bottom = 423.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_min_size = Vector2( 200, 200 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false } [node name="HBoxContainer" type="HBoxContainer" parent="."] -margin_right = 352.0 +margin_right = 1280.0 margin_bottom = 24.0 size_flags_horizontal = 3 @@ -24,14 +27,14 @@ text = "Filter:" [node name="Filter" type="LineEdit" parent="HBoxContainer"] margin_left = 41.0 -margin_right = 352.0 +margin_right = 1280.0 margin_bottom = 24.0 size_flags_horizontal = 3 [node name="Tree" type="Tree" parent="."] margin_top = 28.0 -margin_right = 352.0 -margin_bottom = 423.0 +margin_right = 1280.0 +margin_bottom = 720.0 rect_min_size = Vector2( 100, 100 ) size_flags_horizontal = 3 size_flags_vertical = 3 diff --git a/material_maker/main_window.gd b/material_maker/main_window.gd index 21f171e..26203a3 100644 --- a/material_maker/main_window.gd +++ b/material_maker/main_window.gd @@ -10,13 +10,19 @@ var current_tab = null var updating : bool = false var need_update : bool = false -onready var projects = $VBoxContainer/HBoxContainer/ProjectsPane/Projects -onready var library = $VBoxContainer/HBoxContainer/VBoxContainer/Library +onready var projects = $VBoxContainer/Layout/SplitRight/ProjectsPane/Projects -onready var preview_2d = $VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D -onready var preview_3d = $VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D +onready var layout = $VBoxContainer/Layout +var library +var preview_2d +var preview_3d +var hierarchy -onready var preview_2d_background = $VBoxContainer/HBoxContainer/ProjectsPane/Preview2D +onready var preview_2d_background = $VBoxContainer/Layout/SplitRight/ProjectsPane/Preview2D +onready var preview_2d_background_button = $VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Preview2DButton +onready var preview_3d_background = $VBoxContainer/Layout/SplitRight/ProjectsPane/Preview3D +onready var preview_3d_background_button = $VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Preview3DButton +onready var preview_3d_background_panel = $VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel const RECENT_FILES_COUNT = 15 @@ -45,6 +51,8 @@ const MENU = [ { menu="View", command="view_center", shortcut="C", description="Center view" }, { menu="View", command="view_reset_zoom", shortcut="Control+0", description="Reset zoom" }, + { menu="View" }, + { menu="View", submenu="show_panes", description="Panes" }, { menu="Tools", submenu="create", description="Create" }, { menu="Tools", command="create_subgraph", shortcut="Control+G", description="Create group" }, @@ -116,8 +124,27 @@ func _ready() -> void: # This property is only available in 3.2alpha or later, so use `set()` to fail gracefully if it doesn't exist. OS.set("min_window_size", Vector2(1024, 600)) + # Set window title OS.set_window_title(ProjectSettings.get_setting("application/config/name")+" v"+ProjectSettings.get_setting("application/config/release")) + + layout.load_panes(config_cache) + library = layout.get_pane("Library") + preview_2d = layout.get_pane("Preview2D") + preview_3d = layout.get_pane("Preview3D") + hierarchy = layout.get_pane("Hierarchy") + hierarchy.connect("group_selected", self, "on_group_selected") + + # Load recent projects load_recents() + + # Create menus + for i in MENU.size(): + if ! $VBoxContainer/Menu.has_node(MENU[i].menu): + var menu_button = MenuButton.new() + menu_button.name = MENU[i].menu + menu_button.text = MENU[i].menu + menu_button.switch_on_hover = true + $VBoxContainer/Menu.add_child(menu_button) for m in $VBoxContainer/Menu.get_children(): var menu = m.get_popup() create_menu(menu, m.name) @@ -221,6 +248,21 @@ func _on_SetTheme_id_pressed(id) -> void: set_theme(theme_name) config_cache.set_value("window", "theme", theme_name) + +func create_menu_show_panes(menu : PopupMenu) -> void: + menu.clear() + var panes = layout.get_pane_list() + for i in range(panes.size()): + menu.add_check_item(panes[i], i) + menu.set_item_checked(i, layout.is_pane_visible(panes[i])) + if !menu.is_connected("id_pressed", self, "_on_ShowPanes_id_pressed"): + menu.connect("id_pressed", self, "_on_ShowPanes_id_pressed") + +func _on_ShowPanes_id_pressed(id) -> void: + var pane : String = layout.get_pane_list()[id] + layout.set_pane_visible(pane, !layout.is_pane_visible(pane)) + print(pane) + func create_menu_create(menu) -> void: var gens = mm_loader.get_generator_list() menu.clear() @@ -259,6 +301,7 @@ func new_material() -> void: var graph_edit = new_pane() graph_edit.new_material() graph_edit.update_tab_title() + hierarchy.update_from_graph_edit(get_current_graph_edit()) func load_material() -> void: var dialog = FileDialog.new() @@ -272,9 +315,10 @@ func load_material() -> void: func do_load_materials(filenames) -> void: for f in filenames: - do_load_material(f) + do_load_material(f, false) + hierarchy.update_from_graph_edit(get_current_graph_edit()) -func do_load_material(filename) -> void: +func do_load_material(filename : String, update_hierarchy : bool = true) -> void: var graph_edit : MMGraphEdit = get_current_graph_edit() var node_count = 2 # So test below succeeds if graph_edit is null... if graph_edit != null: @@ -288,12 +332,15 @@ func do_load_material(filename) -> void: graph_edit = new_pane() graph_edit.load_file(filename) add_recent(filename) + if update_hierarchy: + hierarchy.update_from_graph_edit(get_current_graph_edit()) func save_material() -> void: var graph_edit : MMGraphEdit = get_current_graph_edit() if graph_edit != null: if graph_edit.save_path != null: graph_edit.save_file(graph_edit.save_path) + add_recent(graph_edit.save_path) else: save_material_as() @@ -492,7 +539,7 @@ func update_preview() -> void: status = update_preview_2d() while status is GDScriptFunctionState: status = yield(status, "completed") - status = update_preview_3d([ $VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D, $VBoxContainer/HBoxContainer/ProjectsPane/Preview3D]) + status = update_preview_3d([ preview_3d, preview_3d_background ]) while status is GDScriptFunctionState: status = yield(status, "completed") updating = false @@ -547,6 +594,12 @@ func _on_Projects_tab_changed(tab) -> void: new_tab.connect("node_selected", self, "on_selected_node_change") current_tab = new_tab update_preview() + hierarchy.update_from_graph_edit(get_current_graph_edit()) + +func on_group_selected(generator) -> void: + var graph_edit : MMGraphEdit = get_current_graph_edit() + if graph_edit != null: + graph_edit.edit_subgraph(generator) func _exit_tree() -> void: # Save the window position and size to remember it when restarting the application @@ -554,6 +607,7 @@ func _exit_tree() -> void: config_cache.set_value("window", "maximized", OS.window_maximized || OS.window_fullscreen) config_cache.set_value("window", "position", OS.window_position) config_cache.set_value("window", "size", OS.window_size) + layout.save_config(config_cache) config_cache.save("user://cache.ini") func _notification(what : int) -> void: @@ -566,15 +620,15 @@ func dim_window() -> void: modulate = Color(0.5, 0.5, 0.5) func show_background_preview_2d(button_pressed): - $VBoxContainer/HBoxContainer/ProjectsPane/Preview2D.visible = button_pressed + preview_2d_background.visible = button_pressed if button_pressed: - $VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview3DButton.pressed = false + preview_3d_background_button.pressed = false func show_background_preview_3d(button_pressed): - $VBoxContainer/HBoxContainer/ProjectsPane/Preview3D.visible = button_pressed - $VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel.visible = button_pressed + preview_3d_background.visible = button_pressed + preview_3d_background_panel.visible = button_pressed if button_pressed: - $VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview2DButton.pressed = false + preview_2d_background_button.pressed = false func generate_screenshots(): diff --git a/material_maker/main_window.tscn b/material_maker/main_window.tscn index b9bdee7..edf0e12 100644 --- a/material_maker/main_window.tscn +++ b/material_maker/main_window.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=22 format=2] +[gd_scene load_steps=17 format=2] [ext_resource path="res://material_maker/main_window.gd" type="Script" id=1] -[ext_resource path="res://material_maker/library.tscn" type="PackedScene" id=2] -[ext_resource path="res://material_maker/preview/preview_2d.tscn" type="PackedScene" id=3] +[ext_resource path="res://material_maker/main_window_layout.gd" type="Script" id=2] [ext_resource path="res://material_maker/preview/preview_3d.tscn" type="PackedScene" id=4] [ext_resource path="res://material_maker/preview/preview_3d_ui.tscn" type="PackedScene" id=5] [ext_resource path="res://material_maker/widgets/tabs.gd" type="Script" id=6] @@ -11,19 +10,8 @@ [ext_resource path="res://material_maker/node_factory.gd" type="Script" id=9] [ext_resource path="res://material_maker/theme/default.tres" type="Theme" id=10] [ext_resource path="res://material_maker/preview/preview_2d.gd" type="Script" id=11] -[ext_resource path="res://material_maker/preview/control_point.tscn" type="PackedScene" id=12] -[sub_resource type="AtlasTexture" id=1] -flags = 4 -atlas = ExtResource( 8 ) -region = Rect2( 64, 48, 32, 32 ) - -[sub_resource type="AtlasTexture" id=2] -flags = 4 -atlas = ExtResource( 8 ) -region = Rect2( 16, 64, 16, 16 ) - -[sub_resource type="Shader" id=3] +[sub_resource type="Shader" id=1] code = "shader_type canvas_item; uniform sampler2D tex; @@ -39,28 +27,24 @@ void fragment() { COLOR = vec4(mix(image_with_background, vec3(lines_color), step(min(m2.x*size.x, m2.y*size.y), 1.0)), 1.0); }" -[sub_resource type="ShaderMaterial" id=4] -shader = SubResource( 3 ) +[sub_resource type="ShaderMaterial" id=2] +shader = SubResource( 1 ) shader_param/size = Vector2( 947, 682 ) -[sub_resource type="ShaderMaterial" id=5] -shader = SubResource( 3 ) -shader_param/size = Vector2( 721, 546 ) - -[sub_resource type="AtlasTexture" id=6] +[sub_resource type="AtlasTexture" id=3] flags = 4 atlas = ExtResource( 8 ) region = Rect2( 96, 96, 32, 32 ) -[sub_resource type="AtlasTexture" id=7] +[sub_resource type="AtlasTexture" id=4] flags = 4 atlas = ExtResource( 8 ) region = Rect2( 96, 32, 32, 32 ) -[sub_resource type="StyleBoxFlat" id=8] +[sub_resource type="StyleBoxFlat" id=5] bg_color = Color( 0, 0, 0, 0.772549 ) -[sub_resource type="AtlasTexture" id=9] +[sub_resource type="AtlasTexture" id=6] flags = 4 atlas = ExtResource( 8 ) region = Rect2( 96, 64, 32, 31 ) @@ -94,168 +78,58 @@ margin_right = 1268.0 margin_bottom = 22.0 [node name="File" type="MenuButton" parent="VBoxContainer/Menu"] -margin_right = 35.0 +margin_right = 31.0 margin_bottom = 22.0 text = "File" items = [ "New material", null, 0, false, false, 0, 0, null, "", false, "Load material", null, 0, false, false, 1, 268435535, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Save material", null, 0, false, false, 4, 268435539, null, "", false, "Save material as...", null, 0, false, false, 5, 301989971, null, "", false, "Save all materials...", null, 0, false, false, 6, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Export material", null, 0, false, false, 8, 268435525, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Close material", null, 0, false, false, 10, 0, null, "", false, "Quit", null, 0, false, false, 11, 268435537, null, "", false ] switch_on_hover = true -[node name="Edit" type="MenuButton" parent="VBoxContainer/Menu"] -margin_left = 39.0 -margin_right = 75.0 -margin_bottom = 22.0 -text = "Edit" -items = [ "Cut", null, 0, false, false, 12, 268435544, null, "", false, "Copy", null, 0, false, false, 13, 268435523, null, "", false, "Paste", null, 0, false, false, 14, 268435542, null, "", false, "Duplicate", null, 0, false, false, 15, 268435524, null, "", false ] -switch_on_hover = true - -[node name="View" type="MenuButton" parent="VBoxContainer/Menu"] -margin_left = 79.0 -margin_right = 121.0 -margin_bottom = 22.0 -text = "View" -items = [ "Center view", null, 0, false, false, 16, 67, null, "", false, "Reset zoom", null, 0, false, false, 17, 268435504, null, "", false ] -switch_on_hover = true - -[node name="Tools" type="MenuButton" parent="VBoxContainer/Menu"] -margin_left = 125.0 -margin_right = 171.0 -margin_bottom = 22.0 -text = "Tools" -items = [ "Create", null, 0, false, false, 0, 0, null, "PopupMenu", false, "Create group", null, 0, false, false, 19, 268435527, null, "", false, "Make selected nodes editable", null, 0, false, false, 20, 268435543, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Add selected node to user library", null, 0, false, false, 22, 0, null, "", false, "Export the nodes library", null, 0, false, false, 23, 0, null, "", false ] -switch_on_hover = true - -[node name="Help" type="MenuButton" parent="VBoxContainer/Menu"] -margin_left = 175.0 -margin_right = 217.0 -margin_bottom = 22.0 -text = "Help" -items = [ "User manual", null, 0, false, false, 24, 16777244, null, "", false, "Show selected library item documentation", null, 0, false, false, 25, 285212700, null, "", false, "Report a bug", null, 0, false, false, 26, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "About", null, 0, false, false, 28, 0, null, "", false ] -switch_on_hover = true - -[node name="HBoxContainer" type="HSplitContainer" parent="VBoxContainer"] +[node name="Layout" type="HSplitContainer" parent="VBoxContainer"] margin_top = 26.0 margin_right = 1268.0 margin_bottom = 708.0 size_flags_vertical = 3 +split_offset = -1118 +script = ExtResource( 2 ) -[node name="VBoxContainer" type="VSplitContainer" parent="VBoxContainer/HBoxContainer"] -margin_right = 313.0 +[node name="Left" type="VSplitContainer" parent="VBoxContainer/Layout"] +margin_right = 124.0 margin_bottom = 682.0 size_flags_horizontal = 3 size_flags_vertical = 3 +split_offset = 312 -[node name="Library" parent="VBoxContainer/HBoxContainer/VBoxContainer" instance=ExtResource( 2 )] -margin_right = 313.0 -margin_bottom = 390.0 -size_flags_vertical = 3 -size_flags_stretch_ratio = 1.5 +[node name="Top" type="TabContainer" parent="VBoxContainer/Layout/Left"] +margin_right = 124.0 +margin_bottom = 346.0 +tab_align = 0 +drag_to_rearrange_enabled = true +use_hidden_tabs_for_min_size = true -[node name="Preview" type="TabContainer" parent="VBoxContainer/HBoxContainer/VBoxContainer"] -margin_top = 398.0 -margin_right = 313.0 +[node name="Bottom" type="TabContainer" parent="VBoxContainer/Layout/Left"] +margin_top = 354.0 +margin_right = 124.0 margin_bottom = 682.0 tab_align = 0 +drag_to_rearrange_enabled = true +use_hidden_tabs_for_min_size = true -[node name="Preview2D" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview" instance=ExtResource( 3 )] -margin_left = 5.0 -margin_top = 29.0 -margin_right = -5.0 -margin_bottom = -5.0 -rect_min_size = Vector2( 250, 250 ) - -[node name="P1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 1, 0.466667, 0, 1 ) -margin_right = 32.0 -margin_bottom = 32.0 -texture = SubResource( 1 ) - -[node name="P2" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 0, 0.505882, 1, 1 ) -margin_right = 32.0 -margin_bottom = 32.0 -texture = SubResource( 1 ) - -[node name="Rect1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -texture = SubResource( 2 ) -parent_control = "P1" -control_type = 1 - -[node name="Radius1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 2 ) -parent_control = "P1" -control_type = 2 - -[node name="Radius11" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 2 ) -parent_control = "Radius1" -control_type = 2 - -[node name="Scale1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 2 ) -parent_control = "P1" -control_type = 3 - -[node name="Angle1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 2 ) -parent_control = "P1" -control_type = 2 - -[node name="Angle2" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 2 ) -parent_control = "P1" -control_type = 2 - -[node name="Preview3D" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview" instance=ExtResource( 4 )] -margin_left = 5.0 -margin_top = 29.0 -margin_right = -5.0 -margin_bottom = -5.0 -rect_min_size = Vector2( 250, 250 ) - -[node name="Preview3DUI" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" instance=ExtResource( 5 )] - -[node name="ProjectsPane" type="Control" parent="VBoxContainer/HBoxContainer"] -margin_left = 321.0 +[node name="SplitRight" type="HSplitContainer" parent="VBoxContainer/Layout"] +margin_left = 132.0 margin_right = 1268.0 margin_bottom = 682.0 +split_offset = 133 + +[node name="ProjectsPane" type="Control" parent="VBoxContainer/Layout/SplitRight"] +margin_right = 981.0 +margin_bottom = 682.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 3.0 -[node name="Preview2D" type="ColorRect" parent="VBoxContainer/HBoxContainer/ProjectsPane"] +[node name="Preview2D" type="ColorRect" parent="VBoxContainer/Layout/SplitRight/ProjectsPane"] visible = false -material = SubResource( 4 ) +material = SubResource( 2 ) anchor_right = 1.0 anchor_bottom = 1.0 rect_min_size = Vector2( 64, 64 ) @@ -268,30 +142,14 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Preview2D_old" type="ColorRect" parent="VBoxContainer/HBoxContainer/ProjectsPane"] -visible = false -material = SubResource( 5 ) -anchor_right = 1.0 -anchor_bottom = 1.0 -rect_min_size = Vector2( 64, 64 ) -rect_clip_content = true -mouse_filter = 1 -size_flags_horizontal = 0 -size_flags_vertical = 8 -script = ExtResource( 11 ) -__meta__ = { -"_edit_use_anchors_": false, -"_editor_description_": "" -} - -[node name="Preview3D" parent="VBoxContainer/HBoxContainer/ProjectsPane" instance=ExtResource( 4 )] +[node name="Preview3D" parent="VBoxContainer/Layout/SplitRight/ProjectsPane" instance=ExtResource( 4 )] margin_left = 0.0 margin_top = 0.0 margin_right = 0.0 margin_bottom = 0.0 ui_path = "../PreviewUI/Panel/HBoxContainer/Preview3DUI" -[node name="Projects" type="Panel" parent="VBoxContainer/HBoxContainer/ProjectsPane"] +[node name="Projects" type="Panel" parent="VBoxContainer/Layout/SplitRight/ProjectsPane"] self_modulate = Color( 1, 1, 1, 0 ) anchor_right = 1.0 anchor_bottom = 1.0 @@ -304,15 +162,18 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Tabs" type="Tabs" parent="VBoxContainer/HBoxContainer/ProjectsPane/Projects"] +[node name="Tabs" type="Tabs" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects"] margin_right = 950.0 margin_bottom = 24.0 tab_align = 0 tab_close_display_policy = 1 +__meta__ = { +"_edit_use_anchors_": false +} -[node name="AddNodePopup" parent="VBoxContainer/HBoxContainer/ProjectsPane/Projects" instance=ExtResource( 7 )] +[node name="AddNodePopup" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" instance=ExtResource( 7 )] -[node name="PreviewUI" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane"] +[node name="PreviewUI" type="HBoxContainer" parent="VBoxContainer/Layout/SplitRight/ProjectsPane"] anchor_top = 1.0 anchor_bottom = 1.0 margin_left = 1.0 @@ -324,30 +185,30 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Preview2DButton" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"] +[node name="Preview2DButton" type="Button" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI"] margin_right = 44.0 margin_bottom = 40.0 hint_tooltip = "Show 2D preview" toggle_mode = true -icon = SubResource( 6 ) +icon = SubResource( 3 ) -[node name="Preview3DButton" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"] +[node name="Preview3DButton" type="Button" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI"] margin_left = 51.0 margin_right = 95.0 margin_bottom = 40.0 hint_tooltip = "Show 3D preview" toggle_mode = true -icon = SubResource( 7 ) +icon = SubResource( 4 ) -[node name="Panel" type="PanelContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"] +[node name="Panel" type="PanelContainer" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI"] visible = false self_modulate = Color( 1, 1, 1, 0.768627 ) margin_left = 102.0 margin_right = 399.0 margin_bottom = 40.0 -custom_styles/panel = SubResource( 8 ) +custom_styles/panel = SubResource( 5 ) -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel"] +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel"] margin_right = 297.0 margin_bottom = 40.0 custom_constants/separation = 5 @@ -355,18 +216,18 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="SpaceLeft" type="Control" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"] +[node name="SpaceLeft" type="Control" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer"] margin_bottom = 40.0 -[node name="ControlView" type="TextureRect" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"] +[node name="ControlView" type="TextureRect" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer"] margin_left = 5.0 margin_top = 4.0 margin_right = 37.0 margin_bottom = 35.0 size_flags_vertical = 4 -texture = SubResource( 9 ) +texture = SubResource( 6 ) -[node name="Preview3DUI" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer" instance=ExtResource( 5 )] +[node name="Preview3DUI" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer" instance=ExtResource( 5 )] anchor_right = 0.0 margin_left = 42.0 margin_top = 8.0 @@ -374,28 +235,53 @@ margin_right = 292.0 margin_bottom = 32.0 size_flags_vertical = 4 -[node name="SpaceRight" type="Control" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"] +[node name="SpaceRight" type="Control" parent="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer"] margin_left = 297.0 margin_right = 297.0 margin_bottom = 40.0 +[node name="Right" type="VSplitContainer" parent="VBoxContainer/Layout/SplitRight"] +margin_left = 989.0 +margin_right = 1136.0 +margin_bottom = 682.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +split_offset = 312 + +[node name="Top" type="TabContainer" parent="VBoxContainer/Layout/SplitRight/Right"] +margin_right = 147.0 +margin_bottom = 346.0 +tab_align = 0 +drag_to_rearrange_enabled = true +use_hidden_tabs_for_min_size = true + +[node name="Bottom" type="TabContainer" parent="VBoxContainer/Layout/SplitRight/Right"] +margin_top = 354.0 +margin_right = 147.0 +margin_bottom = 682.0 +tab_align = 0 +drag_to_rearrange_enabled = true +use_hidden_tabs_for_min_size = true + [node name="NodeFactory" type="Node" parent="."] script = ExtResource( 9 ) -[connection signal="need_update" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" to="." method="update_preview_3d"] -[connection signal="environment_selected" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D/Preview3DUI" to="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" method="_on_Environment_item_selected"] -[connection signal="model_selected" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D/Preview3DUI" to="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" method="_on_Model_item_selected"] -[connection signal="rotate_toggled" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D/Preview3DUI" to="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" method="_on_Rotate_toggled"] -[connection signal="resized" from="VBoxContainer/HBoxContainer/ProjectsPane/Preview2D" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview2D" method="on_resized"] -[connection signal="need_update" from="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" to="." method="update_preview_3d"] -[connection signal="no_more_tabs" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects" to="." method="new_material"] -[connection signal="resized" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="_on_Projects_resized"] -[connection signal="tab_changed" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects" to="." method="_on_Projects_tab_changed"] -[connection signal="reposition_active_tab_request" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="move_active_tab_to"] -[connection signal="tab_changed" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="set_current_tab"] -[connection signal="tab_close" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="close_tab"] -[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview2DButton" to="." method="show_background_preview_2d"] -[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview3DButton" to="." method="show_background_preview_3d"] -[connection signal="gui_input" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/ControlView" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="on_gui_input"] -[connection signal="environment_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Environment_item_selected"] -[connection signal="model_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Model_item_selected"] -[connection signal="rotate_toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Rotate_toggled"] +[connection signal="dragged" from="VBoxContainer/Layout" to="VBoxContainer/Layout" method="_on_Left_dragged"] +[connection signal="tab_changed" from="VBoxContainer/Layout/Left/Top" to="VBoxContainer/Layout" method="_on_tab_changed"] +[connection signal="tab_changed" from="VBoxContainer/Layout/Left/Bottom" to="VBoxContainer/Layout" method="_on_tab_changed"] +[connection signal="dragged" from="VBoxContainer/Layout/SplitRight" to="VBoxContainer/Layout" method="_on_Right_dragged"] +[connection signal="resized" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Preview2D" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Preview2D" method="on_resized"] +[connection signal="need_update" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Preview3D" to="." method="update_preview_3d"] +[connection signal="no_more_tabs" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" to="." method="new_material"] +[connection signal="resized" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" method="_on_Projects_resized"] +[connection signal="tab_changed" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" to="." method="_on_Projects_tab_changed"] +[connection signal="reposition_active_tab_request" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects/Tabs" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" method="move_active_tab_to"] +[connection signal="tab_changed" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects/Tabs" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" method="set_current_tab"] +[connection signal="tab_close" from="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects/Tabs" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Projects" method="close_tab"] +[connection signal="toggled" from="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Preview2DButton" to="." method="show_background_preview_2d"] +[connection signal="toggled" from="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Preview3DButton" to="." method="show_background_preview_3d"] +[connection signal="gui_input" from="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer/ControlView" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Preview3D" method="on_gui_input"] +[connection signal="environment_selected" from="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Preview3D" method="_on_Environment_item_selected"] +[connection signal="model_selected" from="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Preview3D" method="_on_Model_item_selected"] +[connection signal="rotate_toggled" from="VBoxContainer/Layout/SplitRight/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/Layout/SplitRight/ProjectsPane/Preview3D" method="_on_Rotate_toggled"] +[connection signal="tab_changed" from="VBoxContainer/Layout/SplitRight/Right/Top" to="VBoxContainer/Layout" method="_on_tab_changed"] +[connection signal="tab_changed" from="VBoxContainer/Layout/SplitRight/Right/Bottom" to="VBoxContainer/Layout" method="_on_tab_changed"] diff --git a/material_maker/main_window_layout.gd b/material_maker/main_window_layout.gd new file mode 100644 index 0000000..30b268c --- /dev/null +++ b/material_maker/main_window_layout.gd @@ -0,0 +1,118 @@ +extends HSplitContainer + +const PANE_POSITIONS = { + TopLeft="Left/Top", + BottomLeft="Left/Bottom", + TopRight="SplitRight/Right/Top", + BottomRight="SplitRight/Right/Bottom" +} +const PANES = [ + { name="Library", scene=preload("res://material_maker/library.tscn"), position="TopLeft" }, + { name="Preview2D", scene=preload("res://material_maker/preview/preview_2d_panel.tscn"), position="BottomLeft" }, + { name="Preview3D", scene=preload("res://material_maker/preview/preview_3d_panel.tscn"), position="BottomLeft" }, + { name="Hierarchy", scene=preload("res://material_maker/widgets/graph_tree/hierarchy_pane.tscn"), position="TopRight" } +] + +var panes = {} + +func load_panes(config_cache) -> void: + # Create panels + for pane_pos in PANE_POSITIONS.keys(): + get_node(PANE_POSITIONS[pane_pos]).set_tabs_rearrange_group(1) + for pane in PANES: + var node = pane.scene.instance() + node.name = pane.name + panes[pane.name] = node + var tab = get_node(PANE_POSITIONS[pane.position]) + if config_cache.has_section_key("layout", pane.name+"_location"): + tab = get_node(PANE_POSITIONS[config_cache.get_value("layout", pane.name+"_location")]) + if config_cache.has_section_key("layout", pane.name+"_hidden") && config_cache.get_value("layout", pane.name+"_hidden"): + node.set_meta("parent_tab_container", tab) + else: + tab.add_child(node) + # Split positions + if config_cache.has_section_key("layout", "LeftVSplitOffset"): + split_offset = config_cache.get_value("layout", "LeftVSplitOffset") + if config_cache.has_section_key("layout", "LeftHSplitOffset"): + $Left.split_offset = config_cache.get_value("layout", "LeftHSplitOffset") + if config_cache.has_section_key("layout", "RightVSplitOffset"): + $SplitRight.split_offset = config_cache.get_value("layout", "RightVSplitOffset") + if config_cache.has_section_key("layout", "RightHSplitOffset"): + $SplitRight/Right.split_offset = config_cache.get_value("layout", "RightHSplitOffset") + update_panes() + +func save_config(config_cache) -> void: + for p in panes: + var location = panes[p].get_parent() + var hidden = false + if location == null: + hidden = true + location = panes[p].get_meta("parent_tab_container") + config_cache.set_value("layout", p+"_hidden", hidden) + for l in PANE_POSITIONS.keys(): + if location == get_node(PANE_POSITIONS[l]): + config_cache.set_value("layout", p+"_location", l) + config_cache.set_value("layout", "LeftVSplitOffset", split_offset) + config_cache.set_value("layout", "LeftHSplitOffset", $Left.split_offset) + config_cache.set_value("layout", "RightVSplitOffset", $SplitRight.split_offset) + config_cache.set_value("layout", "RightHSplitOffset", $SplitRight/Right.split_offset) + +func get_pane(n) -> Control: + return panes[n] + +func get_pane_list() -> Array: + var panes_list = panes.keys() + panes_list.sort() + return panes_list + +func is_pane_visible(pane_name : String) -> bool: + return panes[pane_name].get_parent() != null + +func set_pane_visible(pane_name : String, v : bool) -> void: + var pane = panes[pane_name] + if v: + pane.get_meta("parent_tab_container").add_child(pane) + else: + pane.set_meta("parent_tab_container", pane.get_parent()) + pane.get_parent().remove_child(pane) + update_panes() + +func update_panes() -> void: + var left_width = $Left.rect_size.x + var left_requested = left_width + var right_width = $SplitRight/Right.rect_size.x + var right_requested = right_width + if $Left/Top.get_tab_count() == 0: + if $Left/Bottom.get_tab_count() == 0: + left_requested = 10 + $Left.split_offset -= ($Left/Top.rect_size.y-$Left/Bottom.rect_size.y)/2 + $Left.clamp_split_offset() + else: + $Left.split_offset -= $Left/Top.rect_size.y-10 + $Left.clamp_split_offset() + elif $Left/Bottom.get_tab_count() == 0: + $Left.split_offset += $Left/Bottom.rect_size.y-10 + $Left.clamp_split_offset() + if $SplitRight/Right/Top.get_tab_count() == 0: + if $SplitRight/Right/Bottom.get_tab_count() == 0: + right_requested = 10 + $SplitRight/Right.split_offset -= ($SplitRight/Right/Top.rect_size.y-$SplitRight/Right/Bottom.rect_size.y)/2 + $SplitRight/Right.clamp_split_offset() + else: + $SplitRight/Right.split_offset -= $SplitRight/Right/Top.rect_size.y-10 + $SplitRight/Right.clamp_split_offset() + elif $SplitRight/Right/Bottom.get_tab_count() == 0: + $SplitRight/Right.split_offset += $SplitRight/Right/Bottom.rect_size.y-10 + $SplitRight/Right.clamp_split_offset() + split_offset += left_requested - left_width + right_requested - right_width + clamp_split_offset() + $SplitRight.split_offset += right_width - right_requested + +func _on_Left_dragged(offset : int) -> void: + $Left.clamp_split_offset() + +func _on_Right_dragged(offset : int) -> void: + $SplitRight/Right.clamp_split_offset() + +func _on_tab_changed(_tab): + update_panes() diff --git a/material_maker/nodes/generic.gd b/material_maker/nodes/generic.gd index 2a2d7ae..fdadf55 100644 --- a/material_maker/nodes/generic.gd +++ b/material_maker/nodes/generic.gd @@ -11,6 +11,15 @@ var preview_position : int var preview_size : int var preview_timer : Timer = null +func _draw() -> void: + ._draw() + if preview_index >= 0: + var conn_pos = get_connection_output_position(preview_index) + if preview_index > 0: + conn_pos.y += 1 + conn_pos /= get_global_transform().get_scale() + draw_texture(preload("res://material_maker/icons/output_preview.tres"), conn_pos-Vector2(8, 8)) + func set_generator(g) -> void: .set_generator(g) generator.connect("parameter_changed", self, "on_parameter_changed") @@ -262,23 +271,8 @@ func update_node() -> void: hsizer.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL add_child(hsizer) hsizer = get_child(i) - var has_filler = false - for c in hsizer.get_children(): - if c.size_flags_horizontal & SIZE_EXPAND != 0: - has_filler = true - break - if !has_filler: - var empty_control : Control = Control.new() - empty_control.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL - hsizer.add_child(empty_control) - var button = preload("res://material_maker/widgets/preview_button.tscn").instance() - button.size_flags_horizontal = SIZE_SHRINK_END - button.size_flags_vertical = SIZE_SHRINK_CENTER - if i == preview_index: - button.pressed = true - hsizer.add_child(button) - button.connect("toggled", self, "on_preview_button", [ i ]) - button_width = button.rect_size.x + if hsizer.get_child_count() == 0: + hsizer.rect_min_size.y = 16 if !outputs.empty(): for i in range(output_count, get_child_count()): var hsizer : HBoxContainer = get_child(i) @@ -352,34 +346,22 @@ func do_save_generator(file_name : String) -> void: file.close() mm_loader.update_predefined_generators() -func update_preview_buttons(index : int) -> void: - for i in range(output_count): - if i != index: - var line = get_child(i) - line.get_child(line.get_child_count()-1).pressed = false - -var processing_button = false - -func on_preview_button(pressed : bool, index : int) -> void: - if processing_button: - return - processing_button = true - if pressed: +func on_clicked_output(index : int) -> void: + if preview_index == index: + preview_index = -1 + preview.visible = false + remove_child(preview) + rect_size = Vector2(0, 0) + else: preview_index = index var width if preview.visible: - update_preview_buttons(index) update_preview() else: var status = update_preview(get_child(0).rect_size.x) while status is GDScriptFunctionState: status = yield(status, "completed") - else: - preview_index = -1 - preview.visible = false - remove_child(preview) - rect_size = Vector2(0, 0) - processing_button = false + update() func update_preview(size : int = 0) -> void: if preview_index == -1: diff --git a/material_maker/preview/preview_2d.tscn b/material_maker/preview/preview_2d.tscn index 4092213..4bcc1f4 100644 --- a/material_maker/preview/preview_2d.tscn +++ b/material_maker/preview/preview_2d.tscn @@ -20,6 +20,7 @@ void fragment() { }" [sub_resource type="ShaderMaterial" id=2] +resource_local_to_scene = true shader = SubResource( 1 ) shader_param/size = Vector2( 585, 492 ) diff --git a/material_maker/preview/preview_2d_panel.tscn b/material_maker/preview/preview_2d_panel.tscn new file mode 100644 index 0000000..301f416 --- /dev/null +++ b/material_maker/preview/preview_2d_panel.tscn @@ -0,0 +1,130 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=1] +[ext_resource path="res://material_maker/preview/control_point.tscn" type="PackedScene" id=2] +[ext_resource path="res://material_maker/preview/preview_2d.tscn" type="PackedScene" id=3] + +[sub_resource type="Shader" id=1] +code = "shader_type canvas_item; + +uniform sampler2D tex; +uniform vec2 size; + +void fragment() { + float ms = max(size.x, size.y); + vec2 uv = fract(0.5+1.2*(UV-vec2(0.5))*ms/size.yx); + float is = min(size.x, size.y)/1.2; + vec2 m2 = min(fract(uv), 1.0-fract(uv)); + vec4 image = texture(tex, uv); + vec3 image_with_background = mix(vec3(mod(floor(uv.x*32.0)+floor(uv.y*32.0), 2.0)), image.xyz, image.a); + float lines_color = 0.5*(cos(5.0*TIME+100.0*(uv.x+uv.y))+1.0); + COLOR = vec4(mix(image_with_background, vec3(lines_color), step(is*min(m2.x, m2.y), 1.0)), 1.0); +}" + +[sub_resource type="ShaderMaterial" id=2] +resource_local_to_scene = true +shader = SubResource( 1 ) +shader_param/size = Vector2( 585, 492 ) + +[sub_resource type="AtlasTexture" id=3] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 64, 48, 32, 32 ) + +[sub_resource type="AtlasTexture" id=4] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 16, 64, 16, 16 ) + +[node name="Preview2D" instance=ExtResource( 3 )] +material = SubResource( 2 ) +rect_min_size = Vector2( 200, 200 ) + +[node name="P1" parent="." index="0" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 1, 0.466667, 0, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 37.0 +margin_bottom = 61.0 +texture = SubResource( 3 ) + +[node name="P2" parent="." index="1" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 0, 0.505882, 1, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 37.0 +margin_bottom = 61.0 +texture = SubResource( 3 ) + +[node name="Rect1" parent="." index="2" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 21.0 +margin_bottom = 45.0 +texture = SubResource( 4 ) +parent_control = "P1" +control_type = 1 + +[node name="Radius1" parent="." index="3" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 21.0 +margin_bottom = 45.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 4 ) +parent_control = "P1" +control_type = 2 + +[node name="Radius11" parent="." index="4" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 21.0 +margin_bottom = 45.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 4 ) +parent_control = "Radius1" +control_type = 2 + +[node name="Scale1" parent="." index="5" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 21.0 +margin_bottom = 45.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 4 ) +parent_control = "P1" +control_type = 3 + +[node name="Angle1" parent="." index="6" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 21.0 +margin_bottom = 45.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 4 ) +parent_control = "P1" +control_type = 2 + +[node name="Angle2" parent="." index="7" instance=ExtResource( 2 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_left = 5.0 +margin_top = 29.0 +margin_right = 21.0 +margin_bottom = 45.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 4 ) +parent_control = "P1" +control_type = 2 diff --git a/material_maker/preview/preview_3d_panel.tscn b/material_maker/preview/preview_3d_panel.tscn new file mode 100644 index 0000000..76ea808 --- /dev/null +++ b/material_maker/preview/preview_3d_panel.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://material_maker/preview/preview_3d.tscn" type="PackedScene" id=1] +[ext_resource path="res://material_maker/preview/preview_3d_ui.tscn" type="PackedScene" id=2] + +[node name="Preview3D" instance=ExtResource( 1 )] +visible = true +margin_left = 0.0 +margin_top = 0.0 +margin_right = 0.0 +margin_bottom = 0.0 +rect_min_size = Vector2( 250, 200 ) + +[node name="MaterialPreview" parent="." index="0"] +size = Vector2( 1280, 720 ) +render_target_update_mode = 3 + +[node name="Preview3DUI" parent="." index="1" instance=ExtResource( 2 )] +[connection signal="environment_selected" from="Preview3DUI" to="." method="_on_Environment_item_selected"] +[connection signal="model_selected" from="Preview3DUI" to="." method="_on_Model_item_selected"] +[connection signal="rotate_toggled" from="Preview3DUI" to="." method="_on_Rotate_toggled"] diff --git a/material_maker/widgets/gradient_editor.tscn b/material_maker/widgets/gradient_editor.tscn index 8175d56..81fda03 100644 --- a/material_maker/widgets/gradient_editor.tscn +++ b/material_maker/widgets/gradient_editor.tscn @@ -55,6 +55,9 @@ margin_right = 120.0 margin_bottom = 30.0 rect_min_size = Vector2( 120, 32 ) script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} [node name="Background" type="ColorRect" parent="."] material = SubResource( 2 ) diff --git a/material_maker/widgets/graph_tree/hierarchy_pane.gd b/material_maker/widgets/graph_tree/hierarchy_pane.gd new file mode 100644 index 0000000..fba032c --- /dev/null +++ b/material_maker/widgets/graph_tree/hierarchy_pane.gd @@ -0,0 +1,125 @@ +extends Tree + +export(int, 0, 3) var preview : int = 0 + +var default_texture : ImageTexture = null +var current_graph_edit = null +var current_generator = null +var item_from_gen : Dictionary = {} +var update_index = 0 + +var pending_updates = {} + +signal group_selected + +func _ready() -> void: + var default_image = Image.new() + default_image.create(24, 24, false, Image.FORMAT_RGBA8) + default_image.fill(Color(0.0, 0.0, 0.0, 0.0)) + default_texture = ImageTexture.new() + default_texture.create_from_image(default_image) + +func update_from_graph_edit(graph_edit) -> void: + $Delay.stop() + pending_updates = {} + update_index += 1 + for g in item_from_gen.keys(): + if is_instance_valid(g): + g.disconnect("output_changed", self, "on_gen_output_changed") + item_from_gen = {} + set_column_expand(0, true) + columns = preview+1 + for i in range(1, columns): + set_column_expand(i, false) + set_column_min_width(i, 28) + clear() + pending_updates = {} + if current_graph_edit != null and is_instance_valid(current_graph_edit): + current_graph_edit.disconnect("view_updated", self, "on_view_updated") + if current_generator != null and is_instance_valid(current_generator): + current_generator.disconnect("hierarchy_changed", self, "on_hierarchy_changed") + if graph_edit == null or graph_edit.top_generator == null or graph_edit.generator == null: + current_graph_edit = null + current_generator = null + return + current_graph_edit = graph_edit + current_graph_edit.connect("view_updated", self, "on_view_updated") + current_generator = graph_edit.generator + current_generator.connect("hierarchy_changed", self, "on_hierarchy_changed") + var file_name = "PTex" + if graph_edit.save_path != null: + file_name = graph_edit.save_path.get_file() + fill_item(create_item(null), graph_edit.top_generator, graph_edit.generator, file_name) + +func set_icon(item : TreeItem, generator : MMGenGraph, output : int) -> void: + var index = update_index + if output >= preview: + return + var result = generator.render(output, 24, true) + while result is GDScriptFunctionState: + result = yield(result, "completed") + if index == update_index: + var tex = ImageTexture.new() + result.copy_to_texture(tex) + result.release() + item.set_icon(1-min(generator.get_output_defs().size()-preview, 0)+output, tex) + else: + result.release() + +func fill_item(item : TreeItem, generator : MMGenGraph, selected : MMGenGraph, name = null) -> void: + item.set_text(0, name if name != null else generator.get_type_name()) + if generator == selected: + item.set_custom_color(0, Color(0.5, 0.5, 1)) + else: + item.set_custom_color(0, Color(1, 1, 1)) + item.set_metadata(0, generator) + item_from_gen[generator] = item + generator.connect("output_changed", self, "on_gen_output_changed", [ generator ]) + if preview > 0 and generator.get_output_defs().size() > 0: + for i in range(min(preview, generator.get_output_defs().size())): + item.set_icon(i+1, default_texture) + var output_count = min(generator.get_output_defs().size(), preview) + for output in range(output_count): + on_gen_output_changed(output, generator) + for c in generator.get_children(): + if c is MMGenGraph: + if c.is_template(): + continue + fill_item(create_item(item), c, selected) + +func _on_Hierarchy_item_double_clicked() -> void: + emit_signal("group_selected", get_selected().get_metadata(0)) + +func on_view_updated(generator) -> void: + if item_from_gen.has(current_generator): + item_from_gen[current_generator].set_custom_color(0, Color(1, 1, 1)) + current_generator = generator + if item_from_gen.has(current_generator): + item_from_gen[current_generator].set_custom_color(0, Color(0.5, 0.5, 1)) + +func on_gen_output_changed(index, generator) -> void: + if item_from_gen.has(generator) and index < preview: + if !pending_updates.has(generator): + pending_updates[generator] = [index] + elif pending_updates[generator].find(index) == -1: + pending_updates[generator].push_back(index) + $Delay.stop() + $Delay.start() + +func on_hierarchy_changed() -> void: + update_from_graph_edit(current_graph_edit) + +func _on_Delay_timeout() -> void: + for generator in pending_updates.keys(): + var item = item_from_gen[generator] + for index in pending_updates[generator]: + set_icon(item, generator, index) + +func _on_Hierarchy_gui_input(event): + if event is InputEventMouseButton and event.button_index == BUTTON_RIGHT and event.pressed: + $ContextMenu.rect_position = get_global_mouse_position() + $ContextMenu.popup() + +func _on_ContextMenu_id_pressed(id): + preview = id + update_from_graph_edit(current_graph_edit) diff --git a/material_maker/widgets/graph_tree/hierarchy_pane.tscn b/material_maker/widgets/graph_tree/hierarchy_pane.tscn new file mode 100644 index 0000000..bbb0917 --- /dev/null +++ b/material_maker/widgets/graph_tree/hierarchy_pane.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://material_maker/widgets/graph_tree/hierarchy_pane.gd" type="Script" id=1] + +[node name="Hierarchy" type="Tree"] +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_min_size = Vector2( 200, 150 ) +allow_reselect = true +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} +preview = 2 + +[node name="ContextMenu" type="PopupMenu" parent="."] +margin_right = 20.0 +margin_bottom = 20.0 +items = [ "No preview", null, 0, false, false, 0, 0, null, "", false, "1 preview", null, 0, false, false, 1, 0, null, "", false, "2 previews", null, 0, false, false, 2, 0, null, "", false, "3 previews", null, 0, false, false, 3, 0, null, "", false ] + +[node name="Delay" type="Timer" parent="."] +wait_time = 0.5 +one_shot = true +[connection signal="gui_input" from="." to="." method="_on_Hierarchy_gui_input"] +[connection signal="item_activated" from="." to="." method="_on_Hierarchy_item_double_clicked"] +[connection signal="item_double_clicked" from="." to="." method="_on_Hierarchy_item_double_clicked"] +[connection signal="id_pressed" from="ContextMenu" to="." method="_on_ContextMenu_id_pressed"] +[connection signal="timeout" from="Delay" to="." method="_on_Delay_timeout"] diff --git a/material_maker/widgets/tab_container.gd b/material_maker/widgets/tab_container.gd new file mode 100644 index 0000000..ae46ce3 --- /dev/null +++ b/material_maker/widgets/tab_container.gd @@ -0,0 +1,62 @@ +extends Panel + +export var rearrange_group : int = 0 + +var current_tab = -1 + +signal tab_changed +signal no_more_tabs + +func _ready(): + $Tabs.set_tabs_rearrange_group(rearrange_group) + add_to_group("tab_group_"+str(rearrange_group)) + +func add_child(control, legible_unique_name = false) -> void: + .add_child(control, legible_unique_name) + if !(control is Tabs): + $Tabs.add_tab(control.name) + set_current_tab($Tabs.get_tab_count()-1) + +func close_tab(tab = null) -> void: + if tab == null: + tab = $Tabs.get_current_tab() + get_node($Tabs.get_tab_title(tab)).queue_free() + $Tabs.remove_tab(tab) + if $Tabs.get_tab_count() == 0: + emit_signal("no_more_tabs") + current_tab = -1 + else: + set_current_tab(0) + +func set_current_tab(t) -> void: + if t == current_tab or t < 0 or t >= $Tabs.get_tab_count(): + if $Tabs.get_tab_count(): + current_tab = -1 + return + print("Setting current tab to "+str(t)) + var node + if current_tab >= 0: + node = get_node($Tabs.get_tab_title(current_tab)) + if node != null: + node.visible = false + print("Hiding "+$Tabs.get_tab_title($Tabs.current_tab)) + $Tabs.current_tab = t + current_tab = t + node = null + for tab_container in get_tree().get_nodes_in_group("tab_group_"+str(rearrange_group)): + print(tab_container.name) + node = tab_container.get_node($Tabs.get_tab_title(t)) + if node != null: + break + print(node) + if node != null: + if node.get_parent() != self: + node.get_parent().call_deferred("set_current_tab", 0) + node.get_parent().remove_child(node) + .add_child(node) + node.visible = true + node.rect_position = Vector2(0, $Tabs.rect_size.y) + node.rect_size = rect_size - node.rect_position + else: + print("Did not find panel") + emit_signal("tab_changed", t) diff --git a/material_maker/widgets/tab_container.tscn b/material_maker/widgets/tab_container.tscn new file mode 100644 index 0000000..eec8daa --- /dev/null +++ b/material_maker/widgets/tab_container.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://material_maker/widgets/tab_container.gd" type="Script" id=1] + +[node name="Tabs" type="Panel"] +margin_right = 260.0 +margin_bottom = 312.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Tabs" type="Tabs" parent="."] +anchor_right = 1.0 +margin_bottom = 24.0 +tab_align = 0 +drag_to_rearrange_enabled = true +__meta__ = { +"_edit_use_anchors_": false +} +[connection signal="tab_changed" from="Tabs" to="." method="set_current_tab"] +[connection signal="tab_close" from="Tabs" to="." method="close_tab"]