From 3c3c51203bf43f3d3422035d2808c34c36213336 Mon Sep 17 00:00:00 2001 From: abstrakt Date: Tue, 23 Dec 2025 16:56:09 +0000 Subject: [PATCH 1/3] fix: Apply GSplat `unified` property while it is disabled --- packages/lib/src/components/GSplat.tsx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/lib/src/components/GSplat.tsx b/packages/lib/src/components/GSplat.tsx index 7ee469dd..1cc3e8d1 100644 --- a/packages/lib/src/components/GSplat.tsx +++ b/packages/lib/src/components/GSplat.tsx @@ -36,5 +36,29 @@ componentDefinition.schema = { validate: (val: unknown) => val instanceof Asset, errorMsg: (val: unknown) => `Invalid value for prop "asset": "${JSON.stringify(val)}". Expected an Asset.`, default: null + }, + // `unified` is a special property that can not be modified while the component is enabled + unified: { + validate: (val: unknown) => typeof val === 'boolean', + errorMsg: (val: unknown) => `Invalid value for prop "unified": "${JSON.stringify(val)}". Expected a boolean.`, + default: false, + apply: (instance: GSplatComponent, props: Record, key: string) => { + const value = props[key] as boolean; + + if(instance.unified === value) { + return; + } + + // If not enabled, just set directly + if (!instance.enabled) { + instance.unified = value; + return; + } + + // Temporarily disable component, set value, re-enable + instance.enabled = false; + instance.unified = value; + instance.enabled = true; + } } -} \ No newline at end of file +} From 137ecfd8f37d6d4a7f8e9bb81f5c39d2ca20e405 Mon Sep 17 00:00:00 2001 From: abstrakt <68276899+abstrakt8@users.noreply.github.com> Date: Tue, 23 Dec 2025 17:26:26 +0000 Subject: [PATCH 2/3] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- packages/lib/src/components/GSplat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/src/components/GSplat.tsx b/packages/lib/src/components/GSplat.tsx index 1cc3e8d1..1eaa637f 100644 --- a/packages/lib/src/components/GSplat.tsx +++ b/packages/lib/src/components/GSplat.tsx @@ -45,7 +45,7 @@ componentDefinition.schema = { apply: (instance: GSplatComponent, props: Record, key: string) => { const value = props[key] as boolean; - if(instance.unified === value) { + if (instance.unified === value) { return; } From 596dcc9c62bc19513d97e7b85eec7b9987eea8f4 Mon Sep 17 00:00:00 2001 From: abstrakt Date: Mon, 29 Dec 2025 13:40:12 +0000 Subject: [PATCH 3/3] chore: Add changeset --- .changeset/fix-gsplat-unified-property.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/fix-gsplat-unified-property.md diff --git a/.changeset/fix-gsplat-unified-property.md b/.changeset/fix-gsplat-unified-property.md new file mode 100644 index 00000000..1984b9bb --- /dev/null +++ b/.changeset/fix-gsplat-unified-property.md @@ -0,0 +1,6 @@ +--- +"@playcanvas/react": patch +--- + +Fix GSplat `unified` property not being applied correctly. This fix allows users to load Gaussian Splats with LODs. +