Skip to content

Commit ee103b2

Browse files
authored
Use __setattr__ to set PolyData.hemi dynamically
1 parent 85e6759 commit ee103b2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mne/viz/_brain/_brain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ def __init__(
442442
)
443443
self._layered_meshes[h] = mesh
444444
# add metadata to the mesh for picking
445-
mesh._polydata._hemi = h
445+
# using __setattr__ is needed to set dynamic properties for PolyData
446+
object.__setattr__(mesh._polydata, '_hemi', h)
446447
else:
447448
actor = self._layered_meshes[h]._actor
448449
self._renderer.plotter.add_actor(actor, render=False)

0 commit comments

Comments
 (0)