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

    How to get an array of visible points?

    SDK Help
    0
    6
    591
    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
      Helper
      last edited by

      On 23/01/2017 at 05:53, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R18 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello

      Is there a way to retrieve an array of only visible points of selected object in scene view?
      Just like e.g. standard selection tool is able to select only visible polys/points, I am looking for a way to do the same thing from code but for the entire object.

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

        On 24/01/2017 at 08:44, xxxxxxxx wrote:

        Hi and Welcome to the Plugin Cafe forums!

        The class ViewportSelect gives the information needed to obtain an object's visible points.
        Call ViewportSelect::Init() with  op set to the selected object and onlyvisible set to true.
        Then use ViewportSelect::GetPixelInfoPoint() with each pixel coordinate of the view and check if the object for the pixel (ViewportPixel::op) is the active object. If true retrieve the point index (ViewportPixel::i) and process the next pixel.

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

          On 24/01/2017 at 08:46, xxxxxxxx wrote:

          If point is smaller than a pixel the point is not selected (that also happend with c4d selection tool) is there a workaround?

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

            On 24/01/2017 at 12:25, xxxxxxxx wrote:

            Thank you Yannick, I was hoping there is a nice class that offers a method to achieve this. It's exactly what I needed to make things work! ****

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

              On 25/01/2017 at 01:31, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              If point is smaller than a pixel the point is not selected (that also happend with c4d selection tool) is there a workaround?

              This is a limitation of ViewportSelect class.

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

                On 25/01/2017 at 05:30, xxxxxxxx wrote:

                Thanks for the answer. It's very sad. I hope it will be "fixed".

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