# Running Simplygon from Max

To run Simplygon through 3DS Max, type the lines below into a new Max Script (assuming the settings path is valid). Execute the script from the Tools-menu or by pressing CTRL + E. The optimized result will be returned to 3DS Max as soon as the processing has completed. For a more detailed description, see the documentation for general script functions and pipelines.

MaxScript

-- reset state of previously set parameters
sgsdk_Reset()

-- load an asset
resetMaxFile #noPrompt; 
loadMaxFile "D:/Assets/myAsset.max"

-- select all objects in scene
select $*

-- load settings-pipeline from file
reductionPipeline = sgsdk_LoadPipeline "D:/Pipelines/ReductionPipeline.json"

-- optimize selected objects
sgsdk_RunPipelineOnSelection reductionPipeline

-- clear all pipelines
sgsdk_ClearPipelines()

Max script window (MaxScript)

Execute Simplygon via MaxScript

Python

from pymxs import runtime as rt

# reset state of previously set parameters
rt.sgsdk_Reset()

# load an asset
rt.resetMaxFile(rt.Name("noPrompt"))
rt.loadMaxFile('D:/Assets/myAsset.max')

# select all objects in scene
rt.select(rt.objects)

# load settings-pipeline from file
reductionPipeline = rt.sgsdk_LoadPipeline('D:/Pipelines/Reduction.json')

# optimize selected objects
rt.sgsdk_RunPipelineOnSelection(reductionPipeline)

# clear all pipelines
rt.sgsdk_ClearPipelines()

Max script window (Python)

Execute Simplygon via Python

See general functions and pipeline functions for a more detailed description of flags and examples.