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

conversion stuck #13

Open
davzuliani opened this issue Aug 1, 2024 · 2 comments
Open

conversion stuck #13

davzuliani opened this issue Aug 1, 2024 · 2 comments

Comments

@davzuliani
Copy link

Hi,

I'm trying to use this tool to get a working GLTF file to be used with Phoenix.
I was trying to reproduce the LHCb.gltf following the procedure shown, but it seems the process get stuck when deduplicating materials.

sync function convert_geometry(obj3d, name, body) {
    body.innerHTML += "<h2>Exporting to GLTF</h2>"
    await forceDisplay()
    const exporter = new THREE.GLTFExporter;
    let gltf = await new Promise(resolve =>
        exporter.parse(obj3d, resolve, {'binary':false})
    )
    body.innerHTML += "<h2>Finish!</h2>"
    // json output
    body.innerHTML += "<h2>Deduplicating data in GLTF</h2>"    
    await forceDisplay()
    gltf = await deduplicate(gltf, body);
    const fileToSave = new Blob([JSON.stringify(gltf)], {
        type: 'application/json',
        name: name
    });
    saveAs(fileToSave, name);
}

Now, what should be the elapsed time for the whole procedure? Or is it really stuck?

Thank you for your help,
Davide

@davzuliani
Copy link
Author

davzuliani commented Aug 1, 2024

just to add a detail

    // scan them, build table of correspondance
    var kept = []
    var links = {}
    var materials = gltf["materials"];
    body.innerHTML += "initial number of materials : " + materials.length + "</br>"

it doesn't print the "initial number of materials" statement, which makes me thing that it stucks before that

@sponce
Copy link
Collaborator

sponce commented Aug 20, 2024

This is now understood and was due to changes both in GLTF (minor API change) and JSROOT (looks more like a bug in version 7.0). I've pushed fixes but for the ROOT part, it's only hardcoding version 7.6.1, which is the last one working.
Starting with 7.0.0, it seems that materials are not converted anymore when calling build on the object acquired form JSROOT.require('geom'). To be further investigated

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

No branches or pull requests

2 participants