2018-10-13 17:31:37 +02:00
|
|
|
tool
|
|
|
|
extends Node
|
|
|
|
|
|
|
|
var includes
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
pass
|
|
|
|
|
|
|
|
func create_node(type):
|
|
|
|
var node = null
|
|
|
|
if File.new().file_exists("res://addons/material_maker/nodes/"+type+".mmn"):
|
|
|
|
node = preload("res://addons/material_maker/nodes/node_generic.gd").new()
|
|
|
|
node.model = type
|
|
|
|
else:
|
2019-08-12 15:58:42 +02:00
|
|
|
var node_type = load("res://addons/material_maker/nodes/"+type+".tscn")
|
2018-10-13 17:31:37 +02:00
|
|
|
if node_type != null:
|
|
|
|
node = node_type.instance()
|
2019-08-17 17:35:48 +02:00
|
|
|
else:
|
|
|
|
node = preload("res://addons/material_maker/nodes/generic.tscn").instance()
|
2018-10-13 17:31:37 +02:00
|
|
|
return node
|