About
The Substance integration introduces a few new elements. These elements are:
The Substance asset references a Substance archive file (.sbsar) and stores its set of current parameter values.
The Substance shader references a Substance asset.
The Substance preset is used to store a Substance asset including the Substance archive file and a parameter set in the Content Browser.
These elements are typically handled with the functions described in Substance Functions Manual .
Substance Assets
A Substance asset is not represented by a dedicated class. Instead a basic BaseList2D element is used. The parameter IDs are stored in nsubstanceasset.h
.
Note To get the parameter IDs of input parameters use GetSubstanceInput() . To get the IDs of the output channels use GetSubstanceOutput() .
Substance Shader
The Substance shader references a Substance asset and a selected output channel in Cinema 4D 's material system (or all other places, where shaders can be used). The parameters are defined in xsubstance.h
.
See also Materials and Shaders Overview .
if (shader == nullptr )
void * output = nullptr ;
do
{
output =
GetSubstanceOutput (substance, graph, output, outputID, type, outputName,
nullptr );
const Bool validOutput = output !=
nullptr ;
if (validOutput && typeIsBump)
{
}
} while (output != nullptr );
Substance Presets
Substance presets can be stored in the Content Browser.
Substance Preferences
The Substance preferences define the type and behaviour of the integrated Substance Engine and influence the workflow of working with Substance assets. The parameters are defined in prefssubstance.h
.
Further Reading
Bool GetBool(void) const
Definition: c4d_gedata.h:405
Definition: c4d_basechannel.h:31
Definition: Nsubstanceasset.h:12
void SetInt32(Int32 id, Int32 l)
Definition: c4d_basecontainer.h:501
maxon::UInt32 UInt32
Definition: ge_sys_math.h:46
Definition: Nsubstanceasset.h:9
BaseContainer * GetContainerInstance(Int32 id)
Definition: c4d_basecontainer.h:421
Definition: mmaterial.h:34
Definition: Nsubstanceasset.h:8
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
Definition: Xsubstance.h:8
SUBSTANCE_OUTPUT_TYPE
Definition: lib_substance.h:311
Definition: mmaterial.h:278
String GetString(void) const
Definition: c4d_string.h:36
void * GetSubstanceOutput(BaseList2D *const asset, void *const graph, void *const prevOutput, UInt32 &outputUid, SUBSTANCE_OUTPUT_TYPE &type, String &name, BaseBitmap **bmpPtr)
Bool SetParameter(const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
Represents a level within a DescID.
Definition: lib_description.h:274
Definition: c4d_gedata.h:77
const Filename & GetFilename(void) const
Definition: c4d_gedata.h:459
maxon::Int32 Int32
Definition: ge_sys_math.h:45
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:209
static const Int32 ID_SUBSTANCE_ASSET
ID of the Substance asset.
Definition: lib_substance.h:167
Definition: prefssubstance.h:16
const String & GetString(void) const
Definition: c4d_gedata.h:447
BaseShader * CreateSubstanceShader(BaseList2D *const asset)
Definition: prefssubstance.h:15
maxon::Bool Bool
Definition: ge_sys_math.h:40
Definition: c4d_basecontainer.h:42
void InsertShader(BaseShader *shader, BaseShader *pred=nullptr)
Definition: c4d_baselist.h:2469
static const Int32 ID_SUBSTANCE_PREFERENCES
ID of Substance preferences.
Definition: lib_substance.h:170