-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Expose PropertyUsageFlags for External Access from Godot in C# and GDExtension dump #7150
Comments
What situations are we dealing with here? How would this be used for doing bindings generation specifically, because you can easily access this information via |
It is as @AThousandShips says, this information should be available by using Adding an attribute to every member is something we'll likely want to avoid since it increases the size of the assembly. I also don't really like that this attribute would be added to the generated C# classes from the engine but they won't be available in user classes unless they manually add them. Instead of an attribute I would suggest a method that retrieves the |
Mind you I was also sort of wanting to do it for referencing purposes so it could on the engine code gen add a bit to the summary comment instead of adding attributes |
I'm still wondering over the actual need for this, like how would bindings generators etc. use this? Because it adds quite a bit of extra data to the extension dump so some more concrete examples of how this data will be used is needed here |
I so I plan to generate networking coded based off every property and scene object in the engine and I would like to know things like if it serialized or not to know if it should be networked and it would also be nice for me to make my own inspectors/editor UI for the networked scene because I know what is supposed to show up in the editor or not and I like to do this with generated code and not runtime code do to complexions and speed problems |
Also I question the usefullness of this given that usage flags are not static, they are mutable and depend on things in the editor and the status of other properties, so I don't think it's even useful to export this like this as you can't rely on it, just take this as an example: var mat := StandardMaterial3D.new()
mat.shading_mode = BaseMaterial3D.SHADING_MODE_PER_PIXEL
for p in mat.get_property_list():
if p["name"] == "ao_enabled":
print(p["usage"])
mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
for p in mat.get_property_list():
if p["name"] == "ao_enabled":
print(p["usage"]) Will print:
For example if you rely only on the API file you won't be able to handle |
So, this information is NOT for generating a GDExtension binding, but is for a custom application that is part of your project? If so, couldn't you make a GDScript (or C# script) in your Godot project that looped through all the classes in In any case, if this isn't needed for generating a GDExtension binding, I'd argue that we don't need it in extension_api.json. |
Describe the project you are working on
RhubarbVR a real time collaborative engine excrescences
Describe the problem or limitation you are having in your project
In C# and also in a GDExtension dump there is no way of knowing about the usings to find out info of a property like if it is serialized or not.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Adds the number of the property using to the JSON in the API dump for GDExtension and adds a attribute to the C# properties for Reflection and also for c# de-comp referencing
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Explained above how it is implemented
Pull Request
If this enhancement will not be used often, can it be worked around with a few lines of script?
It could be used for refreshing when debugging code in C# but even if it was not used often someone would have to generate the code themself and run there own fork of the engine for this feature
Is there a reason why this should be core and not an add-on in the asset library?
This is editing the generators for both C# and GD Extension which can not be extended with an asset library
The text was updated successfully, but these errors were encountered: