Skip to content

Is there a way to share a variable between Python and JavaScript? #25

@schoenid

Description

@schoenid

I've got a custom node, which will update itself by writing to a widget.
It works fine on single execution, but in batch mode it fails.

Image

I can change the function to not read the original value from the widget, count the iterations and update the widget value.
This works fine.
But if I read back the changed widget value, it fails every second time.
The update trough a onExecuted widget value overwrite is not reliable, because in batch mode the widgets value will be reset to earlier values trough system processes which I don't know

The problem is, if I change the widgets value manually, it won't be read.
So I need a variable to transfer the information, that the widget value has been changed by interaction trough an onNodeCreated callback.

Is there an easy way, to pass a variable, even it's just a boolean?
(I didn't find any or any documentation, how to do it ...)

The only way I found until now, is to add an additional widget, which can be used, but this looks not nice, because it can't be hidden.

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