Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export MaterialsImporter and PipelinePbrMaterial from pipeline_types #1082

Merged
merged 1 commit into from Oct 13, 2023

Conversation

kevzettler
Copy link
Contributor

@kevzettler kevzettler commented Oct 12, 2023

I needed to expose these values to use them in a custom build.rs example:

use ambient_pipeline_types::{
    MaterialsImporter, MaterialsPipeline, ModelImporter, ModelsPipeline, Pipeline,
    PipelinePbrMaterial, PipelineProcessor, PipelinesFile,
};

fn main() {
    PipelinesFile {
        pipelines: vec![
            Pipeline {
                processor: PipelineProcessor::Models(ModelsPipeline {
                    importer: ModelImporter::Regular,
                    ..Default::default()
                }),
                sources: vec!["ships/*.glb".to_string()],
                tags: vec![],
                categories: vec![],
            },
            Pipeline {
                processor: PipelineProcessor::Models(ModelsPipeline {
                    importer: ModelImporter::Regular,
                    ..Default::default()
                }),
                sources: vec!["maps/*.glb".to_string()],
                tags: vec![],
                categories: vec![],
            },
            Pipeline {
                processor: PipelineProcessor::Materials(MaterialsPipeline {
                    importer: Box::new(MaterialsImporter::Single(PipelinePbrMaterial {
                        name: Some("wreticle".to_string()),
                        base_color: Some("hud/wreticle.png".to_string()),
                        ..Default::default()
                    })),
                    output_decals: false,
                }),
                sources: vec!["hud/wreticle.png".to_string()],
                tags: vec![],
                categories: vec![],
            },
        ],
    }
    .save_to_file("assets/pipeline.toml")
    .unwrap();
}

@FredrikNoren FredrikNoren merged commit ed9f31b into AmbientRun:main Oct 13, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants