Skip to content

Ability to export an scene #1

@frivas

Description

@frivas

Hello, it would be good if the library can export an scene, either created or imported from a file, to another format. For example import an fbx file and export it to glb.

The documentation states this can be done as follows:

bool exporterTest() override {
    ::Assimp::Importer importer;
    ::Assimp::Exporter exporter;
    const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/OBJ/spider.obj", aiProcess_ValidateDataStructure);
    exporter.Export(scene, "obj", ASSIMP_TEST_MODELS_DIR "/OBJ/spider_out.obj");
    return true;
}

I have tried it

static bool exporterTest(const aiScene* scene) {
	Assimp::Exporter exporter;
	try {
		if (AI_SUCCESS == exporter.Export(scene, "glb", "spider_out.glb")) {
				std::cout << "Exporting file...";
			};
			return true;
	} catch (const std::exception& e) {
		std::cout << e.what();
		return false;
	}
}

However it is not writing the file to the filesystem.

I call this function from the ImportFileListByMainFile for the sake of testing.

Hopefully this can be done.

Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions