Find the Presentation State That’s Hiding in Plain Sight

A molecular scene can become difficult to inspect when presentation nodes have different visibility or selection states. You may know that an object is present, but still need a reliable way to locate presentations that are visible, hidden, selected, or carrying a particular name. SAMSON’s Node Specification Language (NSL) provides presentation attributes for describing those states in queries.

The first useful detail is scope: the presentation attribute space, abbreviated pr, matches only presentation nodes. That makes it a practical starting point when your question is about how something is presented, rather than about other kinds of nodes. The examples below use individual expressions so you can inspect each attribute separately.

Start with the state you need

To find presentation nodes whose visible attribute is true, use pr.v. To match the opposite value, use not pr.v. The full attribute name is visible; v is its short name. If you prefer to make a query easier to read later, use the full name where supported by your NSL workflow and keep the short name for compact expressions.

The reference also lists hidden, with the short name h. Its examples are pr.h and not pr.h. Although the names “hidden” and “visible” sound like opposites, they are separate attributes in the reference. When the distinction matters, query the attribute you actually want to inspect rather than assuming one expression is interchangeable with the other.

Selection has two useful attributes

For the selected state, use pr.selected or not pr.selected. The presentation version of selected has no short name in this attribute space. That is an easy detail to miss if you are accustomed to short forms: the node attribute space has a short name for selected, but the presentation reference explicitly says it is not available here.

There is also selectionFlag, abbreviated sf, with examples pr.sf and pr.sf false. Keep the attribute names distinct in your queries: the documentation lists both selected and selectionFlag, so a query for one should not be treated as a query for the other.

Use names to narrow your inspection

When state alone returns more nodes than you want to review, the inherited name attribute can help identify presentations by name. The short form is n, and names are written in quotes. The reference gives pr.n "A" and pr.n "L*" as examples. These are useful examples to keep nearby when building a name-based expression; consult the NSL examples if you need more guidance on matching behavior.

A small, dependable workflow

  1. Decide what you are checking: visibility, hidden state, selection, selection flag, or name.

  2. Use the matching presentation attribute, such as pr.v, pr.selected, or pr.sf false.

  3. Check the result before drawing conclusions. Similar-sounding attributes are listed separately and may represent different things.

  4. If the result is too broad, inspect a name-based example such as pr.n "A".

This attribute reference is especially handy when troubleshooting a scene: instead of relying only on what you can see in the viewport, you can describe the presentation state you want to inspect. For the complete attribute list and inherited definitions, see the SAMSON presentation attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.