code: def texture(self, name, scale=1, falsecolors=False, mapTo=1):
          
          import os
  
          if mapTo == 1:
              tmapper = vtk.vtkTextureMapToCylinder()
          elif mapTo == 2:
              tmapper = vtk.vtkTextureMapToSphere()
          elif mapTo == 3:
              tmapper = vtk.vtkTextureMapToPlane()
  
          tmapper.SetInputData(self.polydata(False))
          if mapTo == 1:
              tmapper.PreventSeamOn()
  
          xform = vtk.vtkTransformTextureCoords()
          xform.SetInputConnection(tmapper.GetOutputPort())
          xform.SetScale(scale, scale, scale)
          if mapTo == 1:
              xform.FlipSOn()
          xform.Update()
  
          mapper = vtk.vtkDataSetMapper()
          mapper.SetInputConnection(xform.GetOutputPort())
          mapper.ScalarVisibilityOff()
  
          fn = settings.textures_path + name + ".jpg"
          if os.path.exists(name):
              fn = name
          elif not os.path.exists(fn):
              colors.printc("~sad Texture", name, "not found in", settings.textures_path, c="r")
              colors.printc("~target Available textures:", c="m", end=" ")
              for ff in os.listdir(settings.textures_path):
                  colors.printc(ff.split(".")[0], end=" ", c="m")
              print()
              return
  
          jpgReader = vtk.vtkJPEGReader()
          jpgReader.SetFileName(fn)
          atext = vtk.vtkTexture()
          atext.RepeatOn()
          atext.EdgeClampOff()
          atext.InterpolateOn()
          if falsecolors:
              atext.MapColorScalarsThroughLookupTableOn()
          atext.SetInputConnection(jpgReader.GetOutputPort())
          self.GetProperty().SetColor(1, 1, 1)
          self.SetMapper(mapper)
          self.SetTexture(atext)
          self.Modified()
          return self
docs: Assign a texture to actor from image file or predefined texture name.