diff --git a/src/devtools/plugin.ts b/src/devtools/plugin.ts index deb34583a..dc87653a6 100644 --- a/src/devtools/plugin.ts +++ b/src/devtools/plugin.ts @@ -176,6 +176,9 @@ export function registerTresDevtools(app: DevtoolsApp, tres: TresContext) { payload.state = { object: Object.entries(instance) .map(([key, value]) => { + if (key === 'children') { + return { key, value: value.filter(child => child.type !== 'HightlightMesh') } + } return { key, value, editable: true } }) .filter(({ key }) => { diff --git a/src/utils/perf.ts b/src/utils/perf.ts index 78f08b160..08275db46 100644 --- a/src/utils/perf.ts +++ b/src/utils/perf.ts @@ -5,7 +5,7 @@ export function calculateMemoryUsage(object: TresObject | Scene) { let totalMemory = 0 object.traverse((node: TresObject) => { - if (node.isMesh && node.geometry) { + if (node.isMesh && node.geometry && node.type !== 'HightlightMesh') { const geometry = node.geometry const verticesMemory = geometry.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT const facesMemory = geometry.index ? geometry.index.count * Uint32Array.BYTES_PER_ELEMENT : 0