Commits

Peter Polidoro committed 0156e89

Fixed another bug in add_camera method

Comments (0)

Files changed (1)

cad/src/cad/render_object.py

         self.camera_dict = {}
         self.light_list = []
         self.add_camera(name='default')
-        self.set_camera()
 
     def get_light_list(self):
         return copy.deepcopy(self.light_list)
 
         # Replace default if that is the only camera
         camera_count = self.get_camera_count()
-        camera_name = self.get_camera_name()
-        if (camera_count == 1) and (camera_name == 'default'):
-            self.clear_cameras()
+        if 0 < camera_count:
+            camera_name = self.get_camera_name()
+            if (camera_count == 1) and (camera_name == 'default'):
+                self.clear_cameras()
 
         self.camera_dict[name] = Camera(name,projection,angle,position,look_at,image_size,image_dir)
         camera_count = self.get_camera_count()