Skip to content
On this page

Run a Pipeline

The following example will execute Simplygon on the current selection using a previously saved Pipeline.

MaxScript
-- load an asset
    loadMaxFile "D:/Assets/SomeAsset.max"

    -- select everything in scene
    select $*

    -- load previously saved pipeline
    reductionPipeline = sgsdk_LoadPipeline "D:/Pipelines/reductionPipeline.json"

    -- execute pipeline on selection,
    -- returns result to Max once completed
    sgsdk_RunPipelineOnSelection reductionPipeline

    -- clear all pipelines that resides in memory
    sgsdk_ClearPipelines()
python
from pymxs import runtime as rt

# load an asset
rt.loadMaxFile('D:/Assets/SomeAsset.max')

# select objects
rt.select(rt.objects)

# load previously saved pipeline
reductionPipeline = rt.sgsdk_LoadPipeline('D:/Pipelines/reductionPipeline.json')

# execute pipeline on selection,
# returns result to Max once completed
rt.sgsdk_RunPipelineOnSelection(reductionPipeline)

# clear all pipelines that resides in memory
rt.sgsdk_ClearPipelines()

Next steps

Get to know how to work with Pipelines: