More smaller fixes.

This commit is contained in:
Relintai 2022-06-08 21:48:23 +02:00
parent 7f5e462ad0
commit 96ed3b53a3
5 changed files with 25 additions and 8 deletions

View File

@ -14,6 +14,10 @@ sources = [
"nodes/mm_material.cpp",
"nodes/mm_node_universal_property.cpp",
"nodes/mm_node.cpp",
#"editor/mat_maker_gd_editor.cpp",
#"editor/mm_create_name_popup.cpp",
#"editor/mm_graph_node.cpp",
]

View File

@ -14,6 +14,8 @@ def get_doc_classes():
"MMNode",
"MMNodeUniversalProperty",
"MMMaterial",
"MMGraphNode",
"MatMakerGDEditor",
]
def get_doc_path():

View File

@ -151,6 +151,10 @@ void MatMakerGDEditor::recreate() {
if (ip.is_valid()) {
MMGraphNode *input_node = find_graph_node_for(n);
MMGraphNode *output_node = find_graph_node_for(ip->get_input_property()->get_owner());
ERR_CONTINUE(!input_node);
ERR_CONTINUE(!output_node);
int to_slot = input_node->get_input_property_graph_node_slot_index(ip);
int from_slot = output_node->get_output_property_graph_node_slot_index(ip->get_input_property());
_graph_edit->connect_node(output_node->get_name(), from_slot, input_node->get_name(), to_slot);
@ -337,9 +341,9 @@ MatMakerGDEditor::~MatMakerGDEditor() {
void MatMakerGDEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_graph_edit"), &MatMakerGDEditor::get_graph_edit);
ClassDB::bind_method(D_METHOD("get_material"), &MatMakerGDEditor::get_material);
ClassDB::bind_method(D_METHOD("set_material", "value"), &MatMakerGDEditor::set_material);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "*_material", PROPERTY_HINT_RESOURCE_TYPE, "Ref<MMMaterial>"), "set_material", "get_material");
ClassDB::bind_method(D_METHOD("get_mm_material"), &MatMakerGDEditor::get_mm_material);
ClassDB::bind_method(D_METHOD("set_mm_material", "value"), &MatMakerGDEditor::set_mm_material);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mm_material", PROPERTY_HINT_RESOURCE_TYPE, "MMMaterial"), "set_mm_material", "get_mm_material");
ClassDB::bind_method(D_METHOD("get_ignore_material_change_event"), &MatMakerGDEditor::get_ignore_material_change_event);
ClassDB::bind_method(D_METHOD("set_ignore_material_change_event", "value"), &MatMakerGDEditor::set_ignore_material_change_event);
@ -348,8 +352,8 @@ void MatMakerGDEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_recreation_in_progress", "value"), &MatMakerGDEditor::set_recreation_in_progress);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "recreation_in_progress"), "set_recreation_in_progress", "get_recreation_in_progress");
ClassDB::bind_method(D_METHOD("get_undo_redo"), &MatMakerGDEditor::get_undo_redo);
ClassDB::bind_method(D_METHOD("set_undo_redo", "value"), &MatMakerGDEditor::set_undo_redo);
//ClassDB::bind_method(D_METHOD("get_undo_redo"), &MatMakerGDEditor::get_undo_redo);
//ClassDB::bind_method(D_METHOD("set_undo_redo", "value"), &MatMakerGDEditor::set_undo_redo);
ClassDB::bind_method(D_METHOD("recreate"), &MatMakerGDEditor::recreate);
//ClassDB::bind_method(D_METHOD("find_graph_node_for", "nnode"), &MatMakerGDEditor::find_graph_node_for);

View File

@ -5,6 +5,7 @@
#include "../nodes/mm_node.h"
#include "../nodes/mm_node_universal_property.h"
#include "mat_maker_gd_editor.h"
#include "scene/resources/packed_scene.h"
#include "scene/gui/check_box.h"
#include "scene/gui/color_picker.h"
@ -905,10 +906,10 @@ void MMGraphNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_slot_bool", "getter", "setter", "slot_name"), &MMGraphNode::add_slot_bool);
ClassDB::bind_method(D_METHOD("add_slot_label_universal", "property"), &MMGraphNode::add_slot_label_universal);
ClassDB::bind_method(D_METHOD("add_slot_int_universal", "property"), &MMGraphNode::add_slot_int_universal);
ClassDB::bind_method(D_METHOD("add_slot_float", "getter", "setter", "slot_name", "step", "prange", " 1000)"), &MMGraphNode::add_slot_float, 0.1, Vector2(-1000, -1000));
ClassDB::bind_method(D_METHOD("add_slot_float", "getter", "setter", "slot_name", "step", "prange"), &MMGraphNode::add_slot_float, 0.1, Vector2(-1000, -1000));
ClassDB::bind_method(D_METHOD("add_slot_float_universal", "property"), &MMGraphNode::add_slot_float_universal);
ClassDB::bind_method(D_METHOD("add_slot_vector2", "getter", "setter", "slot_name", "step", "prange", " 1000)"), &MMGraphNode::add_slot_vector2, 0.1, Vector2(-1000, -1000));
ClassDB::bind_method(D_METHOD("add_slot_vector3", "getter", "setter", "slot_name", "step", "prange", " 1000)"), &MMGraphNode::add_slot_vector3, 0.1, Vector2(-1000, -1000));
ClassDB::bind_method(D_METHOD("add_slot_vector2", "getter", "setter", "slot_name", "step", "prange"), &MMGraphNode::add_slot_vector2, 0.1, Vector2(-1000, -1000));
ClassDB::bind_method(D_METHOD("add_slot_vector3", "getter", "setter", "slot_name", "step", "prange"), &MMGraphNode::add_slot_vector3, 0.1, Vector2(-1000, -1000));
ClassDB::bind_method(D_METHOD("add_slot_vector2_universal", "property"), &MMGraphNode::add_slot_vector2_universal);
ClassDB::bind_method(D_METHOD("add_slot", "input_type", "output_type", "getter", "setter", "control"), &MMGraphNode::add_slot);

View File

@ -31,6 +31,9 @@ SOFTWARE.
#include "nodes/mm_node.h"
#include "nodes/mm_node_universal_property.h"
//#include "editor/mat_maker_gd_editor.h"
//#include "editor/mm_graph_node.h"
static _MMAlgos *_mm_algos_singleton = nullptr;
void register_material_maker_types() {
@ -40,6 +43,9 @@ void register_material_maker_types() {
ClassDB::register_class<MMMaterial>();
ClassDB::register_class<MMNode>();
//ClassDB::register_class<MMGraphNode>();
//ClassDB::register_class<MatMakerGDEditor>();
_mm_algos_singleton = memnew(_MMAlgos);
Engine::get_singleton()->add_singleton(Engine::Singleton("MMAlgos", _MMAlgos::get_singleton()));
}