Search code examples
vtk

How to hide a specific actor in python-vtk


There are some actors in same scene, I need to hide an actor of specific index (Not remove it, just hide). Maybe There are some API in python-vtk, but i don't know.


Solution

  • To hide an actor:

    actor.GetProperty().SetOpacity(0)
    

    Here is the vtkProperty API (c++ but Python is quite the same)

    edit

    Or as @mmusy suggest, simply

    actor.VisibilityOff()
    

    actor API.