Hi Mathias, 

I'm not sure about the matrix-transforms issue...
But
you can get selected items in roto/rotopaint nodes like this:


#####
import nuke.rotopaint as rp 
ck =
nuke.toNode('RotoPaint19')['curves']
for i in ck.getSelected():
 if
isinstance(i, rp.Layer):
 print "layer ", i.name, " selected"
 if
isinstance(i, rp.Stroke):
 print "stroke ", i.name, "
selected"
#####

Am 2014-01-31 14:06, schrieb Mathias Möhl: 

> Hi
everyone, 
> 
> how can I write values in the extra matrix of the
transform of a roto or rotopaint node? 
> 
> I first tried to write it
to the array knob which is showing the value. But this does not work, as
the array knob just shows the values that actually live in the layers of
the curves knob. Changes on the array knob don't seem to be propagated
to the actual curves. 
> 
> Hence, in a second attempt I tried to write
the data as follows: 
> 
> curves = rotoPaintNode['curves'] 
> layer =
curves.rootLayer 
> 
> transform = layer.getTransform() 
> 
> for i in
range(0,4): 
> for j in range(0,4): 
> ac =
transform.getExtraMatrixAnimCurve(i, j) 
> ac.removeAllKeys() 
> for
(time,value) in animations[4*i+j]: 
> ac.addKey(time,value) 
>
transform.setExtraMatrixAnimCurve(i, j, ac) 
> 
> ## here
transform.getExtraMatrixAnimCurve(0,0).getNumberOfKeys() has all the
keys I've set 
> layer.setTransform(transform) 
> ## here
layer.getTransform().getExtraMatrixAnimCurve(0,0).getNumberOfKeys() has
0 keys... 
> 
> As you can see from the comments, I can generate the
AnimCTransform object for the curve, but when I try to apply it with
setTransform, nothing seems to happen (no error message - the data I
wrote is simply not there). 
> 
> Any idea what goes wrong? 
> 
> Extra
question: 
> For my application, the user also needs to choose to which
layer(s) the matrix data is written. Is there any way to check which
layers are selected? 
> 
> Thanks a lot for the help! 
> Mathias 
> 
>
-------------------------
> 
> mamoworld.com [3]
> simplify your cgi 
>

> Dr. Mathias Möhl
> Marlow 52 , 18551 Sagard, Germany
> Phone +49
(0)38302 - 88 75 61
> i...@mamoworld.com 
> 
>
_______________________________________________
> Nuke-python mailing
list
> Nuke-python@support.thefoundry.co.uk,
http://forums.thefoundry.co.uk/ [1]
>
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
[2]

 

Links:
------
[1] http://forums.thefoundry.co.uk/
[2]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
[3]
http://mamoworld.com
_______________________________________________
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

Reply via email to