Time remapping or some other trickery involving temporal effects, possibly also expressions. Perfectly normal and logical. Pre-compose, then trim, if necessary.
It's true. I just tried it. I create two solid layers. I applied a 59% stretch to one of them. When I applied "trim to work area" the layer who have no changes was the one who was trimmed...
But now, what is the logic here? I do not understand it. For what this happens??
Is there a way to avoid this trim without precomposing???
No. It's inherent in how AE operates based on natural time, not discrete frames. As for your result, that would be dependent on how exactly you have stretched and shifted your layer in time. Looks like you have stretched your layers form a point somewhere in the middle and after the trim the layer is simply too short near the end, so AE tries to recover the missing frames from the start.
Thanks, but I still do not understand why the program do this. It should not, because I do not see in what situation this can be useful for the user. If you do, please let me know. The worse, of the example I posted, is that it cuts the layer who has absolutely no changes or effects. Completely needless to cut it.
For all of those who have ever wondered this, I found a way to "solve" the problem less painful than precomposing layers (imagine if you have to precompose solids and nulls, ridiculous). Select the Pan Behind tool (shortcut "y") and with it click the layer in the timeline and drag it to the left until the small lines that you see in the red circle in the first picture I posted, dissapears.
Hope this helps. If someone finds a better way, please let me know.
I have exactly the same bug! The problem is bigger if you have to remember different durations in the layers to re-adjust after the cropping of the composition...