The new version of my book is well under way.
By the way, here's a useful method:
This would make it easy to set all cameras. The current camera is doc.activeCamera() so that's already easy.
By the way, here's a useful method:
Code:
function searchChildren(obj, callback, found){
found || (found = []);
for(var i = 0; i < obj.childCount(); i++){
var child = obj.childAtIndex(i);
if(callback(child)){
found.push(child);
}
searchChildren(child, callback, found);
}
return found;
}
// which lets you write a one-liner like this
var cameras = searchChildren(doc.root(), function(obj){ return obj.type() === CAMERA; });
This would make it easy to set all cameras. The current camera is doc.activeCamera() so that's already easy.