Commits

Peter Polidoro committed f439c10

Fixed bugs in add_camera method

Comments (0)

Files changed (1)

cad/src/cad/render_object.py

 
         # Replace default if that is the only camera
         camera_count = self.get_camera_count()
-        if camera_count == 1:
+        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()
+        if camera_count == 1:
+            self.set_camera(name)
 
     def remove_camera(self,camera_name):
         name = self.camera.get_obj_parameter('name')