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
    1. Maxon Developers Forum
    2. robpayne
    3. Best
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    Best posts made by robpayne

    • Cannot set layer parameter for capsules in 2024.3.1

      In 2024.3.1 python cannot set the layer parameter of a Capsule object. Other object types seem to be unaffected. Console shows the error: “AttributeError: parameter set failed”
      Screenshot 2024-02-23 at 18.21.31.jpeg

      Reproduction:

      • Open Cinema 4D
      • Add new layer in the Layer Manager
      • Add a capsule object to the scene (e.g. Polygon Bevel)
      • Run the script below in the Script Manager to set layer parameter for all objects
      import c4d
      
      def main() -> None:
          
          # Get first layer
          myLayer = doc.GetLayerObjectRoot().GetDown()
          
          # Get objects in scene
          allObjects = doc.GetObjects()
          
          # Set layer attribute for objects in scene
          for i in range(len(allObjects)):
              allObjects[i][c4d.ID_LAYER_LINK] = myLayer
              c4d.EventAdd()
          
      if __name__ == '__main__':
          main()
      

      Result

      • The capsule layer is NOT set
      • Error appears in console in the python tab

      Versions

      • [NOK] 2024.3.1
      • [OK] 2024.2.0

      Tested on:

      • Windows 11 Pro (23H2)
      • OSX Monterey 12.6.3
      posted in Cinema 4D SDK python 2024
      R
      robpayne