Set Ambient Occlusion Parameters



  • On 14/04/2016 at 15:29, xxxxxxxx wrote:

    Hi guys!
    I have not post in a while,but i having a small problem on Enabling the Ambient Occlusion from the  Effect in the Render Settings  and Inserting the settings of the Ambient Occlusion  parameters , post below? any ideas? plz help!

    -------------------------------------------------------------------------------------------------------
    Code:
    import c4d
    from c4d import gui
    from c4d import documents

    Python

    def main() :
        doc = documents.GetActiveDocument()
        doc = documents.GetActiveRenderData()

    videoPost = c4d.BaseVideoPost(c4d.VPambientocclusion)

    # set parameters two different 
             
        videoPost[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = True
        videoPost[c4d.VPAMBIENTOCCLUSION_MINLENGTH] = 0.1
        videoPost[c4d.VPAMBIENTOCCLUSION_MAXLENGTH] = 0.1
        videoPost[c4d.VPAMBIENTOCCLUSION_DISPERSION] = 0.1
        videoPost[c4d.VPAMBIENTOCCLUSION_ACCURACY] = 0.1
        videoPost[c4d.VPAMBIENTOCCLUSION_MINSAMPLES] = 1
        videoPost[c4d.VPAMBIENTOCCLUSION_MAXSAMPLES] = 1

    if __name__=='__main__':
        main()

    -------------------------------------------------------------------------------------------------------
    Cheers, 
    Ashton



  • On 15/04/2016 at 00:56, xxxxxxxx wrote:

    Hello,

    to access the active render data you have to use GetActiveRenderData() on the given BaseDocument. This render data contains a list of video post effects.

    You can loop through this list by getting the first video post with GetFirstVideoPost(). Then you can loop the video posts with GetNext(). In such a loop you can check if a video post of a certain type already exists with GetType().

    If a certain video post does not exist, you can create is. Since there is no BaseVideoPost class in Python you cannot use the constructor of such class. But since video posts are based on BaseList2D you can simply use the BaseList2D constructor to create a new video post.

    After you created the video post you can insert it into the given render data using InsertVideoPost().

    To enable or disable video post effects one must edit the bit BIT_VPDISABLED.

    Best wishes,
    Sebastian



  • On 22/04/2016 at 09:13, xxxxxxxx wrote:

    Hello Ashton,

    was your question answered?

    Best wishes,
    Sebastian



  • On 26/04/2016 at 01:40, xxxxxxxx wrote:

    Thank you Sebastian
    It is very useful information !!!!!!!!!!


Log in to reply