Skip to content

Add custom frame range support for local rendering - #132

Open
moonyuet wants to merge 44 commits into
developfrom
enhancement/YN-0726--Custom-Frame-Range-Support-for-Local-Rendering
Open

Add custom frame range support for local rendering#132
moonyuet wants to merge 44 commits into
developfrom
enhancement/YN-0726--Custom-Frame-Range-Support-for-Local-Rendering

Conversation

@moonyuet

@moonyuet moonyuet commented May 8, 2026

Copy link
Copy Markdown
Member

Changelog Description

This PR is to add custom frame range support for local rendering.
Resolve #131

Additional review information

Required dependencies

Test with the twin PR in:

Testing notes:

  1. Create Render
  2. Tested with local and farm rendering (with/without the custom frame range)
  3. Should be working

@moonyuet moonyuet self-assigned this May 8, 2026
@moonyuet moonyuet added type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels May 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for rendering a custom (non-contiguous) frame range during local rendering by collecting an explicit expected frame list and propagating it into render execution and expected output file collection.

Changes:

  • Collects and stores expectedFrameRange for maxrender instances.
  • Uses expectedFrameRange to drive local rt.render() frame iteration (with cancellation support).
  • Updates RenderProducts to generate expected output filenames from an explicit frame list instead of rendStart/rendEnd.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
client/ayon_max/plugins/publish/extract_render.py Uses expectedFrameRange for local rendering and adds cancellation handling.
client/ayon_max/plugins/publish/collect_render.py Passes expectedFrameRange into RenderProducts so expected files match custom frames.
client/ayon_max/plugins/publish/collect_frame_range.py Computes expectedFrameRange via helper and stores min/max handles from it.
client/ayon_max/api/lib.py Adds get_expected_frames() helper to parse/compute expected frames.
client/ayon_max/api/lib_renderproducts.py Refactors expected-file generation APIs to accept an explicit frame list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/ayon_max/plugins/publish/extract_render.py Outdated
Comment thread client/ayon_max/plugins/publish/extract_render.py Outdated
Comment thread client/ayon_max/plugins/publish/extract_render.py Outdated
Comment thread client/ayon_max/plugins/publish/collect_frame_range.py
Comment thread client/ayon_max/api/lib.py Outdated
Comment thread client/ayon_max/api/lib.py Outdated
Comment thread client/ayon_max/api/lib.py Outdated
Comment thread client/ayon_max/api/lib_renderproducts.py Outdated
@moonyuet
moonyuet requested a review from BigRoy May 8, 2026 13:48
moonyuet and others added 6 commits May 8, 2026 21:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…6--Custom-Frame-Range-Support-for-Local-Rendering

@LiborBatek LiborBatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to submit successfully the custom frames and also my render job got finnished succesfully on DL too, however my DL Publish job failed on ffmpeg...

Screenshot 2026-05-11 151425

Im not super sure about the failure but its definetely due to my custom frame range used

1001,1025-1026,1050

Im enclosing the publishing report json and DL publish job log:

3dsmax-publish-report-260511-15-13.json.txt

DL-PublishJob-Failure_2026-05-11_14-58-35_6a01d27b5063b87f0ba96d32.txt

@LiborBatek

Copy link
Copy Markdown
Member

also when trying the same but render locally, Im getting this error during the publish action:

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2510271030_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\max_0.4.4+dev\ayon_max\plugins\publish\extract_render.py", line 40, in process
    rt.render(
RuntimeError: MAXScript exception raised.
-- Unable to convert: #wasCancelled to type: &-reference

@LiborBatek
LiborBatek self-requested a review June 3, 2026 08:17

@LiborBatek LiborBatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had succesfully published render with custom frames using Local rendering and Farm Rendering ...both were succesfully finnished and integrated on AYON too..

tested with 3dsmax 2026 and Vray

LGTM

Comment on lines +40 to +41
was_cancelled = rt.Name('wasCancelled')
was_cancelled.value = False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unused?

@moonyuet
moonyuet marked this pull request as ready for review June 9, 2026 08:00
@LiborBatek
LiborBatek self-requested a review June 26, 2026 14:13

@LiborBatek LiborBatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested both local rendering and farm rendering with Use custom frames

First, the good thing is it didnt failed neither on submission nor rendering on DL which is awesome...

There are some issues still, tho.

First, Ayon can handle continuous custom frames sequence like 1005-1010 (while global context been e.g. 1001-1050 ) and also correctly renders mp4 and integrates those frames...

But once using non-continuous custom frames range like 1001, 1005, 1025 there 2 issues, first if having set in ayon-deadline settings Frame per task set to 5 it wont handle such render job correctly. See imgs below

Image Image

which might lead to rendering unnecessary frames not corresponding to the custom frames set in the publisher.

And secondly, it fails to create correctly the reviewable mp4 and creating just single frame mp4. I would expect to either having mov composed of all those frames only or putting black for missing frames (this might be actually my missing configuration for Extract Review).

Lastly the integrated frames does not follow the frame number so instead of frames 1001, 1005, 1025 integrates those as 1001 1002 and 1003

This was during the render set to local rendering as the farm job had those incorrect frame ranges containing unneccessary frames as seen above.

@LiborBatek

Copy link
Copy Markdown
Member

Here are some more findings / details when renedered locally (1001, 1005, 1025)

When inspecting working folder:

Screenshot 2026-06-26 164407

And Publish folder:

Screenshot 2026-06-26 164453

Publish json report:

max-localRender-publish-report-260626-16-35.json.txt

@LiborBatek

Copy link
Copy Markdown
Member

@moonyuet speaking of the frame per task I could imagine introduce an override when switching to Use Custom Frames features and introduce it below and defaulting to 1 ...just an idea how to treat such circumstance, but maybe there is a better way when sending the job to the DL via submission params etc.

@moonyuet
moonyuet requested a review from BigRoy July 30, 2026 13:18
@LiborBatek
LiborBatek self-requested a review August 8, 2026 13:33
@LiborBatek
LiborBatek dismissed their stale review August 10, 2026 11:56

will re-test with latest commits and event. give approval again right away

@LiborBatek LiborBatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested rendering via Vray , RShift and Arnold for 3dsmax

My findings so far:

  • Vray works and publishes and integrates well
  • RShift also works
  • Arnold malfunction and fails due to wrong staging folder/ rendered frames location see below
Image

Here is the staging folder with rendered frames while additional and incorrect subfolder with metadata.json file and preload maxscript... (second screen of that subfolder below) btw when moved those rendered frames to that subfolder all works well and renders got integrated via DL publishing.

Image

Im also providing the files for your consideration:

maxrenderMain_metadata.json.txt

pre_load_max_script.ms.txt

So only Arnold based renders fails...the rest works...

@moonyuet
moonyuet requested a review from LiborBatek August 10, 2026 13:56

@LiborBatek LiborBatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldnt successfully submit the render while using Arnold renderer as Im getting some error:

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2606031445_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 76, in process
    super().process(instance)
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\abstract_submit_deadline.py", line 136, in process
    job_id = self.process_submission()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 113, in process_submission
    payload = self._use_published_name(payload_data, project_settings)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 173, in _use_published_name
    plugin_info["PostLoadScript"] = self.tmp_pre_load_max_script(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 411, in tmp_pre_load_max_script
    render_dir.mkdir(parents=True, exist_ok=True)
  File "C:\Program Files\Autodesk\3ds Max 2026\Python\Lib\pathlib.py", line 1116, in mkdir
    os.mkdir(self, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\projects\\Quantum_Demo\\assets\\props\\max_tests\\container_b\\work\\lookdev\renders\\3dsmax\\maxrenderMain\\QD_container_b_workfileLookdev_v003'

Also enclosing the full publish report json:

Max-Arn-publish-report-260811-11-50.json.txt

@moonyuet
moonyuet requested a review from LiborBatek August 12, 2026 09:50
@moonyuet

Copy link
Copy Markdown
Member Author

should be fixed in the updated commit in ynput/ayon-deadline#252.

@LiborBatek LiborBatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot see any custom frames in the publisher UI...for some reason.

Image

@LiborBatek

Copy link
Copy Markdown
Member

So Im again able to pick custom frames in the Publisher UI and when trying to render with Arnold on farm getting this error:

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2606031445_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 76, in process
    super().process(instance)
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\abstract_submit_deadline.py", line 136, in process
    job_id = self.process_submission()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 113, in process_submission
    payload = self._use_published_name(payload_data, project_settings)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 173, in _use_published_name
    plugin_info["PostLoadScript"] = self.tmp_pre_load_max_script(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-deadline\client\ayon_deadline\plugins\publish\max\submit_max_deadline.py", line 411, in tmp_pre_load_max_script
    render_dir.mkdir(parents=True, exist_ok=True)
  File "C:\Program Files\Autodesk\3ds Max 2026\Python\Lib\pathlib.py", line 1116, in mkdir
    os.mkdir(self, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\projects\\Quantum_Demo\\assets\\props\\container\\work\\lookmax\renders\\3dsmax\\maxrenderMain\\QD_container_workfileLookmax_v061'

When trying local render it gives different errors due to oiio transcoding I have even disabled publish plugin for OIIO Transcode in ayon-core to see if that helps/solve the issue but it fails again but on Extract Review and oiio too.. with following error:

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2606031445_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Work\REPO\ayon-core\client\ayon_core\plugins\publish\extract_review.py", line 173, in process
    self.main_process(instance)
  File "C:\Work\REPO\ayon-core\client\ayon_core\plugins\publish\extract_review.py", line 369, in main_process
    do_convert = should_convert_for_ffmpeg(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-core\client\ayon_core\lib\transcoding.py", line 654, in should_convert_for_ffmpeg
    input_info = get_oiio_info_for_input(src_filepath)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-core\client\ayon_core\lib\transcoding.py", line 165, in get_oiio_info_for_input
    output = run_subprocess(args, logger=logger)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\REPO\ayon-core\client\ayon_core\lib\execute.py", line 176, in run_subprocess
    raise RuntimeError(exc_msg)
RuntimeError: Executing arguments was not successful: "(['C:\\Users\\lbate\\AppData\\Local\\Ynput\\AYON\\addons_resources\\ayon_third_party\\oiio_windows_83e412e9\\bin\\oiiotool.exe', '--info', '-v', '-i:infoformat=xml', 'C:/projects/Quantum_Demo/assets/props/container/work/lookmax\renders/3dsmax/maxrenderMain/QD_container_lookmax_v101_Arnold\\maxrenderMain.1001.exr'],)"Error:
oiiotool ERROR: read : File does not exist: "C:/projects/Quantum_Demo/assets/props/container/work/lookmax
enders/3dsmax/maxrenderMain/QD_container_lookmax_v101_Arnold\maxrenderMain.1001.exr"
Full command line was:
> oiiotool.exe --info -v -i:infoformat=xml C:/projects/Quantum_Demo/assets/props/container/work/lookmax\renders/3dsmax/maxrenderMain/QD_container_lookmax_v101_Arnold\\maxrenderMain.1001.exr

@moonyuet

moonyuet commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

This is an annoying issue to deal with in Arnold. I will commit the change to see if it can potentially fix that in terms of local rendering.

@moonyuet
moonyuet requested a review from LiborBatek August 14, 2026 10:57
@moonyuet

Copy link
Copy Markdown
Member Author

e5a4bab fixes the potential path issue
publish-report-260814-19-02.json
publish-report-260814-19-00.json

@LiborBatek

LiborBatek commented Aug 14, 2026

Copy link
Copy Markdown
Member

As I was testing with Vray and local render it fails on Extract Review still with:

[image2 @ 0000024c77d22480] Could find no file with path 'C:\Users\lbate\AppData\Local\Temp\ay_tmp_k0qmmaoi\maxrenderMain.%d.exr' and index in the range 1002-1006
[in#0 @ 0000024c77d220c0] Error opening input: No such file or directory
Error opening input file C:\Users\lbate\AppData\Local\Temp\ay_tmp_k0qmmaoi\maxrenderMain.%d.exr.
Error opening input files: No such file or directory

Also enclosing full publish report:

local-render-Vray-publish-report-260814-18-46.json.txt

@LiborBatek

LiborBatek commented Aug 14, 2026

Copy link
Copy Markdown
Member

Local rendering with RShift and custom frames 1001,1025,1050 works like charm tho...

Enclosing also publish successful report for comparison?

local-Rshift-publish-report-260814-18-58.json.txt

Small but important update:

I also succesfully rendered locally with Arnold renderer. also enclosing publish successful report for inspection if needed...

arnold-local-render-publish-report-260814-19-21.json.txt

So far:

Local rendering with custom frames works for

  • RShift
  • Arnold
  • Vray

@moonyuet

moonyuet commented Aug 15, 2026

Copy link
Copy Markdown
Member Author

Local rendering with RShift and custom frames 1001,1025,1050 works like charm tho...

Enclosing also publish successful report for comparison?

local-Rshift-publish-report-260814-18-58.json.txt

Small but important update:

I also succesfully rendered locally with Arnold renderer. also enclosing publish successful report for inspection if needed...

arnold-local-render-publish-report-260814-19-21.json.txt

So far:

Local rendering with custom frames works for

  • RShift
  • Arnold
  • Vray

Can you provide me your scene to me for testing(as well as the way you set up for ayon+settings://core/publish/ExtractReview/? I cannot replicate your issue in my side(with same OCIO colorspace and frame range)

publish-report-260815-21-10.json

I would try to update the latest vray and see if I can replicate the issue

@LiborBatek

Copy link
Copy Markdown
Member

Hmm, Vray still giving me some error ocio related one...dont know why, also tried different ocio config files but still didnt helped...

Here is the full report:

Vray-custom-fr-publish-report-260817-16-14.json.txt

Some excerpt from the report (in case my attachement dont work for you)

RuntimeError: Executing arguments was not successful: "(['C:\\Users\\lbate\\AppData\\Local\\Ynput\\AYON\\addons_resources\\ayon_third_party\\oiio_windows_83e412e9\\bin\\oiiotool.exe', '--nosoftwareattrib', '--colorconfig', 'C:\\Users\\lbate\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.2.2\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_2.0\\studio-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio', '--frames', '1001,1004,1009', '--framepadding', '4', '--parallel-frames', '-i:ch=R,G,B,A', 'C:/projects/Quantum_Demo/assets/props/container/work/lookmax/renders/3dsmax/maxrenderMain/QD_container_lookmax_v115_Vray\\maxrenderMain.#.exr', '--ch', 'R=R,G=G,B=B,A=A', '--iscolorspace', 'ACEScg', '--ociodisplay:subimages=0', 'ACES', 'sRGB', '-o', 'C:\\Users\\lbate\\AppData\\Local\\Temp\\ay_tmp_lebuekzf\\maxrenderMain.#.png'],)"Error:
oiiotool ERROR: -ociodisplay : DisplayViewTransform error. Display 'ACES' not found.
Full command line was:
> oiiotool.exe --nosoftwareattrib --colorconfig C:/Users/lbate/AppData/Local/Ynput/AYON/addons/ayon_ocio_1.2.2/ayon_ocio/configs/OpenColorIOConfigs/aces_2.0/studio-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio --frames 1001,1004,1009 --framepadding 4 --parallel-frames -i:ch=R,G,B,A C:/projects/Quantum_Demo/assets/props/container/work/lookmax/renders/3dsmax/maxrenderMain/QD_container_lookmax_v115_Vray/maxrenderMain.1009.exr --ch R=R,G=G,B=B,A=A --iscolorspace ACEScg --ociodisplay:subimages=0 ACES sRGB -o C:\\Users\\lbate\\AppData\\Local\\Temp\\ay_tmp_lebuekzf\\maxrenderMain.1009.png
oiiotool ERROR: -ociodisplay : DisplayViewTransform error. Display 'ACES' not found.
Full command line was:
> oiiotool.exe --nosoftwareattrib --colorconfig C:/Users/lbate/AppData/Local/Ynput/AYON/addons/ayon_ocio_1.2.2/ayon_ocio/configs/OpenColorIOConfigs/aces_2.0/studio-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio --frames 1001,1004,1009 --framepadding 4 --parallel-frames -i:ch=R,G,B,A C:/projects/Quantum_Demo/assets/props/container/work/lookmax/renders/3dsmax/maxrenderMain/QD_container_lookmax_v115_Vray/maxrenderMain.1004.exr --ch R=R,G=G,B=B,A=A --iscolorspace ACEScg --ociodisplay:subimages=0 ACES sRGB -o C:\\Users\\lbate\\AppData\\Local\\Temp\\ay_tmp_lebuekzf\\maxrenderMain.1004.png
oiiotool ERROR: -ociodisplay : DisplayViewTransform error. Display 'ACES' not found.
Full command line was:
> oiiotool.exe --nosoftwareattrib --colorconfig C:/Users/lbate/AppData/Local/Ynput/AYON/addons/ayon_ocio_1.2.2/ayon_ocio/configs/OpenColorIOConfigs/aces_2.0/studio-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio --frames 1001,1004,1009 --framepadding 4 --parallel-frames -i:ch=R,G,B,A C:/projects/Quantum_Demo/assets/props/container/work/lookmax/renders/3dsmax/maxrenderMain/QD_container_lookmax_v115_Vray/maxrenderMain.1001.exr --ch R=R,G=G,B=B,A=A --iscolorspace ACEScg --ociodisplay:subimages=0 ACES sRGB -o C:\\Users\\lbate\\AppData\\Local\\Temp\\ay_tmp_lebuekzf\\maxrenderMain.1001.png
oiiotool WARNING : oiiotool produced no output. Did you forget -o?

@LiborBatek LiborBatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last missing bit seems working! I was able to successfully publish custom frames while using Vray in local render and farm render too...

All been correctly integrated to AYON and also with blank frames in the reviewable mp4.

LGTM!

Enclosing successful publish report json for you to look:

max-vray-custom-fr-publish-report-260904-09-49.json.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YN-0726: 3dsmax: Custom Frame Range Support for Local Rendering

6 participants