+ def _filterHiddenObjects(self, scene):
+ """Discard object that are on hidden layers in the scene.
+ """
+
+ Objects = scene.getChildren()
+
+ visible_obj_list = [ obj for obj in Objects if
+ set(obj.layers).intersection(set(scene.getLayers())) ]
+
+ for o in Objects:
+ if o not in visible_obj_list:
+ scene.unlink(o)
+
+ scene.update()
+
+
+
+ def _buildLightSetup(self, scene):
+ # Get the list of lighting sources
+ obj_lst = scene.getChildren()
+ self.lights = [ o for o in obj_lst if o.getType() == 'Lamp' ]
+
+ # When there are no lights we use a default lighting source
+ # that have the same position of the camera
+ if len(self.lights) == 0:
+ l = Lamp.New('Lamp')
+ lobj = Object.New('Lamp')
+ lobj.loc = self.cameraObj.loc
+ lobj.link(l)
+ self.lights.append(lobj)
+
+