You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
I am trying to make a JSON resource importer but I'm not sure how to export dynamically created variables
Please add documentation on how to export variable at runtime with set() and get()
func import(source_file, save_path, options, r_platform_variants, r_gen_files):
var file = File.new()
var err = file.open(source_file, File.READ)
if err != OK:
return err
var dict = json2dict(file.get_as_text())
file.close()
var resource = parse_dict(Resource.new(), dict)
resource.property_list_changed_notify()
return ResourceSaver.save("%s.%s" % [save_path, get_save_extension()], resource)
func parse_dict(resource:Resource, dict:Dictionary)->Resource:
var properties = resource.get_property_list()
for i in range(properties.size()):
var k = properties[i].name
var v = properties[i].value
if v is Resource: resource.set(k, parse_dict(resource, v))
else: resource.set(k, v)
# export(resource.get(k))
return resource
Your Godot version:
3.2.3
Issue description:
I am trying to make a JSON resource importer but I'm not sure how to export dynamically created variables
Please add documentation on how to export variable at runtime with set() and get()
URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/tutorials/plugins/editor/import_plugins.html
The text was updated successfully, but these errors were encountered: