ID 143323 - Expression "format" links dont copy/paste correctly

Follow

Problem summary
Knob expressions on Text Knobs do not get updated to match their relatively linked source nodes when either copy pasting or when saved as ToolSets.

 

For example, the below screenshot shows that all of the expressions from dst_node are linked to src_node as they should be. When both of the nodes are copied and pasted, only the numerical expressions from dst_node1 are linked to src_node1 - the Text knobs from dst_node1 are still linked to src_node, and not src_node1.

 

​​

 

Customer reported version
nuke.10.0v4

 

Customer reported platform
n_a_linux

 

Steps to reproduce

1) Open Nuke 

2) Paste the following into the node graph several times:


set cut_paste_input [stack 0]version 11.1 v1push $cut_paste_inputNoOp {name src_nodeselected true xpos 2380ypos 1214addUserKnob {20 User}addUserKnob {1 tcltext l "TCL Text"}tcltext "some TCL text"addUserKnob {1 pythontext l "Python Text"}pythontext "some python text"addUserKnob {3 intknob l Integer}intknob 7addUserKnob {7 floatknob l Float R 0 10}floatknob 3.1415}NoOp {inputs 0name dst_nodelabel "\[value tcltext]\n\[value pythontext]\n\[value intknob]\n\[value floatknob]"selected truexpos 2380ypos 1286addUserKnob {20 User}addUserKnob {1 tcltext l "TCL Text"}tcltext "\[value src_node.tcltext]"addUserKnob {1 pythontext l "Python Text"}pythontext "\[python \{nuke.toNode(\"src_node\")\['pythontext'].value()\}]"addUserKnob {3 intknob l Integer}intknob {{parent.src_node.intknob}}addUserKnob {7 floatknob l Float R 0 10}floatknob {{parent.src_node.floatknob}}}

 

3) Notice some of the expressions (the text knobs) are still linked to the original src_node

 

This also happens if you save the nodes as a Toolset:

 

1) Open Nuke

 

2) Paste the code from above

 

3) Select both nodes in the node graph

 

4)  Click 

  (ToolSets) on the toolbar and select Create.

 

5) Name the Toolset, and click Create

 

6) Right click on the node graph > Toolsets > The name you gave the Toolset

 

7) Notice that the same thing happens as above, when multiple Toolsets are created​


Workaround

The clone tool could be used. To create a clone, select a node and press Alt + K or with the node selected, Right click on the node graph > Edit > Clone.
However, this has limitations as all of the settings on both the clone and the original will always update to be the same.

 

The following workaround could be used in some situations, where only the numerical part of the text needs to be changed.

On the Input node, the user can change the number in the "inputNum" field, and this will update the label of the Output node that it is linked to.

The "number" field is just the value of "inputNum" as an integer.

The "padding" field finds the length of the "inputNum" knob to preserve it's padding (ie. 001) and this uses the following expression: len(nuke.thisNode()['inputNum'].value())

On the Output node, under the Variables tab, the output_num and output_pad values are linked to the number and padding values, of the Input node, respectively. This is done with the following expressions: parent.Input1.number and parent.Input1.padding

Now on the User tab, the dst_text field contains the following expression: Frame_[format "%0[value output_pad]i" [value output_num]]

Where "Frame_" is the prefix that would need to be changed manually, and it is calling the out_pad and output_num values from the Variables tab.

Finally, on the Node tab, the label field is set to [value dst_text] which is displaying the output of the expression in the dst_text knob.

The following code can be copied and pasted into the Node Graph to view the workaround applied.


set cut_paste_input [stack 0]version 11.1 v1Input { inputs 0 name Input1 label "Frame_\[value inputNum]" selected true xpos -1 ypos -51 number {{parent.Input1.inputNum 0 0}} addUserKnob {20 User} addUserKnob {1 inputNum} inputNum 001 addUserKnob {26 ""} addUserKnob {3 int_value} int_value {{inputNum}} addUserKnob {3 padding} padding {{"\[python len(nuke.thisNode()\\\['inputNum'\\].value())]"}}}push $cut_paste_inputOutput { name Output1 label "\[value src_text]" selected true xpos 1 ypos 100 addUserKnob {20 User} addUserKnob {1 src_text} src_text "Frame_\[format \"%0\[value output_pad]i\" \[value output_num]]" addUserKnob {20 Variables} addUserKnob {3 output_num} output_num {{parent.Input1.int_value}} addUserKnob {3 output_pad} output_pad {{parent.Input1.padding}}}

Reproduced by support
This bug has been reproduced in:

Nuke 11.1v1 - Windows 10 - Mac OSX (El Capitan) - Linux CentOS 7

Nuke 11.0v3 - Windows 10

Nuke 11.0v1 - Windows 10

Nuke 10.5v7 - Windows 10

Nuke 10.5v1 - Windows 10

Nuke 9.0v9 - Windows 10

Nuke 9.0v1 - Windows 10

Nuke 8.0v7 - Windows 10

Nuke 8.0v1 - Windows 10

Nuke 7.0v10 - Windows 10 - Mac OSX (El Capitan) - Linux CentOS 7

 

Earliest version tested
Nuke 7.0v10 - Windows 10 - Mac OSX (El Capitan) - Linux CentOS 7

- This issue appears to be in all versions of the product

 

Expected behaviour
The expression on the text knobs to be updated so that they are linked to it's source node, similar to how the numerical knobs are.

 

Actual behaviour
The expression on the text knobs do not update, so they all become linked to the same source node.

 

    We're sorry to hear that

    Please tell us why