Skip to content

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

Open
@curiousjp

Description

@curiousjp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions