def execute(self, context):
        assert len(self.files) == 1
        ofp = os.path.join(self.directory, self.files[0].name)

        cameras, points = export_selected_cameras_and_vertices_of_meshes(
            self, "")
        for cam in cameras:
            assert cam.get_calibration_mat() is not None

        NVMFileHandler.write_nvm_file(self, ofp, cameras, points)

        return {'FINISHED'}
    def execute(self, context):
        paths = [
            os.path.join(self.directory, name.name)
            for name in self.selected_files
        ]
        if not paths:
            paths.append(self.filepath)

        self.report({'INFO'}, 'paths: ' + str(paths))

        for path in paths:

            # by default search for the images in the nvm directory
            if self.path_to_images == '':
                self.path_to_images = os.path.dirname(path)

            cameras, points = NVMFileHandler.parse_nvm_file(path, self)

            self.report({'INFO'}, 'Number cameras: ' + str(len(cameras)))
            self.report({'INFO'}, 'Number points: ' + str(len(points)))

            self.import_photogrammetry_cameras(cameras)
            self.import_photogrammetry_points(points)

        return {'FINISHED'}
    def execute(self, context):

        path = os.path.join(self.directory, self.filepath)
        self.report({'INFO'}, 'path: ' + str(path))

        self.image_dp = get_default_image_path(path, self.image_dp)
        self.report({'INFO'}, 'image_dp: ' + str(self.image_dp))

        cameras, points = NVMFileHandler.parse_nvm_file(
            path, self.image_dp, self.image_fp_type, self)
        self.report({'INFO'}, 'Number cameras: ' + str(len(cameras)))
        self.report({'INFO'}, 'Number points: ' + str(len(points)))

        reconstruction_collection = add_collection('Reconstruction Collection')
        self.import_photogrammetry_cameras(cameras, reconstruction_collection)
        self.import_photogrammetry_points(points, reconstruction_collection)

        return {'FINISHED'}
Esempio n. 4
0
    def execute(self, context):

        path = os.path.join(self.directory, self.filepath)
        self.report({'INFO'}, 'path: ' + str(path))

        # by default search for the images in the nvm directory
        if self.path_to_images == '':
            self.path_to_images = os.path.dirname(path)
        
        cameras, points = NVMFileHandler.parse_nvm_file(path, self)
        
        self.report({'INFO'}, 'Number cameras: ' + str(len(cameras)))
        self.report({'INFO'}, 'Number points: ' + str(len(points)))
        
        reconstruction_collection = add_collection('Reconstruction Collection')
        self.import_photogrammetry_cameras(cameras, reconstruction_collection)
        self.import_photogrammetry_points(points, reconstruction_collection)

        return {'FINISHED'}
Esempio n. 5
0
 def enhance_camera_with_images(self, cameras):
     # Overwrites CameraImportProperties.enhance_camera_with_images()
     cameras, success = NVMFileHandler.parse_camera_image_files(
     cameras, self.path_to_images, self.default_width, self.default_height, self)
     return cameras, success
 def enhance_camera_with_images(self, cameras):
     cameras, success = NVMFileHandler.parse_camera_image_files(
         cameras, self.path_to_images, self.default_width,
         self.default_height, self)
     return cameras, success