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

    Get Points and Polygons from Primitives

    Cinema 4D SDK
    2023 python c++
    2
    2
    439
    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.
    • CJtheTigerC
      CJtheTiger
      last edited by

      How do I get points and polygons from primitives without making them editable?

      Say I insert a sphere into my scene. How do I get all the mesh data from it? It doesn't provide any of the methods like GetPolygonCount usually used to retrieve this data.

      c4d.utils.Neighbor.Init doesn't like primitives either, just says argument 1 must be c4d.PolygonObject, not c4d.BaseObject.

      My goal is to get all edges and create a spline for each edge.

      Python is preferred but C++ is fine as well. I'm on 2023.2.

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

        Hi @CJtheTiger primitives are generators that generate and holds a PolyonObject in there cache. So most of the time for simple primitive like a cube, to access its generated PolygonObject, you should first retrieve it's cache with the GetCache method.

        If you want a more indepth introduction to this topic please read SDK Example - Geometry Readme. Then if you want to cover more complex cases I suggest you to read geometry_caches Example.
        And if you want to visualize the cache and the scene structure I would highly recommend to take a look at the C++ Example - activeobject dialog.

        Finally regarding the spline creation, you can find all the information needed to create a spline in Python Example - SplineObject, if you have more question on the spline creation please open a new topic.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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