# Attribute different visible layer to different organs

**URL:** <https://fspm.discourse.group/t/attribute-different-visible-layer-to-different-organs/389>\
**Category:** GroIMP\
**Created:** [January 16, 2026, 10:47am UTC](https://fspm.discourse.group/t/attribute-different-visible-layer-to-different-organs/389 "2026-01-16T10:47:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michele.butturini](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@michele.butturini](https://fspm.discourse.group/u/michele.butturini)\
**Post date:** [January 16, 2026, 10:47am UTC](https://fspm.discourse.group/t/attribute-different-visible-layer-to-different-organs/389/1 "2026-01-16T10:47:13Z")

</div>

Hi,  
I am trying to attribute different visible layers to different organs so that i can export them separately. How can I do that? At the moment they are all under the same layer

---

<div class="post-metadata">

**Author:** ![tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@tim](https://fspm.discourse.group/u/tim)\
**Post date:** [January 28, 2026, 1:12pm UTC](https://fspm.discourse.group/t/attribute-different-visible-layer-to-different-organs/389/2 "2026-01-28T13:12:07Z")

</div>

Hi Michele,

each node has a setLayer(int x) function, so you could either use a query e.g. `(*Leaflet*).setLayer(3);`

Or directly in the construction of your module:

```java
module A(float len) extends Sphere(0.1)
{
	{
		setShader(GREEN);
		setLayer(2);
	}
}

```

The second one is most likely more helpful for your approach.

To export to different files afterwards you need to call the 3D export from rgg code, with the export3DScene function. In this function the third argument defines if only visible layer should be exported (false= everything is exported, true= only visible layers).

```java

public void test(){
	export3DScene("/home/tim/testAll.obj","obj",false);
	View3D view3d = View3D.getDefaultView(workbench());
	//set Layer 0 to false to hide all F
	view3d.setVisibleLayers(new boolean[]{false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true});
	export3DScene("/home/tim/testA.obj","obj",true);
	//set Layer 2 to flase to hide all A
	view3d.setVisibleLayers(new boolean[]{true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true});
	export3DScene("/home/tim/testF.obj","obj",true);
	// make everything visible again
	view3d.setVisibleLayers(new boolean[]{true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true});
}

```

Sadly the setVisibleLayers function of view3d does not link well with the GUI menu in view. Therefore it can happen that the layer-checkbox in the menu is checked even so the layer is not visible. Just uncheck and check it again 😉

Tim
