Transition from one background to another as object moves in front of camera I have a mesh object passing in front of a camera; the camera is locked in a fixed upward view.

The background to the scene is a sky full of moving procedural clouds. I believe the node setup is Andrew Price's.  As the scene progresses, the clouds constantly change shape and position, as suggested below:



I am creating a video which must loop... which is a pain against a background of moving clouds.

I would like to use the object passing in front of the camera as a wiper to transition from the current frame's clouds to an earlier frame, creating the loop. Here's a suggestion of the transition need: 



The mesh is traveling from bottom to top. The portion below the mesh object reflects the earlier cloud position. Above the mesh is the current frame's clouds position.

I am open to compositor solutions or render-pass solutions, but have been unable to figure one out that uses the mesh as a key to a transition. Also, the use of Z-depth and mist makes artifacting a problem with foreground images rendered transparent and then composited onto the sky.

All that said, I would welcome recommendations. Although the wiper mesh object does go edge-to-edge, I cannot have it scaled so large as to be large enough to completely fill the frame, which would hide all of the clouds for a frame or two. 

Imagine the mesh as an airplane: The wings -- which are irregularly shaped -- move across the scene, but at most points you can see quite a bit of cloud cover above and below the wing.

Compositor, render pass, Object ID.... I've fiddled with all and would welcome so best practices.

All ideas welcome!

EDIT: And, more generally, I went with this 'wiper' approach because it seemed to offer the most potential. There are seconds of the video during which nothing but clouds are visible -- but doing a fade between one series of clouds and another did not seem very elegant... As the opacity levels changed in the VSE between the 'new' clouds and 'old' clouds, it left a muddle of clouds that did not make for a pretty loop... but I am open to different approaches altogether.
The main thing is that the plane wing does not provide the full mask alpha that you require to do the transition. You need to create a second mask (either with an actual mask object in the compositor, or by rendering a second object on a separate render layer) that you can add to the alpha from the plane wing.

Please note I've made the "wing" object more irregular shaped so that the effect is more obvious.