renderStacks

⌘K
  1. Home
  2. Docs
  3. renderStacks
  4. Tutorials
  5. 2. Selecting Objects / Visibility Pmodifier

2. Selecting Objects / Visibility Pmodifier

In the first tutorial, we checked Camera, Resolution and Frame Range pmodifiers. Another most used pmodifier is Visibility pmodifier which controls which objects to show and hide for the rendering.

Use this pmodifier to define what to render. NEVER USE “REDERABLE” property to control what to render. If you don’t want/need render. You should not see in viewport either.

To use Visibility pmodifier, we need to know how to defined object selection in the renderStacks which is a unified dynamic object selection method for all pmodifiers.

Let’s open the renderStacks_Tut_001.max file again. If you have saved renderSTacks data file when you follow the previous tutorial. Go File menu and click Reset.

Making a Visibility Pmodifier

  1. Make a pass “Teapots”.
    Add a Visibility pmodifier

    Visibility pmodifier allow you to hide/unhide objects per pass. Whatever object you defined in the above unified object selection UI will be shown in viewport, and all other objects are hidden.
    renderStacks support 8 ways to define a set of objects. Form the left to the right, LS(LayerSet),nLS(Nested LayerSet), Lyr(Layer), nLy(Nested Layer), SS(Selection Set), PN(Pathname), All, OS(Object Set)

    Among all 8 methods, I recommenced to use Layer Sets. It is like a selection for layers. With Layer Set, you don’t have to micro manage every single objects. Also even when objects internal id changes like making a new object for same name or re-merging the same name object, you don’t have to re-define the selection as long as you put objects in the same layer.

Making a Layer Set

For “Teapots” pass. We want to render all teapots and the cylinder base. Let’s make a layer set for that.

  1. Open Layer Explorer.
  2. Expand All.
    In the Visibility pmodifier, click LS button.
  3. Then, right click LS button to open Layer Set editor. You will see the layer trees.
  4. Select “base” and press CTRL and select “teapots”.
  5. In the dropdown, type “Teapots” which will be a new layer set name, and press Enter. The newly made layer set name, “Teapots” will show up between dropdown and buttons. That area is a display area for the currently selected layer set name.

  6. Because we open this Layer Set editor from a pmodifier, you can directly assign the “Teapots” layer set to the Visibility pmodifier using “Apply” button.

  7. Press the Apply button. You can see “Teapots” layer set in the dropdown. Also in the viewport only teapots and cylinder platform is shown now.

  8. Check the Layer Explorer. You can see only “base” and “teapots layer” are turned on. But, you can also see that “Geos ” and “stuff” layers are turned on. Why? We didn’t include those in “Teapots” layer set. It is because a parent layer is always override child layer in 3dsMax nested layer system. We can not just turn on “base” layer without turning on “Geos” layer.

    For Visibility pmodifier, renderStacks will always automatically take care this nested layer on/off.

Making a Nested Layer Set

  1. Make a new pass, “AllGeos”
  2. Select the “Base_Visibility” pmodifier in “AllGeos” pass.
  3. Press Duplicate Nodes button. This is a quick way to localize base pmodifier.
  4. You can see the the Visibility pmodifier is turn to white(local pmodifier) and the number at the end has been changed.

  5.  Click nLS(nested Layer Set) button.
  6. Right click to open Layer Set Editor.
  7. We want to show all geometries and lights. But, We don’t want to show camera.
    Select “02_Lights” and “Geos”.
  8. Type “allGeo_and_Lits” in the dropdown.
  9. Press Enter.
  10. Press Apply button.

    If you set layer set as a nested layer set, all the children layers of layers in the layer will be used. Therefore, when you select “Geos” layer, all children layers of “Geos” layer will be turned on. Now you can see that all geometries and lights are unbidden. But, all camera are hidden.

Using Single Layer and Its Nested Layer

OK, it is cool to be able to make a layer set. But, what if I have everything I need in a layer? Do I have to make a new layer set for just one layer? Is that even a set? For the lazy users like you, renderStacks has Lyr(layer) and nLyr(nested layer) as object selection, too.

  1. Make “Tubes” Pass and add a Visibility pmodifier or dup the “Teapots pass”.
  2. Select “Lyr”.
  3. Open the dropdown under “Lyr”. You will see all layers in the scene.
  4. Choose “Tubes”
  5. Only pineapples in the “Tubes” are shown in the viewport.

  6. Make “Stuff” Pass with a Visibility pmodifier. You better know how to do this at this point. 🙂
  7. Open the new Visibility pmodifier.
  8. Select “nLyr”.
  9. Open the dropdown under “nLyr”. You will see all layers in the scene.
  10. Choose “stuff”. Everything under “stuff” layer will be shown.

Selection Set

You can also use 3dsMax’s built-in selection set and use built-in tools to make and edit selection set.

  1. Make “ssSample” Pass and add a Visibility pmodifier or dup the base Visibility pmodifier.
  2. Select “SS”.
  3. I already made “sstest” selection set in the file. Choose “sstest” from the dropdown.
  4. You can see 4 objects with yellow wireframe are shown.

Pathname

In Maxscript, pathname is a way to name objects with hierarchy or pattern matching. Basically it allow You to select object with wild card character.
For details about pathname, please check 3dsMax help Help.

  1. Make “Ts” Pass and add a Visibility pmodifier or dup the base Visibility pmodifier.
  2. Select “PN”.
  3. Right click “PN” button to open Set Editor.
    “Pathname” should be already selected.
  4. Type “T*” in the button textbox.
  5. Then, press Add Set button.
    The new pathname will be shown in the list.

  6. Close Set Editor.
  7. Choose just added pathname from the dropdown under “PN” button.
  8. Now all the object whose name started with “T” will be shown in the viewport.

ObjSet

This is a uber object selection method. It allows you to mix and match all above 7 ways to select objects. With this feature, you don’t have to make a new LayerSet that combines multiple LayerSet or exclude one or two objects from LayerSet without moving objects out from the current layers. This certainly allow you very powerful way to selecting objects. But, I highly recommend not to go too crazy with this.

  1. Make pass “UberObjSet” and add a Visibility pmodifier or dup the base Visibility pmodifier.
  2. Click “OS”. You will see 4 new buttons at the bottom, and the dropdown change to editable textbox.
  3. Type “osSample” and press Enter.
    A new line will pop up at the button.

    Each line has 4 columns.
    The first checkbox allow you to temporarily enable/disable the entry
    +/- button means add/subtract3rd and 4th is set name and set type. You need to select set type first then 3rd column content will updated.

  4. Let’s start with nested layer set “allGeo_and_Lits”. Change 4th column to “NestedLayerSet”. Then, choose “allGeo_and_Lits” from 3rd column.
  5. Press “Add” to add another line.
  6. Let’s remove objects in “ssTest” selection set. All yellow wireframe color objects are them. Select “SelectionSet” from 4th column.
  7. Choose “ssTest” from 4rd column.
  8. Then, press [+] button on 2nd column. The button will change to [-], and all the objects with yellow wireframes are gone.
    This is a basic workflow of ObjSet. You stack each object selection method to add or remove objects from selection. As always the evaluation order is from top to bottom.
  9. Let’s bring back out T’s. Press “Add”.
  10. Set as “Pathname” and “T*”
  11. Got it? Add more entries and try various combinations as you want!

  • Try to turn on/off the checkboxes.
  • You can select multiple rows and “Remove” at once. But, you can only move up and down one at a time.
  • Because most row spaces are dropdown. Sometimes it is hard to just select a row to delete or move. For that, there is a little empty space at the right end. If you just want to select rows, click that area.

OK, I think this is it for object selection method. Yes, I know I didn’t explain “All”. But, do you really need an explanation for that?

Thanks!