AppSDK Python: renderSequence() sorts frames ascending — is start() in a loop a supported workaround?

Hello,

we are using the V-Ray AppSDK (Python, v7) to drive a render queue. One feature we need is priority rendering: the user specifies frames in a custom order, e.g. 5, 4, 1, so that a specific frame renders first.

We noticed that renderSequence([5, 4, 1]) always renders in ascending order (1, 4, 5), regardless of the list order passed. This behavior is not mentioned in the documentation.

We ended up with the following approach, which works correctly:
for fn in [5, 4, 1]:
so = renderer.classes.SettingsOutput.getInstanceOrCreat e()
so.frame_start = fn
so.anim_start = fn
so.anim_end = fn
so.frames = [[fn, fn]]
renderer.frame = fn
renderer.start()
renderer.waitForRenderEnd()
save_image(fn)

Two questions:

  1. Is it by design that renderSequence() sorts frames ascending internally? It would be helpful if this were documented.
  2. Is renderer.start() in a manual loop a supported and stable approach for rendering frames in a custom order — particularly with DR2 active? Are there known caveats regarding GI caching, geometry caching, or VFB state between frames?

Thank you!

Kind regards
algato

Hello algato,

Yes, renderSequence() sorts the frame numbers and removes duplicates. I’m sorry it’s not documented. The reason was that V-Ray Standalone did the same and we wanted to match it. Also, some recalculations (light cache, geometry recompilation) between adjacent frames might be avoided in some cases if they are close enough. We haven’t thought of a use case where one would need a different order with a predefined sequence.

The code you showed should be fine (unless there are some DR2 bugs, of course).
Also, in interactive rendering mode you should be able to change the current frame even while rendering.

Best,
Stan

Hi Stan,

Thanks for confirming — that clears it up. We’ll stick with the per-frame start() loop for our priority-order case (rendering the likely-tricky frame first so the artist sees it early in the sequence).

Good to know the sorting matches Standalone’s behavior and that interactive mode allows changing frames mid-render — we’ll keep that in mind if the use case shifts.

Best,
algato