pyvista-support
pyvista-support copied to clipboard
Question: How to apply multiple textures to a mesh?
Description
I am new to pyvista. Here is my sample code that I currently have to load 3d model and texture,
carmesh: PolyData = pv.read(os.path.abspath(os.path.join(os.path.dirname(__file__), "Porsche_911_GT2.obj")))
#carmesh.translate([0,0,2])
#carmesh.rotate_x(90)
carskin: vtkOpenGLTexture = pv.read_texture(os.path.abspath(os.path.join(os.path.dirname(__file__),"55z27frcahz4-P911GT/skin00/0000.BMP")))
carskin1: vtkOpenGLTexture = pv.read_texture(os.path.abspath(os.path.join(os.path.dirname(__file__),"55z27frcahz4-P911GT/skin00/0000-a.BMP")))
.......
car: vtkOpenGLActor = plotter.add_mesh(carmesh, show_scalar_bar=False, texture=carskin,render=False) # Dont render immediately.
car.SetScale(0.2, 0.2, 0.2)
car.SetPosition(0, -0.50, 0)
car.RotateX(90.0)
Sample output:
Note that, wheel texture is not applied.
Example Data
The 3d model including texture BMP files are from https://free3d.com/3d-model/porsche-911-gt-43465.html
Question:
Since this particular 3d model has multiple texture BMP files , How to apply all of them using PyVista?