@liveroom-tech/react-immersive 1.3.0 → 1.3.1
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/dist/index.js +14 -1
- package/dist/index.mjs +14 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -317,9 +317,22 @@ function exportSceneMesh({
|
|
|
317
317
|
for (const [bindingKey, binding] of Object.entries(objectBindings)) {
|
|
318
318
|
bindingKeyByModelObject.set(binding.modelObjectId ?? bindingKey, bindingKey);
|
|
319
319
|
}
|
|
320
|
+
const isVisibleForExport = (node) => {
|
|
321
|
+
let current = node;
|
|
322
|
+
while (current) {
|
|
323
|
+
const nodeName = current.name || current.uuid;
|
|
324
|
+
const bindingKey = bindingKeyByModelObject.get(nodeName) ?? nodeName;
|
|
325
|
+
const binding = objectBindings[bindingKey];
|
|
326
|
+
if (binding ? binding.visible === false : current.visible === false) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
current = current.parent;
|
|
330
|
+
}
|
|
331
|
+
return true;
|
|
332
|
+
};
|
|
320
333
|
scene.traverse((node) => {
|
|
321
334
|
const mesh = node;
|
|
322
|
-
if (!mesh.isMesh || !mesh.geometry) return;
|
|
335
|
+
if (!mesh.isMesh || !mesh.geometry || !isVisibleForExport(mesh)) return;
|
|
323
336
|
const nodeName = mesh.name || mesh.uuid;
|
|
324
337
|
const bindingKey = bindingKeyByModelObject.get(nodeName) ?? nodeName;
|
|
325
338
|
const liveMat = matRefs[bindingKey] ?? mesh.material;
|
package/dist/index.mjs
CHANGED
|
@@ -275,9 +275,22 @@ function exportSceneMesh({
|
|
|
275
275
|
for (const [bindingKey, binding] of Object.entries(objectBindings)) {
|
|
276
276
|
bindingKeyByModelObject.set(binding.modelObjectId ?? bindingKey, bindingKey);
|
|
277
277
|
}
|
|
278
|
+
const isVisibleForExport = (node) => {
|
|
279
|
+
let current = node;
|
|
280
|
+
while (current) {
|
|
281
|
+
const nodeName = current.name || current.uuid;
|
|
282
|
+
const bindingKey = bindingKeyByModelObject.get(nodeName) ?? nodeName;
|
|
283
|
+
const binding = objectBindings[bindingKey];
|
|
284
|
+
if (binding ? binding.visible === false : current.visible === false) {
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
current = current.parent;
|
|
288
|
+
}
|
|
289
|
+
return true;
|
|
290
|
+
};
|
|
278
291
|
scene.traverse((node) => {
|
|
279
292
|
const mesh = node;
|
|
280
|
-
if (!mesh.isMesh || !mesh.geometry) return;
|
|
293
|
+
if (!mesh.isMesh || !mesh.geometry || !isVisibleForExport(mesh)) return;
|
|
281
294
|
const nodeName = mesh.name || mesh.uuid;
|
|
282
295
|
const bindingKey = bindingKeyByModelObject.get(nodeName) ?? nodeName;
|
|
283
296
|
const liveMat = matRefs[bindingKey] ?? mesh.material;
|