diff --git a/HEADS b/HEADS index d8f9d498..14465a50 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": {"3.2": "94a0fc47f7b4e90f8973f9adbfd3312579ed2825", "master": "8c73e813134001e575b6f59e3b0100471c007410", "3.x": "c4864a0e5f73a375259503ea1485794a6aad6df7"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "voxelman": {"master": "65485930a20f65844d496b4ba47dec5b6ed70b91"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "procedural_animations": {"master": "f8aae42bf06b3936cc6bd24cb18e1c3ec9f78f4f"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "983090d21a08ebed30a5ce06681269819ab12e48"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "terraman": {"master": "c72d8fc03295588fc18c5168ce351bd0c321ec5f"}, "pandemonium_engine": {"master": "df9099e0edaccc247899a69c125cbcda671b9145"}} \ No newline at end of file +{"engine": {"3.2": "94a0fc47f7b4e90f8973f9adbfd3312579ed2825", "master": "8c73e813134001e575b6f59e3b0100471c007410", "3.x": "c4864a0e5f73a375259503ea1485794a6aad6df7"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "voxelman": {"master": "65485930a20f65844d496b4ba47dec5b6ed70b91"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "procedural_animations": {"master": "f8aae42bf06b3936cc6bd24cb18e1c3ec9f78f4f"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "983090d21a08ebed30a5ce06681269819ab12e48"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "terraman": {"master": "c72d8fc03295588fc18c5168ce351bd0c321ec5f"}, "pandemonium_engine": {"master": "0abb68c016ed33960ce31f27bd3fe89a2cbd0bed"}} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/editor/MatMakerGDEditor.gd b/game/addons/mat_maker_gd/editor/MatMakerGDEditor.gd index 14369a09..3b3cf5ad 100644 --- a/game/addons/mat_maker_gd/editor/MatMakerGDEditor.gd +++ b/game/addons/mat_maker_gd/editor/MatMakerGDEditor.gd @@ -8,7 +8,7 @@ export(NodePath) var add_popup_path : NodePath = "Popups/AddPopup" var _graph_edit : GraphEdit = null -var _material : MMMateial +var _material : MMMaterial var _ignore_material_change_event : int = 0 var _recreation_in_progress : bool = false @@ -29,28 +29,28 @@ func ensure_objs() -> void: if !_graph_edit: _graph_edit = get_node(graph_edit_path) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_INT, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR3, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_COLOR, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_IMAGE, MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_INT, MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_FLOAT, MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_VECTOR2, MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_VECTOR3, MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_COLOR, MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_INT) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR3) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_COLOR) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SLOT_TYPE_IMAGE) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SLOT_TYPE_INT) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SLOT_TYPE_FLOAT) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SLOT_TYPE_VECTOR2) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SLOT_TYPE_VECTOR3) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SLOT_TYPE_COLOR) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL, MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_INT, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_INT) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR3, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR3) - _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_COLOR, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_COLOR) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_IMAGE, MMNodeUniversalProperty.SLOT_TYPE_IMAGE) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_INT, MMNodeUniversalProperty.SLOT_TYPE_INT) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_FLOAT, MMNodeUniversalProperty.SLOT_TYPE_FLOAT) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_VECTOR2, MMNodeUniversalProperty.SLOT_TYPE_VECTOR2) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_VECTOR3, MMNodeUniversalProperty.SLOT_TYPE_VECTOR3) + _graph_edit.add_valid_connection_type(MMNodeUniversalProperty.SLOT_TYPE_COLOR, MMNodeUniversalProperty.SLOT_TYPE_COLOR) _graph_edit.connect("connection_request", self, "on_graph_edit_connection_request") _graph_edit.connect("disconnection_request", self, "on_graph_edit_disconnection_request") @@ -113,7 +113,7 @@ func find_graph_node_for(nnode) -> Node: return null -func set_mmmaterial(object : MMMateial): +func set_mmmaterial(object : MMMaterial): if _material: _material.disconnect("changed", self, "on_material_changed") diff --git a/game/addons/mat_maker_gd/editor/mm_graph_node.gd b/game/addons/mat_maker_gd/editor/mm_graph_node.gd index 046bbdaf..a5f753d4 100644 --- a/game/addons/mat_maker_gd/editor/mm_graph_node.gd +++ b/game/addons/mat_maker_gd/editor/mm_graph_node.gd @@ -5,7 +5,7 @@ var gradient_editor_scene : PackedScene = preload("res://addons/mat_maker_gd/wid var polygon_edit_scene : PackedScene = preload("res://addons/mat_maker_gd/widgets/polygon_edit/polygon_edit.tscn") var curve_edit_scene : PackedScene = preload("res://addons/mat_maker_gd/widgets/curve_edit/curve_edit.tscn") -var _material : MMMateial = null +var _material : MMMaterial = null var _node : MMNode = null var properties : Array = Array() @@ -33,7 +33,7 @@ func add_slot_texture(getter : String, setter : String) -> int: t.expand = true t.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, t) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, t) t.texture = _node.call(getter, _material, slot_idx) properties[slot_idx].append(t.texture) @@ -86,7 +86,7 @@ func add_slot_gradient() -> int: ge.graph_node = self ge.set_undo_redo(_undo_redo) - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "", "", ge) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, "", "", ge) ge.set_value(_node) #ge.texture = _node.call(getter, _material, slot_idx) @@ -97,7 +97,7 @@ func add_slot_gradient() -> int: func add_slot_polygon() -> int: var ge : Control = polygon_edit_scene.instance() - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "", "", ge) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, "", "", ge) ge.set_value(_node) #ge.texture = _node.call(getter, _material, slot_idx) @@ -108,7 +108,7 @@ func add_slot_polygon() -> int: func add_slot_curve() -> int: var ge : Control = curve_edit_scene.instance() - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "", "", ge) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, "", "", ge) ge.set_value(_node) #ge.texture = _node.call(getter, _material, slot_idx) @@ -119,7 +119,7 @@ func add_slot_curve() -> int: func add_slot_color(getter : String, setter : String) -> int: var cp : ColorPickerButton = ColorPickerButton.new() - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, cp) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, cp) cp.color = _node.call(getter) @@ -145,7 +145,7 @@ func add_slot_label(getter : String, setter : String, slot_name : String) -> int l.text = slot_name - return add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, l) + return add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, l) func add_slot_line_edit(getter : String, setter : String, slot_name : String, placeholder : String = "") -> int: var bc : VBoxContainer = VBoxContainer.new() @@ -158,7 +158,7 @@ func add_slot_line_edit(getter : String, setter : String, slot_name : String, pl le.placeholder_text = placeholder bc.add_child(le) - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, bc) le.text = _node.call(getter) @@ -181,7 +181,7 @@ func add_slot_enum(getter : String, setter : String, slot_name : String, values bc.add_child(mb) - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, bc) mb.selected = _node.call(getter) @@ -202,7 +202,7 @@ func add_slot_int(getter : String, setter : String, slot_name : String, prange : sb.max_value = prange.y bc.add_child(sb) - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, bc) sb.value = _node.call(getter) @@ -214,7 +214,7 @@ func add_slot_bool(getter : String, setter : String, slot_name : String) -> int: var cb : CheckBox = CheckBox.new() cb.text = slot_name - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, cb) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, cb) cb.pressed = _node.call(getter) @@ -265,7 +265,7 @@ func add_slot_float(getter : String, setter : String, slot_name : String, step : var sb : SpinBox = SpinBox.new() bc.add_child(sb) - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, bc) sb.rounded = false sb.step = step sb.min_value = prange.x @@ -312,7 +312,7 @@ func add_slot_vector2(getter : String, setter : String, slot_name : String, step var sby : SpinBox = SpinBox.new() bc.add_child(sby) - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, bc) sbx.rounded = false sby.rounded = false sbx.step = step @@ -348,7 +348,7 @@ func add_slot_vector3(getter : String, setter : String, slot_name : String, step var sbz : SpinBox = SpinBox.new() bc.add_child(sbz) - var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, getter, setter, bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SLOT_TYPE_NONE, MMNodeUniversalProperty.SLOT_TYPE_NONE, getter, setter, bc) sbx.rounded = false sby.rounded = false sbz.rounded = false @@ -522,7 +522,7 @@ func get_output_property_graph_node_slot_index(property) -> int: func get_property_control(slot_idx : int) -> Node: return properties[slot_idx][5] -func set_node(material : MMMateial, node : MMNode) -> void: +func set_node(material : MMMaterial, node : MMNode) -> void: _node = node _material = material diff --git a/game/addons/mat_maker_gd/new_resource.tres b/game/addons/mat_maker_gd/new_resource.tres index 9e96b424..3d322f68 100644 --- a/game/addons/mat_maker_gd/new_resource.tres +++ b/game/addons/mat_maker_gd/new_resource.tres @@ -1,10 +1,8 @@ -[gd_resource type="Resource" load_steps=89 format=2] +[gd_resource type="MMMaterial" load_steps=91 format=2] -[ext_resource path="res://addons/mat_maker_gd/nodes/mm_material.gd" type="Script" id=1] -[ext_resource path="res://addons/mat_maker_gd/nodes/filter/adjust_hsv.gd" type="Script" id=2] +[ext_resource path="res://addons/mat_maker_gd/nodes/filter/colorize.gd" type="Script" id=1] [ext_resource path="res://addons/mat_maker_gd/nodes/noise/voronoi.gd" type="Script" id=3] [ext_resource path="res://addons/mat_maker_gd/nodes/filter/invert.gd" type="Script" id=4] -[ext_resource path="res://addons/mat_maker_gd/nodes/mm_node_universal_property.gd" type="Script" id=5] [ext_resource path="res://addons/mat_maker_gd/nodes/filter/combine.gd" type="Script" id=6] [ext_resource path="res://addons/mat_maker_gd/nodes/transform/scale.gd" type="Script" id=7] [ext_resource path="res://addons/mat_maker_gd/nodes/transform/repeat.gd" type="Script" id=8] @@ -21,72 +19,26 @@ [ext_resource path="res://addons/mat_maker_gd/nodes/filter/math.gd" type="Script" id=19] [ext_resource path="res://addons/mat_maker_gd/nodes/transform/color_tiler.gd" type="Script" id=20] -[sub_resource type="Resource" id=1] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=5] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=3] -script = ExtResource( 5 ) -default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) - -[sub_resource type="Resource" id=4] -script = ExtResource( 2 ) -graph_position = Vector2( 140, 0 ) -image = SubResource( 1 ) -input = SubResource( 3 ) -hue = 0.0 -saturation = 1.0 -value = 1.0 - -[sub_resource type="Resource" id=5] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=6] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=6] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=7] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=7] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=2] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=2] -script = ExtResource( 5 ) -default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) - -[sub_resource type="Resource" id=8] -script = ExtResource( 3 ) +[sub_resource type="MMNode" id=8] graph_position = Vector2( -160, 40 ) +output_properties = [ SubResource( 7 ), SubResource( 5 ), SubResource( 2 ), SubResource( 6 ) ] +script = ExtResource( 3 ) out_nodes = SubResource( 7 ) out_borders = SubResource( 5 ) out_random_color = SubResource( 2 ) @@ -96,305 +48,223 @@ stretch = Vector2( 2.13, 2.13 ) intensity = 1.07 randomness = 0.89 -[sub_resource type="Resource" id=9] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=9] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=10] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=10] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input1 " -[sub_resource type="Resource" id=11] -script = ExtResource( 4 ) +[sub_resource type="MMNode" id=11] graph_position = Vector2( 380, 80 ) +input_properties = [ SubResource( 10 ) ] +output_properties = [ SubResource( 9 ) ] +script = ExtResource( 4 ) image = SubResource( 9 ) input = SubResource( 10 ) -[sub_resource type="Resource" id=12] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=12] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=13] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=13] default_type = 1 -default_int = 0 default_float = 1.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> A " -[sub_resource type="Resource" id=14] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=14] default_type = 1 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> B " input_property = SubResource( 7 ) -[sub_resource type="Resource" id=15] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=15] default_type = 1 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> G " input_property = SubResource( 2 ) -[sub_resource type="Resource" id=16] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=16] default_type = 1 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> R " input_property = SubResource( 5 ) -[sub_resource type="Resource" id=17] -script = ExtResource( 6 ) +[sub_resource type="MMNode" id=17] graph_position = Vector2( 380, 380 ) +input_properties = [ SubResource( 16 ), SubResource( 15 ), SubResource( 14 ), SubResource( 13 ) ] +output_properties = [ SubResource( 12 ) ] +script = ExtResource( 6 ) image = SubResource( 12 ) input_r = SubResource( 16 ) input_g = SubResource( 15 ) input_b = SubResource( 14 ) input_a = SubResource( 13 ) -[sub_resource type="Resource" id=18] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=18] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=19] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=19] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input1 " input_property = SubResource( 12 ) -[sub_resource type="Resource" id=20] -script = ExtResource( 7 ) +[sub_resource type="MMNode" id=20] graph_position = Vector2( 1080, 180 ) +input_properties = [ SubResource( 19 ) ] +output_properties = [ SubResource( 18 ) ] +script = ExtResource( 7 ) image = SubResource( 18 ) input = SubResource( 19 ) center = Vector2( 1, 1 ) scale = Vector2( 1.3, 1.3 ) -[sub_resource type="Resource" id=21] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=21] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +get_value_from_owner = true +input_slot_type = 6 +output_slot_type = 6 +slot_name = ">>> Apply >>>" input_property = SubResource( 12 ) -[sub_resource type="Resource" id=22] -script = ExtResource( 8 ) +[sub_resource type="MMNode" id=22] graph_position = Vector2( 560, 300 ) +input_properties = [ SubResource( 21 ) ] +output_properties = [ SubResource( 21 ) ] +script = ExtResource( 8 ) input = SubResource( 21 ) -[sub_resource type="Resource" id=23] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=23] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=24] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=24] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " input_property = SubResource( 21 ) -[sub_resource type="Resource" id=25] -script = ExtResource( 9 ) +[sub_resource type="MMNode" id=25] graph_position = Vector2( 860, 200 ) +input_properties = [ SubResource( 24 ) ] +output_properties = [ SubResource( 23 ) ] +script = ExtResource( 9 ) image = SubResource( 23 ) input = SubResource( 24 ) direction = 0 amount = 1.06 center = 0.0 -[sub_resource type="Resource" id=26] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=26] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=27] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=27] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " input_property = SubResource( 21 ) -[sub_resource type="Resource" id=28] -script = ExtResource( 10 ) +[sub_resource type="MMNode" id=28] graph_position = Vector2( 620, 460 ) +input_properties = [ SubResource( 27 ) ] +output_properties = [ SubResource( 26 ) ] +script = ExtResource( 10 ) image = SubResource( 26 ) input = SubResource( 27 ) direction = 0 offset = 0.32 -[sub_resource type="Resource" id=32] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=32] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=33] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=33] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " input_property = SubResource( 21 ) -[sub_resource type="Resource" id=34] -script = ExtResource( 12 ) +[sub_resource type="MMNode" id=34] graph_position = Vector2( 820, 580 ) +input_properties = [ SubResource( 33 ) ] +output_properties = [ SubResource( 32 ) ] +script = ExtResource( 12 ) image = SubResource( 32 ) input = SubResource( 33 ) radius = 1.0 repeat = 4 -[sub_resource type="Resource" id=35] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=35] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=36] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=36] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input1 " -[sub_resource type="Resource" id=37] -script = ExtResource( 13 ) +[sub_resource type="MMNode" id=37] graph_position = Vector2( 1040, 560 ) +input_properties = [ SubResource( 36 ) ] +output_properties = [ SubResource( 35 ) ] +script = ExtResource( 13 ) image = SubResource( 35 ) input = SubResource( 36 ) center = Vector2( 0.13, 0 ) rotate = 150.0 -[sub_resource type="Resource" id=38] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=38] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=39] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=39] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " input_property = SubResource( 21 ) -[sub_resource type="Resource" id=40] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=43] +default_type = 1 +default_float = 4.1 +input_slot_type = 6 +slot_name = "Translate X" + +[sub_resource type="MMNodeUniversalProperty" id=44] +default_type = 1 +default_float = 2.2 +input_slot_type = 6 +slot_name = "Translate Y" + +[sub_resource type="MMNodeUniversalProperty" id=40] default_type = 1 -default_int = 0 default_float = 14.5 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = "Rotate" input_property = SubResource( 32 ) -[sub_resource type="Resource" id=41] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=41] default_type = 1 -default_int = 0 default_float = 1.6 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = "Scale X" -[sub_resource type="Resource" id=42] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=42] default_type = 1 -default_int = 0 default_float = 1.1 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = "Scale Y" -[sub_resource type="Resource" id=43] -script = ExtResource( 5 ) -default_type = 1 -default_int = 0 -default_float = 4.1 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) - -[sub_resource type="Resource" id=44] -script = ExtResource( 5 ) -default_type = 1 -default_int = 0 -default_float = 2.2 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) - -[sub_resource type="Resource" id=45] -script = ExtResource( 11 ) +[sub_resource type="MMNode" id=45] graph_position = Vector2( 1280, 560 ) +input_properties = [ SubResource( 39 ), SubResource( 43 ), SubResource( 44 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ) ] +output_properties = [ SubResource( 38 ) ] +script = ExtResource( 11 ) image = SubResource( 38 ) input = SubResource( 39 ) translate_x = SubResource( 43 ) @@ -404,187 +274,142 @@ scale_x = SubResource( 41 ) scale_y = SubResource( 42 ) mode = 1 -[sub_resource type="Resource" id=46] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=46] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=47] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=47] default_type = 1 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " input_property = SubResource( 23 ) -[sub_resource type="Resource" id=48] -script = ExtResource( 14 ) +[sub_resource type="MMNode" id=48] graph_position = Vector2( 620, 0 ) +input_properties = [ SubResource( 47 ) ] +output_properties = [ SubResource( 46 ) ] +script = ExtResource( 14 ) points = [ 0.0, 0.0, 0.0, 1.0, 0.284455, 0.780757, 0.0, 0.0, 0.735577, 0.159306, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0 ] image = SubResource( 46 ) input = SubResource( 47 ) -[sub_resource type="Resource" id=49] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=49] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=50] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=50] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " -[sub_resource type="Resource" id=51] -script = ExtResource( 15 ) +[sub_resource type="MMNode" id=51] graph_position = Vector2( 120, 440 ) +input_properties = [ SubResource( 50 ) ] +output_properties = [ SubResource( 49 ) ] +script = ExtResource( 15 ) image = SubResource( 49 ) input = SubResource( 50 ) axis = 2 -[sub_resource type="Resource" id=52] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=52] default_type = 1 -default_int = 0 default_float = 0.1 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = "edge" +value_step = 0.05 -[sub_resource type="Resource" id=53] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=53] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=54] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=54] default_type = 1 -default_int = 0 default_float = 1.3 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = "radius" +value_step = 0.05 input_property = SubResource( 2 ) -[sub_resource type="Resource" id=55] -script = ExtResource( 16 ) +[sub_resource type="MMNode" id=55] graph_position = Vector2( -440, 200 ) +input_properties = [ SubResource( 54 ), SubResource( 52 ) ] +output_properties = [ SubResource( 53 ) ] +script = ExtResource( 16 ) image = SubResource( 53 ) -shape_type = 3 +shape_type = 2 sides = 7 radius = SubResource( 54 ) edge = SubResource( 52 ) -[sub_resource type="Resource" id=56] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=56] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=59] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=59] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=57] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=57] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " input_property = SubResource( 59 ) -[sub_resource type="Resource" id=58] -script = ExtResource( 17 ) +[sub_resource type="MMNode" id=58] graph_position = Vector2( 580, 800 ) +input_properties = [ SubResource( 57 ) ] +output_properties = [ SubResource( 56 ) ] +script = ExtResource( 17 ) image = SubResource( 56 ) input = SubResource( 57 ) mode = 0 -[sub_resource type="Resource" id=60] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=60] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " input_property = SubResource( 12 ) -[sub_resource type="Resource" id=61] -script = ExtResource( 18 ) +[sub_resource type="MMNode" id=61] graph_position = Vector2( 320, 700 ) +input_properties = [ SubResource( 60 ) ] +output_properties = [ SubResource( 59 ) ] +script = ExtResource( 18 ) image = SubResource( 59 ) input = SubResource( 60 ) edge_color = 0.9 -[sub_resource type="Resource" id=63] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=63] default_type = 1 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> A " +value_step = 0.01 +value_range = Vector2( 0, 1 ) input_property = SubResource( 5 ) -[sub_resource type="Resource" id=64] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=64] default_type = 1 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> B " +value_step = 0.01 +value_range = Vector2( 0, 1 ) input_property = SubResource( 53 ) -[sub_resource type="Resource" id=65] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=65] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=62] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=62] default_type = 1 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +get_value_from_owner = true +output_slot_type = 6 +slot_name = " Output >>>" -[sub_resource type="Resource" id=66] -script = ExtResource( 19 ) +[sub_resource type="MMNode" id=66] graph_position = Vector2( -720, 280 ) +input_properties = [ SubResource( 63 ), SubResource( 64 ) ] +output_properties = [ SubResource( 62 ), SubResource( 65 ) ] +script = ExtResource( 19 ) image = SubResource( 65 ) a = SubResource( 63 ) b = SubResource( 64 ) @@ -592,45 +417,30 @@ output = SubResource( 62 ) operation = 3 clamp_result = true -[sub_resource type="Resource" id=67] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=67] default_type = 1 -default_int = 0 default_float = 1.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Mask " -[sub_resource type="Resource" id=68] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=68] default_type = 4 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +input_slot_type = 6 +slot_name = ">>> Input " -[sub_resource type="Resource" id=69] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=69] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=70] -script = ExtResource( 5 ) +[sub_resource type="MMNodeUniversalProperty" id=70] default_type = 5 -default_int = 0 -default_float = 0.0 -default_vector2 = Vector2( 0, 0 ) -default_vector3 = Vector3( 0, 0, 0 ) -default_color = Color( 0, 0, 0, 1 ) +output_slot_type = 0 -[sub_resource type="Resource" id=71] -script = ExtResource( 20 ) +[sub_resource type="MMNode" id=71] graph_position = Vector2( -1060, 280 ) +input_properties = [ SubResource( 68 ), SubResource( 67 ) ] +output_properties = [ SubResource( 70 ), SubResource( 69 ) ] +script = ExtResource( 20 ) input = SubResource( 68 ) in_mask = SubResource( 67 ) output = SubResource( 70 ) @@ -646,7 +456,54 @@ rnd_scale = 0.2 rnd_opacity = 0.0 variations = false -[resource] +[sub_resource type="MMNodeUniversalProperty" id=74] +default_type = 1 +default_float = 0.65 +input_slot_type = 6 +slot_name = "edge" +value_step = 0.05 + +[sub_resource type="MMNodeUniversalProperty" id=72] +output_slot_type = 0 + +[sub_resource type="MMNodeUniversalProperty" id=75] +default_type = 1 +default_float = 0.3 +input_slot_type = 6 +slot_name = "radius" +value_step = 0.05 + +[sub_resource type="MMNode" id=73] +graph_position = Vector2( -340, -420 ) +input_properties = [ SubResource( 75 ), SubResource( 74 ) ] +output_properties = [ SubResource( 72 ) ] +script = ExtResource( 16 ) +image = SubResource( 72 ) +shape_type = 1 +sides = 12 +radius = SubResource( 75 ) +edge = SubResource( 74 ) + +[sub_resource type="MMNodeUniversalProperty" id=76] +default_type = 5 +output_slot_type = 0 + +[sub_resource type="MMNodeUniversalProperty" id=77] +default_type = 1 +default_float = 1.0 +input_slot_type = 6 +slot_name = ">>> Input1 " +input_property = SubResource( 72 ) + +[sub_resource type="MMNode" id=78] +graph_position = Vector2( -80, -520 ) +input_properties = [ SubResource( 77 ) ] +output_properties = [ SubResource( 76 ) ] script = ExtResource( 1 ) -image_size = Vector2( 128, 128 ) -nodes = [ SubResource( 4 ), SubResource( 8 ), SubResource( 11 ), SubResource( 17 ), SubResource( 20 ), SubResource( 22 ), SubResource( 25 ), SubResource( 28 ), SubResource( 34 ), SubResource( 37 ), SubResource( 45 ), SubResource( 48 ), SubResource( 51 ), SubResource( 55 ), SubResource( 58 ), SubResource( 61 ), SubResource( 66 ), SubResource( 71 ) ] +interpolation_type = 2 +points = PoolRealArray( 0, 0, 0, 0, 1, 0.458472, 0.921875, 0.860657, 0.860657, 1, 1, 1, 0, 0, 1 ) +image = SubResource( 76 ) +input = SubResource( 77 ) + +[resource] +nodes = [ SubResource( 8 ), SubResource( 11 ), SubResource( 17 ), SubResource( 20 ), SubResource( 22 ), SubResource( 25 ), SubResource( 28 ), SubResource( 34 ), SubResource( 37 ), SubResource( 45 ), SubResource( 48 ), SubResource( 51 ), SubResource( 55 ), SubResource( 58 ), SubResource( 61 ), SubResource( 66 ), SubResource( 71 ), SubResource( 73 ), SubResource( 78 ) ] diff --git a/game/addons/mat_maker_gd/nodes/filter/adjust_hsv.gd b/game/addons/mat_maker_gd/nodes/filter/adjust_hsv.gd index 980b5544..b840d899 100644 --- a/game/addons/mat_maker_gd/nodes/filter/adjust_hsv.gd +++ b/game/addons/mat_maker_gd/nodes/filter/adjust_hsv.gd @@ -10,18 +10,18 @@ export(float) var value : float = 1 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -39,7 +39,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : Color = input.get_value(uv) return MMAlgos.adjust_hsv(c, hue, saturation, value) diff --git a/game/addons/mat_maker_gd/nodes/filter/blend.gd b/game/addons/mat_maker_gd/nodes/filter/blend.gd index 7cebb172..3d32535e 100644 --- a/game/addons/mat_maker_gd/nodes/filter/blend.gd +++ b/game/addons/mat_maker_gd/nodes/filter/blend.gd @@ -25,34 +25,34 @@ export(Resource) var opacity : Resource func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !input1: input1 = MMNodeUniversalProperty.new() - input1.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input1.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input1.set_default_value(Color(1, 1, 1, 1)) - input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input1.slot_name = ">>> Input1 " if !input2: input2 = MMNodeUniversalProperty.new() - input2.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input2.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input2.set_default_value(Color(1, 1, 1, 1)) - input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input2.slot_name = ">>> Input2 " if !opacity: opacity = MMNodeUniversalProperty.new() - opacity.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + opacity.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT opacity.set_default_value(0.5) opacity.value_range = Vector2(0, 1) opacity.value_step = 0.01 - opacity.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + opacity.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL opacity.slot_name = "opacity" register_input_property(input1) @@ -74,7 +74,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var b : Vector3 = Vector3() #vec4 $(name_uv)_s1 = $s1($uv); diff --git a/game/addons/mat_maker_gd/nodes/filter/blur_gaussian.gd b/game/addons/mat_maker_gd/nodes/filter/blur_gaussian.gd index 844f6953..d61595be 100644 --- a/game/addons/mat_maker_gd/nodes/filter/blur_gaussian.gd +++ b/game/addons/mat_maker_gd/nodes/filter/blur_gaussian.gd @@ -11,24 +11,24 @@ var size : int = 0 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color()) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !sigma: sigma = MMNodeUniversalProperty.new() - sigma.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + sigma.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT sigma.set_default_value(50) - sigma.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + sigma.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL sigma.slot_name = "Sigma" register_input_property(input) @@ -50,7 +50,7 @@ func _render(material) -> void: image.set_value(img) -func render_image(material) -> Image: +func _render_image(material) -> Image: var img : Image = Image.new() img.create(material.image_size.x, material.image_size.y, false, Image.FORMAT_RGBA8) diff --git a/game/addons/mat_maker_gd/nodes/filter/brightness_contrast.gd b/game/addons/mat_maker_gd/nodes/filter/brightness_contrast.gd index 49bd880b..068b1e18 100644 --- a/game/addons/mat_maker_gd/nodes/filter/brightness_contrast.gd +++ b/game/addons/mat_maker_gd/nodes/filter/brightness_contrast.gd @@ -9,18 +9,18 @@ export(float) var contrast : float = 1 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -37,7 +37,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : Color = input.get_value(uv) return MMAlgos.brightness_contrast(c, brightness, contrast) diff --git a/game/addons/mat_maker_gd/nodes/filter/colorize.gd b/game/addons/mat_maker_gd/nodes/filter/colorize.gd index 2979d09f..ab40c52b 100644 --- a/game/addons/mat_maker_gd/nodes/filter/colorize.gd +++ b/game/addons/mat_maker_gd/nodes/filter/colorize.gd @@ -7,18 +7,18 @@ export(Resource) var input : Resource func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input.set_default_value(1) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -34,7 +34,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = input.get_value(uv) return get_gradient_color(f) diff --git a/game/addons/mat_maker_gd/nodes/filter/combine.gd b/game/addons/mat_maker_gd/nodes/filter/combine.gd index 144b63b5..18c780dc 100644 --- a/game/addons/mat_maker_gd/nodes/filter/combine.gd +++ b/game/addons/mat_maker_gd/nodes/filter/combine.gd @@ -10,42 +10,42 @@ export(Resource) var input_a : Resource func _init_properties(): if !input_r: input_r = MMNodeUniversalProperty.new() - input_r.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input_r.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input_r.set_default_value(0) - input_r.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input_r.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input_r.slot_name = ">>> R " if !input_g: input_g = MMNodeUniversalProperty.new() - input_g.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input_g.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input_g.set_default_value(0) - input_g.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input_g.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input_g.slot_name = ">>> G " if !input_b: input_b = MMNodeUniversalProperty.new() - input_b.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input_b.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input_b.set_default_value(0) - input_b.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input_b.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input_b.slot_name = ">>> B " if !input_a: input_a = MMNodeUniversalProperty.new() - input_a.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input_a.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input_a.set_default_value(1) - input_a.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input_a.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input_a.slot_name = ">>> A " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input_r) @@ -66,7 +66,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var r : float = input_r.get_value(uv) var g : float = input_g.get_value(uv) var b : float = input_b.get_value(uv) diff --git a/game/addons/mat_maker_gd/nodes/filter/decompose.gd b/game/addons/mat_maker_gd/nodes/filter/decompose.gd index 9e2908a7..105c60b7 100644 --- a/game/addons/mat_maker_gd/nodes/filter/decompose.gd +++ b/game/addons/mat_maker_gd/nodes/filter/decompose.gd @@ -10,35 +10,35 @@ export(Resource) var out_a : Resource func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !out_r: out_r = MMNodeUniversalProperty.new() - out_r.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_r.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_r.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_r.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_g: out_g = MMNodeUniversalProperty.new() - out_g.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_g.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_g.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_g.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_b: out_b = MMNodeUniversalProperty.new() - out_b.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_b.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_b.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_b.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_a: out_a = MMNodeUniversalProperty.new() - out_a.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_a.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_a.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_a.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_input_property(input) register_output_property(out_r) @@ -97,5 +97,5 @@ func _render(material) -> void: out_b.set_value(img_b) out_a.set_value(img_a) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() diff --git a/game/addons/mat_maker_gd/nodes/filter/emboss.gd b/game/addons/mat_maker_gd/nodes/filter/emboss.gd index fb22817e..bebb6583 100644 --- a/game/addons/mat_maker_gd/nodes/filter/emboss.gd +++ b/game/addons/mat_maker_gd/nodes/filter/emboss.gd @@ -12,16 +12,16 @@ var size : int = 0 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input.set_default_value(1) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " register_input_property(input) @@ -43,7 +43,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = 0 f = emboss(uv, size, angle, amount, width) diff --git a/game/addons/mat_maker_gd/nodes/filter/fill_channel.gd b/game/addons/mat_maker_gd/nodes/filter/fill_channel.gd index 031d9b56..b0acc5de 100644 --- a/game/addons/mat_maker_gd/nodes/filter/fill_channel.gd +++ b/game/addons/mat_maker_gd/nodes/filter/fill_channel.gd @@ -9,24 +9,24 @@ export(int, "R,G,B,A") var channel : int = 3 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color()) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !value: value = MMNodeUniversalProperty.new() - value.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + value.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT value.set_default_value(1) - value.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + value.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL value.value_step = 0.01 value.value_range = Vector2(0, 1) @@ -46,7 +46,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var col : Color = input.get_value(uv) if channel == 0: diff --git a/game/addons/mat_maker_gd/nodes/filter/fill_to_color.gd b/game/addons/mat_maker_gd/nodes/filter/fill_to_color.gd index fcd68c96..b65abe9f 100644 --- a/game/addons/mat_maker_gd/nodes/filter/fill_to_color.gd +++ b/game/addons/mat_maker_gd/nodes/filter/fill_to_color.gd @@ -9,26 +9,26 @@ export(Color) var edge_color : Color = Color(1, 1, 1, 1) func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !color_map: color_map = MMNodeUniversalProperty.new() - color_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + color_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR color_map.set_default_value(Color(1, 1, 1, 1)) - color_map.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + color_map.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL color_map.slot_name = ">>> Color Map " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -46,7 +46,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #vec4 $(name_uv)_bb = $in($uv); var c : Color = input.get_value(uv) diff --git a/game/addons/mat_maker_gd/nodes/filter/fill_to_position.gd b/game/addons/mat_maker_gd/nodes/filter/fill_to_position.gd index 85b6cc0d..6cc17b7a 100644 --- a/game/addons/mat_maker_gd/nodes/filter/fill_to_position.gd +++ b/game/addons/mat_maker_gd/nodes/filter/fill_to_position.gd @@ -8,18 +8,18 @@ export(int, "X,Y,Radial") var axis : int = 2 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : Color = input.get_value(uv) #vec2 $(name_uv)_c = fract($in($uv).xy+0.5*$in($uv).zw); var cnv : Vector2 = MMAlgos.fractv2(Vector2(c.r, c.g) + 0.5 * Vector2(c.b, c.a)) diff --git a/game/addons/mat_maker_gd/nodes/filter/fill_to_random_color.gd b/game/addons/mat_maker_gd/nodes/filter/fill_to_random_color.gd index 24eb2e4c..35278603 100644 --- a/game/addons/mat_maker_gd/nodes/filter/fill_to_random_color.gd +++ b/game/addons/mat_maker_gd/nodes/filter/fill_to_random_color.gd @@ -8,18 +8,18 @@ export(Color) var edge_color : Color = Color(1, 1, 1, 1) func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #vec4 $(name_uv)_bb = $in($uv); var c : Color = input.get_value(uv) diff --git a/game/addons/mat_maker_gd/nodes/filter/fill_to_random_grey.gd b/game/addons/mat_maker_gd/nodes/filter/fill_to_random_grey.gd index 36a0055b..0f4e0baf 100644 --- a/game/addons/mat_maker_gd/nodes/filter/fill_to_random_grey.gd +++ b/game/addons/mat_maker_gd/nodes/filter/fill_to_random_grey.gd @@ -8,18 +8,18 @@ export(float) var edge_color : float = 1 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #vec4 $(name_uv)_bb = $in($uv); var c : Color = input.get_value(uv) diff --git a/game/addons/mat_maker_gd/nodes/filter/fill_to_size.gd b/game/addons/mat_maker_gd/nodes/filter/fill_to_size.gd index 333291e5..b10a0ec7 100644 --- a/game/addons/mat_maker_gd/nodes/filter/fill_to_size.gd +++ b/game/addons/mat_maker_gd/nodes/filter/fill_to_size.gd @@ -8,18 +8,18 @@ export(int, "Area,Width,Height,Max(W,H)") var formula : int = 0 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #vec4 $(name_uv)_bb = $in($uv); var c : Color = input.get_value(uv) diff --git a/game/addons/mat_maker_gd/nodes/filter/fill_to_uv.gd b/game/addons/mat_maker_gd/nodes/filter/fill_to_uv.gd index 0c128c1d..f2d71155 100644 --- a/game/addons/mat_maker_gd/nodes/filter/fill_to_uv.gd +++ b/game/addons/mat_maker_gd/nodes/filter/fill_to_uv.gd @@ -8,18 +8,18 @@ export(int, "Stretch,Square") var mode : int = 0 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #vec4 $(name_uv)_bb = $in($uv); var c : Color = input.get_value(uv) diff --git a/game/addons/mat_maker_gd/nodes/filter/greyscale.gd b/game/addons/mat_maker_gd/nodes/filter/greyscale.gd index f31525a5..99c396c6 100644 --- a/game/addons/mat_maker_gd/nodes/filter/greyscale.gd +++ b/game/addons/mat_maker_gd/nodes/filter/greyscale.gd @@ -8,18 +8,18 @@ export(int, "Lightness,Average,Luminosity,Min,Max") var type : int = 2 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : Color = input.get_value(uv) var f : float = 0 diff --git a/game/addons/mat_maker_gd/nodes/filter/invert.gd b/game/addons/mat_maker_gd/nodes/filter/invert.gd index d30a5ac0..0d6ee748 100644 --- a/game/addons/mat_maker_gd/nodes/filter/invert.gd +++ b/game/addons/mat_maker_gd/nodes/filter/invert.gd @@ -7,18 +7,18 @@ export(Resource) var input : Resource func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -33,7 +33,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : Color = input.get_value(uv) return MMAlgos.invert(c) diff --git a/game/addons/mat_maker_gd/nodes/filter/make_tileable.gd b/game/addons/mat_maker_gd/nodes/filter/make_tileable.gd index b9277630..eb7d7840 100644 --- a/game/addons/mat_maker_gd/nodes/filter/make_tileable.gd +++ b/game/addons/mat_maker_gd/nodes/filter/make_tileable.gd @@ -10,16 +10,16 @@ var size : int = 0 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color()) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " register_input_property(input) @@ -39,7 +39,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #make_tileable_$(name)($uv, 0.5*$w) return make_tileable(uv, 0.5 * width) diff --git a/game/addons/mat_maker_gd/nodes/filter/math.gd b/game/addons/mat_maker_gd/nodes/filter/math.gd index 6677b5d7..0b9b22cf 100644 --- a/game/addons/mat_maker_gd/nodes/filter/math.gd +++ b/game/addons/mat_maker_gd/nodes/filter/math.gd @@ -12,20 +12,20 @@ export(bool) var clamp_result : bool = false func _init_properties(): if !a: a = MMNodeUniversalProperty.new() - a.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + a.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT a.set_default_value(0) - a.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + a.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL a.slot_name = ">>> A " a.value_step = 0.01 a.value_range = Vector2(0, 1) if !b: b = MMNodeUniversalProperty.new() - b.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + b.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT b.set_default_value(0) - b.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + b.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL b.slot_name = ">>> B " b.value_step = 0.01 b.value_range = Vector2(0, 1) @@ -33,18 +33,18 @@ func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT output.set_default_value(0) - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL output.slot_name = " Output >>>" output.get_value_from_owner = true @@ -61,7 +61,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_enum("get_operation", "set_operation", "Operation", [ "A+B", "A-B", "A*B", "A/B", "log(A)", "log2(A)", "pow(A, B)", "abs(A)", "round(A)", "floor(A)", "ceil(A)", "trunc(A)", "fract(A)", "min(A, B)", "max(A, B)", "A float: +func _get_property_value(uv : Vector2) -> float: var af : float = a.get_value(uv) var bf : float = b.get_value(uv) @@ -122,7 +122,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = get_property_value(uv) return Color(f, f, f, 1) diff --git a/game/addons/mat_maker_gd/nodes/filter/quantize.gd b/game/addons/mat_maker_gd/nodes/filter/quantize.gd index 1fc34cc7..e1f5498e 100644 --- a/game/addons/mat_maker_gd/nodes/filter/quantize.gd +++ b/game/addons/mat_maker_gd/nodes/filter/quantize.gd @@ -8,18 +8,18 @@ export(int) var steps : int = 4 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : Color = input.get_value(uv) #vec4(floor($in($uv).rgb*$steps)/$steps, $in($uv).a) diff --git a/game/addons/mat_maker_gd/nodes/filter/swap_channels.gd b/game/addons/mat_maker_gd/nodes/filter/swap_channels.gd index 181f0c3d..a565a389 100644 --- a/game/addons/mat_maker_gd/nodes/filter/swap_channels.gd +++ b/game/addons/mat_maker_gd/nodes/filter/swap_channels.gd @@ -11,18 +11,18 @@ export(int, "0,1,R,-R,G,-G,B,-B,A,-A") var op_a : int = 8 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -66,7 +66,7 @@ func apply(op : int, val : Color) -> float: return 0.0 -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : Color = input.get_value(uv) return Color(apply(op_r, c), apply(op_g, c), apply(op_b, c), apply(op_a, c)) diff --git a/game/addons/mat_maker_gd/nodes/filter/tonality.gd b/game/addons/mat_maker_gd/nodes/filter/tonality.gd index b4190ab7..9d7d8649 100644 --- a/game/addons/mat_maker_gd/nodes/filter/tonality.gd +++ b/game/addons/mat_maker_gd/nodes/filter/tonality.gd @@ -10,18 +10,18 @@ func _init(): func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input.set_default_value(0) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -37,7 +37,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = input.get_value(uv) var cf : float = MMAlgos.curve(f, points) diff --git a/game/addons/mat_maker_gd/nodes/gradient/circular_gradient.gd b/game/addons/mat_maker_gd/nodes/gradient/circular_gradient.gd index cb294efd..fa676635 100644 --- a/game/addons/mat_maker_gd/nodes/gradient/circular_gradient.gd +++ b/game/addons/mat_maker_gd/nodes/gradient/circular_gradient.gd @@ -7,9 +7,9 @@ export(float) var repeat : float = 1 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -23,7 +23,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: if interpolation_type == 0: return MMAlgos.circular_gradient_type_1(uv, repeat, points) elif interpolation_type == 1: diff --git a/game/addons/mat_maker_gd/nodes/gradient/gradient.gd b/game/addons/mat_maker_gd/nodes/gradient/gradient.gd index 57c6cb16..9dca4d9d 100644 --- a/game/addons/mat_maker_gd/nodes/gradient/gradient.gd +++ b/game/addons/mat_maker_gd/nodes/gradient/gradient.gd @@ -8,9 +8,9 @@ export(float) var rotate : float = 0 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -25,7 +25,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: if interpolation_type == 0: return MMAlgos.normal_gradient_type_1(uv, repeat, rotate, points) elif interpolation_type == 1: diff --git a/game/addons/mat_maker_gd/nodes/gradient/radial_gradient.gd b/game/addons/mat_maker_gd/nodes/gradient/radial_gradient.gd index 6093b308..386f1d39 100644 --- a/game/addons/mat_maker_gd/nodes/gradient/radial_gradient.gd +++ b/game/addons/mat_maker_gd/nodes/gradient/radial_gradient.gd @@ -7,9 +7,9 @@ export(float) var repeat : float = 1 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -23,7 +23,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: if interpolation_type == 0: return MMAlgos.radial_gradient_type_1(uv, repeat, points) elif interpolation_type == 1: diff --git a/game/addons/mat_maker_gd/nodes/mm_material.gd b/game/addons/mat_maker_gd/nodes/mm_material.gd index dd6a5d49..8f56ced5 100644 --- a/game/addons/mat_maker_gd/nodes/mm_material.gd +++ b/game/addons/mat_maker_gd/nodes/mm_material.gd @@ -1,5 +1,5 @@ tool -class_name MMMateial +#class_name MMMaterial extends Resource #threads are implemented using my thread pool engine module. diff --git a/game/addons/mat_maker_gd/nodes/mm_node.gd b/game/addons/mat_maker_gd/nodes/mm_node.gd index 13a5228b..66f25893 100644 --- a/game/addons/mat_maker_gd/nodes/mm_node.gd +++ b/game/addons/mat_maker_gd/nodes/mm_node.gd @@ -1,5 +1,5 @@ tool -class_name MMNode +#class_name MMNode extends Resource export(Vector2) var graph_position : Vector2 = Vector2() @@ -11,7 +11,7 @@ var properties_initialized : bool = false var dirty : bool = true -#MMMateial +#MMMaterial func render(material) -> bool: if !dirty: return false @@ -26,11 +26,11 @@ func render(material) -> bool: return true -#MMMateial +#MMMaterial func _render(material) -> void: pass -func render_image(material) -> Image: +func _render_image(material) -> Image: var image : Image = Image.new() image.create(material.image_size.x, material.image_size.y, false, Image.FORMAT_RGBA8) @@ -41,19 +41,19 @@ func render_image(material) -> Image: var pseed : float = randf() + randi() - for x in range(image.get_width()): - for y in range(image.get_height()): - var v : Vector2 = Vector2(x / w, y / h) - - var col : Color = get_value_for(v, pseed) - - image.set_pixel(x, y, col) +# for x in range(image.get_width()): +# for y in range(image.get_height()): +# var v : Vector2 = Vector2(x / w, y / h) +# +# var col : Color = get_value_for(v, pseed) +# +# image.set_pixel(x, y, col) image.unlock() return image -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() func init_properties() -> void: @@ -81,7 +81,7 @@ func set_graph_position(pos : Vector2) -> void: emit_changed() func register_input_property(prop : MMNodeUniversalProperty) -> void: - prop.owner = self + #prop.owner = self if !prop.is_connected("changed", self, "on_input_property_changed"): prop.connect("changed", self, "on_input_property_changed") @@ -89,8 +89,8 @@ func register_input_property(prop : MMNodeUniversalProperty) -> void: input_properties.append(prop) func unregister_input_property(prop : MMNodeUniversalProperty) -> void: - if prop.owner == self: - prop.owner = null + #if prop.owner == self: + # prop.owner = null if prop.is_connected("changed", self, "on_input_property_changed"): prop.disconnect("changed", self, "on_input_property_changed") @@ -98,7 +98,7 @@ func unregister_input_property(prop : MMNodeUniversalProperty) -> void: input_properties.erase(prop) func register_output_property(prop : MMNodeUniversalProperty) -> void: - prop.owner = self + #prop.owner = self output_properties.append(prop) diff --git a/game/addons/mat_maker_gd/nodes/mm_node_universal_property.gd b/game/addons/mat_maker_gd/nodes/mm_node_universal_property.gd index 68a7a710..11a0abeb 100644 --- a/game/addons/mat_maker_gd/nodes/mm_node_universal_property.gd +++ b/game/addons/mat_maker_gd/nodes/mm_node_universal_property.gd @@ -1,5 +1,5 @@ tool -class_name MMNodeUniversalProperty +#class_name MMNodeUniversalProperty extends Resource enum SlotTypes { diff --git a/game/addons/mat_maker_gd/nodes/noise/anisotropic_noise.gd b/game/addons/mat_maker_gd/nodes/noise/anisotropic_noise.gd index 7310d5a7..80b29459 100644 --- a/game/addons/mat_maker_gd/nodes/noise/anisotropic_noise.gd +++ b/game/addons/mat_maker_gd/nodes/noise/anisotropic_noise.gd @@ -10,9 +10,9 @@ export(float) var interpolation : float = 1 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -22,7 +22,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_smoothness", "set_smoothness", "Smoothness", 0.01)#, Vector2(0, 1)) mm_graph_node.add_slot_float("get_interpolation", "set_interpolation", "Interpolation", 0.01)#, Vector2(0, 1)) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var ps : float = 1.0 / float(pseed) #anisotropic($(uv), vec2($(scale_x), $(scale_y)), $(seed), $(smoothness), $(interpolation)) diff --git a/game/addons/mat_maker_gd/nodes/noise/color_noise.gd b/game/addons/mat_maker_gd/nodes/noise/color_noise.gd index d3d82e40..a6d66f5e 100644 --- a/game/addons/mat_maker_gd/nodes/noise/color_noise.gd +++ b/game/addons/mat_maker_gd/nodes/noise/color_noise.gd @@ -20,9 +20,9 @@ export(int) var size : int = 8 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -30,7 +30,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_texture_universal(image) mm_graph_node.add_slot_int("get_size", "set_size", "Size")#, Vector2(1, 10)) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var ps : float = 1.0 / float(pseed) #color_dots($(uv), 1.0/$(size), $(seed)) diff --git a/game/addons/mat_maker_gd/nodes/noise/color_value.gd b/game/addons/mat_maker_gd/nodes/noise/color_value.gd index 93c3ddb7..6bafd581 100644 --- a/game/addons/mat_maker_gd/nodes/noise/color_value.gd +++ b/game/addons/mat_maker_gd/nodes/noise/color_value.gd @@ -10,9 +10,9 @@ export(float) var persistence : float = 0.5 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -22,7 +22,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_int("get_iterations", "set_iterations", "Iterations")#, Vector2(0, 1)) mm_graph_node.add_slot_float("get_persistence", "set_persistence", "Persistence", 0.01)#, Vector2(0, 1)) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var ps : float = 1.0 / float(pseed) #perlin_color($(uv), vec2($(scale_x), $(scale_y)), int($(iterations)), $(persistence), $(seed)) diff --git a/game/addons/mat_maker_gd/nodes/noise/fbm_noise.gd b/game/addons/mat_maker_gd/nodes/noise/fbm_noise.gd index 55d86614..797fabe3 100644 --- a/game/addons/mat_maker_gd/nodes/noise/fbm_noise.gd +++ b/game/addons/mat_maker_gd/nodes/noise/fbm_noise.gd @@ -12,9 +12,9 @@ export(float) var persistence : float = 0.5 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -26,7 +26,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_int("get_iterations", "set_iterations", "Iterations")#, Vector2(0, 1)) mm_graph_node.add_slot_float("get_persistence", "set_persistence", "Persistence", 0.01)#, Vector2(0, 1)) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var ps : float = 1.0 / float(pseed) #"Value,Perlin,Simplex,Cellular1,Cellular2,Cellular3,Cellular4,Cellular5,Cellular6" diff --git a/game/addons/mat_maker_gd/nodes/noise/noise.gd b/game/addons/mat_maker_gd/nodes/noise/noise.gd index 39421c6f..7c5756ec 100644 --- a/game/addons/mat_maker_gd/nodes/noise/noise.gd +++ b/game/addons/mat_maker_gd/nodes/noise/noise.gd @@ -9,9 +9,9 @@ export(float) var density : float = 0.5 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -20,7 +20,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_int("get_grid_size", "set_grid_size", "Grid Size")#, Vector2(1, 10)) mm_graph_node.add_slot_float("get_density", "set_density", "Density", 0.01)#, Vector2(0, 1)) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var ps : float = 1.0 / float(pseed) #return dots(uv, 1.0/$(size), $(density), $(seed)); diff --git a/game/addons/mat_maker_gd/nodes/noise/voronoi.gd b/game/addons/mat_maker_gd/nodes/noise/voronoi.gd index d5739c47..8fdf2622 100644 --- a/game/addons/mat_maker_gd/nodes/noise/voronoi.gd +++ b/game/addons/mat_maker_gd/nodes/noise/voronoi.gd @@ -14,27 +14,27 @@ export(float) var randomness : float = 0.85 func _init_properties(): if !out_nodes: out_nodes = MMNodeUniversalProperty.new() - out_nodes.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_nodes.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_nodes.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_nodes.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_borders: out_borders = MMNodeUniversalProperty.new() - out_borders.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_borders.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_borders.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_borders.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_random_color: out_random_color = MMNodeUniversalProperty.new() - out_random_color.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_random_color.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_random_color.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_random_color.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_fill: out_fill = MMNodeUniversalProperty.new() - out_fill.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_fill.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_fill.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_fill.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(out_nodes) register_output_property(out_borders) @@ -120,7 +120,7 @@ func _render(material) -> void: out_random_color.set_value(random_color) out_fill.set_value(fill) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() #scale diff --git a/game/addons/mat_maker_gd/nodes/other/output_image.gd b/game/addons/mat_maker_gd/nodes/other/output_image.gd index 84a77fbd..7003fce4 100644 --- a/game/addons/mat_maker_gd/nodes/other/output_image.gd +++ b/game/addons/mat_maker_gd/nodes/other/output_image.gd @@ -7,8 +7,8 @@ export(String) var postfix : String = "" func _init_properties(): image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE - image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE + image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL image.slot_name = "image" register_input_property(image) diff --git a/game/addons/mat_maker_gd/nodes/pattern/beehive.gd b/game/addons/mat_maker_gd/nodes/pattern/beehive.gd index 9a1efff2..a468d33f 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/beehive.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/beehive.gd @@ -10,21 +10,21 @@ export(Vector2) var size : Vector2 = Vector2(4, 4) func _init_properties(): if !out_main: out_main = MMNodeUniversalProperty.new() - out_main.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_main.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_main.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_main.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_random_color: out_random_color = MMNodeUniversalProperty.new() - out_random_color.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_random_color.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_random_color.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_random_color.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_uv_map: out_uv_map = MMNodeUniversalProperty.new() - out_uv_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_uv_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_uv_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_uv_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(out_main) register_output_property(out_random_color) @@ -97,7 +97,7 @@ func _render(material) -> void: out_random_color.set_value(random_color) out_uv_map.set_value(uv_map) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() #size diff --git a/game/addons/mat_maker_gd/nodes/pattern/bricks.gd b/game/addons/mat_maker_gd/nodes/pattern/bricks.gd index a2967edc..3ee396fd 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/bricks.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/bricks.gd @@ -21,72 +21,72 @@ export(float) var corner : float = 0.3 func _init_properties(): if !out_bricks_pattern: out_bricks_pattern = MMNodeUniversalProperty.new() - out_bricks_pattern.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_bricks_pattern.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_bricks_pattern.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_bricks_pattern.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_random_color: out_random_color = MMNodeUniversalProperty.new() - out_random_color.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_random_color.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_random_color.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_random_color.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_position_x: out_position_x = MMNodeUniversalProperty.new() - out_position_x.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_position_x.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_position_x.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_position_x.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_position_y: out_position_y = MMNodeUniversalProperty.new() - out_position_y.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_position_y.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_position_y.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_position_y.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_brick_uv: out_brick_uv = MMNodeUniversalProperty.new() - out_brick_uv.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_brick_uv.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_brick_uv.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_brick_uv.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_corner_uv: out_corner_uv = MMNodeUniversalProperty.new() - out_corner_uv.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_corner_uv.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_corner_uv.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_corner_uv.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_direction: out_direction = MMNodeUniversalProperty.new() - out_direction.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_direction.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_direction.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_direction.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !mortar: mortar = MMNodeUniversalProperty.new() - mortar.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + mortar.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT mortar.set_default_value(0.1) - mortar.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + mortar.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL mortar.slot_name = "Mortar" mortar.value_step = 0.01 mortar.value_range = Vector2(0, 0.5) if !bevel: bevel = MMNodeUniversalProperty.new() - bevel.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + bevel.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT bevel.set_default_value(0.1) - bevel.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + bevel.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL bevel.slot_name = "Bevel" bevel.value_step = 0.01 bevel.value_range = Vector2(0, 0.5) if !roundness: roundness = MMNodeUniversalProperty.new() - roundness.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + roundness.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT roundness.set_default_value(0.1) - roundness.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + roundness.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL roundness.slot_name = "Roundness" roundness.value_step = 0.01 roundness.value_range = Vector2(0, 0.5) @@ -235,7 +235,7 @@ func _render(material) -> void: out_corner_uv.set_value(corner_uv) out_direction.set_value(direction) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() #type diff --git a/game/addons/mat_maker_gd/nodes/pattern/iching.gd b/game/addons/mat_maker_gd/nodes/pattern/iching.gd index 9a8be8a6..eacc2434 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/iching.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/iching.gd @@ -7,9 +7,9 @@ export(Vector2) var size : Vector2 = Vector2(4, 4) func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -22,7 +22,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var ps : float = 1.0 / float(pseed) #IChing(vec2($columns, $rows)*$uv, float($seed)) diff --git a/game/addons/mat_maker_gd/nodes/pattern/pattern.gd b/game/addons/mat_maker_gd/nodes/pattern/pattern.gd index bc68c57a..fe98d786 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/pattern.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/pattern.gd @@ -10,9 +10,9 @@ export(Vector2) var repeat : Vector2 = Vector2(4, 4) func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -28,7 +28,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = MMAlgos.pattern(uv, repeat.x, repeat.y, combiner_type, combiner_axis_type_x, combiner_axis_type_y) return Color(f, f, f, 1) diff --git a/game/addons/mat_maker_gd/nodes/pattern/runes.gd b/game/addons/mat_maker_gd/nodes/pattern/runes.gd index 9a16f28d..90aadeb7 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/runes.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/runes.gd @@ -7,9 +7,9 @@ export(Vector2) var size : Vector2 = Vector2(4, 4) func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -22,7 +22,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var ps : float = 1.0 / float(pseed) #Rune(vec2($columns, $rows)*$uv, float($seed)) diff --git a/game/addons/mat_maker_gd/nodes/pattern/scratches.gd b/game/addons/mat_maker_gd/nodes/pattern/scratches.gd index de7d07df..6e92151e 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/scratches.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/scratches.gd @@ -11,9 +11,9 @@ export(float) var randomness : float = 0.44 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -30,7 +30,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #scratches($uv, int($layers), vec2($length, $width), $waviness, $angle, $randomness, vec2(float($seed), 0.0)) return MMAlgos.scratchesc(uv, layers, size, waviness, angle, randomness, Vector2(pseed, 0.0)) diff --git a/game/addons/mat_maker_gd/nodes/pattern/sine_wave.gd b/game/addons/mat_maker_gd/nodes/pattern/sine_wave.gd index c3a52aaa..28f852b9 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/sine_wave.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/sine_wave.gd @@ -9,9 +9,9 @@ export(float) var phase : float = 0 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -26,7 +26,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = 1.0 - abs(2.0 * (uv.y - 0.5) - amplitude *sin((frequency * uv.x + phase)*6.28318530718)) return Color(f, f, f, 1) diff --git a/game/addons/mat_maker_gd/nodes/pattern/truchet.gd b/game/addons/mat_maker_gd/nodes/pattern/truchet.gd index 4bd88267..cb986c1d 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/truchet.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/truchet.gd @@ -8,9 +8,9 @@ export(float) var size : float = 4 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -24,7 +24,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: if shape == 0: return MMAlgos.truchet1c(uv, size, pseed) elif shape == 1: diff --git a/game/addons/mat_maker_gd/nodes/pattern/weave.gd b/game/addons/mat_maker_gd/nodes/pattern/weave.gd index 98bc1920..0a0e4327 100644 --- a/game/addons/mat_maker_gd/nodes/pattern/weave.gd +++ b/game/addons/mat_maker_gd/nodes/pattern/weave.gd @@ -12,28 +12,28 @@ export(int) var stitch : int = 1 func _init_properties(): if !out_main: out_main = MMNodeUniversalProperty.new() - out_main.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_main.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_main.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_main.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_horizontal_map: out_horizontal_map = MMNodeUniversalProperty.new() - out_horizontal_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_horizontal_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_horizontal_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_horizontal_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_vertical_map: out_vertical_map = MMNodeUniversalProperty.new() - out_vertical_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_vertical_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_vertical_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_vertical_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !width: width = MMNodeUniversalProperty.new() - width.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + width.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 width.set_default_value(Vector2(0.9, 0.9)) - width.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + width.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL width.slot_name = "Width" width.value_step = 0.01 width.value_range = Vector2(0, 1) @@ -109,7 +109,7 @@ func _render(material) -> void: out_horizontal_map.set_value(horizontal_map) out_vertical_map.set_value(vertical_map) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() #size diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_annular_shape.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_annular_shape.gd index 1d7f29a5..c5daf676 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_annular_shape.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_annular_shape.gd @@ -8,11 +8,11 @@ export(int) var ripples : int = 1 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - #output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + #output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Apply >>>" output.get_value_from_owner = true @@ -25,7 +25,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_width", "set_width", "Width", 0.01) mm_graph_node.add_slot_int("get_ripples", "set_ripples", "Ripples") -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): var val : float = output.get_value(uv, true) return MMAlgos.sdRipples(val, width, ripples) diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_bool.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_bool.gd index 5c46bece..9879f366 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_bool.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_bool.gd @@ -9,20 +9,20 @@ export(int, "Union,Substraction,Intersection") var operation : int = 0 func _init_properties(): if !input1: input1 = MMNodeUniversalProperty.new() - input1.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input1.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input1.slot_name = ">>> Input 1 " if !input1.is_connected("changed", self, "on_input_changed"): input1.connect("changed", self, "on_input_changed") if !input2: input2 = MMNodeUniversalProperty.new() - input2.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input2.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input2.slot_name = ">>> Input 2 " if !input2.is_connected("changed", self, "on_input_changed"): @@ -30,10 +30,10 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = " Output >>>" output.get_value_from_owner = true @@ -48,7 +48,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_enum("get_operation", "set_operation", "Operation", [ "Union", "Substraction", "Intersection" ]) -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: if operation == 0: return MMAlgos.sdf_boolean_union(input1.get_value(uv), input2.get_value(uv)) elif operation == 1: diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_circle_repeat.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_circle_repeat.gd index 982ae095..d682b964 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_circle_repeat.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_circle_repeat.gd @@ -7,11 +7,11 @@ export(int) var count : int = 6 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - #output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + #output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Apply >>>" output.get_value_from_owner = true @@ -23,7 +23,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_int("get_count", "set_count", "Count") -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): #$in(circle_repeat_transform_2d($uv-vec2(0.5), $c)+vec2(0.5)) var new_uv : Vector2 = MMAlgos.circle_repeat_transform_2d(uv - Vector2(0.5, 0.5), count) + Vector2(0.5, 0.5) diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_morph.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_morph.gd index aef92b5f..53547f02 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_morph.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_morph.gd @@ -9,20 +9,20 @@ export(float) var amount : float = 0.5 func _init_properties(): if !input1: input1 = MMNodeUniversalProperty.new() - input1.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input1.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input1.slot_name = ">>> Input 1 " if !input1.is_connected("changed", self, "on_input_changed"): input1.connect("changed", self, "on_input_changed") if !input2: input2 = MMNodeUniversalProperty.new() - input2.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input2.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input2.slot_name = ">>> Input 2 " if !input2.is_connected("changed", self, "on_input_changed"): @@ -30,10 +30,10 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = " Output >>>" output.get_value_from_owner = true @@ -48,7 +48,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_amount", "set_amount", "Amount", 0.01) -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: return MMAlgos.sdf_morph(input1.get_value(uv), input2.get_value(uv), amount) #amount diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_repeat.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_repeat.gd index bc39efc0..e76e7684 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_repeat.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_repeat.gd @@ -9,11 +9,11 @@ export(float) var random_rotation : float = 0.5 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - #output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + #output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Apply >>>" output.get_value_from_owner = true @@ -27,7 +27,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_int("get_y", "set_y", "Y") mm_graph_node.add_slot_float("get_random_rotation", "set_random_rotation", "Random rotation", 0.01) -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): #todo add this as a parameter var pseed : int = 123123 diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_rounded_shape.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_rounded_shape.gd index 4bcb8a20..9849a94c 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_rounded_shape.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_rounded_shape.gd @@ -7,11 +7,11 @@ export(float) var radius : float = 0 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - #output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + #output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Apply >>>" output.get_value_from_owner = true @@ -23,7 +23,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): var val : float = output.get_value(uv, true) return MMAlgos.sdf_rounded_shape(val, radius) diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_smooth_bool.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_smooth_bool.gd index 06100354..77ea9dd0 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_smooth_bool.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_op_smooth_bool.gd @@ -10,20 +10,20 @@ export(float) var smoothness : float = 0.15 func _init_properties(): if !input1: input1 = MMNodeUniversalProperty.new() - input1.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input1.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input1.slot_name = ">>> Input 1 " if !input1.is_connected("changed", self, "on_input_changed"): input1.connect("changed", self, "on_input_changed") if !input2: input2 = MMNodeUniversalProperty.new() - input2.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input2.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input2.slot_name = ">>> Input 2 " if !input2.is_connected("changed", self, "on_input_changed"): @@ -31,10 +31,10 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = " Output >>>" output.get_value_from_owner = true @@ -50,7 +50,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_enum("get_operation", "set_operation", "Operation", [ "Union", "Substraction", "Intersection" ]) mm_graph_node.add_slot_float("get_smoothness", "set_smoothness", "Smoothness", 0.01) -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: if operation == 0: return MMAlgos.sdf_smooth_boolean_union(input1.get_value(uv), input2.get_value(uv), smoothness) elif operation == 1: diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_arc.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_arc.gd index 01d507de..e704d386 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_arc.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_arc.gd @@ -9,9 +9,9 @@ export(float) var width : float = 0.1 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -24,7 +24,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) mm_graph_node.add_slot_float("get_width", "set_width", "Width", 0.01) -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: return MMAlgos.sdf_arc(uv, angle, Vector2(radius, width)) #angle diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_box.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_box.gd index 7d40a700..3a88da34 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_box.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_box.gd @@ -8,9 +8,9 @@ export(Vector2) var size : Vector2 = Vector2(0.3, 0.2) func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -22,7 +22,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector2("get_center", "set_center", "Center", 0.01) mm_graph_node.add_slot_vector2("get_size", "set_size", "Size", 0.01) -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: return MMAlgos.sdf_box(uv, center, size) #center diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_circle.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_circle.gd index 7f61db90..c5cce623 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_circle.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_circle.gd @@ -8,9 +8,9 @@ export(float) var radius : float = 0.4 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -22,7 +22,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector2("get_center", "set_center", "Center", 0.01) mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: return MMAlgos.sdf_circle(uv, center, radius) #center diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_line.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_line.gd index c6aeb275..0d53b6db 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_line.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_line.gd @@ -12,9 +12,9 @@ func _init(): func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -28,7 +28,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_width", "set_width", "Width", 0.01) mm_graph_node.add_slot_curve() -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: var line : Vector2 = MMAlgos.sdf_line(uv, A, B, width) #$(name_uv)_sdl.x - $r * $profile($(name_uv)_sdl.y) diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_polygon.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_polygon.gd index 37364608..267c94d5 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_polygon.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_polygon.gd @@ -6,9 +6,9 @@ export(Resource) var output : Resource func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -18,7 +18,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_label_universal(output) mm_graph_node.add_slot_polygon() -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: return MMAlgos.sdPolygon(uv, points) func _polygon_changed() -> void: diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_rhombus.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_rhombus.gd index c65a7bff..827bc41f 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_rhombus.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_shape_rhombus.gd @@ -8,9 +8,9 @@ export(Vector2) var size : Vector2 = Vector2(0.3, 0.2) func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -22,7 +22,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector2("get_center", "set_center", "Center", 0.01) mm_graph_node.add_slot_vector2("get_size", "set_size", "Size", 0.01) -func get_property_value(uv : Vector2) -> float: +func _get_property_value(uv : Vector2) -> float: return MMAlgos.sdf_rhombus(uv, center, size) #center diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_show.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_show.gd index e4b8e7ad..3c8871b5 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_show.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_show.gd @@ -9,17 +9,17 @@ export(float) var base : float = 0 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT #for some reason this doesn't work, todo check -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = "Input" register_output_property(image) @@ -37,7 +37,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = input.get_value(uv) #clamp($base-$in($uv)/max($bevel, 0.00001), 0.0, 1.0) diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_rotate.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_rotate.gd index f0f4ff20..0647613d 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_rotate.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_rotate.gd @@ -7,11 +7,11 @@ export(float) var angle : float = 0 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - #output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + #output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Apply >>>" output.get_value_from_owner = true @@ -23,7 +23,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_angle", "set_angle", "Angle", 1) -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): #$in(sdf2d_rotate($uv, $a*0.01745329251))", return output.get_value(MMAlgos.sdf2d_rotate(uv, angle * 0.01745329251), true) diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_scale.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_scale.gd index 0923b88a..c42fbaaf 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_scale.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_scale.gd @@ -7,11 +7,11 @@ export(float) var scale : float = 1 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - #output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + #output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Apply >>>" output.get_value_from_owner = true @@ -23,7 +23,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_scale", "set_scale", "Scale", 0.01) -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): #$in(($uv-vec2(0.5))/$s+vec2(0.5))*$s return output.get_value(((uv - Vector2(0.5, 0.5)) / scale + Vector2(0.5, 0.5)), true) diff --git a/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_translate.gd b/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_translate.gd index c3099e0b..cc2b9bd0 100644 --- a/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_translate.gd +++ b/game/addons/mat_maker_gd/nodes/sdf2d/sd_tf_translate.gd @@ -7,11 +7,11 @@ export(Vector2) var translation : Vector2 = Vector2(0, 0) func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - output.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL - #output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL + #output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Apply >>>" output.get_value_from_owner = true @@ -23,7 +23,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector2("get_translation", "set_translation", "Translation", 0.01) -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): return output.get_value(uv - translation, true) #a diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_color.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_color.gd index 3a0379ff..03181aa3 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_color.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_color.gd @@ -8,19 +8,19 @@ export(float) var color : float = 0.5 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): input.connect("changed", self, "on_input_changed") if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -33,7 +33,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_color", "set_color", "Color", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: var v : Vector2 = input.get_value_sdf3d(uv3) v.y = color diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_bool.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_bool.gd index 81962a88..95886777 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_bool.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_bool.gd @@ -9,10 +9,10 @@ export(int, "Union,Substraction,Intersection") var operation : int = 0 func _init_properties(): if !input1: input1 = MMNodeUniversalProperty.new() - input1.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input1.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input1.slot_name = ">>> Input 1 " if !input1.is_connected("changed", self, "on_input_changed"): @@ -20,10 +20,10 @@ func _init_properties(): if !input2: input2 = MMNodeUniversalProperty.new() - input2.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input2.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input2.slot_name = ">>> Input 2 " if !input2.is_connected("changed", self, "on_input_changed"): @@ -31,9 +31,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -48,7 +48,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_enum("get_operation", "set_operation", "Operation", [ "Union", "Substraction", "Intersection" ]) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: var s1 : Vector2 = input1.get_value_sdf3d(uv3) var s2 : Vector2 = input2.get_value_sdf3d(uv3) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_circle_repeat.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_circle_repeat.gd index 131e6312..71a37cbb 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_circle_repeat.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_circle_repeat.gd @@ -8,10 +8,10 @@ export(int) var count : int = 5 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): @@ -19,9 +19,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -34,7 +34,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_int("get_count", "set_count", "Count") -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #todo make seed a class variable probably into MMNode var new_uv : Vector3 = MMAlgos.circle_repeat_transform(uv3, count) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_elongation.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_elongation.gd index 2f11b3d6..882f089a 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_elongation.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_elongation.gd @@ -8,19 +8,19 @@ export(Vector3) var length : Vector3 = Vector3(0.2, 0, 0) func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): input.connect("changed", self, "on_input_changed") if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -33,7 +33,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector3("get_length", "set_length", "Length", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #$in($uv - clamp($uv, -abs(vec3($x, $y, $z)), abs(vec3($x, $y, $z)))) var new_uv : Vector3 = uv3 - MMAlgos.clampv3(uv3, -MMAlgos.absv3(length), MMAlgos.absv3(length)) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_extrusion.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_extrusion.gd index e25db9c2..fe27a4bf 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_extrusion.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_extrusion.gd @@ -8,10 +8,10 @@ export(float) var length : float = 0.25 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): @@ -19,9 +19,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -34,7 +34,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_length", "set_length", "Length", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #vec2 $(name_uv)_w = vec2($in($uv.xz+vec2(0.5)),abs($uv.y)-$d); #ret min(max($(name_uv)_w.x,$(name_uv)_w.y),0.0)+length(max($(name_uv)_w,0.0)) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_morph.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_morph.gd index c7be87a1..4ff09cff 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_morph.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_morph.gd @@ -9,10 +9,10 @@ export(float) var amount : float = 0.5 func _init_properties(): if !input1: input1 = MMNodeUniversalProperty.new() - input1.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input1.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input1.slot_name = ">>> Input 1 " if !input1.is_connected("changed", self, "on_input_changed"): @@ -20,10 +20,10 @@ func _init_properties(): if !input2: input2 = MMNodeUniversalProperty.new() - input2.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input2.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input2.slot_name = ">>> Input 2 " if !input2.is_connected("changed", self, "on_input_changed"): @@ -31,9 +31,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -48,7 +48,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_amount", "set_amount", "Amount", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: var s1 : Vector2 = input1.get_value_sdf3d(uv3) var s2 : Vector2 = input2.get_value_sdf3d(uv3) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_repeat.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_repeat.gd index f6fdf2d1..781b0e3d 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_repeat.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_repeat.gd @@ -9,10 +9,10 @@ export(float) var rotation : float = 0.3 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): @@ -20,9 +20,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -36,7 +36,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector2("get_col_row", "set_col_row", "Col,Row", 1) mm_graph_node.add_slot_float("get_rotation", "set_rotation", "Rotation", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #todo make seed a class variable probably into MMNode var new_uv : Vector3 = MMAlgos.sdf3d_repeat(uv3, col_row, rotation, 1) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_revolution.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_revolution.gd index afe9635a..8916bbf2 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_revolution.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_revolution.gd @@ -8,10 +8,10 @@ export(float) var offset : float = 0.25 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): @@ -19,9 +19,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -34,7 +34,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_offset", "set_offset", "Offset", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #vec2 $(name_uv)_q = vec2(length($uv.xy) - $d + 0.5, $uv.z + 0.5); var uv : Vector2 = Vector2(Vector2(uv3.x, uv3.y).length() - offset + 0.5, uv3.z + 0.5) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_rounded.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_rounded.gd index fce1b414..ab9da7d2 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_rounded.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_rounded.gd @@ -8,19 +8,19 @@ export(float) var radius : float = 0.15 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): input.connect("changed", self, "on_input_changed") if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -33,7 +33,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: var v : Vector2 = input.get_value_sdf3d(uv3) #vec2($(name_uv)_v.x-$r, $(name_uv)_v.y) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_smooth_bool.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_smooth_bool.gd index 8dc90168..c68d3bfe 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_smooth_bool.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_op_smooth_bool.gd @@ -10,10 +10,10 @@ export(float) var smoothness : float = 0.15 func _init_properties(): if !input1: input1 = MMNodeUniversalProperty.new() - input1.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input1.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input1.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input1.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input1.slot_name = ">>> Input 1 " if !input1.is_connected("changed", self, "on_input_changed"): @@ -21,10 +21,10 @@ func _init_properties(): if !input2: input2 = MMNodeUniversalProperty.new() - input2.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input2.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input2.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input2.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input2.slot_name = ">>> Input 2 " if !input2.is_connected("changed", self, "on_input_changed"): @@ -32,9 +32,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -50,7 +50,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_enum("get_operation", "set_operation", "Operation", [ "Union", "Substraction", "Intersection" ]) mm_graph_node.add_slot_float("get_smoothness", "set_smoothness", "Smoothness", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: var s1 : Vector2 = input1.get_value_sdf3d(uv3) var s2 : Vector2 = input2.get_value_sdf3d(uv3) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_render.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_render.gd index 03af70b0..d1bd3e4c 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_render.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_render.gd @@ -10,30 +10,30 @@ export(Resource) var out_color_map : Resource func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 #for some reason this doesn't work, todo check -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = "Input" if !out_height_map: out_height_map = MMNodeUniversalProperty.new() - out_height_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_height_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_height_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_height_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_normal_map: out_normal_map = MMNodeUniversalProperty.new() - out_normal_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_normal_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_normal_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_normal_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !out_color_map: out_color_map = MMNodeUniversalProperty.new() - out_color_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + out_color_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - out_color_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + out_color_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(out_height_map) register_output_property(out_normal_map) @@ -100,7 +100,7 @@ func _render(material) -> void: out_normal_map.set_value(normal_map) out_color_map.set_value(color_map) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() #vec2 raymarch_$name(vec2 uv) { diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_box.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_box.gd index 4a4fee68..4c236745 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_box.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_box.gd @@ -8,9 +8,9 @@ export(float) var radius : float = 0.01 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -22,7 +22,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector3("get_size", "set_size", "Size", 0.01) mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: return MMAlgos.sdf3d_box(uv3, size.x, size.y, size.z, radius) #size diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_capsule.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_capsule.gd index ec0208ed..12e8348c 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_capsule.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_capsule.gd @@ -12,9 +12,9 @@ func _init(): func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -28,7 +28,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) mm_graph_node.add_slot_curve() -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: if axis == 0: return sdf3d_capsule_x(uv3, radius, length) elif axis == 1: diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cone.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cone.gd index aae4063e..450242b1 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cone.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cone.gd @@ -8,9 +8,9 @@ export(float) var angle : float = 30 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -22,7 +22,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_enum("get_axis", "set_axis", "Axis", [ "+X", "-X", "+Y", "-Y", "+Z", "-Z" ]) mm_graph_node.add_slot_float("get_angle", "set_angle", "Angle", 1) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: if axis == 0: return MMAlgos.sdf3d_cone_px(uv3, angle) elif axis == 1: diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cylinder.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cylinder.gd index 79ccea6a..cc7c6649 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cylinder.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_cylinder.gd @@ -9,9 +9,9 @@ export(float) var radius : float = 0.25 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -24,7 +24,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_length", "set_length", "Length", 0.01) mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: if axis == 0: return MMAlgos.sdf3d_cylinder_x(uv3, radius, length) elif axis == 1: diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_sphere.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_sphere.gd index f777682e..66f67184 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_sphere.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_sphere.gd @@ -7,9 +7,9 @@ export(float) var radius : float = 0.5 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -20,7 +20,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_radius", "set_radius", "Radius", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: return MMAlgos.sdf3d_sphere(uv3, radius) #radius diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_torus.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_torus.gd index f749552e..fef66986 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_torus.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_shape_torus.gd @@ -9,9 +9,9 @@ export(float) var minor_radius : float = 0.15 func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -24,7 +24,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_major_radius", "set_major_radius", "Major_radius", 0.01) mm_graph_node.add_slot_float("get_minor_radius", "set_minor_radius", "Minor_radius", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: if axis == 0: return MMAlgos.sdf3d_torus_x(uv3, major_radius, minor_radius) elif axis == 1: diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_rotate.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_rotate.gd index 70b0806c..978f20f7 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_rotate.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_rotate.gd @@ -8,10 +8,10 @@ export(Vector3) var rotation : Vector3 = Vector3() func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): @@ -19,9 +19,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -34,7 +34,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector3("get_rotation", "set_rotation", "Rotation", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #$in(rotate3d($uv, -vec3($ax, $ay, $az)*0.01745329251)) return input.get_value_sdf3d(MMAlgos.rotate3d(uv3, -rotation * 0.01745329251)) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_scale.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_scale.gd index 497a6c18..7b6776ee 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_scale.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_scale.gd @@ -8,10 +8,10 @@ export(float) var scale : float = 1 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): @@ -19,9 +19,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -34,7 +34,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_scale", "set_scale", "Scale", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #vec2 $(name_uv)_in = $in(($uv)/$s); return input.get_value_sdf3d(uv3 / scale) diff --git a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_translate.gd b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_translate.gd index 92ab093c..fc617855 100644 --- a/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_translate.gd +++ b/game/addons/mat_maker_gd/nodes/sdf3d/sdf3d_tf_translate.gd @@ -8,10 +8,10 @@ export(Vector3) var translation : Vector3 = Vector3() func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL -# input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_VECTOR2 + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL +# input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_VECTOR2 input.slot_name = ">>> Input " if !input.is_connected("changed", self, "on_input_changed"): @@ -19,9 +19,9 @@ func _init_properties(): if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_VECTOR2 + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_VECTOR2 - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT output.slot_name = ">>> Output >>>" output.get_value_from_owner = true @@ -34,7 +34,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_vector3("get_translation", "set_translation", "Translation", 0.01) -func get_property_value_sdf3d(uv3 : Vector3) -> Vector2: +func _get_property_value_sdf3d(uv3 : Vector3) -> Vector2: #$in($uv-vec3($x, $y, $z)) return input.get_value_sdf3d(uv3 - translation) diff --git a/game/addons/mat_maker_gd/nodes/simple/curve.gd b/game/addons/mat_maker_gd/nodes/simple/curve.gd index 68b57c44..b8e6b5c4 100644 --- a/game/addons/mat_maker_gd/nodes/simple/curve.gd +++ b/game/addons/mat_maker_gd/nodes/simple/curve.gd @@ -13,16 +13,16 @@ export(int) var repeat : int = 1 func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input.set_default_value(1.0) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " register_input_property(input) @@ -38,7 +38,7 @@ func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float("get_width", "set_width", "Width", 0.01) mm_graph_node.add_slot_int("get_repeat", "set_repeat", "Repeat") -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var nuv : Vector2 = transform_uv(uv) var f : float = 0 diff --git a/game/addons/mat_maker_gd/nodes/simple/image.gd b/game/addons/mat_maker_gd/nodes/simple/image.gd index 033a9ebd..a92d9be1 100644 --- a/game/addons/mat_maker_gd/nodes/simple/image.gd +++ b/game/addons/mat_maker_gd/nodes/simple/image.gd @@ -7,9 +7,9 @@ export(String) var image_path : String func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_output_property(image) @@ -21,7 +21,7 @@ func _register_methods(mm_graph_node) -> void: # # image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return image.get_value(uv) func get_image_path() -> String: diff --git a/game/addons/mat_maker_gd/nodes/simple/shape.gd b/game/addons/mat_maker_gd/nodes/simple/shape.gd index 8ec12489..a89abb63 100644 --- a/game/addons/mat_maker_gd/nodes/simple/shape.gd +++ b/game/addons/mat_maker_gd/nodes/simple/shape.gd @@ -18,25 +18,25 @@ export(Resource) var edge : Resource func _init_properties(): if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !radius: radius = MMNodeUniversalProperty.new() - radius.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + radius.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT radius.set_default_value(0.34375) - radius.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + radius.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL radius.slot_name = "radius" radius.value_step = 0.05 if !edge: edge = MMNodeUniversalProperty.new() - edge.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + edge.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT edge.set_default_value(0.2) - edge.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + edge.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL edge.slot_name = "edge" edge.value_step = 0.05 @@ -57,7 +57,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var c : float = 0 var rad : float = radius.get_value(uv) diff --git a/game/addons/mat_maker_gd/nodes/transform/circle_map.gd b/game/addons/mat_maker_gd/nodes/transform/circle_map.gd index fa19a4f1..60de4dc5 100644 --- a/game/addons/mat_maker_gd/nodes/transform/circle_map.gd +++ b/game/addons/mat_maker_gd/nodes/transform/circle_map.gd @@ -10,18 +10,18 @@ export(int) var repeat : int = 1 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -38,7 +38,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$in(vec2(fract($repeat*atan($uv.y-0.5, $uv.x-0.5)*0.15915494309), min(0.99999, 2.0/$radius*length($uv-vec2(0.5)))))", var nuv : Vector2 = Vector2(MMAlgos.fractf(repeat*atan2(uv.y - 0.5, uv.x - 0.5) * 0.15915494309), min(0.99999, 2.0 / radius * (uv - Vector2(0.5, 0.5)).length())) diff --git a/game/addons/mat_maker_gd/nodes/transform/color_tiler.gd b/game/addons/mat_maker_gd/nodes/transform/color_tiler.gd index 25ad75c1..d106c649 100644 --- a/game/addons/mat_maker_gd/nodes/transform/color_tiler.gd +++ b/game/addons/mat_maker_gd/nodes/transform/color_tiler.gd @@ -21,31 +21,31 @@ export(bool) var variations : bool = false func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !in_mask: in_mask = MMNodeUniversalProperty.new() - in_mask.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + in_mask.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT in_mask.set_default_value(1) - in_mask.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + in_mask.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL in_mask.slot_name = ">>> Mask " if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !instance_map: instance_map = MMNodeUniversalProperty.new() - instance_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + instance_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - instance_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + instance_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_input_property(input) register_input_property(in_mask) @@ -106,7 +106,7 @@ func _render(material) -> void: output.set_value(output_img) instance_map.set_value(instance_map_img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() #tile diff --git a/game/addons/mat_maker_gd/nodes/transform/kaleidoscope.gd b/game/addons/mat_maker_gd/nodes/transform/kaleidoscope.gd index a578e197..22ffff53 100644 --- a/game/addons/mat_maker_gd/nodes/transform/kaleidoscope.gd +++ b/game/addons/mat_maker_gd/nodes/transform/kaleidoscope.gd @@ -9,18 +9,18 @@ export(float) var offset : float = 0 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -37,7 +37,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$i(kal_rotate($uv, $count, $offset)) return input.get_value(MMAlgos.kal_rotate(uv, count, offset)) diff --git a/game/addons/mat_maker_gd/nodes/transform/mirror.gd b/game/addons/mat_maker_gd/nodes/transform/mirror.gd index 63b3a66d..2877a84d 100644 --- a/game/addons/mat_maker_gd/nodes/transform/mirror.gd +++ b/game/addons/mat_maker_gd/nodes/transform/mirror.gd @@ -9,18 +9,18 @@ export(float) var offset : float = 0 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -37,7 +37,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$i(uvmirror_$direction($uv, $offset)) if direction == 0: diff --git a/game/addons/mat_maker_gd/nodes/transform/repeat.gd b/game/addons/mat_maker_gd/nodes/transform/repeat.gd index 34264eb3..97182c32 100644 --- a/game/addons/mat_maker_gd/nodes/transform/repeat.gd +++ b/game/addons/mat_maker_gd/nodes/transform/repeat.gd @@ -6,13 +6,13 @@ export(Resource) var input : Resource func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Apply >>>" - #input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_COLOR - input.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + #input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_COLOR + input.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.get_value_from_owner = true register_input_property(input) @@ -21,5 +21,5 @@ func _init_properties(): func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_label_universal(input) -func get_property_value(uv : Vector2): +func _get_property_value(uv : Vector2): return input.get_value(MMAlgos.fractv2(uv), true) diff --git a/game/addons/mat_maker_gd/nodes/transform/rotate.gd b/game/addons/mat_maker_gd/nodes/transform/rotate.gd index e6b99ae4..7652fcac 100644 --- a/game/addons/mat_maker_gd/nodes/transform/rotate.gd +++ b/game/addons/mat_maker_gd/nodes/transform/rotate.gd @@ -9,18 +9,18 @@ export(float) var rotate : float = 0 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -37,7 +37,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$i(rotate($uv, vec2(0.5+$cx, 0.5+$cy), $rotate*0.01745329251)) return input.get_value(MMAlgos.rotate(uv, center + Vector2(0.5, 0.5), rotate*0.01745329251)) diff --git a/game/addons/mat_maker_gd/nodes/transform/scale.gd b/game/addons/mat_maker_gd/nodes/transform/scale.gd index 84e1e446..a0bf726d 100644 --- a/game/addons/mat_maker_gd/nodes/transform/scale.gd +++ b/game/addons/mat_maker_gd/nodes/transform/scale.gd @@ -9,18 +9,18 @@ export(Vector2) var scale : Vector2 = Vector2(1, 1) func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -37,7 +37,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$i(scale($uv, vec2(0.5+$cx, 0.5+$cy), vec2($scale_x, $scale_y))) return input.get_value(MMAlgos.scale(uv, center + Vector2(0.5, 0.5), scale)) diff --git a/game/addons/mat_maker_gd/nodes/transform/shear.gd b/game/addons/mat_maker_gd/nodes/transform/shear.gd index 1a4b0a38..32937814 100644 --- a/game/addons/mat_maker_gd/nodes/transform/shear.gd +++ b/game/addons/mat_maker_gd/nodes/transform/shear.gd @@ -10,18 +10,18 @@ export(float) var center : float = 0 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -39,7 +39,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$in($uv+$amount*($uv.yx-vec2($center))*vec2($direction)) if direction == 0: diff --git a/game/addons/mat_maker_gd/nodes/transform/tiler.gd b/game/addons/mat_maker_gd/nodes/transform/tiler.gd index adcd6608..ec8f0231 100644 --- a/game/addons/mat_maker_gd/nodes/transform/tiler.gd +++ b/game/addons/mat_maker_gd/nodes/transform/tiler.gd @@ -21,31 +21,31 @@ export(bool) var variations : bool = false func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT input.set_default_value(0) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !in_mask: in_mask = MMNodeUniversalProperty.new() - in_mask.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + in_mask.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT in_mask.set_default_value(1) - in_mask.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + in_mask.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL in_mask.slot_name = ">>> Mask " if !output: output = MMNodeUniversalProperty.new() - output.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + output.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - output.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + output.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE if !instance_map: instance_map = MMNodeUniversalProperty.new() - instance_map.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + instance_map.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - instance_map.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + instance_map.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE register_input_property(input) register_input_property(in_mask) @@ -113,7 +113,7 @@ func _render(material) -> void: output.set_value(output_img) instance_map.set_value(instance_map_img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return Color() #tile diff --git a/game/addons/mat_maker_gd/nodes/transform/transform.gd b/game/addons/mat_maker_gd/nodes/transform/transform.gd index 05cc2c17..c095ca50 100644 --- a/game/addons/mat_maker_gd/nodes/transform/transform.gd +++ b/game/addons/mat_maker_gd/nodes/transform/transform.gd @@ -14,63 +14,63 @@ export(int, "Clamp,Repeat,Extend") var mode : int = 0 func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true if !translate_x: translate_x = MMNodeUniversalProperty.new() - translate_x.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + translate_x.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT translate_x.set_default_value(0) translate_x.value_step = 0.01 - translate_x.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + translate_x.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL translate_x.slot_name = "Translate X" if !translate_y: translate_y = MMNodeUniversalProperty.new() - translate_y.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + translate_y.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT translate_y.set_default_value(0) translate_y.value_step = 0.01 - translate_y.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + translate_y.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL translate_y.slot_name = "Translate Y" if !rotate: rotate = MMNodeUniversalProperty.new() - rotate.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + rotate.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT rotate.set_default_value(0) rotate.value_step = 0.01 - rotate.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + rotate.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL rotate.slot_name = "Rotate" if !scale_x: scale_x = MMNodeUniversalProperty.new() - scale_x.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + scale_x.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT scale_x.set_default_value(1) scale_x.value_step = 0.01 - scale_x.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + scale_x.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL scale_x.slot_name = "Scale X" if !scale_y: scale_y = MMNodeUniversalProperty.new() - scale_y.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + scale_y.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT scale_y.set_default_value(1) scale_y.value_step = 0.01 - scale_y.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + scale_y.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL scale_y.slot_name = "Scale Y" register_input_property(input) @@ -98,7 +98,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$i($mode(transform2($uv, vec2($translate_x*(2.0*$tx($uv)-1.0), $translate_y*(2.0*$ty($uv)-1.0)), $rotate*0.01745329251*(2.0*$r($uv)-1.0), vec2($scale_x*(2.0*$sx($uv)-1.0), $scale_y*(2.0*$sy($uv)-1.0)))))", #Mode: diff --git a/game/addons/mat_maker_gd/nodes/transform/translate.gd b/game/addons/mat_maker_gd/nodes/transform/translate.gd index 283e918c..e3423b1f 100644 --- a/game/addons/mat_maker_gd/nodes/transform/translate.gd +++ b/game/addons/mat_maker_gd/nodes/transform/translate.gd @@ -8,18 +8,18 @@ export(Vector2) var translation : Vector2 = Vector2() func _init_properties(): if !input: input = MMNodeUniversalProperty.new() - input.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR input.set_default_value(Color(0, 0, 0, 1)) - input.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL + input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL input.slot_name = ">>> Input1 " if !image: image = MMNodeUniversalProperty.new() - image.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_IMAGE + image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE - #image.input_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_FLOAT - image.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE + #image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT + image.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_IMAGE #image.force_override = true register_input_property(input) @@ -35,7 +35,7 @@ func _render(material) -> void: image.set_value(img) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: #$i($uv-vec2($translate_x, $translate_y)) return input.get_value(uv - translation) diff --git a/game/addons/mat_maker_gd/nodes/uniform/greyscale_uniform.gd b/game/addons/mat_maker_gd/nodes/uniform/greyscale_uniform.gd index c3bf2d61..e59354eb 100644 --- a/game/addons/mat_maker_gd/nodes/uniform/greyscale_uniform.gd +++ b/game/addons/mat_maker_gd/nodes/uniform/greyscale_uniform.gd @@ -6,20 +6,20 @@ export(Resource) var uniform : Resource func _init_properties(): if !uniform: uniform = MMNodeUniversalProperty.new() - uniform.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_FLOAT + uniform.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT uniform.set_default_value(0.5) uniform.slot_name = "Value (Color)" uniform.value_step = 0.01 uniform.value_range = Vector2(0, 1) - uniform.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_COLOR + uniform.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_COLOR register_output_property(uniform) func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_float_universal(uniform) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: var f : float = uniform.get_value(uv) return Color(f, f, f, 1) diff --git a/game/addons/mat_maker_gd/nodes/uniform/uniform.gd b/game/addons/mat_maker_gd/nodes/uniform/uniform.gd index dbd409a4..bccefa1a 100644 --- a/game/addons/mat_maker_gd/nodes/uniform/uniform.gd +++ b/game/addons/mat_maker_gd/nodes/uniform/uniform.gd @@ -6,15 +6,15 @@ export(Resource) var uniform : Resource func _init_properties(): if !uniform: uniform = MMNodeUniversalProperty.new() - uniform.default_type = MMNodeUniversalProperty.MMNodeUniversalPropertyDefaultType.DEFAULT_TYPE_COLOR + uniform.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR uniform.set_default_value(Color(1, 1, 1, 1)) - uniform.output_slot_type = MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_COLOR + uniform.output_slot_type = MMNodeUniversalProperty.SLOT_TYPE_COLOR register_output_property(uniform) func _register_methods(mm_graph_node) -> void: mm_graph_node.add_slot_color_universal(uniform) -func get_value_for(uv : Vector2, pseed : int) -> Color: +func _get_value_for(uv : Vector2, pseed : int) -> Color: return uniform.get_value(uv) diff --git a/game/addons/mat_maker_gd/plugin.gd b/game/addons/mat_maker_gd/plugin.gd index 4cabcdfd..38bc3a16 100644 --- a/game/addons/mat_maker_gd/plugin.gd +++ b/game/addons/mat_maker_gd/plugin.gd @@ -1,20 +1,12 @@ tool extends EditorPlugin -var MMNode = preload("res://addons/mat_maker_gd/nodes/mm_node.gd") -var MMMaterial = preload("res://addons/mat_maker_gd/nodes/mm_material.gd") -var MMNodeUniversalProperty = preload("res://addons/mat_maker_gd/nodes/mm_node_universal_property.gd") - var editor_packed_scene = preload("res://addons/mat_maker_gd/editor/MatMakerGDEditor.tscn") var editor_scene = null var tool_button : ToolButton = null func _enter_tree(): - add_custom_type("MMNode", "Resource", MMNode, null) - add_custom_type("MMMaterial", "Resource", MMMaterial, null) - add_custom_type("MMNodeUniversalProperty", "Resource", MMNodeUniversalProperty, null) - editor_scene = editor_packed_scene.instance() editor_scene.set_plugin(self) @@ -22,10 +14,6 @@ func _enter_tree(): tool_button.hide() func _exit_tree(): - remove_custom_type("MMNode") - remove_custom_type("MMMaterial") - remove_custom_type("MMNodeUniversalProperty") - remove_control_from_bottom_panel(editor_scene) if editor_scene: @@ -35,14 +23,14 @@ func _exit_tree(): tool_button = null func handles(object): - return object is MMMateial + return object is MMMaterial func edit(object): #if editor_scene: # make_bottom_panel_item_visible(editor_scene) - - if object is MMMateial: - editor_scene.set_mmmaterial(object as MMMateial) + + if object is MMMaterial: + editor_scene.set_mmmaterial(object as MMMaterial) func make_visible(visible): if tool_button: