The OutputContext.setView method takes a view index, and index 0 is the default view (currently active view). You could equally do this:
for viewnumber, view in range(len(nuke.views())): output_context.setView(viewnumber + 1) ..it just seemed more "correct" to loop over /all/ the views, and explicitly skip the uninteresting one (the default view is the "view currently active in the GUI") Which remind some: something to add to the feature request: ideally setView could take either an index or a view name, thus you could just do this: for v in nuke.views(): output_context.setView(v) Much nicer. On 18/12/13 13:57, Frank Rueter wrote: > Thanks Ben, I'll use that. Looks like evaluate() should be depreciated > in favour of getEvaluatedValue(). > OutputContext should also have a method to handle the localised vs. > non-localised state I reckon. I shall log a feature request for that. > > One question though: > Is there a reason you use loop over output_context.viewcount(), then > filter out the default view, instead of just looping over nuke.views()? > > > Cheers, > frank > > > On 18/12/13 15:59, Ben Dickson wrote: >> With the "evaluate" functions, I tend to find passing an OutputContext >> the only reliable way to use them. >> >> Can't remember specifically why.. but the "view" arguments are often >> broken, or confusing, or both (e.g accessing the camera 'matrix' for >> different views is almost impossible without using OutputContext, also >> some take the view name as a string, others take view index but silently >> accept a string without error..) >> >> Accusations against Nuke's API aside, this works: >> >> https://gist.github.com/dbr/8016555 >> >> On 18/12/13 13:16, Frank Rueter wrote: >>> I guess <knob>.evaluate() solves it: >>> >>> for v in nuke.views(): >>> print fileKnob.evaluate(view=v) >>> >>> >>> >>> >>> >>> On 18/12/13 15:26, Frank Rueter wrote: >>>> Hi all, >>>> >>>> is there an easy way to get all file paths for a knob when it's split >>>> for multi view/stereo workflow? >>>> I can't find any methods for this and picking apart the output from >>>> knob.toScript() can't possibly be the answer?! >>>> >>>> >>>> Cheers, >>>> frank >>>> >>>> >>>> _______________________________________________ >>>> Nuke-python mailing list >>>> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ >>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>> >>> >>> _______________________________________________ >>> Nuke-python mailing list >>> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ >>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>> > > _______________________________________________ > Nuke-python mailing list > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python -- ben dickson 2D TD | ben.dick...@rsp.com.au rising sun pictures | www.rsp.com.au _______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python