-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support zipped versions of gltf and glb files #656
Conversation
I'm kind of amazed that zipping glb leads to savings! Very interesting. |
Yes, I was surprised too. But actually the 'b' is only for meshes. Otherwise, you get the plain text of the gltf. And even the meshes are not compressed, just not stored as base64. Otherwise do you get why the checks ar efailing :
This is a bit cryptic to me |
Compiling locally I see:
|
Sounds like my lack of knowledge in javascript/typescript. Do we need a "var" keyword in front of that line ? I would guess so. |
Hang on - I think I have fixes for this, and the other issues (though tests are still failing) |
Honestly, I'm not sure where the const name came from, so I made a new name. As you can see from my commits, there were several other issues though, some of which I cannot understand why you wouldn't see, since many are just pure errors. For example this:
cannot be something depending on the local setup (and I could only comment out that line to get around it). Are you sure you don't see this in your log somewhere? BTW please look at my fixes - I'm really not sure if they are correct, just that they got rid of the compilation failures. |
Ah pants - I must have messed up the conflict resolution. :-( |
@sponce I think I will need to rebase to fix this. Is that okay? You will need to force pull afterwards if so. |
No problem. Go on. |
887e9b3
to
f7fc41f
Compare
Okay, compilation problems should be "fixed" (as I said, I'm not sure I handled these correctly, but hopefully my changes at least help). Now I'm trying to understand:
|
Oh man - I'm so confused by this error! I can see that |
Okay, I think I understood it (finally!) At least I understand BTW @sponce, you might want to check that it still works correctly after this change? I think it should, but just in case... And I looked at the documentation you added - nice! We have a similar (but less detailed) version in Phoenix: https://github.com/HSF/phoenix/blob/main/guides/developers/geometry-tips.md#converting-gltf-to-glb. |
@sponce if you confirm that the functionality still works, I will merge this. Edit: just to say, I looked at the LHCb demo of course and it all looks fine. I tried with the ATLAS barrel and this also worked, and went from 12Mb to 1.3Mb (!!!) |
packages/phoenix-event-display/src/managers/three-manager/import-manager.ts
Show resolved
Hide resolved
@EdwardMoyse thanks a lot for the debugging ! I've looked at the diffs and they look fine. Except I do not really understand why they are needed (especially last one). Anyway, if it works I'm happy. But... locally it fails with :
So I suspect it one more iteration of not having the same version of underlying libraries or something of the like. I've tried to update using Bottom line : just merge, I'll recreate an environment from scratch as I already needed to do very regularly for phoenix. Somehow yarn is not very good at keeping things consistent in the long term. |
The problem was this (in afterEach(() => {
expect(component.handleFileInput).toHaveBeenCalled();
}); If you don't call
I regularly have to do |
I've now managed to restart my local server. It took quite some iterations on installing various dev libraries I obviously did not need so far (starting with libpixman-dev), then I dropped node_modules and rebuilt everything. However, I still have the same error |
Yikes. Okay, I see this now. Will revert in a new MR. |
The problem is that in case we load via the icon, we do not have a File object. So we pass the content of the file as a string. And this is handled downstream. I will have to leave this for now, but I can try to figure it out later today. Maybe we do not have to revert then, we only fix |
Revert error introduced in #656.
Okay, well for the moment I will revert (as I don't want Phoenix broken l in the meantime). |
After I've discovered how compression was giving a factor 8-10 on glb files, I've implemented direct usage of zip files in phoenix.
And applied it to LHCb description, which went from 7MB to 0.3MB ! I admit I've also cleaned up the geometry, but this was only a factor 2.
For info, I've put some documentation concerning optimization of gltf/glb files in the readme of the root_cern-To_gltf-Exporter : https://github.com/HSF/root_cern-To_gltf-Exporter, at the bottom. May be of interest