Open and-rad opened 5 months ago
Another way to get this done, but which I assumed might pose too much of a hurdle (but maybe not?), is to provide the same functionality that Unreal Engine does as described above. The base resource importer class would need a new field that is subsequently available for all imported resources. This field could take any resource as its value and the resource is serialized along with all the other import data.
Might be worth thinking about.
Describe the project you are working on
A game that requires diligent tracking of third-party licenses and CC-type attribution on individual assets.
Describe the problem or limitation you are having in your project
In trying to find an efficient way to track and store asset attributions, I come up against different limitations in the engine that makes the whole thing more complicated than it would ideally be. My requirements are:
Of the above, only numbers 1 and 2 cause significant problems, 4 is no issue at all and 3 is solved with a custom inspector plugin. I just can't find a way to store custom information per resource that satisfies these two requirements. Imported scenes do not seem to suffer from the same limitations, but I need to explore my options there further.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I can think of several ways to make this possible, but the easiest seems to be making sure that metadata on imported resources can be edited with GDScript and persists after reimporting a resource. The field exists already and is used by importers:
For reference, Unreal Engine provides a field called Asset User Data on all imported assets, which is an array of an inheritable base class that you can use to pass arbitrary user data that is stored with the asset:
This is essentially what I'm trying to build.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Object::set_meta
to be able to store data in an imported resource's metadata field, andObject::get_meta
to read it. I haven't gotten around to testing whether this is already the case, so this might already work.If this enhancement will not be used often, can it be worked around with a few lines of script?
Not to my knowledge, at least when it comes to save additional data on any kind of imported resource. The overall goal I want to achieve (the attribution system) can be implemented in lots of ways that don't need this particular feature.
Is there a reason why this should be core and not an add-on in the asset library?
The engine doesn't expose the necessary classes and methods to implement this feature on the user side.