Create a variable of type Substance Instance Factory and set the default value to the Imported Substance Factory.
- Substance 3D home
- Ecosystems and Plugins
- Home
- Game Engines
- Unreal Engine
- Unreal Engine 5
- Unreal Engine 5 overview
- Unreal Engine 5 Release Notes
- Plugin Overview - UE5
- Plugin Settings - UE5
- Substance Input Image - UE5
- Material Instance Definition - UE5
- Material Template Usage - UE5
- Out-of-the-Box Material Templates
- Tiling Substance - UE5
- Substance 3D Plugin Default Templates
- Substance 3D Assets Library Usage - UE5
- Blueprints - UE5
- Unreal Engine 5 Scripting
- Installing to Source Builds
- Unreal Engine 5 overview
- Unreal Engine 4
- Unreal Engine 4 overview
- Unreal Engine 4 plugin release notes
- Unreal plugin 4.27.0.1
- Unreal plugin 4.26.0.21
- Unreal plugin 4.26.0.2
- Unreal plugin 4.26.0.1
- Unreal plugin 4.25.0.5
- Unreal plugin 4.25.0.4
- Unreal plugin 4.25.0.3
- Unreal plugin 4.24.0.3
- Unreal plugin 4.23.0.2
- Unreal plugin 4.23.0.1
- Unreal plugin 4.22.0.33
- Unreal plugin 4.22.0.32
- Unreal plugin 4.21.0.31
- Plugin Overview - UE4
- Plugin Settings - UE4
- Substance Input Image - UE4
- Material Instance Definition - UE4
- Tiling Substance - UE4
- Working with Bump Offset (Parallax) - UE4
- Working with Displacement - UE4
- Source in UE4
- Live Link in UE4
- Blueprints - UE4
- Unreal Engine 4 Scripting
- Unreal Engine 4 overview
- Unreal Engine 5
- Unity
- Unity overview
- Unity Release Notes
- Downloading Substance 3D Plugin in Unity
- Unity Plugin Overview
- Unity Preferences
- Optimization Guidelines
- Upgrading Projects/Known Issues
- Managing Substance Graphs
- Changing parameters
- Generated Textures (Packing)
- Rendering Color Space
- Using Image Inputs
- Publishing for Mobile
- Substance 3D for Unity Scripting
- Scripting in Unity (Deprecated)
- API Overview
- Scripting API
- C# Example Script
- Substance 3D Assets Library Usage
- Removing Substance Plugin
- Substance 3D in Unity Tutorials
- Physical Size in Unity
- Sharing sbsar Files Between Projects
- Unity overview
- Lumberyard
- Roblox
- Unreal Engine
- 3D Applications
- Maya
- 3ds Max
- MODO
- MODO overview
- Modo Plugin Release Notes
- Substance in MODO Overview
- Modo Installation
- Parameters
- Custom Materials
- Working with Normals
- Working with Emissive
- Bump and Displacement
- Working with References
- Animating Substances
- Copy/Duplicate Substance
- Environment and Rendering Setup
- Modo Switch Engine
- Tiling Modo textures
- MODO overview
- Cinema 4D
- Houdini
- Blender
- Blender overview
- Release Notes
- Substance in Blender Overview
- Downloading and Installing the Plugin
- Preferences
- The Substance 3D Panel
- Shortcuts and Navigation
- Workflows
- Physical size in Blender
- Substance 3D Assets Library
- Troubleshooting
- Uninstalling the Add-on
- Substance 3D Add-on for Blender Tutorials
- Blender overview
- Creative Cloud Applications
- Renderers
- Partnerships
Blueprint(UE4): Dynamic Material Instance
You can create a Substance Graph Instance to create a Dynamic Graph Instance at runtime.
-
-
Add a Create Graph Instance node and plug the Substance Instance Factory into the Factory input. Set an Instance name.
-
Create another variable of type Substance Instance Factory. This will hold a references to the dynamic substance material.
-
Set the variable for the dynamic substance material with the return value of the Create Graph Instance node.
-
Create a variable of type Material. This will be the material template. In the Content Browser, make a duplicate of the UE4 material generated by the Substance. Set this duplicated material as the input for the material template variable.
-
Add a Create Dynamic Material Instance and set the Material Template variable as the parent.
-
Create a variable of type Material. This will be the Material Instance Dynamic (MID). Set the return value of the Dynamic Material Instance to the variable.
-
Add a Set Material Node and set the value of the MID variable as the Material Input. For the target, set it to the object you want to apply the material.
-
Create a variable of type Name. This variable will hold the name for the channels set in the material. Initialize this with a value of "NONE"
-
Add a Get Substance Textures node and set the Graph Instance to the Dynamic Graph Instance variable.
-
Add a For Loop node. Here you loop through the Substance Textures. Take the result of the Get Substance Textures as the input array.
-
Add a Substance Get Channel node with the array element from the for loop as input.
-
Add a Sequence node. Here we will first run the result of the Get Channel node.
-
Add a Switch on ESubChannelType after the Sequence Then 0 with the Get Channel return value as the Selection. Here we check the channels names.
-
Set the MID Name variable to the channel names in the duplicated Substance Material from step 5. See the material image.
-
In the Sequence node Then 1, you will set up the process of assigning the channel names to the dynamic material.
-
Get the MID name variable and add an equal string node with a value of "NONE" This is the value will initialized the variable.
-
Add a Branch Node with the Condition from the Equal node.
-
Add a Substance Set Texture Parameter Value. The target is the MID variable and the parameter name is the MID name variable. The Value is the Array Element from the ForEachLoop Node.