mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-23 21:16:54 +01:00
19 lines
419 B
GDScript
19 lines
419 B
GDScript
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:
|
|
var node_type = load("res://addons/material_maker/nodes/"+type+".tscn")
|
|
if node_type != null:
|
|
node = node_type.instance()
|
|
return node
|