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
NEXT-00000 - Add gltf file format support #3612
base: trunk
Are you sure you want to change the base?
Conversation
|
daf873c
to
1278994
Compare
I think this option would be the best. Uploading gltf and image files together like in option 3 should not be the approach. Multiple gltf files could point to the same image (which one would then be required to be uploaded twice?), or it could be an external source, which cannot be uploaded by the user at all. The only valid option here is option 2 with only an information reminder. |
1d4654f
to
db1ce63
Compare
Hey @akf-bw! I don't think that your code covers everything. First since the .gltf format is just a "recipe" to assemble different files it might occur that even mesh data or animations are not embedded in array buffers but stored in separated .bin files. So with the current standard we cannot even make sure that the user's mesh data is transported to Shopware properly. We would not only have to make sure that all textures are set correct but also the array buffer data is correct. You can find the .gltf-standard here: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#gltf-basics In addition it is very hard for us to set up connections between files since we don't have such a system yet. For example let's say you have a tree-model with a bark texture. And let's not care for the mesh data for now, let's assume it is embedded in the .gltf-file. What happens if you delete the bark texture in your Media? The model display would not be correct anymore and you would not know why. Since not every person that manages product media or product data has a technical background they might not know what the impact of deleting a strange wooden image from their database might have. So to warn the merchant if something breaks due to their changes we would need a system to link files to each other double-sided (to ensure that the 3D model is displayed correctly and not unnecessary data is stored on the server). As you mentioned correctly, the .gltf-format makes it way easier for human beings to edit the assembled 3D data. But since Shopware is only capable of displaying and not in-depth editing a 3D model there is not technical need to store data in .gltf-format. For now editing has to be done in distinct software outside of Shopware (like Blender). I can also refer you to a package that can handle transform .gltf-files to .glb-files: https://github.com/donmccurdy/glTF-Transform If you have any other thoughts please share! |
Hey @ffrank913,
Shopware is not responsable for the gltf file to be valid. You have to provide a valid gltf file for this all to work.
The same thing here, Shopware is not responsable for your gltf file to be valid. It is not possible in Shopware to link files together and would need an insame about of rework of the current media behavior just to add support for your needs here.
I don't mean to edit the file in the administration, but rather programmatically. For example, we wrote a plugin that reads multiple GLTF media files from the server and merges them inside of PHP to directly provide a merged GLTF JSON to the user to display it in the frontend. |
db1ce63
to
1278994
Compare
You are correct. We are not responsible for taking care of correctness of data. But what we have to take care of is a proper user experience. Typically files are standalone and work for their own. Before .gltf we are just working with such files, including .glb-files. For images basically we have a quick feedback for the merchant to view the image in a sidebar to check if everything is working properly. So in fact we do have such a check, at least not programmatically but done very easy by the merchant. We don't have such a viewer for our 3D models yet. When we have, we will probably include .gltf-files as well since we then have a proper tool to view if everything works fine. I understand your use-case and where you are coming from. But image there are people paying a huge amount of money to have their products visualized in 3D and have no clue of how all this magic works. We need a proper way to help our merchants or at least have to properly error-catch our algorithms and not simply throw errors that are not precise enough to give a quick correct answer. At least this is my opinion on that topic. I will discuss this with our teams and come back later. Feel free to add what you think. |
What about including the Three.js viewer also in the administration in the "preview slot of images"? |
1. Why is this change necessary?
.glb
files not the.gltf
file format, which is just the non binary version of a.glb
file.gltf
file format allows programs/developers to modify the file much more easily since it is just a JSON file, making it more attractive to use compared to a.glb
file in some cases.gltf
file format for upload & usageShopware-TODO:
.svg
icons for the gltf format. Currently theicons-multicolor-file-thumbnail-gltf.svg
file is only a copy of theicons-multicolor-file-thumbnail-glb.svg
file2. What does this change do, exactly?
SpatialObjectTypeDetector
allowed_extensions
&private_allowed_extensions
inshopware.yaml
sw-media-base-item
,sw-media-preview-v2
,sw-media-quickinfo
,sw-product-media-form
,sw-product-detail-base
,file-validation.service
&media.api.service
3. Describe each step to reproduce the issue or behaviour.
.gltf
file4. Please link to the relevant issues (if any).
/
5. Checklist