-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Enable script class resource exports. #32018
Conversation
36c7eb8
to
85e8e7c
Compare
I have discovered a bug thus far where the custom resources do not match up when using MyResource for both the export hint and the type hint. Working on fixing it now. Edit: bugs fixed! Here are the results of the export hint, type hint, and expression type combinations:
|
85e8e7c
to
9cfbbea
Compare
Ah, that's a new error. Haven't tried omitting the export type and inferring it from the type hint. Will take a look at that tomorrow. |
9cfbbea
to
5ea74d8
Compare
@somnivore This should now be fixed. Please re-test things and let me know if you encounter any issues. |
5ea74d8
to
03b4578
Compare
Was this tested in C#? Apparently i cannot manage to work
|
This will not work for C# untill script class support is added for it (godotengine/godot-proposals#22). I am actually currently working on that, hehe. |
Commit 1fe8ded causes a merge conflict for your branch. I believe I can resolve it though. |
I believe this is the proper fix rand0m-cloud@952e991 |
@winadam Thanks for letting me know. I'll push an update to the PR soon. |
d8e561e
to
7160f66
Compare
7160f66
to
20dc0cb
Compare
Will we have the luck of seeing this in v4? along side project wide groups? |
@xDGameStudios I'm not sure what you mean by resource groups (there a PR about that I missed?), but yes, I believe this will get merged for the 4.0 release at some point. Probably after all the major core revisions are completed and the master branch becomes slightly more stable. |
Edit2: I solved this problem by moving over to the 3.2 stable branch and the only changes i had to do was replace the export hints with ''Resource'' instead of my custom Ressource class. The defined Resources still remained and im able to successfully export again. (If somebody else might happen to be in the same predicament as me) Hi, Im using these changes in my project, but im unable to compile working export-templates for any platform. The compilation for those export templates works, but the compiled game doesnt work (crash on windows, "'' is not a valid selector" on html). If i export the project with the 3.2 stable export template, the game works, but is missing all the custom resources. im currently using thise branch for my project, as the changes in this pull request are making things a lot easier for me (defining data). Im currently working on a locally compiled version of (https://github.com/Reneator/godot/commits/master_2020). Is there a plan/date to get this pull-request into master in the nearby future? or is there anything i can do, to help? (no C/C++ knowledge) Edit: Changed formulation of last paragraph |
this should be picked for 3.2, it makes working with resources so powerful |
Hey, i cloned your repo and tried to build the gdres branch :
|
@astrale-sharp That is probably because it's in the middle of trying to get converted into a 4.0-compatible build. I have a separate |
Rebased |
@willnationsdev, I can't find your |
you can find it in his personal forked godot repository: https://github.com/willnationsdev/godot/tree/gdres-3.2 when i looked for it in branches, i couldnt find it, but in the Active category it still exists. |
@RandomShaper @Reneator I'm not sure why it wouldn't show up for you. If I just go to my repo and click the branch dropdown, it shows up for me. |
@willnationsdev what's the status of this? I'd love to see this in 3.2.4 :) |
@MeikelLP I had a port of this for 3.2 in my |
Just an update for folks here. I re-tested the baseline of features in 4.0 to see if I could even properly test whether this PR's code works, and there are still some issues preventing me from doing so (which means there's no point in even updating the PR's code yet). Unfortunately, because exporting basic resources still doesn't work yet, I can't update this PR. See #43904 for details. |
A full 3.2 port of this which includes not only GDScript support, but also VisualScript, NativeScript, PluginScript, and C# can now be found at #44879. After GDNative 2.0 is implemented, I'll have to refactor this PR to do all the same features as the 3.2 port, but building off of the new core foundation for script classes. |
Any plans for this? |
Closes godotengine/godot-proposals#18 for GDScript. To add support for custom resource exports in other languages, all you would have to do is add script class support to those languages (godotengine/godot-proposals#22) and program their export code to correctly set the
class_name
andhint_string
values for the PropertyInfo object.Credits:
Much of this work derives from @vixelz's efforts from #26162, so some credit is due there.
Changes:
I have fixed some of the concerns addressed by those who commented on that PR, namely...
Caveats:
As for using preloaded constants, I have decided to forego any implementation on purpose since...
Screenshots:
Here are some images of the PR in action. It demonstrates...
Edit: Fixed a bug where the custom resource icons were not displaying in the Inspector. The screenshots are outdated in this respect, so keep in mind that class icons will appear in the resource dropdown menu.