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
    • Recent
    • Tags
    • Users
    • Login

    Get Polygons

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 614 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 05/11/2015 at 11:30, xxxxxxxx wrote:

      Is there a way to get Polygons from BaseObjects() ?

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

        On 05/11/2015 at 12:34, xxxxxxxx wrote:

        Only if the BaseObject is a PolygonObject.

        So, you need to check the type of the object (GetType), cast to PolygonObject, and use GetPolygonR (or W) to access the polys.

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

          On 05/11/2015 at 13:21, xxxxxxxx wrote:

          ok - and otherwise there is no way to gain access to the position of a point in a parametric object?

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

            On 05/11/2015 at 14:56, xxxxxxxx wrote:

            For parametric and deformed objects, you should check out the documentation for GetCache(), GetDeformCache(), and perhaps HierarchyHelp. The internal caches can be complete hierarchies that need to be traversed but should ultimately resolve to PolygonObjects.

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

              On 06/11/2015 at 03:50, xxxxxxxx wrote:

              GetCache().GetClone() returns only the non deformed geometry of an parametric object.

              this works for me:

                  surface = gen[c4d.MG_OBJECT_LINK]
                  surface2list = [surface]
                  
                  doc.SetActiveObject(None)
                  settings = c4d.BaseContainer()
                  
                  settings.SetBool(c4d.MDATA_CURRENTSTATETOOBJECT_INHERITANCE, True)
                  polysurface = c4d.utils.SendModelingCommand(c4d.MCOMMAND_CURRENTSTATETOOBJECT, surface2list, bc=settings, doc=doc)
                  
                  polys = polysurface[0].GetAllPolygons()
                  points = polysurface[0].GetAllPoints()
                
              
              
              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 06/11/2015 at 05:11, xxxxxxxx wrote:

                Cairyn was actually right. He didn't only mention GetCache(), but also GetDeformCache(). If you look at the code example given for GetCache(), you see that both are used in conjunction to get the caches for more complex hierarchies.

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