diff --git a/modules/material_maker/config.py b/modules/material_maker/config.py index 557a90b24..d1dbbb38b 100644 --- a/modules/material_maker/config.py +++ b/modules/material_maker/config.py @@ -21,7 +21,7 @@ def get_doc_classes(): "MatMakerGDEditor", "MMUniform", - "GreyscaleUniform ", + "MMGreyscaleUniform", ] def get_doc_path(): diff --git a/modules/material_maker/nodes/uniform/greyscale_uniform.cpp b/modules/material_maker/nodes/uniform/greyscale_uniform.cpp index f2cde33f0..29faf0077 100644 --- a/modules/material_maker/nodes/uniform/greyscale_uniform.cpp +++ b/modules/material_maker/nodes/uniform/greyscale_uniform.cpp @@ -3,15 +3,15 @@ #include "../../editor/mm_graph_node.h" -Ref GreyscaleUniform::get_uniform() { +Ref MMGreyscaleUniform::get_uniform() { return uniform; } -void GreyscaleUniform::set_uniform(const Ref &val) { +void MMGreyscaleUniform::set_uniform(const Ref &val) { uniform = val; } -void GreyscaleUniform::_init_properties() { +void MMGreyscaleUniform::_init_properties() { if (!uniform.is_valid()) { uniform.instance(); uniform->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_FLOAT); @@ -25,26 +25,26 @@ void GreyscaleUniform::_init_properties() { register_output_property(uniform); } -void GreyscaleUniform::_register_methods(MMGraphNode *mm_graph_node) { +void MMGreyscaleUniform::_register_methods(MMGraphNode *mm_graph_node) { mm_graph_node->add_slot_float_universal(uniform); } -Color GreyscaleUniform::_get_value_for(const Vector2 &uv, const int pseed) { +Color MMGreyscaleUniform::_get_value_for(const Vector2 &uv, const int pseed) { float f = uniform->get_value(uv); return Color(f, f, f, 1); } -GreyscaleUniform::GreyscaleUniform() { +MMGreyscaleUniform::MMGreyscaleUniform() { } -GreyscaleUniform::~GreyscaleUniform() { +MMGreyscaleUniform::~MMGreyscaleUniform() { } -void GreyscaleUniform::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_uniform"), &GreyscaleUniform::get_uniform); - ClassDB::bind_method(D_METHOD("set_uniform", "value"), &GreyscaleUniform::set_uniform); +void MMGreyscaleUniform::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_uniform"), &MMGreyscaleUniform::get_uniform); + ClassDB::bind_method(D_METHOD("set_uniform", "value"), &MMGreyscaleUniform::set_uniform); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "uniform", PROPERTY_HINT_RESOURCE_TYPE, "Ref"), "set_uniform", "get_uniform"); - ClassDB::bind_method(D_METHOD("_init_properties"), &GreyscaleUniform::_init_properties); - ClassDB::bind_method(D_METHOD("_get_value_for", "uv", "pseed"), &GreyscaleUniform::_get_value_for); + ClassDB::bind_method(D_METHOD("_init_properties"), &MMGreyscaleUniform::_init_properties); + ClassDB::bind_method(D_METHOD("_get_value_for", "uv", "pseed"), &MMGreyscaleUniform::_get_value_for); } diff --git a/modules/material_maker/nodes/uniform/greyscale_uniform.h b/modules/material_maker/nodes/uniform/greyscale_uniform.h index 87e53dcbd..f086259fc 100644 --- a/modules/material_maker/nodes/uniform/greyscale_uniform.h +++ b/modules/material_maker/nodes/uniform/greyscale_uniform.h @@ -4,8 +4,8 @@ #include "../mm_node.h" #include "../mm_node_universal_property.h" -class GreyscaleUniform : public MMNode { - GDCLASS(GreyscaleUniform, MMNode); +class MMGreyscaleUniform : public MMNode { + GDCLASS(MMGreyscaleUniform, MMNode); public: Ref get_uniform(); @@ -15,8 +15,8 @@ public: void _register_methods(MMGraphNode *mm_graph_node); Color _get_value_for(const Vector2 &uv, const int pseed); - GreyscaleUniform(); - ~GreyscaleUniform(); + MMGreyscaleUniform(); + ~MMGreyscaleUniform(); protected: static void _bind_methods(); diff --git a/modules/material_maker/register_types.cpp b/modules/material_maker/register_types.cpp index 11e8f0960..cadd0cc0b 100644 --- a/modules/material_maker/register_types.cpp +++ b/modules/material_maker/register_types.cpp @@ -62,9 +62,9 @@ void register_material_maker_types() { ClassDB::register_class(); ClassDB::register_class(); - ClassDB::register_class(); + ClassDB::register_class(); MMAlgos::register_node_class("Uniform", "MMUniform"); - MMAlgos::register_node_class("Uniform", "GreyscaleUniform"); + MMAlgos::register_node_class("Uniform", "MMGreyscaleUniform"); _mm_algos_singleton = memnew(_MMAlgos); Engine::get_singleton()->add_singleton(Engine::Singleton("MMAlgos", _MMAlgos::get_singleton()));