pyvista.BlockAttributes.visible#

property BlockAttributes.visible: bool | None[source]#

Get or set the visibility of a block.

Examples

Hide the first block of a composite dataset.

Note how the zero index is the entire multiblock, so we have to add 1 to our indexing to access the right block.

>>> import pyvista as pv
>>> dataset = pv.MultiBlock(
...     [pv.Cube(), pv.Sphere(center=(0, 0, 1))]
... )
>>> pl = pv.Plotter()
>>> actor, mapper = pl.add_composite(dataset)
>>> mapper.block_attr[1].visible = False
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/6f21e77117849958572d0653ca50e14ed5ce75fd/d914a/_images/pyvista-blockattributes-visible-1_00_00.png