def execute(self, context):
     if self.bake_animation:
         obj = context.active_object
         target = None
         if len(context.selected_objects
                ) == 2 and obj in context.selected_objects:
             target = context.selected_objects[0]
             if target == obj:
                 target = context.selected_objects[1]
         elif len(context.selected_objects
                  ) == 1 and obj not in context.selected_objects:
             target = context.selected_objects[0]
         MMDCamera.newMMDCameraAnimation(obj, target, self.scale)
     else:
         MMDCamera.convertToMMDCamera(context.active_object, self.scale)
     return {'FINISHED'}
 def execute(self, context):
     if self.bake_animation:
         obj = context.active_object
         targets = [x for x in context.selected_objects if x != obj]
         target = targets[0] if len(targets) == 1 else None
         if self.camera_source == 'SCENE':
             obj = None
         camera = MMDCamera.newMMDCameraAnimation(
             obj, target, self.scale, self.min_distance).camera()
         camera.select = True
         context.scene.objects.active = camera
     else:
         MMDCamera.convertToMMDCamera(context.active_object, self.scale)
     return {'FINISHED'}