Skip to content

Making objects "unpickable" when render mode is ordered1 #702

@hmaarrfk

Description

@hmaarrfk

In our context, we might need to make certain "unpickable" so they don't "get in the way".

I noticed that this was maybe a concept:

# pickable, so they won't be "in the way".

However, when you set the render mode to ordered1 it seems that this concept isn't respected.

To exaggerate this effect I am running the image_click_event.py demo with the following patch:

diff --git a/examples/feature_demo/image_click_events.py b/examples/feature_demo/image_click_events.py
index b8d691a..031edaa 100644
--- a/examples/feature_demo/image_click_events.py
+++ b/examples/feature_demo/image_click_events.py
@@ -14,7 +14,8 @@ import pygfx as gfx
 import numpy as np
 
 canvas = WgpuCanvas()
-renderer = gfx.renderers.WgpuRenderer(canvas)
+renderer = gfx.renderers.WgpuRenderer(canvas, blend_mode="ordered1")
+# renderer = gfx.renderers.WgpuRenderer(canvas)
 scene = gfx.Scene()
 
 # add image
@@ -44,6 +45,18 @@ points = gfx.Points(
 points.local.z = 1  # move points in front of the image
 scene.add(points)
 
+lines = gfx.Line(
+    gfx.Geometry(
+        positions=[(x, y, 0) for x, y in zip(xx, yy)],
+    ),
+    gfx.LineMaterial(
+        color=[0.3, 0.3, 0.3, 0.9],
+        thickness=30
+    ),
+)
+lines.local.z = 0.5
+scene.add(lines)
+
 
 previous_selection = None
 

When the mode is ordered1 I can't click through the image. Any tips?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions