Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Reflection Layer Settings

    Cinema 4D SDK
    python
    4
    4
    604
    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.
    • kosmos3dK
      kosmos3d
      last edited by

      Hi all,
      is there any way to change values of Reflection Layer settings (blend mode and value) in Python?
      2021-02-02_100434.jpg
      It's strange that a parameter so simple was not implemented...
      It's parent is c4d.REFLECTION_LAYER_DATA that seems to be not accessible.
      Thanks lot.

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by mp5gosu

        Reflection Layers aren't simple parameters. They are of type c4d.ReflectionLayer and have their own ID. Since the number of reflection layers can change dynamically, the parameter access also happens dynamically.

        For example:

        import c4d
          
        def main() :
            mat = doc.GetActiveMaterial()
            cntLayer = mat.GetReflectionLayerCount() # get the number of all reflection layers
            
            for i in xrange(0, cntLayer) :  # loop through all layers
                layer = mat.GetReflectionLayerIndex(i) # process current layer
                
                # Sets the Strength for each layer to 50%
                mat[layer.GetDataID() + c4d.REFLECTION_LAYER_TRANS_BRIGHTNESS] = 0.5 # Here, the DataID is the unique, dynamic identifier for the layer. This can be chained with actual parameters.
          
            c4d.EventAdd() # update C4D
          
        if __name__=='__main__':
            main()
        

        There's plenty of questions and answers to reflection layers on this forum. Just need to search for it. 🙂

        1 Reply Last reply Reply Quote 1
        • M
          m_adam
          last edited by

          Hi @kosmos3d please for the future use our Q&A Functionality.

          Regarding your question, I think @mp5gosu provides the correct answers, if you want more information I let you read set / get reflectance layer options.

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by

            Hi @kosmos3d,

            without further questions or feedback, we will consider this thread as solved by Monday and flag it accordingly.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

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