-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Describe the bug π
`const syncHiddenObjectsStore = async () =>
{
if (!componentsRef)
{
return;
}
const hider = componentsRef.get(OBC.Hider) as OBC.Hider | undefined;
if (!hider)
{
return;
}
const hiddenMap = await hider.getVisibilityMap(false);
const hiddenInternalIds: string[] = [];
for (const [modelId, list] of Object.entries(hiddenMap))
{
if (!list)
{
continue;
}
for (const localId of list as number[])
{
hiddenInternalIds.push(`${modelId}:${localId}`);
}
}
const { setHiddenObjIds } = useSceneObjectsStore.getState();
setHiddenObjIds(hiddenInternalIds);
};`
I implemented a visibility-tracking function that synchronizes show/hide/isolate actions in the viewer with other UI components (e.g., greying out hidden nodes in the project tree). While the visibility operations themselves are fast, getVisibilityMap becomes a bottleneck when handling tens of thousands of objects, even though that scale should be manageable.
Reproduction βΆοΈ
No response
Steps to reproduce π’
Call this function When lots of elements are hidden
const hiddenMap = await hider.getVisibilityMap(false);
System Info π»
-Used Package Manager π¦
yarn
Error Trace/Logs π
No response
Validations β
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
- Check that this is a concrete bug. For Q&A join our Community.
- The provided reproduction is a minimal reproducible example of the bug.