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

    Switching off scene ambient occlusion

    Scheduled Pinned Locked Moved PYTHON Development
    16 Posts 0 Posters 1.3k 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

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

      On 16/11/2011 at 07:33, xxxxxxxx wrote:

      Originally posted by xxxxxxxx

      All these enums should be documented to avoid searching in files.

      Welcome to my world.😉
      It's refreshing to hear someone in a moderator role say the same thing.

      -ScottA

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

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

        On 08/03/2012 at 07:40, xxxxxxxx wrote:

        Hi there,

        I also try to disable AO. So I read the topic and messed around for some hours to get it work. but the following script That I copied from this thread is not working under 13.051.
        If it is a simple mistake ... sorry for that I am a newbee. But I have no Idea what to do next:(

        Thanks, Jops

        import c4d

        def main() :
            # Get render data
            rdata = doc.GetActiveRenderData()
            if rdata == None: return
            
            # Get first Video Post effect
            post = rdata.GetFirstVideoPost()
            if post == None: return
            
            # Loop through Video Post effects
            while post:
                if post.GetType() == c4d.VPambientocclusion:
                    print "DETECTED"
                    post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = True
                    #post.SetBit(c4d.BIT_ACTIVE)   # also not working
                    c4d.EventAdd()
                    post = None                                         
                else:
                    print "else"
                    post = post.GetNext()
            
            c4d.EventAdd()

        if __name__=='__main__':
            main()

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

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

          On 08/03/2012 at 08:39, xxxxxxxx wrote:

          Hello Jops,

                     post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = True
          

          This line will turn this checkmark on!

          If you want to disable it, change the value to False.

                     post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = False
          

          Cheers,
          Niklas

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

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

            On 08/03/2012 at 09:04, xxxxxxxx wrote:

            Hello Niklas,

            ahh wenn wron bool then 😞

            I would love to be able to read-out and activate this bool here:

            any chances?

            thanks a lot
            Jops

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

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

              On 08/03/2012 at 11:45, xxxxxxxx wrote:

              Hi Jops,

              I digged a bit through the SDK and found out that you can use post.SetBit(c4d.BIT_VPDISABLED) and post.DelBit(c4d.BIT_VPDISABLED) to either disable or enable the video-post. Note that, as the constant is called VP_DISABLED, setting the bit will disable the video-post, deleting the bit will enable it. Confusing, if you ask me 😉

              Also note, that your call to c4d.EventAdd() before post = None is redundant, as you call it at the and of main() anyway..

              # Disables the Ambient Occlusion Video-post from the Render Manager  
                
              import c4d  
                
              def main() :  
                rdata = doc.GetActiveRenderData()  
                if not rdata:  
                    return  
                
                pdata = rdata.GetFirstVideoPost()  
                if not pdata:  
                    return  
                
                while pdata:  
                    if pdata.CheckType(c4d.VPambientocclusion) :  
                        pdata.DelBit(c4d.BIT_VPDISABLED)  
                        pdata = None  
                    else:  
                        pdata = pdata.GetNext()  
                
                c4d.EventAdd()  
                
              main()
              

              Cheers,
              -Niklas

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

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

                On 09/03/2012 at 01:39, xxxxxxxx wrote:

                Hi Niklas,

                Thanks a lot for you great advice. I will imideately test it out.

                did you find it in the Python SDK (that would mean that I did not look hard enough :()

                best wishes
                Jops

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

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

                  On 09/03/2012 at 03:21, xxxxxxxx wrote:

                  Hi Jops,

                  I knew about the use of BaseList2D.SetBit() and ~.GetBit() before. After searching some minutes they appeared in my mind. Looking at their documentation made me spot the VP_DISABLED constant, and it all made sense. 😉

                  I think, understanding the documentation and knowing what to search for requires a lot of experience, you don't have to shame.

                  Cheers,
                  -Niklas

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

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

                    On 09/03/2012 at 03:39, xxxxxxxx wrote:

                    Thank you...

                    I try hard and for quite a while to get into it, but it takes a lot of time especially if you have no friend or college who already knows his stuff 🙂

                    CU
                    Jops

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

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

                      On 09/03/2012 at 06:11, xxxxxxxx wrote:

                      Just to let you know, if you're in a hurry getting into the Py4D SDK: I'm currently giving private education especially belonging to the Py4D SDK to someone from Utah, America.

                      Cheers,
                      -Niklas

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

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

                        On 09/03/2012 at 06:27, xxxxxxxx wrote:

                        niklas du hast eine PM.

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