diff --git a/modules/material_maker/nodes/mm_node.cpp b/modules/material_maker/nodes/mm_node.cpp index 5c3631a35..25c689b64 100644 --- a/modules/material_maker/nodes/mm_node.cpp +++ b/modules/material_maker/nodes/mm_node.cpp @@ -1,6 +1,7 @@ #include "mm_node.h" +#include "../editor/mm_graph_node.h" #include "core/object.h" #include "mm_material.h" #include "mm_node_universal_property.h" @@ -146,10 +147,14 @@ void MMNode::register_methods(Node *mm_graph_node) { } void MMNode::_register_methods_bind(Node *mm_graph_node) { - _register_methods(mm_graph_node); + MMGraphNode *gn = Object::cast_to(mm_graph_node); + + ERR_FAIL_COND(!gn); + + _register_methods(gn); } -void MMNode::_register_methods(Node *mm_graph_node) { +void MMNode::_register_methods(MMGraphNode *mm_graph_node) { } void MMNode::register_input_property(const Ref &p_prop) { diff --git a/modules/material_maker/nodes/mm_node.h b/modules/material_maker/nodes/mm_node.h index 293568d7f..a258afa23 100644 --- a/modules/material_maker/nodes/mm_node.h +++ b/modules/material_maker/nodes/mm_node.h @@ -11,6 +11,7 @@ class Node; class MMMaterial; class MMNodeUniversalProperty; +class MMGraphNode; class MMNode : public Resource { GDCLASS(MMNode, Resource); @@ -32,20 +33,20 @@ public: void set_dirty(const bool val); bool render(const Ref &material); - void _render(const Ref &material); + virtual void _render(const Ref &material); Ref render_image(const Ref &material); - Ref _render_image(const Ref &material); + virtual Ref _render_image(const Ref &material); Color get_value_for(const Vector2 &uv, const int pseed); - Color _get_value_for(const Vector2 &uv, const int pseed); + virtual Color _get_value_for(const Vector2 &uv, const int pseed); void init_properties(); - void _init_properties(); + virtual void _init_properties(); void register_methods(Node *mm_graph_node); - void _register_methods_bind(Node *mm_graph_node); - void _register_methods(Node *mm_graph_node); + virtual void _register_methods_bind(Node *mm_graph_node); + virtual void _register_methods(MMGraphNode *mm_graph_node); void register_input_property(const Ref &prop); void unregister_input_property(const Ref &prop);