Property.metallic#
- property Property.metallic: float[source]#
Return or set metallic.
Default
pyvista.plotting.themes._LightingConfig.metallic.This requires that the
interpolationbe set to'Physically based rendering'.Property has range
[0.0, 1.0]. A value of0.0is a non-metal such as plastic and1.0is a bare metal.
Examples#
Download Python source code | Download Jupyter notebook
Get the default metallic value.
>>> import pyvista as pv
>>> prop = pv.Property()
>>> prop.metallic
0.0
Visualize metallic at 0.0, 0.5, and 1.0 from left to right
with physically based rendering.
>>> from pyvista import examples
>>> mesh = examples.download_bunny_coarse()
>>> pl = pv.Plotter()
>>> for i, metallic in enumerate([0.0, 0.5, 1.0]):
... actor = pl.add_mesh(mesh.translate((0.35 * i, 0, 0)))
... actor.prop.interpolation = 'pbr' # required
... actor.prop.metallic = metallic
>>> pl.set_environment_texture(examples.download_sky_box_cube_map())
>>> pl.camera_position = 'xy'
>>> pl.camera.zoom('tight')
>>> pl.show()