Path expressions and filtering
Paths
Each Element in a Scene has a unique path which includes its name and every group it is placed under, if any. This path starts at the Scene root and its syntax follows traditional file systems.
For instance, the Element 'cylinder' in the group 'simple_shapes' will have the following path:
/simple_shapes/cylinder
Syntax
Scene root
In the example above, note that the path starts with a /
character. This represents the Scene root. Know that all Elements of a Scene are always one level or more under the root.
Example
In a Scene containing nothing else than a Mesh Item named 'sphere', the full path of that Item is: /sphere
The level at which an Element stands under the root will be discussed as depth in this section, such as:
- An Element named 'cylinder' just under the root is at depth 1 has the name:
/sphere
- An Element named 'cube' in the 'torus' group is at depth 2 and has the name:
/torus/cube
- An Element named 'cone' in the 'knot' group which is itself in the 'box' group is at depth 3 and has the name:
/box/knot/cone
Forbidden names
The following rules apply for naming Elements:
- The name should not include spaces nor any of the following characters:
[ ] ' “ * | : < > / \ ?
- The name should not start with a number
Note: *
cannot be used specifically because it is a wildcard, learn more below.
Path expressions
A significant number of nodes available for Substance model graphs let you specify which Elements should be impacted by the effect of the node. To identify these Elements in input Scenes, these nodes include parameters which let you input a path expression.
These expressions function as name templates which are compared against Elements' paths, so that each Element which full path meet the criteria of a given template receive the effect of the node.
Wildcards
To match multiple Elements' paths with a single path expression, you may use the wildcard character: *
A wildcard character is a symbol which stands for any single or chain of characters. It can be used to match an entire name or only a part of it.
Examples
- Match all Elements at depth 1:
/*
- Match all Elements at depth 1 which name starts with 'sph':
/sph*
- Match all Elements at depth 1 which name ends with 'ere':
/*ere
- Match all Elements at depth 2 which name includes a 't' in the middle:
/*/*t*
The wildcard can be doubled ( **
) to match any substring. A substring is a chain of characters which traverses multiple depths.
Examples
- Match Elements at any depth which are in a group named 'torus':
/**/torus/*
- Match Element 'sphere' at any depth under the group 'cone':
/cone/**/sphere
- Match any Element which is at any depth lower than 1:
/**/*