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. jrpmedia
    The forum rollback caused push notifications and recent user data to malfunction. The problem will fix itself naturally within the next days. See the topic Broken Push Notifications for a more in detail explanation. You can fix this yourself by forcibly clearing your browser cache (for most browsers: CTRL + F5).
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    jrpmedia

    @jrpmedia

    Imagineer / Mentor

    0
    Reputation
    4
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Email [email protected] Website www.jrpmedia.co.uk Location UK

    jrpmedia Unfollow Follow

    Latest posts made by jrpmedia

    • RE: My goal is to Export all the Child objects in a Cloner as individual STL files.

      Thank you Ilia,
      Let me digest your extremely kind advice and example, learn from it, and come back tom you.
      Kind regards,
      James.

      posted in Cinema 4D SDK
      J
      jrpmedia
    • My goal is to Export all the Child objects in a Cloner as individual STL files.

      My goal is to Export all the Child objects (or the top group) in a Cloner as individual STL files.

      Here is my initial code to simply list the Child items.
      But I get syntax errors for lines 32, 29 and 4 even at this early stage 😞

      import c4d
      
      def list_cloner_children(obj):
          if obj is None or obj.GetType() != c4d.Ocloner:
              print("Please select a Cloner object.")
              return
      
          children = obj.GetChildren()
          if not children:
              print("The selected Cloner has no children.")
          else:
              print("Children of selected Cloner:")
              for child in children:
                  print("  ", child.GetName())
      
      def main():
          # Get the active document
          doc = c4d.documents.GetActiveDocument()
          if doc is None:
              return
      
          # Get the first selected object
          selection = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_SELECTIONORDER)
          if not selection:
              print("No objects selected.")
              return
      
          selected_obj = selection[0]
      
          # List the children of the selected object
          list_cloner_children(selected_obj)
      
      if __name__ == '__main__':
          main()
      
      posted in Cinema 4D SDK
      J
      jrpmedia