A very old bug indeed, but I never heard of it before: If you use an anim layer on a camera with an aim, it will break it to some extent. You can still use it, but some functionalities may not behave correctly. By the way you can’t update a camera to a camera with aim if this camera already has an anim layer. It’s as simple as that, cameras with aim do not like anim layers.
Create the camera with aim
$camera = `camera`;
cameraMakeNode 2 "";
If you try to get the lookAt node (aim) of the camera:
getCameraNode "lookAt" $camera[0];
// Result: camera1_group //
Now create the anim layer with the camera in it.
$animLayer = `animLayer`;
animLayer -edit -addSelectedObjects $animLayer;
If you haven’t noticed, your camera aim is broken in the viewport as soon as you added it to the anim layer.
And now if you try to get the lookAt node of the camera.
$lookAt = `getCameraNode "lookAt" $camera[0]`
It can’t retrieve the lookAt node.
The problem is that internally Maya rely on the connection on the rotateX of the camera, then the Y if the X has no lookAt node on the X, then the Z… But since they are all connected to the anim layer, the lookAt node can never be retrieved.
You can see it in the file /maya-install/scripts/others/getCameraNode.mel
proc string getLookAtNode( string $camera )
{
string $lookAts[] = `listConnections ($camera+".rotateX")`;
if (size($lookAts) == 0 || `objectType $lookAts[0]` != "lookAt")
$lookAts = `listConnections ($camera+".rotateY")`;
if (size($lookAts) == 0 || `objectType $lookAts[0]` != "lookAt")
$lookAts = `listConnections ($camera+".rotateZ")`;
return (size($lookAts) == 0 || `objectType $lookAts[0]` != "lookAt") ?
"" : $lookAts[0];
}
Try it the other way around. Create a camera in an anim layer, then try to convert your camera to a camera with aim. Execute those lines one by one.
$camera = `camera`;
$animLayer = `animLayer`;
animLayer -e -addSelectedObjects $animLayer;
cameraMakeNode 2 "";
The fourth line results in an error:
// Error: file: /maya-install/scripts/others/cameraMakeNode.mel line 71: 'camera1.rotateX' already has an incoming connection from 'camera1_rotate_animLayer2.outputX'. //
// Error: file: /maya-install/scripts/others/cameraMakeNode.mel line 112: Cannot connect camera camera1 to the lookAt node. Some attributes may be locked. //