Compound Filters
This feature lets you create a new type of filters that are represented as a single layer in the interface and be composed of multiples filters.
Supported since Substance Alchemist 2020.2 (2.2)
Description
A compound filter is .alchfilter description file using JSON formatting. It contains:
- Name: Label of the compound filter displayed in the interface
- Version: Incremental number to define the version of your compound filter.
- Node: List of filters to be used
- Link: List of connections between the different filters
Example
{ "AlchemistFilter": { "Name": "Example", "Version": 2, "Node": [ { "Id": "Preprocess", "InternalFilter": "Dirt" }, { "Id": "Process", "File": "foo.sbsar" }, { "Id": "PostProcess", "InternalFilter": "Dust" } ], "Link": [ { "From": { "Node": "FilterInput", "Usage": "baseColor" }, "To": { "Node": "Preprocess", "Usage": "baseColor"} }, { "From": { "Node": "FilterInput", "Usage": "normal" }, "To": { "Node": "Preprocess", "Usage": "normal"} }, { "From": { "Node": "Preprocess", "Usage": "baseColor" }, "To": { "Node": "Process", "Usage": "baseColor"} }, { "From": { "Node": "Process", "Usage": "baseColor" }, "To": { "Node": "PostProcess", "Usage": "baseColor"} }, { "From": { "Node": "Preprocess", "Usage": "normal" }, "To": { "Node": "PostProcess", "Usage": "normal"} }, { "From": { "Node": "PostProcess", "Usage": "baseColor" }, "To": { "Node": "FilterOutput", "Usage": "baseColor"} }, { "From": { "Node": "PostProcess", "Usage": "normal" }, "To": { "Node": "FilterOutput", "Usage": "normal"} } ] }}
Documentation
Version
Using a version number allows you to keep track of your different iterations. When opening a layer stack done with a previous version of your compound filter, a notification will be showed to suggest you to upgrade to the latest version.
Node
A node can refer to an internal filter of Substance Alchemist. Define a unique identifier Id to be used to define links between nodes and the label of the internal filter InternalFilter
{ "Id": "step1_identifier", "InternalFilter": "Dirt" }
A node can refer to a SBSAR file, not in Substance Alchemist. Define a unique identifier Id to be used to define links between nodes and the filename File of the SBSAR file. The SBSAR file has to be in a resources folder next to the .alchfilter file.
{ "Id": "step1_identifier", "File": "foo.sbsar" }
Link
A link is a description of how two nodes are linked and are composed of two elements:
- From: Usage to be used by the node
- To: Usage output of the node
Each element has 3 attributes:
- Node: Declare the Id of the node you want to use
- set the input of the compound filter, the node Id is FilterInput
- set the output of your compound layer, the node Id is FilterOutput
- Usage: Declare the usage you want to use. There are 3 options:
- Single usage at a time and declare link by link (baseColor, normal, height, ambientOcclusion, roughness, metallic, diffuse, specular, glossiness, specularLevel, opacity, emissive, scan1, ...)
- You can also specify a list ["baseColor", "normal"]. The first item of the list of From will match the first item of the list of To. etc...
- Use * to let Substance Alchemist does the matching between identical usages of all usages of the From node and the To node (It's not possible to combine * with another link, while single links and list links are possible between same nodes)
- Group: In case of a node has several times the same usage, you can use the Group attribute to select a specific usage. ie: For Blend filters, to get the baseColor of the bottom material use Material1 and to get the baseColor of the top material use Material2
Link between two nodes { "From": { "Node": "node1","Usage": "baseColor", "Group": ""}, "To": { "Node": "node2", "Usage": "baseColor"} } Link between outputs of layers below of the compound filter and the compound filter: { "From": { "Node": "FilterInput", "Usage": "*" }, "To": { "Node": "node1", "Usage": "*"} } Link to declare outputs of the compound filter: { "From": { "Node": "node1", "Usage": "*" }, "To": { "Node": "FilterOutput", "Usage": "*"} }
filterImg and filterMat can't be used as node Id