Skip to content

Commit

Permalink
fix(picker): handle prop properties which does not define getOpacity
Browse files Browse the repository at this point in the history
depending on the prop type being tested for picking, the property can be different classes. e.g.
vtkVolumeProperty which does not define a getOpacity method.
  • Loading branch information
bourdaisj committed Mar 4, 2024
1 parent be48ee6 commit f9cb176
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/Rendering/Core/Picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,17 @@ function vtkPicker(publicAPI, model) {
// Note that only vtkProp3D's can be picked by vtkPicker.
props.forEach((prop) => {
const mapper = prop.getMapper();

let propIsNotFullyTranslucent = true;

if (prop.getProperty && prop.getProperty().getOpacity) {
propIsNotFullyTranslucent = prop.getProperty().getOpacity() > 0.0;
}

const pickable =
prop.getNestedPickable() &&
prop.getNestedVisibility() &&
prop.getProperty().getOpacity() > 0.0;
propIsNotFullyTranslucent;

if (!pickable) {
// prop cannot be picked
Expand Down

0 comments on commit f9cb176

Please sign in to comment.