Playing with the file


I’m starting to play with the file in order to customize nodes at the moment they are created.
First off, it seems that the exemple file available here is outdated :

In this exemple, setting the default value for a Blur size is achieved using the setDefaultValue() function.
It doesn’t work, the setValue() function has to be used instead.

Then, setColor() doesn’t seem to work neither.
It works when running it in the script editor doing : app.Blur1.setColor(1,0,0)
but not within the file.

Another weird thing : at the time a Blur node is created, i ask Natron to print the node color in the script editor.
But the value returned is wrong. In this case it return (0,0,0) (black), although a Blur node is by default orange.

What am i doing wrong ?


At some point setDefaultValue was changed to only modify the default value without actually reseting the current value to the default value.
Using setDefaultValue + restoreDefaultValue should work.
Regarding the color of the node, this might be because of a bug in the current version of Natron: it probably is because the color is not yet set internally (because the node UI is not created) when the callback is called.


Thanks MrKepzie.
I was indeed expecting that setColor() wasn’t taken in account because the UI wasn’t initialized yet.
It was just to play around with Python anyway, not a big deal.
Thx again.