Model flickers when calling setNodesVisibility repeatedly

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

I used your code snippet from a previous post:

// 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 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.

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.

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.