# Model flickers when calling setNodesVisibility repeatedly

**URL:** <https://forum.techsoft3d.com/t/model-flickers-when-calling-setnodesvisibility-repeatedly/5040>\
**Category:** General\
**Tags:** code, sample, webviewer, how-to\
**Created:** [January 4, 2026, 12:17pm UTC](https://forum.techsoft3d.com/t/model-flickers-when-calling-setnodesvisibility-repeatedly/5040 "2026-01-04T12:17:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raja.r](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@raja.r](https://forum.techsoft3d.com/u/raja.r)\
**Post date:** [January 4, 2026, 12:17pm UTC](https://forum.techsoft3d.com/t/model-flickers-when-calling-setnodesvisibility-repeatedly/5040/1 "2026-01-04T12:17:39Z")

</div>

I’m facing a flickering issue in HOOPS Communicator whenever I update node visibility.

Each time I call the following API, the entire 3D model visibly flickers (looks like a repaint or full re-render):

viewer.model.setNodesVisibility(nodeIds, true, true);

This method is invoked frequently (from multiple code paths) to update visibility of different node sets. Version using Hoop Viewer → 2023\_SP1

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [January 4, 2026, 1:44pm UTC](https://forum.techsoft3d.com/t/model-flickers-when-calling-setnodesvisibility-repeatedly/5040/2 "2026-01-04T13:44:34Z")

</div>

I used your code snippet from a previous post:

```auto
// Recursively get all children from root
const allNodes = [];
function traverse(nodeId) {
  const children = viewer.model.getNodeChildren(nodeId);
  children.forEach(child => {
    allNodes.push(child);
    traverse(child);
  });
}
traverse(rootNodeId);

// Set visibility
viewer.model.setNodesVisibility(allNodes, true, true);

```

I was not able to reproduce the flickering issue on a few different models using HC 2023 SP1.

The method [setNodesVisibility](https://docs.techsoft3d.com/hoops/visualize-web/api_ref/viewing/classes/Model.html#wv.Model.setNodesVisibility) returns a `Promise`. So how are you chaining the calls if you are using it for different sets of nodes? One quick suggestion is to try aggregate all the node ids in one array and calling the function once.

---

<div class="post-metadata">

**Author:** ![raja.r](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@raja.r](https://forum.techsoft3d.com/u/raja.r)\
**Post date:** [January 4, 2026, 1:49pm UTC](https://forum.techsoft3d.com/t/model-flickers-when-calling-setnodesvisibility-repeatedly/5040/3 "2026-01-04T13:49:27Z")

</div>

Aggregating all node IDs into a single array and applying the visibility update in one call works well and significantly reduces flickering (to one time). This is the workaround we are currently using.

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [January 4, 2026, 2:05pm UTC](https://forum.techsoft3d.com/t/model-flickers-when-calling-setnodesvisibility-repeatedly/5040/4 "2026-01-04T14:05:35Z")

</div>

In my testing, there was no flickering at all. Can you test your code on the default Web Viewer to confirm that the flickering occurs? Ths issue might be coming from your application only so I wouldn’t be able to reproduce it.
