Cleaned up MMTransform.

This commit is contained in:
Relintai 2022-06-16 19:26:46 +02:00
parent 20af76c795
commit 9ff5be15e5
5 changed files with 223 additions and 291 deletions

View File

@ -54,6 +54,7 @@ sources = [
"nodes/uniform/greyscale_uniform.cpp",
"nodes/transform/translate.cpp",
"nodes/transform/transform.cpp",
]
if env["tools"]:

View File

@ -24,6 +24,7 @@ def get_doc_classes():
"MMGreyscaleUniform",
"MMTranslate",
"MMTransform",
]
def get_doc_path():

View File

@ -1,296 +1,233 @@
#include "transform.h"
#include "../../algos/mm_algos.h"
#include "../../editor/mm_graph_node.h"
Ref<Resource> Transform::get_image() {
return image;
Ref<MMNodeUniversalProperty> MMTransform::get_image() {
return image;
}
void Transform::set_image(const Ref<Resource> &val) {
image = val;
void MMTransform::set_image(const Ref<MMNodeUniversalProperty> &val) {
image = val;
}
Ref<Resource> Transform::get_input() {
return input;
Ref<MMNodeUniversalProperty> MMTransform::get_input() {
return input;
}
void Transform::set_input(const Ref<Resource> &val) {
input = val;
void MMTransform::set_input(const Ref<MMNodeUniversalProperty> &val) {
input = val;
}
Ref<Resource> Transform::get_translate_x() {
return translate_x;
Ref<MMNodeUniversalProperty> MMTransform::get_translate_x() {
return translate_x;
}
void Transform::set_translate_x(const Ref<Resource> &val) {
translate_x = val;
void MMTransform::set_translate_x(const Ref<MMNodeUniversalProperty> &val) {
translate_x = val;
}
Ref<Resource> Transform::get_translate_y() {
return translate_y;
Ref<MMNodeUniversalProperty> MMTransform::get_translate_y() {
return translate_y;
}
void Transform::set_translate_y(const Ref<Resource> &val) {
translate_y = val;
void MMTransform::set_translate_y(const Ref<MMNodeUniversalProperty> &val) {
translate_y = val;
}
Ref<Resource> Transform::get_rotate() {
return rotate;
Ref<MMNodeUniversalProperty> MMTransform::get_rotate() {
return rotate;
}
void Transform::set_rotate(const Ref<Resource> &val) {
rotate = val;
void MMTransform::set_rotate(const Ref<MMNodeUniversalProperty> &val) {
rotate = val;
}
Ref<Resource> Transform::get_scale_x() {
return scale_x;
Ref<MMNodeUniversalProperty> MMTransform::get_scale_x() {
return scale_x;
}
void Transform::set_scale_x(const Ref<Resource> &val) {
scale_x = val;
void MMTransform::set_scale_x(const Ref<MMNodeUniversalProperty> &val) {
scale_x = val;
}
Ref<Resource> Transform::get_scale_y() {
return scale_y;
Ref<MMNodeUniversalProperty> MMTransform::get_scale_y() {
return scale_y;
}
void Transform::set_scale_y(const Ref<Resource> &val) {
scale_y = val;
void MMTransform::set_scale_y(const Ref<MMNodeUniversalProperty> &val) {
scale_y = val;
}
int Transform::get_mode() const {
return mode;
int MMTransform::get_mode() const {
return mode;
}
void Transform::set_mode(const int val) {
mode = val;
void MMTransform::set_mode(const int val) {
mode = val;
set_dirty(true);
}
void MMTransform::_init_properties() {
if (!input.is_valid()) {
input.instance();
input->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_COLOR);
input->set_default_value(Color(0, 0, 0, 1));
}
input->set_input_slot_type(MMNodeUniversalProperty::SLOT_TYPE_UNIVERSAL);
input->set_slot_name(">>> Input ");
//tool;
//export(Resource) ;
Ref<Resource> image;
//export(Resource) ;
Ref<Resource> input;
//export(Resource) ;
Ref<Resource> translate_x;
//export(Resource) ;
Ref<Resource> translate_y;
//export(Resource) ;
Ref<Resource> rotate;
//export(Resource) ;
Ref<Resource> scale_x;
//export(Resource) ;
Ref<Resource> scale_y;
//export(int, "Clamp,Repeat,Extend") ;
int mode = 0;
if (!image.is_valid()) {
image.instance();
image->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_IMAGE);
}
void Transform::_init_properties() {
//image.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_FLOAT;
image->set_output_slot_type(MMNodeUniversalProperty::SLOT_TYPE_IMAGE);
//image.force_override = true;
if (!input) {
input = MMNodeUniversalProperty.new();
input.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_COLOR;
input.set_default_value(Color(0, 0, 0, 1));
if (!translate_x.is_valid()) {
translate_x.instance();
translate_x->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_FLOAT);
translate_x->set_default_value(0);
translate_x->set_value_step(0.01);
}
translate_x->set_input_slot_type(MMNodeUniversalProperty::SLOT_TYPE_UNIVERSAL);
translate_x->set_slot_name("Translate X");
if (!translate_y.is_valid()) {
translate_y.instance();
translate_y->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_FLOAT);
translate_y->set_default_value(0);
translate_y->set_value_step(0.01);
}
translate_y->set_input_slot_type(MMNodeUniversalProperty::SLOT_TYPE_UNIVERSAL);
translate_y->set_slot_name("Translate Y");
if (!rotate.is_valid()) {
rotate.instance();
rotate->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_FLOAT);
rotate->set_default_value(0);
rotate->set_value_step(0.01);
}
rotate->set_input_slot_type(MMNodeUniversalProperty::SLOT_TYPE_UNIVERSAL);
rotate->set_slot_name("Rotate");
if (!scale_x.is_valid()) {
scale_x.instance();
scale_x->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_FLOAT);
scale_x->set_default_value(1);
scale_x->set_value_step(0.01);
}
scale_x->set_input_slot_type(MMNodeUniversalProperty::SLOT_TYPE_UNIVERSAL);
scale_x->set_slot_name("Scale X");
if (!scale_y.is_valid()) {
scale_y.instance();
scale_y->set_default_type(MMNodeUniversalProperty::DEFAULT_TYPE_FLOAT);
scale_y->set_default_value(1);
scale_y->set_value_step(0.01);
}
scale_y->set_input_slot_type(MMNodeUniversalProperty::SLOT_TYPE_UNIVERSAL);
scale_y->set_slot_name("Scale Y");
register_input_property(input);
register_output_property(image);
register_input_property(translate_x);
register_input_property(translate_y);
register_input_property(rotate);
register_input_property(scale_x);
register_input_property(scale_y);
}
input.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL;
input.slot_name = ">>> Input ";
void MMTransform::_register_methods(MMGraphNode *mm_graph_node) {
mm_graph_node->add_slot_label_universal(input);
mm_graph_node->add_slot_texture_universal(image);
mm_graph_node->add_slot_float_universal(translate_x);
mm_graph_node->add_slot_float_universal(translate_y);
mm_graph_node->add_slot_float_universal(rotate);
mm_graph_node->add_slot_float_universal(scale_x);
mm_graph_node->add_slot_float_universal(scale_y);
if (!image) {
image = MMNodeUniversalProperty.new();
image.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_IMAGE;
Array arr;
arr.push_back("Clamp");
arr.push_back("Repeat");
arr.push_back("Extend");
mm_graph_node->add_slot_enum("get_mode", "set_mode", "Mode", arr);
}
//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.DEFAULT_TYPE_FLOAT;
translate_x.set_default_value(0);
translate_x.value_step = 0.01;
void MMTransform::_render(const Ref<MMMaterial> &material) {
Ref<Image> img = render_image(material);
image->set_value(img);
}
translate_x.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL;
translate_x.slot_name = "Translate X";
Color MMTransform::_get_value_for(const Vector2 &uv, const int pseed) {
//$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:;
//Clamp -> transform2_clamp;
//Repeat -> fract;
//Extend -> "";
Vector2 tr = Vector2(float(translate_x->get_default_value()) * (2.0 * float(translate_x->get_value_or_zero(uv)) - 1.0), float(translate_y->get_default_value()) * (2.0 * float(translate_y->get_value_or_zero(uv)) - 1.0));
float rot = float(rotate->get_default_value()) * 0.01745329251 * (2.0 * float(rotate->get_value_or_zero(uv)) - 1.0);
Vector2 sc = Vector2(float(scale_x->get_default_value()) * (2.0 * float(scale_x->get_value_or_zero(uv)) - 1.0), float(scale_y->get_default_value()) * (2.0 * float(scale_y->get_value_or_zero(uv)) - 1.0));
Vector2 nuv = MMAlgos::transform2(uv, tr, rot, sc);
if (!translate_y) {
translate_y = MMNodeUniversalProperty.new();
translate_y.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT;
translate_y.set_default_value(0);
translate_y.value_step = 0.01;
if (mode == 0) {
nuv = MMAlgos::transform2_clamp(nuv);
}
else if (mode == 1) {
nuv = MMAlgos::fractv2(nuv);
}
return input->get_value(nuv);
}
translate_y.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL;
translate_y.slot_name = "Translate Y";
if (!rotate) {
rotate = MMNodeUniversalProperty.new();
rotate.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT;
rotate.set_default_value(0);
rotate.value_step = 0.01;
MMTransform::MMTransform() {
mode = 0;
}
rotate.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL;
rotate.slot_name = "Rotate";
if (!scale_x) {
scale_x = MMNodeUniversalProperty.new();
scale_x.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT;
scale_x.set_default_value(1);
scale_x.value_step = 0.01;
MMTransform::~MMTransform() {
}
scale_x.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL;
scale_x.slot_name = "Scale X";
void MMTransform::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_image"), &MMTransform::get_image);
ClassDB::bind_method(D_METHOD("set_image", "value"), &MMTransform::set_image);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "image", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMNodeUniversalProperty>"), "set_image", "get_image");
if (!scale_y) {
scale_y = MMNodeUniversalProperty.new();
scale_y.default_type = MMNodeUniversalProperty.DEFAULT_TYPE_FLOAT;
scale_y.set_default_value(1);
scale_y.value_step = 0.01;
ClassDB::bind_method(D_METHOD("get_input"), &MMTransform::get_input);
ClassDB::bind_method(D_METHOD("set_input", "value"), &MMTransform::set_input);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "input", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMNodeUniversalProperty>"), "set_input", "get_input");
ClassDB::bind_method(D_METHOD("get_translate_x"), &MMTransform::get_translate_x);
ClassDB::bind_method(D_METHOD("set_translate_x", "value"), &MMTransform::set_translate_x);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "translate_x", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMNodeUniversalProperty>"), "set_translate_x", "get_translate_x");
ClassDB::bind_method(D_METHOD("get_translate_y"), &MMTransform::get_translate_y);
ClassDB::bind_method(D_METHOD("set_translate_y", "value"), &MMTransform::set_translate_y);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "translate_y", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMNodeUniversalProperty>"), "set_translate_y", "get_translate_y");
ClassDB::bind_method(D_METHOD("get_rotate"), &MMTransform::get_rotate);
ClassDB::bind_method(D_METHOD("set_rotate", "value"), &MMTransform::set_rotate);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "rotate", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMNodeUniversalProperty>"), "set_rotate", "get_rotate");
ClassDB::bind_method(D_METHOD("get_scale_x"), &MMTransform::get_scale_x);
ClassDB::bind_method(D_METHOD("set_scale_x", "value"), &MMTransform::set_scale_x);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "scale_x", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMNodeUniversalProperty>"), "set_scale_x", "get_scale_x");
ClassDB::bind_method(D_METHOD("get_scale_y"), &MMTransform::get_scale_y);
ClassDB::bind_method(D_METHOD("set_scale_y", "value"), &MMTransform::set_scale_y);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "scale_y", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMNodeUniversalProperty>"), "set_scale_y", "get_scale_y");
ClassDB::bind_method(D_METHOD("get_mode"), &MMTransform::get_mode);
ClassDB::bind_method(D_METHOD("set_mode", "value"), &MMTransform::set_mode);
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode"), "set_mode", "get_mode");
}
scale_y.input_slot_type = MMNodeUniversalProperty.SLOT_TYPE_UNIVERSAL;
scale_y.slot_name = "Scale Y";
register_input_property(input);
register_output_property(image);
register_input_property(translate_x);
register_input_property(translate_y);
register_input_property(rotate);
register_input_property(scale_x);
register_input_property(scale_y);
}
void Transform::_register_methods(const Variant &mm_graph_node) {
mm_graph_node.add_slot_label_universal(input);
mm_graph_node.add_slot_texture_universal(image);
mm_graph_node.add_slot_float_universal(translate_x);
mm_graph_node.add_slot_float_universal(translate_y);
mm_graph_node.add_slot_float_universal(rotate);
mm_graph_node.add_slot_float_universal(scale_x);
mm_graph_node.add_slot_float_universal(scale_y);
mm_graph_node.add_slot_enum("get_mode", "set_mode", "Mode", [ "Clamp", "Repeat", "Extend" ]);
}
void Transform::_render(const Variant &material) {
Ref<Image> img = render_image(material);
image.set_value(img);
}
Color Transform::_get_value_for(const Vector2 &uv, const int pseed) {
//$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:;
//Clamp -> transform2_clamp;
//Repeat -> fract;
//Extend -> "";
Vector2 tr = Vector2(translate_x.get_default_value() * (2.0 * translate_x.get_value_or_zero(uv) - 1.0), translate_y.get_default_value() *(2.0 * translate_y.get_value_or_zero(uv) - 1.0));
float rot = rotate.get_default_value() * 0.01745329251*(2.0 * rotate.get_value_or_zero(uv) - 1.0);
Vector2 sc = Vector2(scale_x.get_default_value() *(2.0 * scale_x.get_value_or_zero(uv) - 1.0), scale_y.get_default_value() *(2.0 * scale_y.get_value_or_zero(uv) - 1.0));
Vector2 nuv = MMAlgos.transform2(uv, tr, rot, sc);
if (mode == 0) {
nuv = MMAlgos.transform2_clamp(nuv);
}
else if (mode == 1) {
nuv = MMAlgos.fractv2(nuv);
}
return input.get_value(nuv);
}
//mode;
int Transform::get_mode() {
return mode;
}
void Transform::set_mode(const int val) {
mode = val;
set_dirty(true);
}
}
Transform::Transform() {
image;
input;
translate_x;
translate_y;
rotate;
scale_x;
scale_y;
mode = 0;
}
Transform::~Transform() {
}
static void Transform::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_image"), &Transform::get_image);
ClassDB::bind_method(D_METHOD("set_image", "value"), &Transform::set_image);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "image", PROPERTY_HINT_RESOURCE_TYPE, "Ref<Resource>"), "set_image", "get_image");
ClassDB::bind_method(D_METHOD("get_input"), &Transform::get_input);
ClassDB::bind_method(D_METHOD("set_input", "value"), &Transform::set_input);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "input", PROPERTY_HINT_RESOURCE_TYPE, "Ref<Resource>"), "set_input", "get_input");
ClassDB::bind_method(D_METHOD("get_translate_x"), &Transform::get_translate_x);
ClassDB::bind_method(D_METHOD("set_translate_x", "value"), &Transform::set_translate_x);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "translate_x", PROPERTY_HINT_RESOURCE_TYPE, "Ref<Resource>"), "set_translate_x", "get_translate_x");
ClassDB::bind_method(D_METHOD("get_translate_y"), &Transform::get_translate_y);
ClassDB::bind_method(D_METHOD("set_translate_y", "value"), &Transform::set_translate_y);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "translate_y", PROPERTY_HINT_RESOURCE_TYPE, "Ref<Resource>"), "set_translate_y", "get_translate_y");
ClassDB::bind_method(D_METHOD("get_rotate"), &Transform::get_rotate);
ClassDB::bind_method(D_METHOD("set_rotate", "value"), &Transform::set_rotate);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "rotate", PROPERTY_HINT_RESOURCE_TYPE, "Ref<Resource>"), "set_rotate", "get_rotate");
ClassDB::bind_method(D_METHOD("get_scale_x"), &Transform::get_scale_x);
ClassDB::bind_method(D_METHOD("set_scale_x", "value"), &Transform::set_scale_x);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "scale_x", PROPERTY_HINT_RESOURCE_TYPE, "Ref<Resource>"), "set_scale_x", "get_scale_x");
ClassDB::bind_method(D_METHOD("get_scale_y"), &Transform::get_scale_y);
ClassDB::bind_method(D_METHOD("set_scale_y", "value"), &Transform::set_scale_y);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "scale_y", PROPERTY_HINT_RESOURCE_TYPE, "Ref<Resource>"), "set_scale_y", "get_scale_y");
ClassDB::bind_method(D_METHOD("get_mode"), &Transform::get_mode);
ClassDB::bind_method(D_METHOD("set_mode", "value"), &Transform::set_mode);
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode"), "set_mode", "get_mode");
ClassDB::bind_method(D_METHOD("_init_properties"), &Transform::_init_properties);
ClassDB::bind_method(D_METHOD("_register_methods", "mm_graph_node"), &Transform::_register_methods);
ClassDB::bind_method(D_METHOD("_render", "material"), &Transform::_render);
ClassDB::bind_method(D_METHOD("_get_value_for", "uv", "pseed"), &Transform::_get_value_for);
ClassDB::bind_method(D_METHOD("get_mode"), &Transform::get_mode);
ClassDB::bind_method(D_METHOD("set_mode", "val"), &Transform::set_mode);
}

View File

@ -1,68 +1,57 @@
#ifndef TRANSFORM_H
#define TRANSFORM_H
#ifndef MM_TRANSFORM_H
#define MM_TRANSFORM_H
#include "../mm_node.h"
#include "../mm_node_universal_property.h"
class Transform : public MMNode {
GDCLASS(Transform, MMNode);
class MMTransform : public MMNode {
GDCLASS(MMTransform, MMNode);
public:
public:
Ref<MMNodeUniversalProperty> get_image();
void set_image(const Ref<MMNodeUniversalProperty> &val);
Ref<Resource> get_image();
void set_image(const Ref<Resource> &val);
Ref<MMNodeUniversalProperty> get_input();
void set_input(const Ref<MMNodeUniversalProperty> &val);
Ref<Resource> get_input();
void set_input(const Ref<Resource> &val);
Ref<MMNodeUniversalProperty> get_translate_x();
void set_translate_x(const Ref<MMNodeUniversalProperty> &val);
Ref<Resource> get_translate_x();
void set_translate_x(const Ref<Resource> &val);
Ref<MMNodeUniversalProperty> get_translate_y();
void set_translate_y(const Ref<MMNodeUniversalProperty> &val);
Ref<Resource> get_translate_y();
void set_translate_y(const Ref<Resource> &val);
Ref<MMNodeUniversalProperty> get_rotate();
void set_rotate(const Ref<MMNodeUniversalProperty> &val);
Ref<Resource> get_rotate();
void set_rotate(const Ref<Resource> &val);
Ref<MMNodeUniversalProperty> get_scale_x();
void set_scale_x(const Ref<MMNodeUniversalProperty> &val);
Ref<Resource> get_scale_x();
void set_scale_x(const Ref<Resource> &val);
Ref<MMNodeUniversalProperty> get_scale_y();
void set_scale_y(const Ref<MMNodeUniversalProperty> &val);
Ref<Resource> get_scale_y();
void set_scale_y(const Ref<Resource> &val);
int get_mode() const;
void set_mode(const int val);
int get_mode() const;
void set_mode(const int val);
void _init_properties();
void _register_methods(MMGraphNode *mm_graph_node);
void _render(const Ref<MMMaterial> &material);
Color _get_value_for(const Vector2 &uv, const int pseed);
void _init_properties();
void _register_methods(const Variant &mm_graph_node);
void _render(const Variant &material);
Color _get_value_for(const Vector2 &uv, const int pseed);
int get_mode();
void set_mode(const int val);
MMTransform();
~MMTransform();
Transform();
~Transform();
protected:
static void _bind_methods();
protected:
static void _bind_methods();
//tool
//export(Resource)
Ref<Resource> image;
//export(Resource)
Ref<Resource> input;
//export(Resource)
Ref<Resource> translate_x;
//export(Resource)
Ref<Resource> translate_y;
//export(Resource)
Ref<Resource> rotate;
//export(Resource)
Ref<Resource> scale_x;
//export(Resource)
Ref<Resource> scale_y;
//export(int, "Clamp,Repeat,Extend")
int mode = 0;
//mode
Ref<MMNodeUniversalProperty> image;
Ref<MMNodeUniversalProperty> input;
Ref<MMNodeUniversalProperty> translate_x;
Ref<MMNodeUniversalProperty> translate_y;
Ref<MMNodeUniversalProperty> rotate;
Ref<MMNodeUniversalProperty> scale_x;
Ref<MMNodeUniversalProperty> scale_y;
//export(int, "Clamp,Repeat,Extend")
int mode;
};
#endif

View File

@ -45,6 +45,7 @@ SOFTWARE.
#include "nodes/uniform/greyscale_uniform.h"
#include "nodes/uniform/uniform.h"
#include "nodes/transform/transform.h"
#include "nodes/transform/translate.h"
static _MMAlgos *_mm_algos_singleton = nullptr;
@ -71,6 +72,9 @@ void register_material_maker_types() {
ClassDB::register_class<MMTranslate>();
MMAlgos::register_node_class("Transform", "MMTranslate");
ClassDB::register_class<MMTransform>();
MMAlgos::register_node_class("Transform", "MMTransform");
_mm_algos_singleton = memnew(_MMAlgos);
Engine::get_singleton()->add_singleton(Engine::Singleton("MMAlgos", _MMAlgos::get_singleton()));