From f345bd13580e2f6755136e2f5b465e4f4d04a4e3 Mon Sep 17 00:00:00 2001 From: Divyun Raje Vaid Date: Mon, 26 Aug 2024 21:05:50 +0530 Subject: [PATCH] fix(view/lights): for spotlights, restore parent on its target --- packages/view/src/pools/SingleUserPool.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/view/src/pools/SingleUserPool.ts b/packages/view/src/pools/SingleUserPool.ts index f9a2336b..8e2c1992 100644 --- a/packages/view/src/pools/SingleUserPool.ts +++ b/packages/view/src/pools/SingleUserPool.ts @@ -1,5 +1,5 @@ import { Property as PropertyDef, Mesh as MeshDef, Node as NodeDef, uuid } from '@gltf-transform/core'; -import { Object3D } from 'three'; +import{ DirectionalLight, type Object3D, SpotLight } from 'three'; import { LightLike } from '../constants.js'; import { Pool } from './Pool.js'; @@ -27,6 +27,14 @@ export class SingleUserPool extends Pool { if (base === srcObject) return; // Skip root; recorded elsewhere. if ((srcObject as unknown as LightLike).isLight) return; // Skip light target.