Yes, the fromScript() method should work too, but then you need to know the
names of your views beforehand (not all stereo scripts will have views named
"left" and "right")
Or, to make it more portable, you would need to check for the view names in
nuke.views(), and then build a string with the views you want, in the order
you want them, to feed into the fromScript() method. It may still be more
readable after that, but it's definitely more lines of code. ;-)
My guess is that this is actually the reason why it wasn't working for Jacob
in the first place. fromScript("right left") will silently fail if your
views are named "lt" and "rt", or "L" and "R", etc.
On Tue, Mar 29, 2011 at 8:24 PM, Aaron Weintraub <[email protected]> wrote:
> Hi Jacob,
>
> Yep, it does work for me. You can definitely do it the indexed way too,
> as Ivan said, though I find this way more readable.
>
> You can just print the whole node itself ("print n") to see the literal
> text of the change.
>
> -A
>
>
> On 29/03/2011 5:58 PM, Jacob Harris 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
>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python