Error: 0 connections

Hello, I am trying to create a silhouette which highlights a box. I create a box with the standard lines of code, using vtkCubeSource, …, and vtkActor.

664 silhouette = vtk.vtkPolyDataSilhouette()
665 silhouette.SetCamera(self.renderer.GetActiveCamera())
666 silhouetteMapper = vtk.vtkPolyDataMapper()
667 silhouetteMapper.SetInputConnection(silhouette.GetOutputPort())
668 silhouetteActor = vtk.vtkActor()
669 silhouetteActor.SetMapper(silhouetteMapper)
670 silhouetteActor.GetProperty().SetColor(1, 1, 0)
671 silhouetteActor.GetProperty().SetLineWidth(5)
672 silhouetteActor.VisibilityOff()

I also create a silhouette using:


This will update the silhouette actor so that the silhouette will be in the same position and orientation as the boxActor in 3d space and highlight its edges.

When I run the code, the silhouette appears but it is not been moved to the box’s position and orientation. Also, I get this error:

ERROR: In /work/standalone-x64-build/VTK-source/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, line 709
vtkCompositeDataPipeline (0x4cc41d0): Input port 0 of algorithm vtkPolyDataSilhouette(0x4cefcd0) has 0 connections but is not optional.

What does this error mean and how do I fix it? By the way, I create mutliple boxActors and a silhouette for each.

Thank you. Any help would be much appreciated.

The error means that you did not set input for vtkPolyDataSilhouette filter. You need to call something like silhouette.SetInputConnection(somePolyDataSource.GetOutputPort()).