Open Vivraan opened 4 years ago
Material Maker requires a few autoloads for the plugin to work. I started making this smoother for (I hope) next release.
What are the necessary autoloads?
mm_io_types="res://addons/material_maker/engine/io_types.gd" mm_loader="res://addons/material_maker/engine/loader.gd" mm_renderer="*res://addons/material_maker/engine/renderer.tscn"
I tried adding the autoloads and I got this:
modules/gdscript/gdscript.cpp:1453 - Condition "!named_globals.has(p_name)" is true.
modules/gdscript/gdscript.cpp:1453 - Condition "!named_globals.has(p_name)" is true.
Script does not inherit a Node: res://addons/material_maker/engine/io_types.gd.
editor/editor_autoload_settings.cpp:488 - Condition "!info->node" is true. Continuing.
Script does not inherit a Node: res://addons/material_maker/engine/loader.gd.
editor/editor_autoload_settings.cpp:488 - Condition "!info->node" is true. Continuing.
res://addons/material_maker/engine/gen_base.gd:222 - Parse Error: Couldn't fully load the singleton script "mm_io_types" (possible cyclic reference or parse error).
modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
There's a cyclic reference of this order (upon inspecting the code): MMGenBase -> mm_io_types -> mm_loader -> MMGenBase.
I also noticed that your code adheres to some kind of mixed convention leaving a lot of code ambiguous. The style used is also ambiguous, since I couldn't identify the autoload classes at first glance. I'd suggest sticking with static typing entirely, renaming these autoloads or switching to class_name for them.
The autoloads are singletons, it would be possible to instanciate them explicitely in the plugin and in material Maker, but it would be impractical. It is probably possible to break the dependency loop by adding a new class for material maker paths (that's defined in the loader and used in io_types).
And yes, I often forget to specify types (and I've been using Godot for quite some time and typing was not available when I started this projeect).
Material Maker version: .92
OS/device including version: Windows 10, Godot v3.2.2 Mono Stable
Issue description: When I tried to import the plugin, I immediately got a bunch of errors, preventing me from using it.
Steps to reproduce:
AssetLib > Plugins...