babylon.quarks-editor 0.30.0 → 0.32.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/CHANGELOG.md CHANGED
@@ -2,7 +2,45 @@
2
2
 
3
3
  All notable changes to the `babylon.quarks-editor` package are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
- and the project follows the `quarks.core` 0.x version line.
5
+ and the editor keeps its own 0.x version line; each release names the babylon.quarks line it
6
+ needs in its peer dependency.
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.32.0] — 2026-11-08
11
+
12
+ Released with babylon.quarks 1.0.0-rc.2, on npm's `next` tag with it; its peer dependency is
13
+ `~1.0.0-rc.2`, for the API the candidate adds (mesh vertex colours).
14
+
15
+ ### Added
16
+
17
+ - **Mesh vertex colours** in the Mesh render mode's geometry: a host's `geometryOptions` and
18
+ `resolveGeometry` can give `colors`, `r, g, b, a` per vertex and linear, which the particle colour
19
+ is multiplied by (`ParticleSystem.instancingColors`). Picking another geometry clears them. The
20
+ example editor's glTF import reads `COLOR_0`.
21
+
22
+ ### Fixed
23
+
24
+ - An effect whose root is a group around one emitter, as the Unity exporter writes them, drew
25
+ nothing: the editor makes the emitter the root and disposes the group, and the group held the
26
+ effect's textures, which went with it. The emitter now takes the hold first
27
+ (`QuarksUtil.shareResources`).
28
+ - A field row without a label spans the whole inspector width: the min and max of _Random between
29
+ two_, a constant's value, the colour swatch of Start color and the angles of Start rotation. It
30
+ sat in the 110 px label column, which left each number box about 26 px wide and the min and max
31
+ unreadable. `Row` with an empty label now lays its children across the row in one block.
32
+
33
+ ## [0.31.0] — 2026-10-26
34
+
35
+ Released with babylon.quarks 1.0.0-rc.1, on npm's `next` tag with it. The editor stays on 0.x
36
+ while the library reaches 1.0.
37
+
38
+ ### Breaking
39
+
40
+ - The peer dependency on babylon.quarks is `~1.0.0-rc.1`: this candidate and the 1.0.x releases
41
+ after it. An editor release that names 1.0.0 itself follows with it.
42
+ - Peer ranges are `@babylonjs/core` `^9.24.0` and `@babylonjs/materials` `^9.23.0`, the releases
43
+ babylon.quarks now needs and CI tests against.
6
44
 
7
45
  ## [0.30.0] — 2026-10-24
8
46
 
package/README.md CHANGED
@@ -10,8 +10,13 @@ Shuriken-style effect editor for [babylon.quarks](https://www.npmjs.com/package/
10
10
  npm install babylon.quarks-editor babylon.quarks @babylonjs/core @babylonjs/materials react react-dom @heroicons/react @tanstack/react-virtual
11
11
  ```
12
12
 
13
- The editor is an ES module package (`import`, not `require`). Its version follows babylon.quarks:
14
- editor 0.30.x needs babylon.quarks 0.30.x.
13
+ Until babylon.quarks 1.0.0 is out, editor 0.31 and the 1.0 release candidate are on the `next` tag:
14
+ install `babylon.quarks-editor@next babylon.quarks@next` in place of the first two.
15
+
16
+ The editor is an ES module package (`import`, not `require`). It stays on 0.x while babylon.quarks
17
+ reaches 1.0, and each editor release names the babylon.quarks line it works with: editor 0.31.x
18
+ needs babylon.quarks 1.0 (from 1.0.0-rc.1, installed with `@next` until 1.0.0 is out), and editor
19
+ 0.30.x needs babylon.quarks 0.30.x.
15
20
 
16
21
  ## Usage
17
22
 
@@ -74,10 +79,11 @@ an opinion on your CDN, asset pipeline, or loader (`@babylonjs/loaders`, your ow
74
79
  `system.texture`. Return `null` or `undefined` to leave the texture unset.
75
80
  - `resolveGeometry(file) => Promise<GeometryData>` — turns a picked file (from "Load from file…"
76
81
  in the Mesh render mode's geometry dropdown) into vertex buffers: `{positions, indices?, uvs?,
77
- uvs2?, normals?}` (typed arrays or plain number arrays; `uvs2` is the second UV set textures on
78
- UV channel 1 read).
82
+ uvs2?, normals?, colors?}` (typed arrays or plain number arrays; `uvs2` is the second UV set textures on
83
+ UV channel 1 read, `colors` the vertex colours, `r, g, b, a` per vertex and linear, the particle
84
+ colour is multiplied by).
79
85
  - `textureOptions?: {label, url}[]` / `geometryOptions?: {label, positions, indices?, uvs?,
80
- uvs2?, normals?}[]` — preset lists shown alongside "Custom URL…" / "Load from file…". The texture
86
+ uvs2?, normals?, colors?}[]` — preset lists shown alongside "Custom URL…" / "Load from file…". The texture
81
87
  presets also serve the gradient map's ramp, the erosion mask and the distortion noise.
82
88
 
83
89
  **Signature differs by entry point** — a common source of "works in the demo, throws in my
@@ -11,11 +11,13 @@ function groupChildren(node) {
11
11
  }
12
12
  /** Reparents `only` onto `parent`, transferring the outgoing node's name if `only` doesn't
13
13
  * already have a meaningful one of its own, then disposes the now-empty wrapper. World
14
- * transform is preserved via `setParent`. */
14
+ * transform is preserved via `setParent`. The loaded root holds the effect's textures and
15
+ * materials, so `only` takes a hold first: a wrapper root goes, and with it that hold. */
15
16
  function collapseInto(wrapper, only, parent) {
16
17
  if (!hasMeaningfulName(only) && hasMeaningfulName(wrapper)) {
17
18
  only.name = wrapper.name;
18
19
  }
20
+ QuarksUtil.shareResources(wrapper, only);
19
21
  only.setParent(parent);
20
22
  wrapper.dispose(true, false);
21
23
  }
@@ -8,13 +8,14 @@ export function applyRendererMaterial(system, patch) {
8
8
  system.blending = patch.blendMode;
9
9
  }
10
10
  if (patch.transparent !== undefined) {
11
- settings.materialTransparent = patch.transparent;
11
+ // The setter, so a depth write not chosen follows the surface.
12
+ system.transparent = patch.transparent;
12
13
  }
13
14
  if (patch.depthTest !== undefined) {
14
15
  settings.materialDepthTest = patch.depthTest;
15
16
  }
16
17
  if (patch.depthWrite !== undefined) {
17
- settings.materialDepthWrite = patch.depthWrite;
18
+ system.depthWrite = patch.depthWrite;
18
19
  }
19
20
  if (patch.alphaTest !== undefined) {
20
21
  settings.materialAlphaTest = patch.alphaTest;
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
- /** An inspector row: a label, with an optional hint, and its controls. */
2
+ /**
3
+ * An inspector row: a label, with an optional hint, and its controls. With an empty label the
4
+ * controls span the whole row, continuing the row above; the hint is then not shown.
5
+ */
3
6
  export declare function Row(props: {
4
7
  label: string;
5
8
  hint?: string;
@@ -1,10 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import { InspectorLabel } from './InspectorLabel.js';
4
4
  import { inputStyle, rowStyle } from './theme.js';
5
- /** An inspector row: a label, with an optional hint, and its controls. */
5
+ /**
6
+ * An inspector row: a label, with an optional hint, and its controls. With an empty label the
7
+ * controls span the whole row, continuing the row above; the hint is then not shown.
8
+ */
6
9
  export function Row(props) {
7
- return (_jsxs("div", { style: rowStyle, children: [_jsx(InspectorLabel, { label: props.label, hint: props.hint, hintKey: props.hintKey }), props.children] }));
10
+ return (_jsx("div", { style: rowStyle, children: props.label ? (_jsxs(_Fragment, { children: [_jsx(InspectorLabel, { label: props.label, hint: props.hint, hintKey: props.hintKey }), props.children] })) : (_jsx("div", { style: { gridColumn: '1 / -1', minWidth: 0 }, children: props.children })) }));
8
11
  }
9
12
  /** Number input that keeps focus-friendly local text state and commits parsed values. */
10
13
  export function NumberField(props) {
@@ -36,6 +36,11 @@ export interface GeometryOption {
36
36
  uvs2?: Float32Array | number[];
37
37
  /** Vertex normals, three values per vertex; without them lighting uses +Z. */
38
38
  normals?: Float32Array | number[];
39
+ /**
40
+ * Vertex colours, `r, g, b, a` per vertex, linear (glTF `COLOR_0`), which the particle colour
41
+ * is multiplied by; see `ParticleSystem.instancingColors`.
42
+ */
43
+ colors?: Float32Array | number[];
39
44
  }
40
45
  /** Vertex buffers a host loader (e.g. a GLB importer) returns for the Mesh render mode. */
41
46
  export type GeometryData = Omit<GeometryOption, 'label'>;
@@ -499,6 +499,7 @@ export function RendererModule({ binding, textureOptions, geometryOptions, resol
499
499
  settings.instancingUVs = undefined;
500
500
  settings.instancingUVs2 = undefined;
501
501
  settings.instancingNormals = undefined;
502
+ settings.instancingColors = undefined;
502
503
  s.instancingGeometry = new Float32Array(g.positions);
503
504
  s.instancingIndices = g.indices
504
505
  ? new Uint32Array(g.indices)
@@ -509,6 +510,8 @@ export function RendererModule({ binding, textureOptions, geometryOptions, resol
509
510
  s.instancingUVs2 = new Float32Array(g.uvs2);
510
511
  if (g.normals)
511
512
  settings.instancingNormals = new Float32Array(g.normals);
513
+ if (g.colors)
514
+ s.instancingColors = new Float32Array(g.colors);
512
515
  });
513
516
  return (_jsx(Row, { label: "Geometry", children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 6 }, children: [_jsx(SelectField, { value: preset, options: [
514
517
  ...(preset === 'custom' ? [{ value: 'custom', label: 'Custom (imported)' }] : []),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylon.quarks-editor",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "description": "Shuriken-style effect editor for babylon.quarks: headless edit-model core + React module-stack UI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -57,11 +57,11 @@
57
57
  },
58
58
  "homepage": "https://github.com/Soullnik/babylon.quarks-standalone#readme",
59
59
  "peerDependencies": {
60
- "@babylonjs/core": "^9.0.0",
61
- "@babylonjs/materials": "^9.0.0",
60
+ "@babylonjs/core": "^9.24.0",
61
+ "@babylonjs/materials": "^9.23.0",
62
62
  "@heroicons/react": ">=2.0.0",
63
63
  "@tanstack/react-virtual": ">=3.0.0",
64
- "babylon.quarks": "~0.30.0",
64
+ "babylon.quarks": "~1.0.0-rc.2",
65
65
  "react": ">=18",
66
66
  "react-dom": ">=18"
67
67
  },
@@ -25,11 +25,13 @@ function groupChildren(node: TransformNode): TransformNode[] {
25
25
 
26
26
  /** Reparents `only` onto `parent`, transferring the outgoing node's name if `only` doesn't
27
27
  * already have a meaningful one of its own, then disposes the now-empty wrapper. World
28
- * transform is preserved via `setParent`. */
28
+ * transform is preserved via `setParent`. The loaded root holds the effect's textures and
29
+ * materials, so `only` takes a hold first: a wrapper root goes, and with it that hold. */
29
30
  function collapseInto(wrapper: TransformNode, only: TransformNode, parent: Node | null): void {
30
31
  if (!hasMeaningfulName(only) && hasMeaningfulName(wrapper)) {
31
32
  only.name = wrapper.name;
32
33
  }
34
+ QuarksUtil.shareResources(wrapper, only);
33
35
  only.setParent(parent);
34
36
  wrapper.dispose(true, false);
35
37
  }
@@ -34,13 +34,14 @@ export function applyRendererMaterial(system: ParticleSystem, patch: RendererMat
34
34
  system.blending = patch.blendMode;
35
35
  }
36
36
  if (patch.transparent !== undefined) {
37
- settings.materialTransparent = patch.transparent;
37
+ // The setter, so a depth write not chosen follows the surface.
38
+ system.transparent = patch.transparent;
38
39
  }
39
40
  if (patch.depthTest !== undefined) {
40
41
  settings.materialDepthTest = patch.depthTest;
41
42
  }
42
43
  if (patch.depthWrite !== undefined) {
43
- settings.materialDepthWrite = patch.depthWrite;
44
+ system.depthWrite = patch.depthWrite;
44
45
  }
45
46
  if (patch.alphaTest !== undefined) {
46
47
  settings.materialAlphaTest = patch.alphaTest;
@@ -2,12 +2,23 @@ import React, {useEffect, useState} from 'react';
2
2
  import {InspectorLabel} from './InspectorLabel.js';
3
3
  import {inputStyle, rowStyle} from './theme.js';
4
4
 
5
- /** An inspector row: a label, with an optional hint, and its controls. */
5
+ /**
6
+ * An inspector row: a label, with an optional hint, and its controls. With an empty label the
7
+ * controls span the whole row, continuing the row above; the hint is then not shown.
8
+ */
6
9
  export function Row(props: {label: string; hint?: string; hintKey?: string; children: React.ReactNode}) {
7
10
  return (
8
11
  <div style={rowStyle}>
9
- <InspectorLabel label={props.label} hint={props.hint} hintKey={props.hintKey} />
10
- {props.children}
12
+ {props.label ? (
13
+ <>
14
+ <InspectorLabel label={props.label} hint={props.hint} hintKey={props.hintKey} />
15
+ {props.children}
16
+ </>
17
+ ) : (
18
+ // A row without a label continues the one above it across the whole width, rather
19
+ // than squeezing its fields into the label column.
20
+ <div style={{gridColumn: '1 / -1', minWidth: 0}}>{props.children}</div>
21
+ )}
11
22
  </div>
12
23
  );
13
24
  }
@@ -947,6 +947,11 @@ export interface GeometryOption {
947
947
  uvs2?: Float32Array | number[];
948
948
  /** Vertex normals, three values per vertex; without them lighting uses +Z. */
949
949
  normals?: Float32Array | number[];
950
+ /**
951
+ * Vertex colours, `r, g, b, a` per vertex, linear (glTF `COLOR_0`), which the particle colour
952
+ * is multiplied by; see `ParticleSystem.instancingColors`.
953
+ */
954
+ colors?: Float32Array | number[];
950
955
  }
951
956
 
952
957
  /** Vertex buffers a host loader (e.g. a GLB importer) returns for the Mesh render mode. */
@@ -1494,6 +1499,7 @@ export function RendererModule({
1494
1499
  settings.instancingUVs = undefined;
1495
1500
  settings.instancingUVs2 = undefined;
1496
1501
  settings.instancingNormals = undefined;
1502
+ settings.instancingColors = undefined;
1497
1503
  s.instancingGeometry = new Float32Array(g.positions);
1498
1504
  s.instancingIndices = g.indices
1499
1505
  ? new Uint32Array(g.indices)
@@ -1501,6 +1507,7 @@ export function RendererModule({
1501
1507
  if (g.uvs) s.instancingUVs = new Float32Array(g.uvs);
1502
1508
  if (g.uvs2) s.instancingUVs2 = new Float32Array(g.uvs2);
1503
1509
  if (g.normals) settings.instancingNormals = new Float32Array(g.normals);
1510
+ if (g.colors) s.instancingColors = new Float32Array(g.colors);
1504
1511
  });
1505
1512
  return (
1506
1513
  <Row label="Geometry">