Thanks Ivan that was indeed very helpful.  Looks like I was on the right
track, I was just unaware of the attribute for number of views.  That was
the key I was missing :)

Thanks!

- John Vanderbeck
- http://www.johnvanderbeck.com


On Thu, Apr 28, 2011 at 12:27 PM, Ivan Busquets <[email protected]>wrote:

> Hi John,
>
> I sent this to the list some time ago, which may be just what you're
> looking for.
> It's all wrapped in a simple panel, so it's easy to change the views for
> all (or selected) existing Roto and RotoPaint nodes.
>
> http://pastebin.com/ViZa5i9g
>
> Hope it helps.
>
> Cheers,
> Ivan
>
>
> On Wed, Apr 27, 2011 at 7:11 PM, Frank Rueter <[email protected]>wrote:
>
>> the rotopaint api definitely needs a bit more explaining yet.
>>
>> This may get you started though:
>>
>> import nuke.rotopaint as rp
>> node = nuke.toNode( 'Roto1' )
>> curvesKnob = node['curves']
>> root = curvesKnob.rootLayer
>> oldShapes = [shape for shape in root]
>>
>>
>> for shape in oldShapes:
>> newShape = rp.Shape( curvesKnob )
>>  newShape.name = shape.name + '_newView'
>>  attr = newShape.getAttributes()
>> root.append( newShape )
>>
>> for pt in shape:
>>  newPt = pt
>> newShape.append( newPt )
>>
>>
>> I haven't figures out how to set the views yet though
>>
>>
>>
>>
>> On Apr 28, 2011, at 1:28 PM, John Vanderbeck wrote:
>>
>> Hey gang,
>>
>> I've been asked to put together a script that will take existing Roto or
>> RotoPaint nodes that were done before the creation of stereo views, and
>> update them to be in both new views.  I figured this wouldn't be so hard,
>> but nothing i've tried has worked.  The docs on interfacing with these nodes
>> is practically non-existent it seems.
>>
>> I've tried modifyi/gadding attributes for views to the shapes, but nothing
>> i've tried has had any effect and I feel like i'm sort of stabbing in the
>> dark.  Anyone done this, or have an idea how it would work?
>>
>> Going off memory as i'm at home right now, but I tried something like:
>>
>> n = nuke.toNode('Roto1')
>> root = n['curves'].rootLayer
>> for shape in root:
>>     shape.getAttributes().add('view2', 2)
>>
>> I've tried various variations on that as well as using setValue, with no
>> luck.  Any help would be appreciated.
>>
>> - John Vanderbeck
>> - http://www.johnvanderbeck.com
>>  _______________________________________________
>> 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