Problem summary
Array_Knob.valueAt() is ignoring the 'view' argument and returning incorrect values
Customer reported version
nuke.10.0v6
Customer reported platform
ubuntu
Steps to reproduce
1. Launch Nuke, set up Views for Stereo
2. Add a Script Editor to the layout
3. Execute the following:
root = nuke.root()root.addView('extra1', 'purple')root.addView('extra2', 'yellow')root.addView('extra3', 'blue')
4. Paste the following node into the Node Graph:
set cut_paste_input [stack 0]version 10.5 v1push $cut_paste_inputGrade { blackpoint {(default {{curve x1 2 x10 5}} right {{curve x1 4 x10 7}} extra1 {{curve x1 6 x10 9}} extra2 {{curve x1 8 x10 11}} extra3 {{curve x1 10 x10 13}})} name Grade1 selected true xpos 237 ypos -186}
5. Open the node's properties, unfurl the views on the 'blackpoint' knob
6. Execute the following:
nuke.toNode('Grade1')['blackpoint'].valueAt(5, 0, 3)
-
It returns '3.3333333357861994', the value for the 'left' view
-
Should have returned '7.333333335786199', the value for the 'extra1' view
It doesn't matter what you set the 'view' argument to, it always returns the value for the 'left' view. If you unsplit the 'right' view (so that the * view appears), it will start returning the value for *.
It also makes no difference using the name of the view instead of the view index number, i.e. 'extra1' instead of '3'.
Workaround
Adding the following commands to the loop will start and stop playback
nuke.activeViewer().play(1)
nuke.activeViewer().stop()
You can grab the values by starting and stopping the viewer each time it is changed.
active_viewer = nuke.activeViewer() current_view = active_viewer.view() def loopViews(): for view in nuke.views(): # Edit the current view switchView(view) print 'Currently active view: ', current_view print 'Looped view: ', view print nuke.toNode('Grade1')['blackpoint'].valueAt(5, 0, view) # Switch back to original view switchView(current_view)# starting and stopping playback can force updatedef switchView(view): nuke.activeViewer().setView(view) nuke.activeViewer().play(1) nuke.activeViewer().stop()loopViews()
This is bit of a 'hacky' workaround, but it works for this situation.
Reproduced by support
Can repro on -
OSX 10.11.6:
Nuke11.1v1
Nuke 11.0v3
Nuke 10.5v2
Nuke 10.0v1
Windows 8
Nuke11.1v1
Nuke 11.0v3
Nuke 10.5v2
Linux CentOS 7.4
Unable to repro on -
OSX 10.11.6:
Nuke9.0v8
Expected behaviour
Output correct values based on view argument
Actual behaviour
View argument is ignored