Masks not Animating in Render workaround

As rendering as animation with masking isnt working atm, see https://developer.blender.org/T59939
but it is working rendering out single frames. (but not as an image sequence or video file) i’m working on a quick and dirty workaround. so far what i have is this:

import bpy
bpy.context.scene.frame_current = 1
bpy.context.scene.render.filepath = "D:\001.jpg "
bpy.ops.render.render(write_still = 1)
bpy.context.scene.frame_current = 2
bpy.context.scene.render.filepath = "D:\002.jpg "
bpy.ops.render.render(write_still = 1)

I set the frame, set the filename and then render.
the current animation has 200 frames, so it would a lot of work to type out all the numbers following this script to get to 200. how can i automate/loop this so it ads +1 to frame and +1 to filename until i reach the end of the animation. thank you :slight_smile:

did some testing, just rendering to file as above yields the same result and rendering the animation normally.
to get the desired result i have to go to frame, hit f12 render, view output of render (which is correct) then save that.