Skip to content

IS_CHANGED should be defined as a class method, not an instance method #476

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

Open
curiousjp opened this issue May 8, 2025 · 0 comments
Open

Comments

@curiousjp
Copy link

When attempting to use the SystemNotification or PlaySound node, users will see a warning in the log:

WARNING: SystemNotification.IS_CHANGED() missing 1 required positional argument: 'self'

Per custom_nodes/example_node.py.example, IS_CHANGED should be defined as a class method:

    Class methods
    -------------
...
    IS_CHANGED:
        optional method to control when the node is re executed.
...
    #@classmethod
    #def IS_CHANGED(s, image, string_field, int_field, float_field, print_to_screen):
    #    return ""

Fixing this by changing the signature in e.g. system_notification.py or play_sound.py to

@classmethod
def IS_CHANGED(cls, **kwargs):
    return float("NaN")

will fix this error, and also restore the functionality of the sound / notification system. (Just make sure you don't have notifications snoozed...)

I hope you will excuse me not filing a PR on this, but it is such a small change it did not seem worthwhile.

#439 - I believe this will also resolve your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant