Input and Default value for boolean

Hello,

I’m making a custom node with a Boolean Input.
The custom Node work if I connect something to my input but I want he work with a default value?

I write:
InputName : bool = false

Someone has an idea? Maybe is not possible to affect default value for a Boolean Input?

InputName:bool dont work.
I’ve no control of my Input type

@Severin I suppose this is what you want

Within the custom node, you do this …

Hello Vikram,

It’s what I do but … it’s strange it’s not completely stable. I’ve the same redaction than you, but with boolean it’s work. If a change for an other name after it’s work again???

by the way, if I code:

boolean:bool

and put an other type for my input,like a number or a string, it’s work.
""; or 0; for false, anything other for true.

So thank Vikram

@Severin It works with other variable names for me.
However your observation about returning true for anything other than “” , 0 and_false_ is correct.
If you feel it’s and issue and have suggestions for improvement please post them here.

You need to check the box for the ‘Use Default Value’ setting for the input when the Custom Node is placed in a .dyn graph. After changing the setting, remove the Custom Node and place it again. See the post below:

That input format is correct (InputName : bool = false) :man_gesturing_ok: .

If you havent placed the node new again when testing that is needed for default values to take effect for the first time.