I'm trying to get the two transform matrix's from a stereo camera, using the mycam['transform'].value() call, but I can't see anyway to do this..

The value method doesn't take a view, only an OutputContext object, which seems to have no effect:

cam = nuke.nodes.Camera2()
cam['translate'].splitView()
cam['translate'].setValue((1,1,1), 0, "left")
cam['translate'].setValue((22,22,22), 0, "right")

ctx_left = nuke.OutputContext("left")
print cam['transform'].value(ctx_left)

ctx_right = nuke.OutputContext("right")
print cam['transform'].value(ctx_right)

..at least in 6.2v3 and 6.3v1 that returns the matrix for whatever the current view is. Also tried "ctx = nuke.OutputContext(); ctx.setView(0)" etc, same thing

I also tried:

for view in nuke.views():
    nuke.activeViewer().setView(view)
    print "current view:", nuke.activeViewer().view()
    print cam['transform'].value()

..which prints out the view, but still returns the same matrix

...and:

ct = nuke.nodes.CurveTool()

for view in nuke.views():
    nuke.activeViewer().setView(view)
    nuke.execute(ct, nuke.frame(), nuke.frame())
    print cam['transform'].value()


Any ideas? While I could manually create the matrix, that's a bit tedious, especially given if there are any axis's parented.. Plus, I'd also have to modify the nukescripts.snap3d methods I'm using (which also don't take a view, although they use getValue etc which do)
--
ben dickson
2D TD | [email protected]
rising sun pictures | www.rsp.com.au
_______________________________________________
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