@umicat/three-sdk 1.28.0 → 1.30.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.
@@ -1634,6 +1634,26 @@ export async function runEditorDesignPlayer3D(renderer, opts = {}) {
1634
1634
  // host can push a partial update, and the grid is rebuilt on any change
1635
1635
  // because its cell size IS the step (the grid is the snap grid, not a
1636
1636
  // separate decoration).
1637
+ // ADR-052 — set the selection from outside the canvas. The entity list
1638
+ // needs it: clicking a row has to select in the viewport, and until now
1639
+ // every selection originated from a pointer event in here. Ids that are
1640
+ // not in the scene are skipped rather than failing the whole call — a
1641
+ // list can race a delete, and dropping one stale id is better than
1642
+ // dropping the user's whole selection.
1643
+ if (data.type === 'umicat:editor:selectEntities3d') {
1644
+ const ids = data.entityIds;
1645
+ if (!Array.isArray(ids))
1646
+ return;
1647
+ const objs = ids
1648
+ .map((id) => (typeof id === 'string' ? objectByEntity.get(id) : undefined))
1649
+ .filter((o) => !!o);
1650
+ // Deliberately NOT filtered by `isInert`: selecting a locked entity
1651
+ // FROM THE LIST is the whole point of the list — lock makes something
1652
+ // inert to the canvas, not invisible to the editor. The gizmo it gets
1653
+ // is reachable only because the user asked for it by name.
1654
+ applySelection(objs);
1655
+ return;
1656
+ }
1637
1657
  if (data.type === 'umicat:editor:setSnap3d') {
1638
1658
  const d = data;
1639
1659
  if (typeof d.enabled === 'boolean')
package/dist/scene3d.js CHANGED
@@ -306,9 +306,16 @@ export function validateScene(scene) {
306
306
  ids.add(e.id);
307
307
  const kinds = [e.modelAssetId && 'model', e.primitive && 'primitive',
308
308
  e.heightfield && 'heightfield', e.water && 'water'].filter(Boolean);
309
- if (kinds.length === 0) {
310
- problems.push(`entity '${e.id}' is nothing — no model, primitive, heightfield or water, so it would render nothing`);
311
- }
309
+ // An entity with no geometry is a GROUP (or folder) node, and that is
310
+ // legitimate — `loadScene3D` builds it as a bare `THREE.Group`, which is
311
+ // exactly what ADR-045's "Group as Model" creates and what organising a
312
+ // scene into folders needs. Unity and Unreal treat an empty
313
+ // GameObject/Actor the same way: completely ordinary, never warned about.
314
+ //
315
+ // This used to be an error, and it made "Group as Model" produce a scene
316
+ // that could not be RELOADED: grouping worked live, then the next editor
317
+ // open, Play or rebuild threw out of `loadScene3D` and blanked the whole
318
+ // scene. You had to group AND reload to see it, which is why it survived.
312
319
  if (kinds.length > 1) {
313
320
  problems.push(`entity '${e.id}' is ${kinds.join(' and ')} at once — an entity can only be one kind of thing`);
314
321
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umicat/three-sdk",
3
- "version": "1.28.0",
3
+ "version": "1.30.0",
4
4
  "description": "Three.js runtime for Umicat games: the scene3d design format, its loader with physics, a kinematic character controller, and the Umicat platform via @umicat/platform-sdk.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",