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 1f6180de..4b8fe124 100644 --- a/game/addons/mat_maker_gd/editor/mm_graph_node.gd +++ b/game/addons/mat_maker_gd/editor/mm_graph_node.gd @@ -84,7 +84,7 @@ func add_slot_int_universal(input_property : MMNodeUniversalProperty, output_typ sb.max_value = prange.y bc.add_child(sb) - var slot_idx : int = add_slot(MMNode.SlotTypes.SLOT_TYPE_UNIVERSAL, output_type, "", "", bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, output_type, "", "", bc) sb.value = input_property.get_default_value() @@ -125,7 +125,7 @@ func add_slot_float_universal(input_property : MMNodeUniversalProperty, output_t var sb : SpinBox = SpinBox.new() bc.add_child(sb) - var slot_idx : int = add_slot(MMNode.SlotTypes.SLOT_TYPE_UNIVERSAL, output_type, "", "", bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, output_type, "", "", bc) sb.rounded = false sb.step = step sb.min_value = prange.x @@ -184,7 +184,7 @@ func add_slot_vector2_universal(input_property : MMNodeUniversalProperty, output var sby : SpinBox = SpinBox.new() bc.add_child(sby) - var slot_idx : int = add_slot(MMNode.SlotTypes.SLOT_TYPE_UNIVERSAL, output_type, "", "", bc) + var slot_idx : int = add_slot(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_UNIVERSAL, output_type, "", "", bc) sbx.rounded = false sby.rounded = false sbx.step = step diff --git a/game/addons/mat_maker_gd/nodes/mm_node.gd b/game/addons/mat_maker_gd/nodes/mm_node.gd index debcf6dd..4fb44853 100644 --- a/game/addons/mat_maker_gd/nodes/mm_node.gd +++ b/game/addons/mat_maker_gd/nodes/mm_node.gd @@ -2,16 +2,6 @@ tool class_name MMNode extends Resource -enum SlotTypes { - SLOT_TYPE_NONE = -1, - SLOT_TYPE_IMAGE = 0, - SLOT_TYPE_INT = 1, - SLOT_TYPE_FLOAT = 2, - SLOT_TYPE_VECTOR2 = 3, - SLOT_TYPE_VECTOR3 = 4, - SLOT_TYPE_UNIVERSAL = 5, -} - export(Vector2) var graph_position : Vector2 = Vector2() func recalculate_image(material, slot_idx : int) -> ImageTexture: 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 31b3f7ee..35e89cd8 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 @@ -2,6 +2,16 @@ tool class_name MMNodeUniversalProperty extends Resource +enum SlotTypes { + SLOT_TYPE_NONE = -1, + SLOT_TYPE_IMAGE = 0, + SLOT_TYPE_INT = 1, + SLOT_TYPE_FLOAT = 2, + SLOT_TYPE_VECTOR2 = 3, + SLOT_TYPE_VECTOR3 = 4, + SLOT_TYPE_UNIVERSAL = 5, +} + enum MMNodeUniversalPropertyDefaultType { DEFAULT_TYPE_INT = 0, DEFAULT_TYPE_FLOAT = 1, diff --git a/game/addons/mat_maker_gd/nodes/noise/perlin.gd b/game/addons/mat_maker_gd/nodes/noise/perlin.gd index ca3b502c..eb41ee46 100644 --- a/game/addons/mat_maker_gd/nodes/noise/perlin.gd +++ b/game/addons/mat_maker_gd/nodes/noise/perlin.gd @@ -14,10 +14,10 @@ func get_value_for(uv : Vector2, slot_idx : int, pseed : int) -> Color: return NoisePerlin.perlinc(uv, scale, iterations, persistence, pseed) func register_methods(mm_graph_node) -> void: - mm_graph_node.add_slot_texture(SlotTypes.SLOT_TYPE_NONE, SlotTypes.SLOT_TYPE_IMAGE, "recalculate_image", "") - mm_graph_node.add_slot_int(SlotTypes.SLOT_TYPE_NONE, SlotTypes.SLOT_TYPE_NONE, "get_iterations", "set_iterations", "iterations")#, Vector2(1, 10)) - mm_graph_node.add_slot_float(SlotTypes.SLOT_TYPE_NONE, SlotTypes.SLOT_TYPE_NONE, "get_persistence", "set_persistence", "persistence", 0.05)#, Vector2(0, 1)) - mm_graph_node.add_slot_vector2(SlotTypes.SLOT_TYPE_NONE, SlotTypes.SLOT_TYPE_NONE, "get_scale", "set_scale", "scale", 1)#, Vector2(1, 32)) + mm_graph_node.add_slot_texture(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE, "recalculate_image", "") + mm_graph_node.add_slot_int(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "get_iterations", "set_iterations", "iterations")#, Vector2(1, 10)) + mm_graph_node.add_slot_float(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "get_persistence", "set_persistence", "persistence", 0.05)#, Vector2(0, 1)) + mm_graph_node.add_slot_vector2(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "get_scale", "set_scale", "scale", 1)#, Vector2(1, 32)) func get_iterations() -> int: return iterations diff --git a/game/addons/mat_maker_gd/nodes/simple/shape.gd b/game/addons/mat_maker_gd/nodes/simple/shape.gd index cf05af6d..0810d971 100644 --- a/game/addons/mat_maker_gd/nodes/simple/shape.gd +++ b/game/addons/mat_maker_gd/nodes/simple/shape.gd @@ -54,11 +54,11 @@ func get_value_for(uv : Vector2, slot_idx : int, pseed : int) -> Color: return Color(c, c, c, 1) func register_methods(mm_graph_node) -> void: - mm_graph_node.add_slot_texture(SlotTypes.SLOT_TYPE_NONE, SlotTypes.SLOT_TYPE_IMAGE, "recalculate_image", "") - mm_graph_node.add_slot_enum(SlotTypes.SLOT_TYPE_NONE, SlotTypes.SLOT_TYPE_NONE, "get_shape_typoe", "set_shape_typoe", "shape_type", [ "Circle", "Polygon", "Star", "Curved Star", "Rays" ]) - mm_graph_node.add_slot_int(SlotTypes.SLOT_TYPE_NONE, SlotTypes.SLOT_TYPE_NONE, "get_sides", "set_sides", "sides")#, Vector2(1, 10)) - mm_graph_node.add_slot_float_universal(radius, SlotTypes.SLOT_TYPE_NONE, "radius", 0.05) - mm_graph_node.add_slot_float_universal(edge, SlotTypes.SLOT_TYPE_NONE, "edge", 0.05) + mm_graph_node.add_slot_texture(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_IMAGE, "recalculate_image", "") + mm_graph_node.add_slot_enum(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "get_shape_typoe", "set_shape_typoe", "shape_type", [ "Circle", "Polygon", "Star", "Curved Star", "Rays" ]) + mm_graph_node.add_slot_int(MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "get_sides", "set_sides", "sides")#, Vector2(1, 10)) + mm_graph_node.add_slot_float_universal(radius, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "radius", 0.05) + mm_graph_node.add_slot_float_universal(edge, MMNodeUniversalProperty.SlotTypes.SLOT_TYPE_NONE, "edge", 0.05) func get_shape_typoe() -> int: return shape_type