@viji-dev/core 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -246,6 +246,11 @@ await core.setParameters({
246
246
  'enabled': false
247
247
  });
248
248
 
249
+ // Image and 3D model parameters take files, URLs or null
250
+ await core.setParameter('texture', imageFile); // File / Blob / URL; host value: ImageBitmap | null
251
+ await core.setParameter('statue', modelFile); // File / Blob / ArrayBuffer / { bytes, format } / URL
252
+ // host value: ModelDescriptor ({ format }) | null, never the bytes
253
+
249
254
  // Get current parameter values
250
255
  const values = core.getParameterValues();
251
256
  const color = core.getParameter('color');
@@ -574,6 +579,17 @@ const resetPosition = viji.button({
574
579
  group: 'interaction',
575
580
  category: 'interaction'
576
581
  });
582
+
583
+ // Binary assets: the host supplies the file, the scene consumes it
584
+ const texture = viji.image(null, { label: 'Texture' }); // value: ImageBitmap | null
585
+
586
+ const statue = viji.model(null, { // value: { bytes, url, format } | null
587
+ label: 'Statue',
588
+ formats: ['glb', 'obj'] // required: only what your loader parses; the host filters its picker by it
589
+ });
590
+ // Core never parses the model: pass statue.value.bytes to a loader's parse() or
591
+ // statue.value.url to its load() (three.js loaders, p5 loadModel()). Read the value
592
+ // where you load it; replacing the model revokes the old url.
577
593
  ```
578
594
 
579
595
  #### Parameter Usage in Render Loop
@@ -1158,6 +1174,7 @@ function render(viji, p5) {
1158
1174
  - ❌ p5.sound (use `viji.audio` instead)
1159
1175
  - ❌ P5.js events (use `viji.mouse`/`keyboard`/`touches`/`pointer` instead)
1160
1176
  - ❌ Direct image loading (use Viji image parameters instead)
1177
+ - ❌ `preload()` and file loaders, except `loadModel(statue.value.url, true, ok, err, '.' + statue.value.format)` with a `viji.model()` parameter
1161
1178
 
1162
1179
  ### Audio Reactive P5.js Example
1163
1180