Rules can be added per mesh operation entry in the Mesh Match Rules
tab of the Mesh Operations
window. To create a new rule, select the (add) icon. Specify the Attribute
that needs to be matched and enter a Match Value
expression.
A Match Value consists of a relational operator followed by a number. Multiple expressions can be combined with the logical operator AND
. The following relational operators are supported:
<
less than<=
less than or equal to==
equal to>=
greater than or equal to>
greater thanThis example matches all meshes that have a bounding sphere radius that is greater or equal to 15 and less than 500 units.
Multiple rules can be added per mesh operation entry to match multiple attributes simultaneously. For a mesh operation to be executed on a mesh, at least one of the rules must match.
When specifying the attributes "Path", "Name", or other user-defined properties, rules use a regular expression instead of a relational expression to match the attributes. More information on the available attributes and how to set them up can also be found in the article Available attributes for rule-based matching.
User-defined attributes can be used by typing them into the
Attribute
box manually. To see all available custom attributes on a mesh, select theObject Inspector
window.
The new MeshMatchRules
JSON array property allows filtering meshes per mesh operation entry using rules that match attributes. An example JSON profile that utilizes match rules is shipped with InstaLOD Pipeline and can be found in the "Profiles" directory.
The following MeshMatchRule uses two attributes to match meshes. The first rule matches all meshes that have the material "lambert3" applied to it. Additionally, all meshes that have between 0 and 49 boundary vertices are also matched and processed through the mesh operation.
"MeshMatchRules" : [
{
"Description" : "Uses lambert3 material",
"Attribute" : "Mesh.Material.Name",
"MatchValue" : "lambert3",
"Enabled" : true
},
{
"Description" : "Less than 50 boundary vertices",
"Attribute" : "Mesh.Vertex.Boundary.Count",
"MatchValue" : ">=0 and <50",
"Enabled" : true
}
A full list of available attributes that can be used for mesh matching can be found in the article Available attributes for rule-based matching.