@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
21 lines • 693 B
JavaScript
let _factory;
/**
* Register a factory for creating quicklook handlers.
* Called by USDZExporter to register itself as the handler.
*/
export function setQuicklookHandlerFactory(factory) {
_factory = factory;
}
/**
* Find an existing quicklook handler in the scene, or create a new one if none exists.
* @returns A quicklook handler, or null if no factory has been registered.
*/
export function getOrCreateQuicklookHandler() {
if (!_factory)
return null;
const existing = _factory.find();
if (existing)
return { handler: existing, created: false };
return { handler: _factory.create(), created: true };
}
//# sourceMappingURL=quicklook-handler.js.map