-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Script properties coming from _get_property_list
are no longer shown in inspector
#43491
Comments
Oh gosh, lovely. Guess I'll have to take a look at that when I get a chance. Thanks for the sample project. |
Looks like this happens because Seems to me like the only good solution is to modify implementations of |
So, I have an updated version of the sample project where I make a That then results in a naturally-generated list that looks like this:
We want it to become this:
Unfortunately, it doesn't seem like there was ever support for having generated properties be mixed together with the regular properties of each script, so they are always appended to the end, regardless of which script actually implemented the logic to generate them. When I initially wrote this change, I wanted to find a way to implement all of the logic for fixing the order in a single place and just let scripts do what they want, but if you look carefully, the generated properties are in a reverse-class-order compared to their regular counterparts. In addition, because they don't show up in As such, the only way to know which properties go where is to modify how each respective scripting language builds each of its |
I suppose, at least for now, to fix it in stable, I can do a half-measure where I create a Edit: Additionally, I could add support for class/file name prefixed properties to automatically be added to that class's property section. So, if you have |
So... the PR you did only added the name of the scripts properties come from right? And just because of that... we can't get properties from |
@Zylann well, we can get the properties. They are there. It's just that the way I was building the new property list was by looking up the properties by name from whatever came back from Edit: I guess, it may be better to just not have a |
If I do that it's going to break everything, because that's an API breakage as well, while also being awkward... If the problem is only about generated properties, if possible, I would just not have that feature trigger if some of them exist. But if even that is not possible, I would not have the feature at all until it can be properly implemented. |
I believe I could do that, although it'd be a little weird on the logic side. You'd have to get the names of all properties, then get names of properties from individual scripts and systematically remove them all from the master list of properties. Then check if any properties are remaining and if so, exit early. |
Well that first idea was just for a first workaround until better is implemented, but if that's not ok (seems dirty to me as well) then this feature needs to get reverted IMO, and rework the internals if needed, so that this can be properly handled just like the core classes. The info is definitely there, we just need a clean way to get it. |
Yeah, I think doing the first solution for 3.2.x would be good, and then a better solution for 4.x can be done. |
@Zylann Then again, I think the idea of having properties just suddenly appear sorted and then not appear sorted if you happen to implement a certain method is even more jarring of a user experience. So, @aaronfranke @akien-mga I think it may be a good idea to revert my 8a02f22 until a more in-depth implementation can be made, both in 3.2 and in master. |
Can you try getting the ScriptInstance, and then check if it's null before using it? Sorry if that seems naïve, I haven't looked into this in depth. Maybe this should be reverted in 3.2, but I think that it's fine to keep this in master for now (we'll just need to keep this issue open to remind us to either revert it later or make a proper solution). |
Well, I just tried to test it out in the master branch, but the unaltered Happens here: https://github.com/godotengine/godot/blob/master/core/string/ustring.h#L438 |
This reverts commit 8a02f22. This caused regression godotengine#43491.
Since it's probably going to be breaking why not simply use _get_property_list() for extra properties etc that are just appended to the property data, while also allowing _get_property_list(gen_props) to be called with the props pregenerated and returning itself (default implementation obviously return gen_props) |
There's a deeper issue at root here. Namely that the manner in which I was trying to generate the titles of scripts was using statically defined information only rather than runtime information available to the Object/ScriptInstance. And since each scripting language devises its own manner of organizing properties, the appropriate solution would be to have an internal solution for each language that independently pre-inserts the necessary property groups/categories where they should appear in the inheritance history (godotengine/godot-proposals#2803). However, I noticed in a recent build that Godot is now already showing the class names in 4.0 - at least, with GDScript, not sure about others - and that kind of kills the need for this issue / my PR in the first place unless it is something specific to GDScript (would have to investigate further). |
@willnationsdev are there any updates on this issue? The error in the console is related to custom classes registered with This is the most related issue to this, since other nodes/resources that this scene is using appends a lot of properties in zkiMqbeb2q.mp4 |
I believe I'm still hitting that problem in master 28174d5, I am unable to use some editor plugins after porting them to Godot4 because of this. |
I believe this may be related to #54410. The custom properties do actually show up (for me and those in that issue) if they are in a category. But otherwise they do not. |
Godot 3.2.4 adf2dab
Windows 10 64 bits
From report Zylann/godot_heightmap_plugin#216 (comment)
My plugin makes extensive use of
_get_property_list
to add specific hints and categories to its exported variables and make a few dynamic ones appear, which worked in Godot 3.2.3. However, it appears the commit 8a02f22 now prevents all these properties from appearing.Godot3 MRP:
CustomPropertyList.zip
Open main scene, select root node. The first property is the only one exported with the
export
keyword. There are many others supposed to be visible, but in master they aren't showing up anymore.Godot4 MRP:
#43491 (comment)
The text was updated successfully, but these errors were encountered: