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

Output correct glTF type based on extension #117

Merged
merged 2 commits into from
Jun 30, 2016

Conversation

JoshuaStorm
Copy link

See #116

Also added a DeveloperError to be thrown if output path given has neither .glb or .gltf file extensions.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 93.712% when pulling 24f1e79 on output-flag-extension into 0edf83e on master.

@lasalvavida
Copy link
Contributor

@JoshuaStorm Can you add a test making sure the exception gets thrown?

@JoshuaStorm
Copy link
Author

@lasalvavida I am actually unsure how we would go about testing gltf-pipeline since it is just the command line interface. We don't actually have a spec associated with gltf-pipeline yet.

@lasalvavida
Copy link
Contributor

@JoshuaStorm You should move this check into lib/gltfPipeline.js processFileToDisk and processJsonToDisk. Add the test to specs/lib/gltfPipelineSpec.js.

@@ -96,11 +97,12 @@ function processFile(inputPath, options, callback) {
}

function writeFile(gltf, outputPath, options, callback) {
var fileExtension = path.extname(outputPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how all of this is wired together, but can't we just make sure that binary is set to true before this is called; otherwise, this is forcing some of the command-line logic deeper in the engine.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 29, 2016

We don't actually have a spec associated with gltf-pipeline yet.

I think this is fine for now.

@lasalvavida
Copy link
Contributor

@pjcozzi I think this check and exception should be thrown in lib/gltfPipeline.js so that this also happens when gltf-pipeline is used as a node module, not just from command line.

@JoshuaStorm
Copy link
Author

@lasalvavida That makes sense, I imagine we should do the same for the other two exceptions in gltf-pipeline as well?

@lasalvavida
Copy link
Contributor

@JoshuaStorm That sounds good to me. Maybe add a validateOptions function and wrap all of that logic up in there.

@JoshuaStorm
Copy link
Author

@lasalvavida On second thought, wouldn't it make most sense to check for these exceptions within the readGltf and writeGltf functions? We already do check most of them in these functions anyway.

@lasalvavida
Copy link
Contributor

@lasalvavida On second thought, wouldn't it make most sense to check for these exceptions within the readGltf and writeGltf functions? We already do check most of them in these functions anyway.

That could work too; I'm fine with either.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 93.805% when pulling eacb0de on output-flag-extension into 0edf83e on master.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 29, 2016

@lasalvavida please merge when you guys are happy.

@lasalvavida
Copy link
Contributor

Tested; this resolves #116 correctly. Good job @JoshuaStorm!

@lasalvavida lasalvavida reopened this Jun 30, 2016
@lasalvavida lasalvavida merged commit 1482418 into master Jun 30, 2016
@lasalvavida lasalvavida deleted the output-flag-extension branch June 30, 2016 16:06
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

4 participants