Skip to content
renderStacks by QuasiKrystal

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.

File menu with the Reset item

Making a Visibility Pmodifier

  1. Make a pass "Teapots".
    Add a Visibility pmodifier.
    Teapots pass with a new 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.

  1. Open the Layer Explorer.

  2. Expand all layers.
    In the Visibility pmodifier, click the LS button.
    Visibility pmodifier with the LS button selected

  3. Right-click the LS button to open the LayerSet Editor. It shows the layer tree.

  4. Select "base". Hold CTRL and select "teapots". LayerSet Editor with the base and teapots layers selected

  5. 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.

    LayerSet Editor with the new Teapots layer set

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

    Apply button of the LayerSet Editor with its tooltip

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

    Viewport that shows only the teapots and the platform, with the Teapots layer set in the Visibility pmodifier

  8. 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".

    Layer Explorer with the base and teapots layers and their parent layers on

    For the Visibility pmodifier, renderStacks always turns these nested layers on and off automatically.

Making a Nested Layer Set

  1. Make a new pass, "AllGeos".

  2. Select the "Base_Visibility" pmodifier in the pass "AllGeos".

  3. Press the Duplicate Nodes button. This is a quick way to make a local copy of a base pmodifier.
    Duplicate Nodes button with its tooltip, and the Base_Visibility pmodifier in the AllGeos pass

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

    Treeview with the local Visibility_441 pmodifier in the AllGeos pass

  5. Click the nLS (Nested LayerSet) button.

  6. Right-click it to open the LayerSet Editor.

  7. This pass must show all geometry and lights, but no cameras.
    Select "02_Lights" and "Geos".

  8. Type "allGeo_and_Lits" in the dropdown.

  9. Press Enter. LayerSet Editor with the 02_Lights and Geos layers selected for the allGeo_and_Lits layer set

  10. Press Apply. Visibility pmodifier with the nested layer set allGeo_and_Lits, and the viewport with all the geometry

    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.

  1. Make a pass "Tubes" and add a Visibility pmodifier. Or duplicate the pass "Teapots".
  2. Select Lyr.
  3. Open the dropdown below Lyr. It shows all layers in the scene.
  4. Select "Tubes".
    Visibility pmodifier with the layer list open and Tubes selected
  5. The viewport shows only the objects on the layer "Tubes".
    Viewport with only the three tubes of the Tubes layer
  6. Make a pass "Stuff" with a Visibility pmodifier. You know how to do this now. 🙂
  7. Open the new Visibility pmodifier.
  8. Select nLyr.
  9. Open the dropdown below nLyr. It shows all layers in the scene.
  10. Select "stuff". All objects on the layer "stuff" and its child layers show.
    Visibility pmodifier with nLyr and the stuff layer, and the viewport with the objects of the stuff layer and its child layers

Selection Set

You can also use the 3ds Max selection sets. Use the 3ds Max tools to make and edit them.

  1. Make a pass "ssSample" and add a Visibility pmodifier. Or duplicate the base Visibility pmodifier.
  2. Select SS.
  3. The file already has a selection set "sstest". Select "sstest" in the dropdown. Visibility pmodifier with the SS button and the sstest selection set, and the four objects of the set in the viewport
  4. 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.

  1. Make a pass "Ts" and add a Visibility pmodifier. Or duplicate the base Visibility pmodifier.
  2. Select PN.
  3. Right-click the PN button to open the Set Editor.
    "Pathname" is already selected.
  4. Type "T*" in the text box at the bottom.
    Set Editor with Pathname selected and T* in the name field
  5. Press the Add Set button.
    The list shows the new pathname.
    Set Editor with the new T* pathname and the Add a new set button
  6. Close the Set Editor.
  7. Select the new pathname in the dropdown below the PN button. Visibility pmodifier with the PN button and the T* pathname
  8. The viewport now shows all objects with a name that starts with "T". Viewport with all the objects whose names start 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.

  1. Make a pass "UberObjSet" and add a Visibility pmodifier. Or duplicate the base Visibility pmodifier.

  2. Click OS. 4 new buttons show at the bottom, and the dropdown becomes an editable text box.

  3. Type "osSample" and press Enter.
    A new row shows at the bottom. Visibility pmodifier with the OS button, the osSample obj set and a new LayerSet line

    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.

  4. Start with the Nested LayerSet "allGeo_and_Lits". Set the 4th column to "NestedLayerSet". Then select "allGeo_and_Lits" in the 3rd column.
    Visibility pmodifier with the osSample obj set and the allGeo_and_Lits NestedLayerSet line, and the viewport with all the geometry

  5. Press Add to add a new row.

  6. Now remove the objects in the selection set "ssTest". These are the objects with a yellow wireframe. Select "SelectionSet" in the 4th column.

  7. Select "ssTest" in the 3rd column.

  8. 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. osSample obj set with a minus line for the sstest SelectionSet, so the sstest objects are gone from the viewport

  9. Now add the "T" objects again. Press Add.

  10. Set the row to "Pathname" and "T*". osSample obj set with a T* PathName line that adds back the objects whose names start with T

  11. Add more rows and try different combinations.

  12. Turn the check boxes on and off.

  13. 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.

  14. 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. Obj set lines with the empty space at the right end that selects a row

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

Thanks!