Hello!
I want to create multi renderer like image belowe:
I created it by QVTKRenderWindowInteractor and a code belowe:
def __set_multiple_view_port(self) -> None:
"""."""
xmins = [0, .5, 0, .5]
xmaxs = [0.5, 1, 0.5, 1]
ymins = [0, 0, .5, .5]
ymaxs = [0.5, 0.5, 1, 1]
camera = self.ren.GetActiveCamera()
ren_bkg = ['Chocolate', 'Goldenrod', 'Orange', 'Bisque']
for i in range(4):
ren = vtkRenderer()
self.wren.AddRenderer(ren)
ren.SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i])
if i == 0:
camera = ren.GetActiveCamera()
camera.Azimuth(30)
camera.Elevation(30)
else:
ren.SetActiveCamera(camera)
ren.SetBackground(COLORS.GetColor3d(ren_bkg[i]))
ren.ResetCameraClippingRange()
ren.ResetCamera()
self.renderers.append(ren)
Overall its works as intended, but i have a one problem. When I add actors to individual sub renderers I would like to reset the camera or call the self.wren.Render() method. However, when I do this I get a MakeCurrent failed error. What could be the reasons for this?