material-maker/addons/material_maker/engine/gen_context.gd

23 lines
424 B
GDScript3
Raw Normal View History

tool
extends Object
class_name MMGenContext
var renderer : MMGenRenderer
var variants : Dictionary = {}
func _init(r : MMGenRenderer):
renderer = r
func has_variant(generator):
return variants.has(generator)
func get_variant(generator, uv):
var rv = -1
if variants.has(generator):
rv = variants[generator].find(uv)
if rv == -1:
2019-09-10 21:01:08 +02:00
variants[generator].push_back(uv)
else:
variants[generator] = [uv]
return rv