ale2x72
(Alessio Erioli)
June 3, 2026, 2:55pm
1
I have a Rhino file with a nested layers structure:
The same sub-layer structure is repeated (with some variations) under different top-level layers. When I load the same file via Three.js (slightly modifying the sample code here: three.js/examples/webgl_loader_3dm.html at master · mrdoob/three.js · GitHub ), the layers hierarchy is flattened, resulting in duplicate layers:
Acting on either layer with the same name hides all objects belonging to any layer with the same name, regardless of the original top-level layer.
Is it possible to preserve the layers’ nesting hierarchy somehow?
Pinging @fraguada , in case you are still in charge of this.
ale2x72
(Alessio Erioli)
June 16, 2026, 11:31am
2
bump… @fraguada … or anyone who dabbles in three.js?
fraguada
(Luis Fraguada)
June 16, 2026, 7:10pm
3
I’ll be getting back to rhino3dm in the next week or so. I will take a look at this and see what we can do.
fraguada
(Luis Fraguada)
August 17, 2026, 9:40pm
4
@ale2x72 I think I was lazy in the example and only match by layer name, not the fully qualified layer name with parent info. Maybe this will work:
function initGUI( layers ) {
gui = new GUI( { title: 'layers' } );
for ( let i = 0; i < layers.length; i ++ ) {
const layer = layers[ i ];
const layerIndex = i; // unique per layer
// use fullPath so duplicate-named layers are distinguishable in the panel
gui.add( layer, 'visible' ).name( layer.fullPath ?? layer.name )
.onChange( function ( val ) {
scene.traverse( function ( child ) {
const attr = child.userData?.attributes;
if ( attr && 'layerIndex' in attr && attr.layerIndex === layerIndex ) {
child.visible = val;
}
} );
} );
}
}