-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inst2dict does not turn classes inside classes to dict #6533
Comments
The functions |
@bojidar-bg Any idea with this? |
No, I never touched inst2dict/dict2inst code so far. I guess I might, if this issue sticks around 😆 |
First of all thank you for your report and sorry for the delay. We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to. We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us. For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors. Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed. Thanks in advance. Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it. |
I've stumbled upon the same issue when I needed to serialize data. I made a few attempts to modify While trying to find a fix, I've also realized the same conversion should be done on properties that possibly have arrays of instances. For some reason I can't get it to work on arrays (most likely because of recursion hell). |
You can try this implementation https://github.com/GodotExplorer/gdutils/blob/master/utils/InstanceManager.gd |
I made a script, that fixes that bug and made |
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments and another to validate that an argument is boolean.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments and another to validate that an argument is boolean.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments and another to validate that an argument is boolean.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments and another to validate that an argument is boolean.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments and another to validate that an argument is boolean.
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments and another to validate that an argument is boolean.
For 4.x this method is now deprecated, so this is now only really relevant for 3.x: |
inst2dict does not turn classes inside classes to dict.
Here is an example of to_json() output;
I believe the classes (Reference:8XX) should also be converted to Dictionary for this to work as intended. :)
Currently; a workaround for this is to save the other classes as Dict, and use a set/get where you convert between class and dictionary. However I am sure inst2dict should also include subclasses.
Hope to see a fix implemented in the future :)
The text was updated successfully, but these errors were encountered: