-
-
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
notify_property_list_changed
does not refresh the inspector in certain cases
#76795
Comments
This looks to be due to the assign method in Array not correctly assigning over the type information when dealing with variant types. More details in the linked PR. |
The linked PR does not fix the described bug but a regression that appears when trying to replicate this (#76642). I linked a fix I made for another issue that also fix this at the same time. |
I looked a bit more at this PR, the other PR fix was in fact fixing only this appearance of this bug. It looks like there would be other cases where it won't work. In a more general way this will happen whenever the call to the setter (which himself calls |
Godot version
Godot 4.0.2
Godot
4.0
90b4ca2System information
Windows 10 64 bits NVIDIA GeForce GTX 1060
Issue description
I have a class with a
TypedArray<Resource>
property (where the Resource is a custom one, but it doesnt matter in this issue). When items of this array are modified, it calls the setter of that property, which is ok. I rely on that to update certain things.In that class, I generate new properties in
_get_property_list
depending on the non-null contents of the array (null has to be allowed otherwise the inspector wouldn't work). So inside the setter of the array, I callnotify_property_list_changed
to refresh the inspector. However, in certain cases, Godot is not refreshing the inspector.Steps to reproduce
In the test project:
Array
property to expand it.Add Element
. This makes the array contain one null item. Notice in the Output panel that the setter was called,notify_property_list_changed
was called, and_get_property_list
was called, printing0 variants
, that's fine.Resource
. Now the array contains oneResource
. Observenotify_property_list_changed
has been printed again, however it is not followed by_get_property_list
, and the inspector is not refreshing. This is not expected._get_property_list: 1 variants
is printed, and a new property shows up,variants/0
.Minimal reproduction project
NotifyPropertyListChangedArray.zip
The text was updated successfully, but these errors were encountered: