Thank you Salvador for the correction,
I've corrected the script of my last post, so it is without the error now.
AE does not render 3d layers that are outside of the camera's field of view (for example, behind the camera).
However, it WILL render 3d layers that are in the field of view, but being obscured by other layers. Even if they are completely obscured ! And in this case you'd better give them zero opacity (by keyframes or expression), and then run my script, so they will be trimmed.
I'm using your script on a project that's been made by three different people. The problem I have is that the script runs on every layer and I have some layers for wich I want to control the outpoint. Is it difficult to have the script run only on selected layers ?
That's more complicated to work on selected layers, because I split layers when needed and create new layers, thus changing the layer's selection. However, I've changed the script so it will not work on locked layers. So you could lock the layers you don't want the script to work on, and then launch the script.