PY change GI settings?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 19/10/2010 at 08:19, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   12 
Platform:      
Language(s) :       PYTHON  ;

---------
Hello there,

with:

import c4d
from c4d import gui, documents

def main() :
    doc = documents.GetActiveDocument()
    rd = doc.GetActiveRenderData()
    # get antialiasing
    AA_ = rd[c4d.RDATA_ANTIALIASING]
    # set antialiasing
    rd[c4d.RDATA_ANTIALIASING] = 2 #2 is best AA

I can read and set Render data (AA, resolution, and so on)

But:

print rd[c4d.GI_SETUP_DATA_DIFFUSE_DEPTH]

does not work (as it is a Post effect?)

how can I get and set GI settings, and how can I look up wether GI is active as a post effect.

Thanks a Lot!
Jops

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 19/10/2010 at 11:30, xxxxxxxx wrote:

Hi Jops,

first you have to iterate through the attached video posts and locate the GI video post. Just pass the render data object to this function and you get the GI video post object.

def GetGIPostEffect(rd) :
    """
    Returns the GI post effect from a passed
    RenderData object
    
    :return: Can be None if  no GI VP found.
    """
    post = rd.GetFirstVideoPost()
    while post:
        if post.GetType()==c4d.VPglobalillumination:
            return post
        post = post.GetNext()
    return None
vpgi = GetGIPostEffect(rd)
if vpgi: return
  
vpgi[c4d.GI_SETUP_DATA_DIFFUSE_DEPTH]

To check if its enabled or disabled use:

vpgi.GetBit(c4d.BIT_VPDISABLED) #is True if its disabled

Hope this helps!

Cheers, Sebastian

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 20/10/2010 at 00:30, xxxxxxxx wrote:

Hi Sebastian,

thanks for your quick and detailed reply 🙂

Thanks a lot!!!

Jops