Hi
just a short question: Is there a component or smth similar, to explicitly exclude things like skybox from the Quicklook export? My project doesn’t export to Quicklook anymore, if the skybox is to high-res (1024 and up), but works fine below.
To exclude specific elements like the skybox from the Quicklook export in Needle Engine, you can implement custom filtering logic during the export process.
In the USDZExporter, you can modify the export function to explicitly check for objects you wish to exclude. Here is a pseudocode outline for how this could look:
Define the objects to exclude, e.g., skybox.
Traverse the object hierarchy during export.
Skip the objects that are in the exclusion list.
Here’s a code snippet based on the exported functionality:
import { USDZExporter } from "@needle-tools/engine";
class CustomUSDZExporter extends USDZExporter {
exportAndOpen(): Promise<Blob | null> {
// Call the original export and open logic
return super.exportAndOpen().then(blob => {
// Logic to exclude unwanted objects
const objectsToExport = this.getObjectsToExport();
const filteredObjects = objectsToExport.filter(object => !this.shouldExclude(object));
// Assuming there's a function in the base class that handles exporting
return this.export(filteredObjects);
});
}
shouldExclude(object: Object3D): boolean {
// Check if the object is a skybox or any other criteria you want to add
return object.name === "Skybox"; // Example condition
}
}
You may also want to check if any specific settings allow filtering during the Quicklook export process.
It sounds like the high-resolution textures may be causing issues by exceeding the allowed limits for Quicklook, which might be why working under 1024 solves it. Reducing texture sizes or excluding high-res textures could also be beneficial.
To implement this effectively, please check the documentation of Needle Engine regarding the exporter customization options, and ensure that your implementation does not introduce any unwanted behaviors.
If you need more tailored advice based on your implementation or further help with the specifics of your project setup, feel free to ask!
1 replies left - Get a PRO license for more AI replies. thread_WNkuyywaQL06SFUr2sJHdonL Reply to this message to continue the conversation
To exclude the scene skybox from Quicklook export in Needle Engine, you can adjust export settings and implement custom logic in the exporting process. Here are steps and code snippets to guide you:
Identify the Skybox: In your code, identify the skybox material or instance.
Modify the Export Logic: When you call the export function, include logic to skip exporting the identified skybox.
Here’s a code outline to exclude the skybox during Quicklook export:
import { USDZExporter } from "@needle-tools/engine";
class CustomUSDZExporter extends USDZExporter {
async exportAndOpen(): Promise<Blob | null> {
// Call base export method to get the blob
const blob = await super.exportAndOpen();
// Implement logic to remove skybox
this.excludeSkybox();
return blob;
}
excludeSkybox() {
// Example condition to check for skybox
const skyboxName = "YourSkyboxName"; // Replace with your skybox name
const sceneObjects = this.context.scene.children;
for (const object of sceneObjects) {
if (object.name === skyboxName) {
// Logic to exclude the skybox from export
this.context.scene.remove(object);
}
}
}
}
Texture Size Consideration: If resolution limits are a concern, ensure your skybox textures are below the maximum threshold.
Consider verifying settings in your project that pertain to skybox export as well to ensure they align with your requirements (see the documentation) (see the documentation).
If you need further customization or implementation details, feel free to ask!
1 replies left - Get a PRO license for more AI replies. thread_WNkuyywaQL06SFUr2sJHdonL Reply to this message to continue the conversation
nvm, it seems that this is a memory issue, as the experience works fine on iPhone 15 Pro Max, but doesn’t load on iPhone 13. So it’s not a skybox/USDZ export issue as far as I can tell.
The skybox shouldn’t be included in USDZ export at all.
What you can do to understand why a file may not work is to open the URL on your desktop with ?debugusdz appended – you will see the “Open in AR” button which will download a USDZ file. You can unpack that with 7zip, and look at which meshes or textures contribute the most to the filesize.