Detecting When Assets Have Been Loaded
Why Track Asset Loading?
3D assets can be very large (hundreds of MBs), and loading them takes time. You often need to know when assets have finished loading so you can:
- Start simulations only after all meshes are ready
- Show loading progress to users
- Trigger animations or other actions upon completion
How It Works
Vuer provides a simple event-based mechanism:
- Set the
onLoadattribute on your 3D component with a descriptive string - Register a
LOADevent handler that will be called when loading completes
The onLoad string you provide will be passed to your handler as event.value, allowing you to identify which asset finished loading.
Code Example
Expected Output
When the assets finish loading, the handler prints:
