# Examples from pyvista.BlockAttributes
# =====================================

# Add a sphere and a cube as a multiblock dataset to a plotter and then
# change the visibility and color of the blocks. Note how the index of the
# cube is `1` as the index of the entire multiblock is `0`.
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].color = 'b'
mapper.block_attr[1].opacity = 0.1
mapper.block_attr[1]

pl.show()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

