Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
In a theme extension app I have a single script that utilizes the node modules three.js and mediapipe/tasks-vision. The script interacts with the user's webcam to analyze where their body is within the camera frame. This is fine and works in an embedded window of the theme in the online store preview. The goal of this app is to display the clothing item onto the customer's body. This works outside of Shopify using FBXLoader and an FBX file. I need a way of storing the FBX file in either the Shopify store or the extension app that I'm building. However the only resources I can find are saying you have to use a GLB file. Shopify isn't using or interacting with the fbx file only the javascript from within the extension app so is there any way I can store the fbx file and reference it from the theme extension app? Here is how I'm currently loading the fbx file from the javascript in my assets folder:
function loadModel(){ const loader = new FBXLoader(); loader.load('/Hoodie3.fbx', (object) => { model3D = object; const boundingBox = new THREE.Box3().setFromObject(model3D); const size = new THREE.Vector3(); boundingBox.getSize(size); modelWidth = size.x; modelHeight = size.y; modelDepth = size.z; fixedRatio = modelWidth/190; shirtRatioHeightWidth = modelHeight/modelWidth; getCustomProperty(model3D); scene.add(model3D); // Render loop for 3D model renderModel(); }); }
Solved! Go to the solution
This is an accepted solution.
Solution:
Since a javascript file from my app is the only thing using the fbx file I just dropped the file into the "files" section in the content section of admin shopify page. Then I was able to access the fbx file with a CDN link shopify generated for the file.
This is an accepted solution.
Solution:
Since a javascript file from my app is the only thing using the fbx file I just dropped the file into the "files" section in the content section of admin shopify page. Then I was able to access the fbx file with a CDN link shopify generated for the file.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025