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

    REFLECTION #Resolved

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 757 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 23/09/2017 at 05:50, xxxxxxxx wrote:

      Greetings to all! Tell me how you can manage  c4d.REFLECTION_LAYER_MAIN_VALUE_ROUGHNESSREAL and c4d.REFLECTION_LAYER_MAIN_VALUE_REFLECTION from python? Beforehand grateful.

      I can not understand what's the matter.

      self.mat_floor = self.floor.GetTag(5616)[c4d.TEXTURETAG_MATERIAL]
      

      self.mat_floor[c4d.MATERIAL_USE_REFLECTION] = op[ud.IF_ONOFF]

      ref = self.mat_floor.GetReflectionLayerIndex(0)
              mainid = ref.GetDataID()

      self.mat_floor[mainid + c4d.REFLECTION_LAYER_SAMPLING_DIM] = op[ud.IF_DIM]
              self.mat_floor[mainid + c4d.REFLECTION_LAYER_SAMPLING_DIM_DISTANCE] = op[ud.IF_DIST]
              self.mat_floor[mainid + c4d.REFLECTION_LAYER_SAMPLING_DIM_FALLOFF] = op[ud.IF_FALLOFF]

      This code working. I can't used c4d.REFLECTION_LAYER_MAIN_VALUE_ROUGHNESSREAL and c4d.REFLECTION_LAYER_MAIN_VALUE_REFLECTION. What should I do?

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

        On 23/09/2017 at 08:48, xxxxxxxx wrote:

        https://developers.maxon.net/forum/topic/8647/11313_r16-material-reflectance-limitation&PID=44848#44848

        I guess you have everything in this thread for fixing your issue.

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

          On 23/09/2017 at 08:54, xxxxxxxx wrote:

          My code from your link, but this want work with reflection roughness)))

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

            On 23/09/2017 at 09:16, xxxxxxxx wrote:

            `
            I don't have a working environment until 2 days
            But as the sdk say there is no REFLECTION_LAYER_MAIN_VALUE_ROUGHNESSREAL only REFLECTION_LAYER_MAIN_VALUE_ROUGHNESS

            But I will look at this when I will have a working environment since I'm sure it's not your issue here 🙂

            EDIT:
            I'm back at home.
            Personally I'm able to get the roughness and the reflection using this code

            import c4d
              
            def main() :
               mat = doc.GetFirstMaterial() 
               layer = mat.GetReflectionLayerIndex(0)
                  
               roughness = mat[layer.GetDataID() + c4d.REFLECTION_LAYER_MAIN_VALUE_ROUGHNESS]
               reflection = mat[layer.GetDataID() + c4d.REFLECTION_LAYER_MAIN_VALUE_REFLECTION]
               
               print "roughness: {0}, reflection: {1}".format(roughness, reflection)
              
            if __name__=='__main__':
                main()
            

            `

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

              On 25/09/2017 at 01:35, xxxxxxxx wrote:

              Hello,

              the reflection strength is set with REFLECTION_LAYER_MAIN_VALUE_REFLECTION , the reflection roughness with REFLECTION_LAYER_MAIN_VALUE_ROUGHNESS. You find the full list in the c4d_reflection.h header file or in the C++ online documentation.

              best wishes,
              Sebastian

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

                On 25/09/2017 at 04:29, xxxxxxxx wrote:

                Thank you all for the clarification. In the console showed Mat[c4d.REFLECTION_LAYER_MAIN_VALUE_ROUGHNESSREAL] and it a little confused me.

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