2. Selecting Objects / Visibility Pmodifier¶
The first tutorial showed the Camera, Resolution and FrameRange pmodifiers. The Visibility pmodifier is also used very often. It controls which objects show and which objects are hidden for the render.
Use this pmodifier to define what to render. NEVER USE the "RENDERABLE" property to control what to render. If you do not need to render an object, do not show it in the viewport either.
To use the Visibility pmodifier, you must know how to define an object selection in renderStacks. All pmodifiers use the same dynamic object selection method.
Open the file renderStacks_Tut_001.max again. If you saved the renderStacks data in the previous tutorial, open the File menu and click Reset.

Making a Visibility Pmodifier¶
-
Make a pass "Teapots".
Add a Visibility pmodifier.

The Visibility pmodifier hides and unhides objects for each pass. The objects that you define in the object selection UI above show in the viewport. All other objects are hidden.
renderStacks has 8 ways to define a set of objects. From left to right: LS (LayerSet), nLS (Nested LayerSet), Lyr (Layer), nLyr (Nested Layer), SS (Selection Set), PN (Pathname), All, OS (Object Set).Of the 8 methods, we recommend the LayerSet. It is like a selection set for layers. With a LayerSet, you do not manage each object. The internal ID of an object can change, for example when you make a new object with the same name or merge the object again. If the object stays on the same layer, you do not have to define the selection again.
Making a Layer Set¶
The pass "Teapots" must render all teapots and the cylinder base. Make a LayerSet for that.
-
Open the Layer Explorer.
-
Expand all layers.
In the Visibility pmodifier, click the LS button.

-
Right-click the LS button to open the LayerSet Editor. It shows the layer tree.
-
Select "base". Hold CTRL and select "teapots".

-
In the dropdown, type "Teapots" as the new LayerSet name and press Enter. The name "Teapots" shows between the dropdown and the buttons. This area shows the name of the current LayerSet.

-
You opened this LayerSet Editor from a pmodifier. Thus, you can assign the LayerSet "Teapots" directly to the Visibility pmodifier with the Apply button.

-
Press Apply. The dropdown shows the LayerSet "Teapots". The viewport now shows only the teapots and the cylinder platform.

-
Look at the Layer Explorer. The layers "base" and "teapots" are on. But the layers "Geos" and "stuff" are also on, and the LayerSet "Teapots" does not include them. In the 3ds Max nested layer system, a parent layer always overrides its child layers. Thus, you cannot turn on the layer "base" without the layer "Geos".

For the Visibility pmodifier, renderStacks always turns these nested layers on and off automatically.
Making a Nested Layer Set¶
-
Make a new pass, "AllGeos".
-
Select the "Base_Visibility" pmodifier in the pass "AllGeos".
-
Press the Duplicate Nodes button. This is a quick way to make a local copy of a base pmodifier.

-
The Visibility pmodifier becomes white (a local pmodifier), and the number at the end of its name changes.

-
Click the nLS (Nested LayerSet) button.
-
Right-click it to open the LayerSet Editor.
-
This pass must show all geometry and lights, but no cameras.
Select "02_Lights" and "Geos". -
Type "allGeo_and_Lits" in the dropdown.
-
Press Enter.

-
Press Apply.

A Nested LayerSet also uses all child layers of its layers. Thus, when you select the layer "Geos", all child layers of "Geos" turn on. All geometry and lights are now visible. All cameras are hidden.
Using Single Layer and Its Nested Layer¶
A LayerSet is useful. But what if one layer has all that you need? You do not need a LayerSet for one layer. For this, renderStacks also has the Lyr (layer) and nLyr (nested layer) object selection.
- Make a pass "Tubes" and add a Visibility pmodifier. Or duplicate the pass "Teapots".
- Select Lyr.
- Open the dropdown below Lyr. It shows all layers in the scene.
- Select "Tubes".

- The viewport shows only the objects on the layer "Tubes".

- Make a pass "Stuff" with a Visibility pmodifier. You know how to do this now. 🙂
- Open the new Visibility pmodifier.
- Select nLyr.
- Open the dropdown below nLyr. It shows all layers in the scene.
- Select "stuff". All objects on the layer "stuff" and its child layers show.

Selection Set¶
You can also use the 3ds Max selection sets. Use the 3ds Max tools to make and edit them.
- Make a pass "ssSample" and add a Visibility pmodifier. Or duplicate the base Visibility pmodifier.
- Select SS.
- The file already has a selection set "sstest". Select "sstest" in the dropdown.

- The viewport shows 4 objects with a yellow wireframe.
Pathname¶
In MAXScript, a pathname names objects by hierarchy or by pattern. It lets you select objects with wildcard characters.
For more data about pathnames, see the 3ds Max help.
- Make a pass "Ts" and add a Visibility pmodifier. Or duplicate the base Visibility pmodifier.
- Select PN.
- Right-click the PN button to open the Set Editor.
"Pathname" is already selected. - Type "T*" in the text box at the bottom.

- Press the Add Set button.
The list shows the new pathname.

- Close the Set Editor.
- Select the new pathname in the dropdown below the PN button.

- The viewport now shows all objects with a name that starts with "T".

ObjSet¶
The ObjSet combines the 7 methods above. With an ObjSet, you do not have to make a new LayerSet that combines LayerSets. You can also exclude objects from a LayerSet without moving them to a different layer. This is a strong method to select objects. But we recommend that you keep your ObjSets simple.
-
Make a pass "UberObjSet" and add a Visibility pmodifier. Or duplicate the base Visibility pmodifier.
-
Click OS. 4 new buttons show at the bottom, and the dropdown becomes an editable text box.
-
Type "osSample" and press Enter.
A new row shows at the bottom.
Each row has 4 columns:
- The 1st column is a check box. It enables or disables the row temporarily. - The 2nd column is the ± button. It adds or subtracts the set. - The 3rd column is the set name. - The 4th column is the set type. Select the set type first. The 3rd column then updates. -
Start with the Nested LayerSet "allGeo_and_Lits". Set the 4th column to "NestedLayerSet". Then select "allGeo_and_Lits" in the 3rd column.

-
Press Add to add a new row.
-
Now remove the objects in the selection set "ssTest". These are the objects with a yellow wireframe. Select "SelectionSet" in the 4th column.
-
Select "ssTest" in the 3rd column.
-
Press the [+] button in the 2nd column. The button changes to [-], and all objects with a yellow wireframe are hidden.
This is the basic ObjSet workflow. You stack object selection methods to add or remove objects. renderStacks always applies the rows from the top to the bottom.
-
Now add the "T" objects again. Press Add.
-
Set the row to "Pathname" and "T*".

-
Add more rows and try different combinations.
-
Turn the check boxes on and off.
-
You can select more than one row and press Remove to remove them. But you can move only one row up or down at a time.
-
Most of each row is dropdowns. Thus, it can be hard to select a row to delete or move. Each row has a small empty area at the right end. Click that area to select the row.

This is the end of the object selection methods. The "All" method selects all objects.
Thanks!