-
-
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
Materials do not fire changed
signal when any of its properties change
#69571
Comments
I did some digging and there is no |
The docs for That being said, from working with the codebase for awhile, that definitely is not the case in practice. Many property setters do not have it looks like the docs were updated relatively recently by Mickeon in #67072. @Mickeon Do you have any additional insight as to whether |
This is probably it, to be honest. Hence my highlighting on the "usually" part of it. I am not sure if having them emit "changed" would be a performance burden, or if they normally should but they aren't as a result of a bug, right now.
But wait, Material is not a Node, it is a Resource. |
Ooops. I meant Resource |
That's why I expect to receive the signal on any change. If this is how it is with other Resources, there should be a better consistency on when the signal is or isn't emmited. |
I encountered this problem as well, but ended up using "property_list_changed" signal. Edit: As expected "property_list_changed" doesn't fire on value changes, but only on texture changes. I need to know those changes too. |
We discussed this on rocketchat with a few core contributors and the consensus is that the documentation should be changed to no longer say that The documentation for emit changed should be changed from:
to
Then we should strive to note in the documentation for which properties |
Going through all members of all resources will be a feat in itself, however if somebody wants to do it, we should have a reusable text to add in appropriate places. How about:
I also wrote a small tool script to test if changing certain properties will trigger
EDIT: I'm not sure why I didn't notice that op already supplied very similiar code snippet 😅 This may be automated further by iterating through property list and setting values, however I'm not sure how to handle all types in reasonable manner. |
I think it would be more reasonable to note when |
Material does really seem to be the odd one here, so far in my sporadical testing most resources do emit |
I'm taking the update for the docs project.
Just for clarification, this details should be added in the Material class docs, right? Not in the Resource class docs. |
Is this still open? I was thinking of fixing this as my first contribution to the project. |
It is not, sorry been a PR open and just linking it |
Ah, it's fine, I'll just look for another issue! |
Godot version
4.0.beta7
System information
Irelevant
Issue description
Any Material
NodeResource does not emit thechanged
signal when its properties change (Properties of base Resources still emit the signal)Steps to reproduce
Copy-paste this script to any node
Try different Resources and change their properties and watch when the
changed
signal is emmited.When testing any Material derivate, any of its properties changing did not emitted the signal.
Minimal reproduction project
See above
The text was updated successfully, but these errors were encountered: