3

So im building a plugin in Nuke (from The Foundry) that will mimic Maya's animation constraint behaviours. I have a parent, a child, and then options for point, orientation, aim, parent constraints. This is all working pretty well, however my biggest issue at the moment is the Aim constraint.

Some background: Working with the Nuke Matrix4 class Its worth noting this matrix is a 4x4 in which the first 3 columns of the first 3 rows apply to rotations/scale, and the last column of the first 3 rows is translation (X,Y,Z)

in Vector3 classes I am getting the source and target position. Target-source = ST Then im setting up a Y plane (one inverted, one not) Then i get the corss product of my ST point and the Y plane, and then another cross product of my ST and inverted Y plane. (for when the parent is behind the child to invert it) I then get the cross product of my ST and the result of my ST.cross(y_plane)

The aim constraint actually works quite well, but i get a lot of Z rotation in my camera (child) when the parent is in certain postions. I want to be able to avoid this Z rotation. Would anyone happen to know how to do so?

mhlester
  • 22,781
  • 10
  • 52
  • 75
Alex
  • 95
  • 1
  • 7

1 Answers1

1

If you're emulating Maya's constraint system, Maya handles Z rotation through the up vector, which adjusts your Z rotation to align with one of five options:

  • scene up aims the top of your camera to +Y
  • object up aims the top of your camera toward a third object
  • object rotation up matches the camera's Z rotation to the XYZ rotation of a third object
  • vector aims the top of your camera at that vector
  • none Doesn't attempt to orient the top of your camera with anything. This must be what you have currently.

Additionally, there's an up vector which defines what is the "top of your camera" just like the aim vector defines where the camera should point.

mhlester
  • 22,781
  • 10
  • 52
  • 75
  • This is great info -do you have any reading material to help me implement it? Im not sure how/where to plug this in. Thanks! – Alex May 28 '15 at 17:24
  • I wish I did. I would imagine it's a bit like having a second constraint which only affects Z rotation, but I don't know for sure. – mhlester May 28 '15 at 17:29
  • Let me know when you finish your plugin. I'd love to have a constraint system in Nuke :) – mhlester May 28 '15 at 17:29
  • Hey - its finished and fantastic thanks to the help! - Unfortunately its built for my company, and I cant share it :( – Alex Jun 29 '15 at 23:50
  • No worries. Congrats on finishing it! Sounds like a great tool – mhlester Jun 30 '15 at 00:02