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

    How to obtain all vertices of an object in C++.

    Cinema 4D SDK
    s26 c++ sdk
    2
    3
    435
    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.
    • P
      pchg
      last edited by

      Hello colleagues,
      I used C++ to write the C4D S26 plugin on Windows 10,Get all vertices of an object,but There are no GetAllPoints in the document。
      maxon::BaseArray<maxon::Vector >objectPoints = obj->GetAllPoints();

      GetAllPoints included in Python documentation,but not in C++.
      How to obtain all vertices of an object in C++.

      Thanks in advance!

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

        Hi this can be done via PointObject::GetPointR or GetPointW. GetPointW is if you want to modify the position otherwise use GetPointR if you only need to read them.

        So this will give use something like that where obj is a PointObject:

        iferr_scope_handler
        {
        return false;
        };
        
        maxon::BaseArray<maxon::Vector>> pts;
        const Vector* const objPts = obj->GetPointR();
        const Int32 objPtCount = obj->GetPointCount();
         
          for (Int i = 0; i < objPtCount; ++i)
          {
            pts.Append(objPts[i]) iferr_return;
          }
        

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        P 1 Reply Last reply Reply Quote 0
        • P
          pchg @m_adam
          last edited by

          @m_adam Thanks

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