Function to render image one by one with Python code

Is there no function to render image one by one with Python code?

result = RLPy.RGlobal.RenderVideo()

I am using this function to render video with my project settings (AVI, Uncompressed version).

However, recently, I found that there is a difference in image quality between the result rendered as Video with this setting and the result rendered as an image in GUI. (Image rendering is better)

I need a perfect quality image. Therefore,

  1. Please tell me how to render image frame by frame with Python code.

→ Even if it is not the above problem, this function is very necessary. I would like to know this method if possible.

  1. If it is not possible, please tell me how to set it so that I can get the same quality as the GUI image rendering result using result = RLPy.RGlobal.RenderVideo().

Thank you very much.

Have you checked the subdivision level which can vary beetween preview and render ? This may have impact on your issue.
https://manual.reallusion.com/iClone-8/Content/ENU/8.0/03-Introducing-the-User-Interface/Realtime_Smooth_for_Objects.htm

I don’t really understand "render image frame by frame " when you can render sequence image with Iclone with targa format that is one of the best quality.
Hope this helps.

It seems the OP wants to render images sequences using Python code.

Thank you for answer.
I know i can render sequence image with targa format with
But the problem is i don’t know
The only function I know for rendering is <RLPy.RGlobal.RenderVideo()>
Could you help me to render sequence image with python code?

That’s right! Thank you for summary

Thank you for information.
That’s good, but still there’s quality difference between render and

What I do to render sequence image is to select this settings in the render window

1 Like

Slightly off topic, but over the weekend I wrote a video upscaler. It converts an MP4 to image sequence, then runs the images thru an upscaler then renders back to MP4. It’s slow if you choose Ultra Sharp Upscale option, but free. Does a pretty good job. I haven’t tried it with an IClone video yet. I will release it once I get a few more things done.

3 Likes

Thank you for your response!
I understand that pressing the Export button with UI allows rendering as a Sequence.
However, what I’m trying to achieve is to render it using PythonCode .

As a test, I saved the Scene with your settings and ran RLPy.RGlobal.RenderVideo(), but it still renders based on the Video Settings configured in the Scene. (crying)

Could I be missing something?
To clarify, I’m looking for a way to render a Sequence using Python Code, not UI .
I would greatly appreciate any help or advice!

I only have bad news :upside_down_face:

That’s not possible with current Python interface. (Update: I suppose it is after Victor posted custom script)

Not a chance unfortunately either. PNG sequence beats uncompressed AVI video when it comes to render details… minor difference though.

1 Like

I have to retrieve my second statement!

iClone 8 apparently has this ugly bug where it does NOT render AVI uncompressed any longer.

I rarely render to AVI (always output to an image sequence for important renders).

So I just glanced at the size of the 60 frames render to uncompressed AVI produced by iClone 8 and was shocked to see that it was only 400Kb.

I then started a new project in iClone 7 and opened the same project in iClone 8. Rendered both 60 frames to uncompressed AVI.

iClone 7 render was 1.4 Gb in size
iClone 8 render - the same 400 Kb

Maybe 1.4 Gb is over the board, but 400 Kb is certainly not enough for 60 frames to accommodate for quality match with PNG image sequence.

Under 1800% zoom there were visible signs of smudged and compressed frames in iClone 8 AVI render, while iClone 7 AVI render matched almost perfectly the PNG sequence.

So yes, as I said it’s a bug in iClone 8!
I wish someone to confirm it too and it’s not just an issue with my iClone 8 install.

I guess you can see the difference:

1 Like

This should render each frame using the current image render settings. You’ll need to update the BASE_FOLDER, BASE_FILE_NAME and EXT as desired.

Whether it will render to the quality you are looking for, I have no idea.

from RLPy import *
import os

rl_plugin_info = { "ap": "iClone", "ap_version": "8.0" }

BASE_FOLDER = "F:\\test"
BASE_FILE_NAME = "image"
EXT=".png"

def run_script():
    fps: RFps = RGlobal.GetFps()
    start_time: RTime = RGlobal.GetStartTime()
    end_time: RTime = RGlobal.GetEndTime()
    RGlobal.SetTime(start_time)
    current_time: RTime = start_time
    current_frame = fps.GetFrameIndex(current_time)
    file_path = os.path.join(BASE_FOLDER, BASE_FILE_NAME)
    RGlobal.RenderImage(f"{file_path}_{current_frame:05d}{EXT}")

    while current_time.ToInt() < end_time.ToInt():
        next_time = fps.GetNextFrameTime(current_time)
        next_frame = fps.GetFrameIndex(next_time)
        RGlobal.SetTime(next_time)
        current_time = next_time
        current_frame = next_frame
        RGlobal.RenderImage(f"{file_path}_{current_frame:05d}{EXT}")

edit: 05d it is.

4 Likes

@Victor.Soupday

Worked out perfectly as it inherits current render quality and size from UI!
Just maybe 05d to fully comply with iClone sequence naming format.

Perfect!!!
I regret not asking this here sooner.
Thank you so much.