OverviewFilesCommitsIssuesDocsReleasesPeers

proc-nodes / src / graph / proc_node.cpp

39 lines · cpp ref:
#include "proc_node.h"

namespace godot {

void ProcNode::_bind_methods() {
	ClassDB::bind_method(D_METHOD("get_node_type"), &ProcNode::get_node_type);
	ClassDB::bind_method(D_METHOD("get_node_title"), &ProcNode::get_node_title);
	ClassDB::bind_method(D_METHOD("supports_gpu"), &ProcNode::supports_gpu);
	// Bound because the two are a PAIR and only one was askable. A node can
	// emit nothing for two different reasons -- missing arithmetic, which must
	// refuse, or structural transparency, which must skip -- and a gate that
	// can see supports_gpu() but not gpu_transparent() cannot tell them apart.
	ClassDB::bind_method(D_METHOD("gpu_transparent"), &ProcNode::gpu_transparent);
	// Bound so glsl_golden_gate.gd can assert that the slot a node's GLSL reads
	// is the slot GraphExecutor packs -- the drift this map exists to end is
	// only visible if the gate can see the map.
	ClassDB::bind_method(D_METHOD("get_push_constant_sockets"), &ProcNode::get_push_constant_sockets);
	ClassDB::bind_method(D_METHOD("get_input_count"), &ProcNode::get_input_count);
	ClassDB::bind_method(D_METHOD("get_output_count"), &ProcNode::get_output_count);
	ClassDB::bind_method(D_METHOD("get_graph_position"), &ProcNode::get_graph_position);
	ClassDB::bind_method(D_METHOD("set_graph_position", "position"), &ProcNode::set_graph_position);
	ClassDB::bind_method(D_METHOD("get_source_id"), &ProcNode::get_source_id);
	ClassDB::bind_method(D_METHOD("set_source_id", "id"), &ProcNode::set_source_id);
	ClassDB::bind_method(D_METHOD("get_input_default", "index"), &ProcNode::get_input_default);
	ClassDB::bind_method(D_METHOD("get_input_name", "index"), &ProcNode::get_input_name);
	ClassDB::bind_method(D_METHOD("get_input_type", "index"), &ProcNode::get_input_type);
	ClassDB::bind_method(D_METHOD("get_output_name", "index"), &ProcNode::get_output_name);
	ClassDB::bind_method(D_METHOD("get_output_type", "index"), &ProcNode::get_output_type);
	ClassDB::bind_method(D_METHOD("set_input_default", "index", "value"), &ProcNode::set_input_default);
	ClassDB::bind_method(D_METHOD("is_input_default_modified", "index"), &ProcNode::is_input_default_modified);

	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "graph_position"), "set_graph_position", "get_graph_position");
	// Serialized, so a graph saved as a .tres can still be addressed by the ids
	// the tree it came from used.
	ADD_PROPERTY(PropertyInfo(Variant::INT, "source_id"), "set_source_id", "get_source_id");
}

} // namespace godot