>From the knob's help:

|  setValue(...)
|      self.setValue(val, chan) -> bool

There's 2 channels/fields in the 'viewPair' knob.

You can set each one individually like so:

n = nuke.createNode("O_NewView2_")
n['viewPair'].setValue(1,0)
n['viewPair'].setValue(2,1)

First argument is the index of the view, second argument is the index of the
knob's channels. (keep in mind that the first view is index 1, and not 0,
though)

-1 is just the knob's return value when no view is set.


On Tue, Mar 29, 2011 at 2:58 PM, Jacob Harris <[email protected]> wrote:

> Aaron,
>
> Does this properly set the views for you? It doesn't work for me. And
> if I do n['viewPair'].value() afterwards, I get -1, which puts me
> right back to square one, aka what the hell does -1 mean?!
>
>
>
> On Tue, Mar 29, 2011 at 1:51 PM, Aaron Weintraub <[email protected]> wrote:
> > Hi Jacob,
> >
> > Use fromScript and enter the views as text:
> >
> > n = nuke.createNode("O_NewView2_2")
> > n['viewPair'].fromScript("right left")
> >
> > -A
> >
> >
> > On 03/28/2011 03:57 PM, Jacob Harris wrote:
> >>
> >> I'm trying to pythonically set the 'viewPair' knob of some Ocula
> >> nodes. It seems to want a non-negative integer, but I can't come up
> >> with any combination of values to predictably set both left and right.
> >> Is this a bug?
> >> _______________________________________________
> >> Nuke-python mailing list
> >> [email protected]
> >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> >
> > _______________________________________________
> > Nuke-python mailing list
> > [email protected]
> > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> >
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to