Closed PyMarc2 closed 2 years ago
Line 49 in the red ball example is
point_id = picker.point_id/glyph_points.shape[0]
but should be
point_id = int(picker.point_id/glyph_points.shape[0])
To guarantee an int value, which is later used for indexing a numpy array. Changing this line fixes the issue.
It works! Thanks, you should do a pull request for this fix! :)
I just noticed the example provided with mayavi works, it includes this fix: https://github.com/enthought/mayavi/blob/a0b9f1ccebdbea6387329655ac0d099d029226d3/examples/mayavi/data_interaction/select_red_balls.py#L70 So instead of converting it to an int, it is done by floor division.
It seems that the example code on the website just wasn't updated.
I guess we will close this issue then! Thanks for your input @drocheam
Mac OS 11.5.2 intel Python 3.8.4 mayavi 4.7.4 pyqt5 5.15.6
Red Balls example Pick On Surface example When clicking on the red balls, nothing happens. Window, MacOs, mouse or trackpad. I can move the view, but nothing else.