DisplayPipeline.isVisible() in Python?

Hi,
I am trying to do a simple visibility check in Python with the following code:

import Rhino
import rhinoscriptsyntax as rs

a = rs.GetObject()
print Rhino.Display.DisplayPipeline.IsVisible(a)

The result is following error message:
Message: IsVisible() takes exactly 2 arguments (1 given)

As I understand it the method takes the arguments self, object.
Do I need to point the method to the right pipeline?
How would that be done?

Thanks!
Henning

Hi Henning,

Why not use either of these:

import Rhino
import rhinoscriptsyntax as rs

a = rs.GetObject()
print rs.IsVisibleInView(a,rs.CurrentView)
print rs.IsObjectHidden(a)

-Willem

Hey Willem,
I want to check if the view on an object is obscured by other objects in my view.
I think what these methods do is just test if the object is hidden via layer properties or the hide command.

Thanks anyway!

It seems to me the method .isVisible is not testing for obscuring of the object by other objects. It’s a mere test if the object is inside the view frustrum, but I could be wrong:
http://developer.rhino3d.com/api/RhinoCommon/html/Overload_Rhino_Display_DisplayPipeline_IsVisible.htm

-Willem

@DavidRutten may I ask you directly? How do I adress the DisplayPipeline? And is it the right way to what I am trying?

The DisplayPipeline.IsVisible function only reports if an object will attempt to be displayed in a given viewport. It does not account for obscuring of other objects. This function is also only available in the context of callbacks (when inside a draw event).

The IsVisibleInView function that Willem mentions is the function to use, but it also does not account for obscuring.

@stevebaer Thanks for clarifying this. Unfortunatly this doesn’t solve my problem. Do I have access to these callbacks? I know I can prevent Objects from beeing obscured so I guessed asking if they were couldn’t be THAT difficult =D

The display pipeline functions are available when you are working with display conduits and display events. This is specifically for customizing what is shown on the screen.