Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Set Ambient Occlusion Parameters

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 401 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          Hello Ashton,

          was your question answered?

          Best wishes,
          Sebastian

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

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

            1 Reply Last reply Reply Quote 0
            • First post
              Last post