Problem summary
Adding
Text2 nodes via Python behaves incorrectly when added through a Callback.
If the user adds a command to set the
box Knob as part of the
Text2 node creation, the callback will ignore the given values and use its own defaults.
This is confusing behaviour appears to occur automatically.
This behaviour does not occur on the Legacy Text node.
Customer reported version
nuke.10.5v5
Customer reported platform
windows7
Steps to reproduce
1) Open Nuke
2) Copy/Paste the following in the Script Editor and execute it:
text_node01 = nuke.createNode("Text2")text_node01.knob("message").setValue("the foundry")text_node01.knob("box").setValue([0,0,1000,1000])print '\nBox knob set to:', text_node01.knob("box").getValue()
A new
Text2 node should appear within the Node Graph, with a
box knob value of [0,0,1000,1000] .
3) Copy/Paste the following into the Script Editor and execute it:
def createText2(): text_node01 = nuke.createNode("Text") text_node01.knob("message").setValue("Legacy Text Node") text_node01.knob("box").setValue([0,0,1000,1000]) print '\nLegacy Text Box knob set to:', text_node01.knob("box").getValue() text_node02 = nuke.createNode("Text2") text_node02.knob("message").setValue("Text2 Node") text_node02.knob("box").setValue([0,0,1000,1000]) print '\nText2 Box knob set to:', text_node02.knob("box").getValue()nuke.addOnCreate(createText2, nodeClass='Dot')
This will setup a callback, which will create a Text2 and the Legacy Text node with the added box knob value set when creating a Dot node.
4) Create a Dot node within your Node Graph
Result:
- The Text2 and Legacy Text node will be created with the Dot node.
- The Text2 will not contain the set box knob values, while the Legacy Text node will have the set box knob values.
- Additionally, the Script Editor will print out that both knobs added should have a box knob value of [0,0,1000,1000] .
Workaround
Unknown.
Reproduced by support
This bug has been reproduced in:
Nuke11.1v4 - Windows 7 - Mac10.12 - CentOS6.9
Nuke11.1v1 - Windows 7 - Mac10.12 - CentOS6.9
Nuke11.0v4 - Windows 7
Nuke11.0v1 - Windows 7 - Mac10.12 - CentOS6.9
Nuke10.5v7 - Windows 7
Nuke10.5v1 - Windows 7 - Mac10.12 - CentOS6.9
Nuke10.0v6 - Windows 7
Nuke10.0v1 - Windows 7
Nuke9.0v9 - Windows 7
Nuke9.0v1 - Windows 7 - Mac10.12 - CentOS6.9
Earliest version tested
- This feature did not exist before this version - Text2 node added in Nuke9.0v1
Expected behaviour
- The callback added Text2 node should use the user-provided box knob values
Actual behaviour
- The Text2 knob ignores the user provided value and sets it to default bottom left corner.