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

Not working when used as a library inside an existing Node.js app #29

Closed
triceam opened this issue Sep 21, 2016 · 5 comments
Closed

Not working when used as a library inside an existing Node.js app #29

triceam opened this issue Sep 21, 2016 · 5 comments
Labels

Comments

@triceam
Copy link

triceam commented Sep 21, 2016

I have a project that generates models using OpenDroneMap, and I'm trying to convert those .obj models to be viewable on the web. I can view the .obj models using meshlab without any issues. When I try to use obj2gltf to convert them as part of my workflow inside of a Node.js app, it does nothing. I never get any response from the promise (no success, no error), and no console output. It just hangs. I left it running for about 20 minutes to see if it was just taking a really long time, but finally killed it when nothing happened.

My code looks like this:

var filePrefix = __dirname + "/" + rootDirName + "/" + currentDocument.id + '/odm_texturing/odm_textured_model_geo';
var options = {
    embedImage : false // Don't embed image in the converted glTF
}
var objFile = filePrefix +'.obj';
var gltfFile = filePrefix +'.gltf';
console.log(objFile);
console.log(gltfFile);

convert(objFile, gltfFile, options)
    .then(function() {
        console.log('Converted model');
        callback();
    })
    .catch(function(err){
        console.log("ERROR:" + err.toString());
        callback(err);
    });

My output only shows the file names, nothing else:

/root/analysis-baremetal/temp/6f5ddb39312feefc5e37bad7baf71cdd/odm_texturing/odm_textured_model_geo.obj
/root/analysis-baremetal/temp/6f5ddb39312feefc5e37bad7baf71cdd/odm_texturing/odm_textured_model_geo.gltf

I assume this is just failing silently - there are no other indications of an error, and no stack trace. The .obj file is about 25 MB, which isn't tiny, but again, it also is not huge so I wouldn't expect it to take this long.

@lilleyse
Copy link
Contributor

Can you try it out with a smaller obj? I totally agree that 25MB should be quick, but we have some optimization issues in https://github.com/AnalyticalGraphicsInc/gltf-pipeline which this project uses.

@pjcozzi pjcozzi added the bug label Jan 3, 2017
@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 3, 2017

@triceam any update here?

Can you try it out with a smaller obj? I totally agree that 25MB should be quick, but we have some optimization issues in https://github.com/AnalyticalGraphicsInc/gltf-pipeline which this project uses.

@lilleyse
Copy link
Contributor

lilleyse commented Jan 3, 2017

The speed should be significantly faster once I finish the obj2gltf cleanup and use the preserve flag in gltf-pipeline.

@triceam
Copy link
Author

triceam commented Jan 3, 2017

I have not had an opportunity to try with the latest... I'll have to revist this once I'm done updating the photogrammetry rendering server to the latest.

@lilleyse lilleyse mentioned this issue Mar 14, 2017
1 task
@lilleyse
Copy link
Contributor

Fixed in #49

Speeds should improve since gltf-pipeline optimizations are disabled be default. Also --bypassPipeline is an available option for the fastest conversion, however this will export the gltf with the KHR_materials_common extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants