Is it possible to hide objects from specific camera’s whilst being visible on other camera’s? I’m using viewports.
That’s a bit of an old one and not very flexible.
There is a work around, but it’s pretty difficult and doesn’t have good performance.
The best way would be to add 2 planes in front of the main camera, render from two other cameras and assign the rendered images to the texture of the two planes.
You should use this method:
and you can time the refresh() call until after you’ve hidden the items you don’t want seen.
# make a list of things that are exclusive to one camera, by marking them with a property if "ini" not in own: own['cam_1_visible'] = [ob for ob in own.scene.objects if ob.get("visible_1")] own['cam_2.visible'] = [ob for ob in own.scene.objects if ob.get("visible_2")] own['ini'] = True # render things only visible to camera 1 for ob in own['cam_1_visible']: ob.visible = True cam_1['render'].refresh() # hide them again for ob in own['cam_1_visible']: ob.visible = False # render things only visible to camera 2 for ob in own['cam_2.visible']: ob.visible = True cam_2['render'].refresh() for ob in own['cam_2.visible']: ob.visible = False # hide them again
Though I’m sure you could make a better script with better performance with work.