I was going to add picking support in 3DViewer and run into this issue. For some reason targets of any mouse events in 3DViewer ContentModel subscene is SubScene, not the mesh inside.
I was unable to reproduce it with a simple app in reasonable time so please debug 3DViewer directly.
In order to debug just add the following lines to Jfx3dViewerApp.start() method:
scene.addEventFilter(MouseEvent.MOUSE_CLICKED, new EventHandler<Event>() {
@Override
public void handle(Event t) {
System.out.println("t = " + t);
}
});
and observe that whenever you click anything inside 3D view subscene, you get only SubScene as the target:
t = MouseEvent [source = javafx.scene.Scene@2b5997ae, target = SubScene@45f5f40f, eventType = MOUSE_CLICKED, consumed = false, x = 397.0, y = 303.0, z = 0.0, button = PRIMARY, pickResult = PickResult [node = SubScene@45f5f40f, point = Point3D [x = 397.0, y = 268.0, z = 0.0], distance = 1.0]
3DViewer is available in rt/apps/experiments/3DViewer
You can drag the attached simple maya file onto the 3DViewer to load it and use for testing. However it seems to be reproducible no matter which file is loaded.
I also identified that if camera is changed to new PerspectiveCamera(false) in ContentModel.java:67, although it is hard to position camera properly, picking seems to work ok.