Hi Sagroth,

If I'm not mistaken, you'd need to get the AnimCurve object of the
attribute you're interested in, and edit that instead. Ex:

curvesKnob = nuke.toNode( 'Roto1' )['curves']

for shp in curvesKnob.rootLayer:

  attrs = shp.getAttributes()

  cv = attrs.getCurve('opc')

  cv.useExpression = True

  cv.expressionString = "frame/100"


 nuke.toNode( 'Roto1' )['curves'].changed()




On Mon, Aug 27, 2012 at 2:35 PM, Sagroth <[email protected]
> wrote:

> **
> Can't figure out how to setup an expression for one of the attributes of
> the roto/rotoshape shape, opacity for example.
>
> import nuke
> shps = nuke.toNode( 'Roto1' )['curves'].rootLayer
> for shp in shps:
> attrs = shp.getAttributes()
> shp.set( 'opc', 0.5 )
>
> Works like that, but how to set an expression instead of value? No
> setExpression method for AnimAttributes.
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to