Skip to content
On this page

Run a Pipeline

The Simplygon command provides flags for specifying which Pipeline to use for the optimization. The following example will load a Pipeline from file using the SimplygonPipeline command and then execute the Simplygon command with the so (SettingsObject) flag followed by the previously loaded pipeline.

MEL
// 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 = `SimplygonPipeline -l "D:/Pipelines/reductionPipeline.json"`;

// execute pipeline on selection,
// returns result to Maya once completed
Simplygon -so $reductionPipeline;

// clear all pipelines that resides in memory
SimplygonPipeline -cl;
python
import maya.cmds as cmds

# load an asset
cmds.file('D:/Assets/SomeAsset.mb', i = True, mergeNamespacesOnClash = True, namespace = ':', importFrameRate = True)

# select objects
cmds.select(all = True)

# load previously saved pipeline
reductionPipeline = cmds.SimplygonPipeline(l = 'D:/Pipelines/reductionPipeline.json')

# execute pipeline on selection,
# returns result to Maya once completed
cmds.Simplygon(so = reductionPipeline)

# clear all pipelines that resides in memory
cmds.SimplygonPipeline(cl = True)

Next steps

Get to know how to work with Pipelines: