diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index ee6429a2..177c27fd 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -5983,18 +5983,42 @@ export class ViewportHost { private syncSimulationModelInstances( runtimeScene: RuntimeSceneDefinition ): boolean { + let addedRenderGroup = false; + for (const modelInstance of runtimeScene.modelInstances) { const renderGroup = this.modelRenderObjects.get( modelInstance.instanceId ); if (renderGroup === undefined) { - return false; + const displayedModelInstance = this.getDisplayedModelInstanceById( + modelInstance.instanceId + ); + + if ( + displayedModelInstance !== null && + displayedModelInstance.enabled && + displayedModelInstance.visible + ) { + this.addModelInstanceRenderGroup( + displayedModelInstance, + isModelInstanceSelected( + this.currentSelection, + displayedModelInstance.id + ) + ); + addedRenderGroup = true; + } + continue; } renderGroup.visible = modelInstance.visible; } + if (addedRenderGroup) { + this.applyShadowState(); + } + return true; }