Pipeline commands
Introduction
A fundamental part of this "Preview" version of the plugin is the new Pipeline
settings system that was introduced in Simplygon 8.3. SPL-
and Preset-files
are no longer supported and will be deprecated in future versions of Simplygon. Pipeline-objects has a one-to-one settings mapping to the Simplygon API, please refer to the API documentation for information about the individual settings. The purpose of the Pipeline command is to expose methods for creating and modifying Pipeline-files through Maya, providing unprecedented flexibility and direct access for all users.
Commands and flags
The following list describes all supported commands and flags.
Command |
---|
Pipeline |
Short | Long | Parameter(s) | Description |
---|---|---|---|
-c |
-Create |
string pipelineType |
Creates a pipeline of the specified type. |
-d |
-Delete |
int pipelineId |
Deletes the pipeline. |
-c |
-Clear |
<none> | Clears all pipelines that has been loaded or created by Create . |
-l |
-Load |
string inputPath |
Loads a pipeline-file. |
-s |
-Save |
int pipelineId string outputPath |
Saves pipeline to file. |
-ss |
-SetSetting |
int pipelineId string parameterPath <T> parameterValue |
Sets the value of the specified pipeline parameter. ( string , bool , int , double , float ) |
-gs |
-GetSetting |
int pipelineId string parameterPath |
Gets the value of the specified pipeline parameter. |
-t |
-GetType |
int pipelineId |
Gets the type of the specified pipeline. ( ReductionPipeline , AggregationPipeline , RemeshingPipeline , ...) |
-a |
-GetPipelines |
<none> | Gets all pipeline ids that are loaded or created by Create . |
-amc |
-AddMaterialCaster |
int pipelineId string materialCasterType |
Adds a material-caster to the specified pipeline. ( ColorCaster , NormalCaster , ...) |
Examples
This section contains various Pipeline examples written in MEL and Python. We've left out some aprts of the scripts to keep things as simple as possible.
import maya.cmds as cmds
must be declared at the top of each Python script.reductionPipeline
settings-path must be declared for both MEL and Python scripts where it makes scense.- a scene-selection is made before each
Simplygon
-command.
Create a Pipeline object
Creates a ReductionPipeline
, other supported pipelines are AggregationPipeline
and RemeshingPipeline
.
MEL
$reductionPipeline = `Pipeline -c "ReductionPipeline"`;
Python
reductionPipeline = cmds.Pipeline(c = "ReductionPipeline")
Load / save a Pipeline object
Loads a Pipeline object from file and then saves it.
MEL
$reductionPipeline = `Pipeline -l "D:/Pipelines/reductionPipeline.json"`;
Pipeline -s $reductionPipeline "D:/Pipelines/reductionPipeline.json";
Python
reductionPipeline = cmds.Pipeline(l = "D:/Pipelines/reductionPipeline.json")
cmds.Pipeline(s = [reductionPipeline, "D:/Pipelines/reductionPipeline.json"])
Get / Set Pipeline settings
Currently we support three Pipelines: ReductionPipeline
, AggregationPipeline
and RemeshingPipeline
. These Pipelines can be created by the c
-flag (Create
) in combination with the type name of the Pipeline.
Each Pipeline has settings which reflects the settings for the specific Processor in the Simplygon API. ReductionPipeline contains a ReductionProcessor which contains ReductionSettings while for example the RemeshingProcessor has RemeshingSettings.
MaterialCaster
is a separate object that is located inside the Pipelines, which contains the settings for material baking.
To set a reduction setting for a ReductionPipeline
, let's say TriangleRatio
, we will have to pinpoint the path to the specific setting. Pipeline
is the command we use to work with settings, to set a setting we use the ss
-flag (SetSetting
). The first input is the Pipeline-object, the second is the settings-path and the third is the value we want to set. Fetching a value of a setting works the same way, except that it returns the value of the given settings-path instead of setting it, the flag for fetching a settings value is gs
(GetSetting
).
A settings-path can start with a Processor, MaterialCaster, or any other first level object. In this case we want to set a setting in the ReductionProcessor
, which is the first part of the path, the second part is the settings-object which in this case is Reduction
. And at also, the parameter we want to set is named TriangleRatio
. Let's set the value of TriangleRatio
to 50% (0.5).
// sets the TriangleRatio for the given ReductionPipeline
Pipeline -ss $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio" 0.5;
// gets the TriangleRatio from the given ReductionPipeline
$triangleRatio = `Pipeline -gs $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio"`;
The same goes for TextureWidth
and TextureHeight
, which are part of the MappingImage
settings-object. In most cases we only use one mapping image, thus Output0
which is allocated by default. Let's set them to 512x512 pixels.
// sets the Texture-width for the given ReductionPipeline
Pipeline -ss $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureWidth" 512;
// gets the Texture-width for the given ReductionPipeline
$textureWidth = `Pipeline -gs $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureWidth"`;
// sets the Texture-height for the given ReductionPipeline
Pipeline -ss $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureHeight" 512;
// gets the Texture-height for the given ReductionPipeline
$textureHeight = `Pipeline -gs $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureHeight"`;
For material baking the initial object is MaterialCaster
, and as there aren't any casters by default they will have to be created with the amc
(AddMaterialCaster
) flag. There after we can use the index and type of the caster to access its parameters.
// add a ColorCaster to the given ReductionPipeline
$bCasterAdded = `Pipeline -amc $reductionPipeline "ColorCaster"`;
// set the MaterialChannel to "Diffuse" for the given ColorCaster
Pipeline -ss $reductionPipeline "MaterialCaster/0/ColorCaster/MaterialChannel" "Diffuse";
// get the MaterialChannel for the given ColorCaster
$colorCaster0 = `Pipeline -gs $reductionPipeline "MaterialCaster/0/ColorCaster/MaterialChannel"`;
// add a NormalCaster to the given ReductionPipeline
$bCasterAdded = `Pipeline -amc $reductionPipeline "NormalCaster"`;
// set the MaterialChannel to "Diffuse" for the given NormalCaster
Pipeline -ss $reductionPipeline "MaterialCaster/1/NormalCaster/MaterialChannel" "Normals";
// get the MaterialChannel for the given NormalCaster
$normalCaster1 = `Pipeline -gs $reductionPipeline "MaterialCaster/1/NormalCaster/MaterialChannel"`;
// set the tangent-space flag for the given NormalCaster
Pipeline -ss $reductionPipeline "MaterialCaster/1/NormalCaster/GenerateTangentSpaceNormals" true;
// get the tangent-space flag for the given NormalCaster
$generateTangentSpaceNormals = `Pipeline -gs $reductionPipeline "MaterialCaster/1/NormalCaster/GenerateTangentSpaceNormals"`;
For more information about the structure of Pipelines, see the Pipeline API documentation. There are also three examples on how to create a ReductionPipeline, AggregationPipeline and RemeshingPipeline and set some of its settings at the end of this document.
Run a Pipeline
// load an asset
file -f -options "v=0;" -ignoreVersion -typ "mayaBinary" -o "D:/Assets/SomeAsset.mb";
// select everything in scene
select -all;
// load previously saved pipeline
$reductionPipeline = `Pipeline -l "D:/Pipelines/reductionPipeline.json"`;
// execute pipeline on selection,
// returns result to Maya once completed
Simplygon -so $reductionPipeline;
// clear all pipelines
Pipeline -cl;
Pipeline LOD-chain (based on original asset)
The example below execute Simplygon three times in a loop, where each optimization (in this case Reduction
) is based on the original asset. This is accomplished by simply overriding the TriangleCount
each loop before sending the asset off to Simplygon.
// load an asset
file -f -options "v=0;" -ignoreVersion -typ "mayaBinary" -o "D:/Assets/SomeAsset.mb";
// select everything in scene
select -all;
// load previously saved pipeline
$reductionPipeline = `Pipeline -l "D:/Pipelines/reductionPipeline.json"`;
// override triangle ratio to 100%
Pipeline -ss $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio" 1.0;
// loop 3 times,
// 1 - reduce original asset to 100 - 25 = 75% (LOD1)
// 2 - reduce original asset to 75 - 25 = 50% (LOD2)
// 3 - reduce original asset to 50 - 25 = 25% (LOD3)
for( $i = 0; $i < 3; ++$i )
{
// fetch current triangle ratio
$triangleRatio = `Pipeline -gs $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio"`;
// subtract triangle ratio by 25%
Pipeline -ss $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio" ($triangleRatio - 0.25);
// execute pipeline on selection,
// returns result to Maya once completed
Simplygon -so $reductionPipeline;
}
// clear all pipelines
Pipeline -cl;
Pipeline LOD-chain (cascaded / based on previous LOD)
The example below execute Simplygon three times in a loop, where each optimization (in this case Reduction
) is based on the previously optimized result (except the first which is based on the original asset). This behaviour can be accomplished by overriding the TriangleCount
one time before the loop, then in the loop execute Simplygon and after each optimization select the resulting meshes returned from the Simplygon call (which will be the source for the next iteration).
// load an asset
file -f -options "v=0;" -ignoreVersion -typ "mayaBinary" -o "D:/Assets/SomeAsset.mb";
// select everything in scene
select -all;
// load previously saved pipeline
$reductionPipeline = `Pipeline -l "D:/Pipelines/reductionPipeline.json"`;
// override reduction ratio to 75%
Pipeline -ss $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio" 0.75;
// loop 3 times,
// 1 - reduce original asset by 25%
// 2 - reduce LOD1 by 25%
// 3 - reduce LOD2 by 25%
for( $i = 0; $i < 3; ++$i )
{
// execute pipeline on selection,
// returns result to Maya once completed
string $processedMeshes[] = `Simplygon -so $reductionPipeline`;
// clear selection
select -cl;
// select optimized meshes returned by Simplygon,
// they will be the source in the next iteration
for($m in $processedMeshes)
{
select -add $m;
}
}
// clear all pipelines
Pipeline -cl;
Simple Reduction Pipeline
This example shows how to create a new ReductionPipeline
and how to set basic parameters for reduction and material baking.
// create a Reduction Pipeline object
$reductionPipeline = `Pipeline -c "ReductionPipeline"`;
// set the triangle ratio to 50%
Pipeline -ss $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio" 0.5;
$triangleRatio = `Pipeline -gs $reductionPipeline "ReductionProcessor/Reduction/TriangleRatio"`;
print ("TriangleRatio: " + $triangleRatio + "\n");
// more settings can be set for the Reduction pipeline,
// see Pipeline documentation and/or inspect the generated file
// that is saved out by this script!
// set bMaterialBake to true to enable material baking,
// if material baking is enabled Simplygon will generate
// a new material (with textures) shared by all the optimized meshes.
$bMaterialBake = true;
if($bMaterialBake)
{
// enable material baking
// mapping image is required for material baking
Pipeline -ss $reductionPipeline "ReductionProcessor/MappingImage/GenerateMappingImage" true;
$generateMappingImage = `Pipeline -gs $reductionPipeline "ReductionProcessor/MappingImage/GenerateMappingImage"`;
print ("GenerateMappingImage: " + $generateMappingImage + "\n");
// in this case we want to generate texture coordinates (UVs)
Pipeline -ss $reductionPipeline "ReductionProcessor/MappingImage/GenerateTexCoords" true;
$generateTexCoords = `Pipeline -gs $reductionPipeline "ReductionProcessor/MappingImage/GenerateTexCoords"`;
print ("GenerateTexCoords: " + $generateTexCoords + "\n");
// the name of the resulting texture coordinate field
Pipeline -ss $reductionPipeline "ReductionProcessor/MappingImage/TexCoordLevelName" "MaterialLOD";
$texCoordLevel = `Pipeline -gs $reductionPipeline "ReductionProcessor/MappingImage/TexCoordLevelName"`;
print ("TexCoordLevelName: " + $texCoordLevel + "\n");
// width of the baked textures
Pipeline -ss $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureWidth" 512;
$textureWidth = `Pipeline -gs $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureWidth"`;
print ("TextureWidth: " + $textureWidth + "\n");
// height of the baked textures
Pipeline -ss $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureHeight" 512;
$textureHeight = `Pipeline -gs $reductionPipeline "ReductionProcessor/MappingImage/Output0/TextureHeight"`;
print ("TextureHeight: " + $textureHeight + "\n");
// add material casters (ambient, diffuse, specular and normals)
$bCasterAdded = `Pipeline -amc $reductionPipeline "ColorCaster"`;
Pipeline -ss $reductionPipeline "MaterialCaster/0/ColorCaster/MaterialChannel" "Ambient";
$colorCaster0 = `Pipeline -gs $reductionPipeline "MaterialCaster/0/ColorCaster/MaterialChannel"`;
print ("ColorCaster0: " + $colorCaster0 + "\n");
$bCasterAdded = `Pipeline -amc $reductionPipeline "ColorCaster"`;
Pipeline -ss $reductionPipeline "MaterialCaster/1/ColorCaster/MaterialChannel" "Diffuse";
$colorCaster1 = `Pipeline -gs $reductionPipeline "MaterialCaster/1/ColorCaster/MaterialChannel"`;
print ("ColorCaster1: " + $colorCaster1 + "\n");
$bCasterAdded = `Pipeline -amc $reductionPipeline "ColorCaster"`;
Pipeline -ss $reductionPipeline "MaterialCaster/2/ColorCaster/MaterialChannel" "Specular";
$colorCaster2 = `Pipeline -gs $reductionPipeline "MaterialCaster/2/ColorCaster/MaterialChannel"`;
print ("ColorCaster2: " + $colorCaster2 + "\n");
// note: normal caster for normals!
$bCasterAdded = `Pipeline -amc $reductionPipeline "NormalCaster"`;
Pipeline -ss $reductionPipeline "MaterialCaster/3/NormalCaster/MaterialChannel" "Normals";
$normalCaster3 = `Pipeline -gs $reductionPipeline "MaterialCaster/3/NormalCaster/MaterialChannel"`;
print ("NormalCaster3: " + $normalCaster3 + "\n");
// set the correct tangent space type,
// in this example we use tangent space normals
Pipeline -ss $reductionPipeline "MaterialCaster/3/NormalCaster/GenerateTangentSpaceNormals" true;
$generateTangentSpaceNormals = `Pipeline -gs $reductionPipeline "MaterialCaster/3/NormalCaster/GenerateTangentSpaceNormals"`;
print ("GenerateTangentSpaceNormals: " + $generateTangentSpaceNormals + "\n");
}
// save the generated Pipeline object to file for later use
Pipeline -s $reductionPipeline "D:/Pipelines/Reduction_With_Baking.json";
// clear all pipelines
Pipeline -cl;
Simple Aggregation Pipeline
This example shows how to create a new AggregationPipeline
and how to set basic parameters for Aggregation as well as material baking.
// create a Aggregation Pipeline object
$aggregationPipeline = `Pipeline -c "AggregationPipeline"`;
// merge geometries
Pipeline -ss $aggregationPipeline "AggregationProcessor/Aggregation/MergeGeometries" true;
$mergeGeometries = `Pipeline -gs $aggregationPipeline "AggregationProcessor/Aggregation/MergeGeometries"`;
print ("MergeGeometries: " + $mergeGeometries + "\n");
// more settings can be set for the Aggregation pipeline,
// see Pipeline documentation and/or inspect the generated file
// that is saved out by this script!
// set bMaterialBake to true to enable material baking,
// if material baking is enabled Simplygon will generate
// a new material (with textures) shared by all the optimized meshes.
$bMaterialBake = true;
if($bMaterialBake == false)
{
// do not merge materials if no baking,
// in this case we want to maintain the original materials/ids
Pipeline -ss $aggregationPipeline "AggregationProcessor/Aggregation/MergeMaterials" false;
$mergeMaterials = `Pipeline -gs $aggregationPipeline "AggregationProcessor/Aggregation/MergeMaterials"`;
print ("MergeMaterials: " + $mergeMaterials + "\n");
}
else
{
// merge materials/ids when material bake
Pipeline -ss $aggregationPipeline "AggregationProcessor/Aggregation/MergeMaterials" true;
$mergeMaterials = `Pipeline -gs $aggregationPipeline "AggregationProcessor/Aggregation/MergeMaterials"`;
print ("MergeMaterials: " + $mergeMaterials + "\n");
// enable material baking
// mapping image is required for material baking
Pipeline -ss $aggregationPipeline "AggregationProcessor/MappingImage/GenerateMappingImage" true;
$generateMappingImage = `Pipeline -gs $aggregationPipeline "AggregationProcessor/MappingImage/GenerateMappingImage"`;
print ("GenerateMappingImage: " + $generateMappingImage + "\n");
// in this case we want to generate texture coordinates (UVs)
Pipeline -ss $aggregationPipeline "AggregationProcessor/MappingImage/GenerateTexCoords" true;
$generateTexCoords = `Pipeline -gs $aggregationPipeline "AggregationProcessor/MappingImage/GenerateTexCoords"`;
print ("GenerateTexCoords: " + $generateTexCoords + "\n");
// the name of the resulting texture coordinate field
Pipeline -ss $aggregationPipeline "AggregationProcessor/MappingImage/TexCoordLevelName" "MaterialLOD";
$texCoordLevel = `Pipeline -gs $aggregationPipeline "AggregationProcessor/MappingImage/TexCoordLevelName"`;
print ("TexCoordLevelName: " + $texCoordLevel + "\n");
// width of the baked textures
Pipeline -ss $aggregationPipeline "AggregationProcessor/MappingImage/Output0/TextureWidth" 512;
$textureWidth = `Pipeline -gs $aggregationPipeline "AggregationProcessor/MappingImage/Output0/TextureWidth"`;
print ("TextureWidth: " + $textureWidth + "\n");
// height of the baked textures
Pipeline -ss $aggregationPipeline "AggregationProcessor/MappingImage/Output0/TextureHeight" 512;
$textureHeight = `Pipeline -gs $aggregationPipeline "AggregationProcessor/MappingImage/Output0/TextureHeight"`;
print ("TextureHeight: " + $textureHeight + "\n");
// add material casters (ambient, diffuse, specular and normals)
$bCasterAdded = `Pipeline -amc $aggregationPipeline "ColorCaster"`;
Pipeline -ss $aggregationPipeline "MaterialCaster/0/ColorCaster/MaterialChannel" "Ambient";
$colorCaster0 = `Pipeline -gs $aggregationPipeline "MaterialCaster/0/ColorCaster/MaterialChannel"`;
print ("ColorCaster0: " + $colorCaster0 + "\n");
$bCasterAdded = `Pipeline -amc $aggregationPipeline "ColorCaster"`;
Pipeline -ss $aggregationPipeline "MaterialCaster/1/ColorCaster/MaterialChannel" "Diffuse";
$colorCaster1 = `Pipeline -gs $aggregationPipeline "MaterialCaster/1/ColorCaster/MaterialChannel"`;
print ("ColorCaster1: " + $colorCaster1 + "\n");
$bCasterAdded = `Pipeline -amc $aggregationPipeline "ColorCaster"`;
Pipeline -ss $aggregationPipeline "MaterialCaster/2/ColorCaster/MaterialChannel" "Specular";
$colorCaster2 = `Pipeline -gs $aggregationPipeline "MaterialCaster/2/ColorCaster/MaterialChannel"`;
print ("ColorCaster2: " + $colorCaster2 + "\n");
// note: normal caster for normals!
$bCasterAdded = `Pipeline -amc $aggregationPipeline "NormalCaster"`;
Pipeline -ss $aggregationPipeline "MaterialCaster/3/NormalCaster/MaterialChannel" "Normals";
$normalCaster3 = `Pipeline -gs $aggregationPipeline "MaterialCaster/3/NormalCaster/MaterialChannel"`;
print ("NormalCaster3: " + $normalCaster3 + "\n");
// set the correct tangent space type,
// in this example we use tangent space normals
Pipeline -ss $aggregationPipeline "MaterialCaster/3/NormalCaster/GenerateTangentSpaceNormals" true;
$generateTangentSpaceNormals = `Pipeline -gs $aggregationPipeline "MaterialCaster/3/NormalCaster/GenerateTangentSpaceNormals"`;
print ("GenerateTangentSpaceNormals: " + $generateTangentSpaceNormals + "\n");
}
Pipeline -s $aggregationPipeline "D:/Pipelines/Aggregation_With_Baking.json";
// clear all pipelines
Pipeline -cl;
Simple Remeshing Pipeline
This example shows how to create a new RemeshingPipeline
and how to set basic parameters for Remeshing and material baking.
// create a Remeshing Pipeline object
$remeshingPipeline = `Pipeline -c "RemeshingPipeline"`;
// set the OnScreenSize for the generated mesh
Pipeline -ss $remeshingPipeline "RemeshingProcessor/Remeshing/OnScreenSize" 300;
$onScreenSize = `Pipeline -gs $remeshingPipeline "RemeshingProcessor/Remeshing/OnScreenSize"`;
print ("OnScreenSize: " + $onScreenSize + "\n");
// set the merge distance for the Remeshing processor,
// a lower value might be prefered for skinned assets to avoid small gaps to merge,
// or when you want to preserve details (at a cost of triangles).
Pipeline -ss $remeshingPipeline "RemeshingProcessor/Remeshing/MergeDistance" 0;
$mergeDistance = `Pipeline -gs $remeshingPipeline "RemeshingProcessor/Remeshing/MergeDistance"`;
print ("MergeDistance: " + $mergeDistance + "\n");
// more settings can be set for the Remeshing pipeline,
// see Pipeline documentation and/or inspect the generated file
// that is saved out by this script!
// set bMaterialBake to true to enable material baking,
// if material baking is enabled Simplygon will generate
// a new material (with textures) for the generated mesh.
$bMaterialBake = true;
if($bMaterialBake)
{
// enable material baking
// mapping image is required for material baking
Pipeline -ss $remeshingPipeline "RemeshingProcessor/MappingImage/GenerateMappingImage" true;
$generateMappingImage = `Pipeline -gs $remeshingPipeline "RemeshingProcessor/MappingImage/GenerateMappingImage"`;
print ("GenerateMappingImage: " + $generateMappingImage + "\n");
// in this case we want to generate texture coordinates (UVs)
Pipeline -ss $remeshingPipeline "RemeshingProcessor/MappingImage/GenerateTexCoords" true;
$generateTexCoords = `Pipeline -gs $remeshingPipeline "RemeshingProcessor/MappingImage/GenerateTexCoords"`;
print ("GenerateTexCoords: " + $generateTexCoords + "\n");
// the name of the resulting texture coordinate field
Pipeline -ss $remeshingPipeline "RemeshingProcessor/MappingImage/TexCoordLevelName" "MaterialLOD";
$texCoordLevel = `Pipeline -gs $remeshingPipeline "RemeshingProcessor/MappingImage/TexCoordLevelName"`;
print ("TexCoordLevelName: " + $texCoordLevel + "\n");
// width of the baked textures
Pipeline -ss $remeshingPipeline "RemeshingProcessor/MappingImage/Output0/TextureWidth" 512;
$textureWidth = `Pipeline -gs $remeshingPipeline "RemeshingProcessor/MappingImage/Output0/TextureWidth"`;
print ("TextureWidth: " + $textureWidth + "\n");
// height of the baked textures
Pipeline -ss $remeshingPipeline "RemeshingProcessor/MappingImage/Output0/TextureHeight" 512;
$textureHeight = `Pipeline -gs $remeshingPipeline "RemeshingProcessor/MappingImage/Output0/TextureHeight"`;
print ("TextureHeight: " + $textureHeight + "\n");
// add material casters
$bCasterAdded = `Pipeline -amc $remeshingPipeline "ColorCaster"`;
Pipeline -ss $remeshingPipeline "MaterialCaster/0/ColorCaster/MaterialChannel" "Ambient";
$colorCaster0 = `Pipeline -gs $remeshingPipeline "MaterialCaster/0/ColorCaster/MaterialChannel"`;
print ("ColorCaster0: " + $colorCaster0 + "\n");
$bCasterAdded = `Pipeline -amc $remeshingPipeline "ColorCaster"`;
Pipeline -ss $remeshingPipeline "MaterialCaster/1/ColorCaster/MaterialChannel" "Diffuse";
$colorCaster1 = `Pipeline -gs $remeshingPipeline "MaterialCaster/1/ColorCaster/MaterialChannel"`;
print ("ColorCaster1: " + $colorCaster1 + "\n");
$bCasterAdded = `Pipeline -amc $remeshingPipeline "ColorCaster"`;
Pipeline -ss $remeshingPipeline "MaterialCaster/2/ColorCaster/MaterialChannel" "Specular";
$colorCaster2 = `Pipeline -gs $remeshingPipeline "MaterialCaster/2/ColorCaster/MaterialChannel"`;
print ("ColorCaster2: " + $colorCaster2 + "\n");
// note: normal caster for normals!
$bCasterAdded = `Pipeline -amc $remeshingPipeline "NormalCaster"`;
Pipeline -ss $remeshingPipeline "MaterialCaster/3/NormalCaster/MaterialChannel" "Normals";
$normalCaster3 = `Pipeline -gs $remeshingPipeline "MaterialCaster/3/NormalCaster/MaterialChannel"`;
print ("NormalCaster3: " + $normalCaster3 + "\n");
// set the correct tangent space type,
// in this example we use tangent space normals
Pipeline -ss $remeshingPipeline "MaterialCaster/3/NormalCaster/GenerateTangentSpaceNormals" true;
$generateTangentSpaceNormals = `Pipeline -gs $remeshingPipeline "MaterialCaster/3/NormalCaster/GenerateTangentSpaceNormals"`;
print ("GenerateTangentSpaceNormals: " + $generateTangentSpaceNormals + "\n");
}
Pipeline -s $remeshingPipeline "D:/Pipelines/Remeshing_With_Baking.json";
// clear all pipelines
Pipeline -cl;