Loading and Unloading Specific Model Nodes Using onDemand Streaming

Hello TechSoft3D Support,

I’m working on a feature where we need to dynamically load and unload a specific single part (node) of a model at a time — only one part should be loaded and displayed at any given time.

To achieve this, I explored using streamingMode: "onDemand" and followed this approach:

  1. Loaded a node (e.g., node ID 5) using requestNode(5).
  2. Before loading the next node, I called clear() or deleteNode() to unload the previous node.
  3. Then attempted to load a new node (e.g., node ID 10) using requestNode(10).

However, after calling clear() or deleteNode(), the viewer remains empty and does not load the new node.

We do not want to toggle visibility using setNodesVisibility() — our goal is to truly load and unload individual parts, maintaining only a single active node in the scene at any time.

Could you please advise on:

  • Whether this kind of selective load/unload behavior is supported using onDemand mode?
  • If not, is there any other recommended way to implement this functionality?
  • Are there internal API methods or a different workflow we should consider?

Any suggestions or workarounds would be greatly appreciated.

My reply to a previous post also applies to your situation:

For onDemand streaming, once the node has been requested from the server to be loaded in the client, there is not an option to unload it. When calling clear or delete, the model or node is permanently removed from the streaming session.

In the same thread I replied to, the original poster had success using a manually shattered workflow which I recommend to you as well: