The following example will execute Simplygon on the current selection using a previously saved Pipeline.
-- 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()
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()