-
-
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
Property list changes are only notified when it did change in Curve #74927
Property list changes are only notified when it did change in Curve #74927
Conversation
It's nice that it fixes the most visible symptom of my issue, but the curve editor will still be reconstructed when adding or removing points, which isn't expected behavior. For example in a WIP commit where I implemented a snap button in the curve editor, every time I add/remove a point, the snap button would get untoggled. Makes the whole thing dysfunctional. This helps with the re-construction issue but it's not a full fix IMO |
`Object::notify_property_list_changed()` should only be called when the structure of the property has actually changed. The structure of the property tree has not changed if the size of the array has not changed, and the only possibility is that the element value has changed.
25ae932
to
69f488e
Compare
Because when adding or removing array elements, the structure of the property tree does change. See Perhaps when the size of Array changes, we can try to use a new signal to specifically notify this change. Make these array properties behave like a sub-inspector (same as |
And |
Did a very quick look - the thought process and changes do seem to make sense. I like the discussion around making a sub-editor just for the points though, since that would allow changing points without resetting the rest of the editor. I think that would help @MewPurPur 's future efforts to add snapping! Any chance that makes sense to add in this PR, or is that a future PR? |
I don't see why we would need to redraw the entire tree when the structure of an array or a dictionary property changes. It's all handled by a single editor property control (from the POV of the inspector), we don't really need to update the entire tree. |
@YuriSizov so the issue is that the points of the curve are individually exported as properties. The curve doesn't export the array of points: godot/scene/resources/curve.cpp Lines 1263 to 1281 in c0a48a3
Whereas, for instance, Unfortunately, I believe it would be a compatibility-breaking change to directly export the underlying point & tangent arrays directly. I think maybe the way to handle this is to follow up on the idea of having a subinspector just for the points, and that's what gets updated when the property list changes, leaving the rest untouched (particularly, the visual curve editor itself), which is at the origin of this bug. But I also don't fully understand UI and whether this is possible :) |
The array here refers to using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I guess it makes sense to make this change for now to speed things up a bit. Looks like a proper solution would require bigger changes to the way we work with the property list in the inspector.
Thanks! |
Object::notify_property_list_changed()
should only be called when the structure of the property has actually changed.The structure of the property tree has not changed if the size of the array has not changed, and the only possibility is that the element value has changed.
Fix #74865.