How to get an array of visible points?



  • 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.



  • 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.



  • 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?



  • 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! ****



  • 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.



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

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


Log in to reply