Actor.texture#
Notes#
The mapper dataset must have texture coordinates for the texture to be used.
Examples#
Download Python source code | Download Jupyter notebook
Create an actor and add a texture to it. Note how the
pyvista.PolyData has texture coordinates by default.
>>> import pyvista as pv
>>> from pyvista import examples
>>> plane = pv.Plane()
>>> plane.active_texture_coordinates is not None
True
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(plane)
>>> actor.texture = examples.download_masonry_texture()
>>> actor.texture
Texture (...)
Components: 3
Cube Map: False
Dimensions: 256, 256