Thanks Ivan, that's fantastic. Cheers, Jordan
On Fri, Nov 4, 2011 at 3:48 PM, Ivan Busquets <[email protected]> wrote: > Hi Jordan, > > You can get them from the world_matrix knob of your internal Axis node. It > will carry all concatenated transforms up to that point. > > For translations, you could just point to the right indices in that > Array_knob (3, 7 and 11, I believe). > > If you need to get rotations as well, you'll need to settle for a certain > rotation order, and derive the rotations for that particular order. > > There's a convenient method in the Matrix4 class to get a tuple of rotations > for a ZXY rotation order. > > The sequence would go like this: > > mtx = nuke.math.Matrix4() > k = n['world_matrix'] > > # fill in the matrix object with values from the world_matrix knob > for y in range(k.height()): > for x in range(k.width()): > mtx[x+(y*k.width())] = k.value(x,y) > > # And then your "ZXY" rotations would be > rotations = [math.degrees(x) for x in mtx.rotationsZXY()] > > Hope that helps > > Cheers, > Ivan > > > On Thu, Nov 3, 2011 at 6:58 PM, Jordan Olson <[email protected]> wrote: >> >> Hi everyone, >> I've got a group that takes a camera as an input. >> Internally however, I'd like to be able to use the 3D transform >> coordinates of whatever camera/axis that input is attached to... >> >> closet thing I could think of was to to attach an axis inside of the >> group to that input- so it should be inheriting the 3d transformations >> from the camera. This works great in practice- but how can I now query >> the 3D translation and rotation coordinates of that axis in absolute >> world space? By python or TCL is fine- I just need the coordinates for >> an expression. >> >> Cheers, >> Jordan >> _______________________________________________ >> 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 > > _______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
