Chaos Corona for Cinema 4D > [C4D] I need help!

Problem with rendering difference between manual and python

(1/2) > >>

raffaele.tortora88:
Goodmorning everyone,
i've the following problem. I have a c4d file which render well with right illumination when i render it from Cinema4D manually. Instead, when i run mi python script all is dark, illumination doesn't work.
I use following code:

    # Crea un nuovo bitmap
    bmp = bitmaps.BaseBitmap()
    if bmp is None:
        return

    # Ottieni le impostazioni di rendering correnti
    rd = doc.GetActiveRenderData()
    # Imposta la risoluzione del bitmap
    bmp.Init(int(rd[c4d.RDATA_XRES]), int(rd[c4d.RDATA_YRES]))

    # Esegui il rendering
    result = c4d.documents.RenderDocument(doc, rd.GetData(), bmp, c4d.RENDERFLAGS_EXTERNAL)
    if result == c4d.RENDERRESULT_OK:
        bmp.Save(output_file, c4d.FILTER_PNG)
        print("Rendering completed successfully.")
    else:
        print("Error during rendering.")

Seems there are some settings (like Global Illumination) which are not used when i run render from script.

Can you give me some support?

Thanks in advance

BigAl3D:
Why are you rendering with a Python script? Just curious.

John_Do:
The gamma correction is missing on the version saved through Python. I think it's handled by C4D Picture Viewer but it's bypassed in this case, so you have to find a way to add it to your bitmap before saving.


raffaele.tortora88:
Hi,
thank you very much for your reply.
My project regard rendering automation. I've developped a python script which elaborate a JSON with some operations (import object in scene, change material, move object...) and at the end make render.

John_Do, i've tried to execute gamma correction on saved image but with not good results. Can you please suggest me which kind of correction have you made on the example picture you have posted?

Thank you very much.

John_Do:

--- Quote from: raffaele.tortora88 on 2024-06-24, 10:57:55 ---John_Do, i've tried to execute gamma correction on saved image but with not good results. Can you please suggest me which kind of correction have you made on the example picture you have posted?

--- End quote ---

It's just an Exposure layer in Photoshop with the gamma value set to 2.2, nothing fancy!

Navigation

[0] Message Index

[#] Next page

Go to full version