Last updated on
May 17, 2023
- Home
-
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
- 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
- Creative Cloud Applications
-
Renderers
- Converting Substance outputs
- Color Management
- Arnold
- Vray
- Renderman
- Redshift
- Maxwell
- Corona
- Octane
- Keyshot
- Thea
- Maverick
- Toolbag
- Cycles and Eevee
- Partnerships
C# Example Script
Changing Parameters
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Substance.Game;
public class scifiScript : MonoBehaviour
{
public Substance.Game.SubstanceGraph mySubstance;
// Use this for initialization
void Start ()
{
UpdateSubstance();
}
public void UpdateSubstance()
{
Color color = new Color(0.237f, 0.834f, 0.045f, 1.0f);
Vector2 panelSize = new Vector2(0.101f, 0.209f);
float wearLevel = 0.977f;
// panel color
mySubstance.SetInputColor("paint_color", color);
// panel size
mySubstance.SetInputVector2("square_open", panelSize);
// wear level
mySubstance.SetInputFloat("wear_level", wearLevel);
// queue for render
mySubstance.QueueForRender();
//render all substances async
Substance.Game.Substance.RenderSubstancesAsync();
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Substance.Game;
public class scifiScript : MonoBehaviour
{
public Substance.Game.SubstanceGraph mySubstance;
// Use this for initialization
void Start ()
{
UpdateSubstance();
}
public void UpdateSubstance()
{
Color color = new Color(0.237f, 0.834f, 0.045f, 1.0f);
Vector2 panelSize = new Vector2(0.101f, 0.209f);
float wearLevel = 0.977f;
// panel color
mySubstance.SetInputColor("paint_color", color);
// panel size
mySubstance.SetInputVector2("square_open", panelSize);
// wear level
mySubstance.SetInputFloat("wear_level", wearLevel);
// queue for render
mySubstance.QueueForRender();
//render all substances async
Substance.Game.Substance.RenderSubstancesAsync();
}
}
using System.Collections; using System.Collections.Generic; using UnityEngine; using Substance.Game; public class scifiScript : MonoBehaviour { public Substance.Game.SubstanceGraph mySubstance; // Use this for initialization void Start () { UpdateSubstance(); } public void UpdateSubstance() { Color color = new Color(0.237f, 0.834f, 0.045f, 1.0f); Vector2 panelSize = new Vector2(0.101f, 0.209f); float wearLevel = 0.977f; // panel color mySubstance.SetInputColor("paint_color", color); // panel size mySubstance.SetInputVector2("square_open", panelSize); // wear level mySubstance.SetInputFloat("wear_level", wearLevel); // queue for render mySubstance.QueueForRender(); //render all substances async Substance.Game.Substance.RenderSubstancesAsync(); } }
Duplicate graph
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SubstanceScript : MonoBehaviour
{
// Start is called before the first frame update
public Substance.Game.SubstanceGraph sgo;
public GameObject cube2;
public Color userColor;
private Substance.Game.SubstanceGraph sgo2 = null;
void Start()
{
//duplicate sgo
if(sgo2 == null)
{
sgo2 = sgo.Duplicate();//duplicate graph
sgo2.SetInputColor("paint_color",userColor);
cube2.GetComponent<Renderer>().sharedMaterial = sgo2.material;//set material
sgo2.QueueForRender();//queue for render
sgo2.RenderAsync();//render graph
Substance.Game.Substance.RenderSubstancesAsync();//render all substances async
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SubstanceScript : MonoBehaviour
{
// Start is called before the first frame update
public Substance.Game.SubstanceGraph sgo;
public GameObject cube2;
public Color userColor;
private Substance.Game.SubstanceGraph sgo2 = null;
void Start()
{
//duplicate sgo
if(sgo2 == null)
{
sgo2 = sgo.Duplicate();//duplicate graph
sgo2.SetInputColor("paint_color",userColor);
cube2.GetComponent<Renderer>().sharedMaterial = sgo2.material;//set material
sgo2.QueueForRender();//queue for render
sgo2.RenderAsync();//render graph
Substance.Game.Substance.RenderSubstancesAsync();//render all substances async
}
}
}
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SubstanceScript : MonoBehaviour { // Start is called before the first frame update public Substance.Game.SubstanceGraph sgo; public GameObject cube2; public Color userColor; private Substance.Game.SubstanceGraph sgo2 = null; void Start() { //duplicate sgo if(sgo2 == null) { sgo2 = sgo.Duplicate();//duplicate graph sgo2.SetInputColor("paint_color",userColor); cube2.GetComponent<Renderer>().sharedMaterial = sgo2.material;//set material sgo2.QueueForRender();//queue for render sgo2.RenderAsync();//render graph Substance.Game.Substance.RenderSubstancesAsync();//render all substances async } } }