Skip to content
On this page

Migrate from Simplygon 8 to Simplygon 10

The Simplygon Max plug-in exports various commands and flags that exposes Simplygon functionality through Max. Since Simplygon 8 there's been breaking changes to core features as well as the Simplygon API in general. The standalone Simplygon UI and the fundamentals it was built upon, as well as Simplygon Processing Language (SPL) and the Simplygon Scene Format (SSF) no longer exists. The Simplygon Max plug-in work directly against the Simplygon API. Compatibility with previous versions is kept where possible, but there are some fundamental things that has changed and improved.

This guide will focus on how to migrate from Simplygon 8 to Simplygon 10.

Installation

Simplygon 8 install scripts will no longer work with Simplygon 10. Instead, Simplygon 10 relies on environment variables to find certain components compared to previous solution of registry and configuration files. We recommend the Simplygon installer as it not only sets everything up correctly, but also installs all necessary prerequisites. We also provide a Simplygon 10 archive for manual installation. See the Simplygon 10 plug-in installation for further instructions. Please note that Simplygon 10 relies on its own set of environment flags.

Simplygon UI

The standalone Simplygon UI has been replaced by a lightweight UI in the form of a Max plug-in. The UI plug-in is bundled with the installer and will show up in the plug-in manager after installation. See the Simplygon 10 plug-in installation for further instructions on how to enable plug-ins in Max.

Settings system

The settings system has been completely revamped which means that old settings of the SPL- and Preset format is no longer compatible with Simplygon 10. The successor of SPL is Pipeline objects. Pipelines are made to make the life easier for users by encapsulating functionality in Pipeline objects. Some of our common Pipelines are; Reduction, Aggregation, Remeshing as well as several Impostor pipelines. These pipelines have a 1-to-1 mapping to the Simplygon API and should feel quite familiar to existing users. Pipelines are saved as text-based files with JSON extension. The job distribution system (that was previously part of Simplygon Grid) is now part of Pipelines.

Note that some settings have been added, removed, renamed and / or moved to a different settings group, see the SPL-to-Pipeline documentation for information of how to migrate SPL to Pipelines.

New Remesher

The new Remesher that was introduced in Simplygon 9 completely replaces the old remesher in Simplygon 10. The old remesher (deprecated in Simplygon 9) has been completely removed in Simplygon 10. The new remesher introduces features such as intelligent hole-filling, cavity removal as well as some performance increases when generating large OnScreenSize meshes.

New remesher:

  • RemeshingPipeline
  • RemeshingProcessor
  • RemeshingSettings

For more information, see the Remeshing Pipeline example and Remeshing Pipeline API documentation.

Script migration

The following sections contain details of how to migrate specific parts from Simplygon 8 to Simplygon 10.

General Simplygon functions

PreviouslyStatusReplacementNote
sgsdk_SetLoginInfoRemovedUser system has been removed
sgsdk_SetBatchModeRemovedStandalone UI has been removed
sgsdk_GetBatchModeRemovedStandalone UI has been removed
sgsdk_ProcessSelectedGeometriesReplaced
(deprecated)
sgsdk_RunPipelineOnSelectionNow takes a Pipeline-object or Pipeline-path as input
sgsdk_SetSettingsPathReplacedsgsdk_SetPipelineNow takes a Pipeline-object or Pipeline-path as input
sgsdk_UseSPLReplacedsgsdk_SetPipelineNow takes a Pipeline-object or Pipeline-path as input
sgsdk_MaterialTextureUpdatedNow takes sRGB flag as last argument
sgsdk_CustomShaderChannelOverrideRemoved
sgsdk_SetUseColorChannelAsWeightsRemovedMoved to Pipeline settings
sgsdk_SetWeightsMultiplierRemovedMoved to Pipeline settings
sgsdk_SetWeightsInterpreterRemovedMoved to Pipeline settings
sgsdk_SetLockOnBoneRemovedMoved to Pipeline settings (selection-set)

See Simplygon functions for more details.

SPL- to Pipeline functions

PreviouslyStatusReplacementNote
spl_SaveReplacedsgsdk_SavePipelineSaves Pipeline-object to file.
spl_LoadReplacedsgsdk_LoadPipelineLoads Pipeline-object from file.
spl_CreateReplacedsgsdk_CreatePipelineUse to create Pipeline-object.
spl_SetReplacedsgsdk_SetSettingSpecify setting path and value to set
spl_SetStringReplacedsgsdk_SetSettingSpecify setting path and value to set
spl_GetReplacedsgsdk_GetSettingSpecify setting path from where to fetch the setting value
spl_AddRemoved
spl_RemoveRemoved
spl_GetChildRemoved
spl_ClearListRemoved
spl_GetParameterRemoved
spl_ClearReplacedsgsdk_ClearPipelinesClears all Pipelines that resides in memory (created and loaded)

See Simplygon Pipeline functions for more details.

Shading network functions

PreviouslyStatusReplacementNote
sgsdk_ConnectOutputToMaterialMetadataReplacedsgsdk_ConnectOutputToDirectXMaterialNow takes target shader (effect) file path, source material channel (the one with baked texture) and target texture slot

See Simplygon Shading Network functions for more details.

Load and save settings

Loading a SPL-file was previously done using the spl_Load function followed by the file path and the name of the handle the SPL object. The spl_Save function takes the file path and the SPL object handle.

MaxScript
reductionObject = spl_Load "D:/Pipelines/Reduction.spl" "reductionObjectName"
spl_Save "D:/Pipelines/Reduction.spl" reductionObject

For Pipelines the loading of files translates to the sgsdk_LoadPipeline function followed by the file path. The function returns the Pipeline handle as soon as the load has completed. Saving works in a similar fashion; sgsdk_SavePipeline followed by the file path and the Pipeline handle.

MaxScript
reductionPipeline = sgsdk_LoadPipeline "D:/Pipelines/Reduction.json"
bResult = sgsdk_SavePipeline "D:/Pipelines/Reduction.json" reductionPipeline

Get and set settings

The SPL settings system in Simplygon 8 has been replaced by the Pipeline settings system which are focusing more on ease-of-use. To set a setting in a Pipeline, simply specify the setting path and value, or just setting path for queries. There is no longer any need to manually traverse the SPL graph to be able to set and get settings, no more containers or write nodes are necessary.

Note that some settings have been added, removed, renamed and / or moved to a different settings group, see the SPL-to-Pipeline documentation for information of how to migrate SPL to Pipelines.

Previously these lines were required to create a "simple" 50% reduction:

MaxScript
-- create SPL object
    reductionObject = spl_Create "SPL" "reductionObject"

    -- create reduction settings
    spl_Create "ReductionSettings" "reductionSettings"
    spl_Set "reductionSettings" "TriangleRatio" 0.5
    spl_Set "reductionSettings" "Enabled" true

    -- create reduction processor and assign the reduction settings
    spl_Create "ReductionProcessor" "reductionProcessor"
    spl_Set "reductionProcessor" "ReductionSettings" "reductionSettings"

    -- create process node and assign reduction processor
    spl_Create "ProcessNode" "processNode"
    spl_SetString "processNode" "Name" "processNode"
    spl_Set "processNode" "Processor" "reductionProcessor"

    -- create write node and add it to the process node
    spl_Create "WriteNode" "writeNode"
    spl_SetString "writeNode" "Format" "ssf"
    spl_SetString "writeNode" "Name" "outputlod_0"
    spl_Add "processNode" "Children" "writeNode"

    -- create container node,
    -- add process node to container node
    spl_Create "ContainerNode" "containerNode"
    spl_SetString "containerNode" "Name" "containerNode"
    spl_Add "containerNode" "Children" "processNode"

    -- assign container node to spl node
    spl_Set reductionObject "ProcessGraph" "containerNode"

    -- execute Simplygon in batch mode with the provided SPL object
    sgsdk_UseSPL reductionObject
    sgsdk_SetBatchMode true
    sgsdk_ProcessSelectedGeometries()

The new Pipeline settings system reduces the lines above to:

MaxScript
-- create a reduction Pipeline object
    reductionPipeline = sgsdk_CreatePipeline "ReductionPipeline"

    -- set the triangle ratio to 50%
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/ReductionSettings/ReductionTargetTriangleRatio" 0.5

    -- execute Simplygon with the provided Pipeline object
    sgsdk_RunPipelineOnSelection reductionPipeline

    -- clear all pipelines that resides in memory
    sgsdk_ClearPipelines()

As you can see there is no direct translation for the get and set flags as Pipeline settings can be set through a settings path and does not require the individual objects.

Here's how to get and set the triangle ratio for a reduction processor:

MaxScript
-- set the triangle ratio to 50%
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/ReductionSettings/ReductionTargetTriangleRatio" 0.5

    -- get the triangle ratio
    reductionTargetTriangleRatio = sgsdk_GetSetting reductionPipeline "ReductionProcessor/ReductionSettings/ReductionTargetTriangleRatio"

    -- print the triangle ratio
    print ("ReductionTargetTriangleRatio: " + reductionTargetTriangleRatio as string + "\n")

How to setup material baking settings for a reduction Pipeline:

MaxScript
-- mapping image is required for material baking
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/MappingImageSettings/GenerateMappingImage" true

    -- generate new texture coordinates
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/MappingImageSettings/GenerateTexCoords" true

    -- specify name for generated texture coordinates
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/MappingImageSettings/TexCoordName" "MaterialLOD"

    -- width and height of the baked textures
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/MappingImageSettings/Output0/TextureWidth" 512
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/MappingImageSettings/Output0/TextureHeight" 512

    -- add a color caster for Max's standard material (Diffuse_Color)
    bCasterAdded = sgsdk_AddMaterialCaster reductionPipeline "ColorCaster"
    bResult = sgsdk_SetSetting reductionPipeline "MaterialCaster/1/ColorCasterSettings/MaterialChannel" "Diffuse_Color"

    -- add normal caster for Max's standard material (Bump)
    bCasterAdded = sgsdk_AddMaterialCaster reductionPipeline "NormalCaster"
    bResult = sgsdk_SetSetting reductionPipeline "MaterialCaster/2/NormalCasterSettings/MaterialChannel" "Bump"

    -- set the correct tangent space type
    bResult = sgsdk_SetSetting reductionPipeline "MaterialCaster/2/NormalCasterSettings/GenerateTangentSpaceNormals" true

Material channel mapping

Previously Max's standard materials (Blinn, Phong etc) were mapped to Simplygon materials by redirecting material channels to a pre-defined structure (that was required by the standalone Simplygon UI). As the standalone UI is no longer a part of Simplygon, Max's material channels are used through and through. This removes extra layers of complexity, making life easier for users.

If you wish to bake standard materials in Max, see the updated channel names in the table below.

Previous channelNew channel
AmbientAmbient_Color
DiffuseDiffuse_Color
SpecularSpecular_Color
OpacityOpacity
NormalsBump

Selection sets

Selection sets are read automatically from Max's built in selection-sets. Some common features that require a selection-set are Bone Lock, Bone Removal, Processing- and Clipping-sets. To assign a selection-set to a Pipeline, as a processing selection-set or clipping selection-set, see Clipping geometry example, for more information about Pipelines, see Simplygon Pipeline functions.

Vertex colors to vertex weights

The "vertex colors to vertex weights" functionality has been moved from the Simplygon Max plug-in (sgsdk_SetUseColorChannelAsWeights, sgsdk_SetWeightsMultiplier, sgsdk_SetWeightsInterpreter) to Pipelines and is now a part of the Pipeline weights settings. An additional setting has been added to allow users to specify which color component of the vertex colors to use as weights.

Previous method of specifying which mapping channel to use as vertex weights:

MaxScript
-- creates SPL object and populates it with reduction process node, settings and write-node (excluded)
    reductionObject = spl_Create SPL reductionObject
    ...

    -- set which vertex-color-set to use as weights, multiplier and interpreter
    sgsdk_SetUseColorChannelAsWeights 3
    sgsdk_SetWeightsMultiplier 8
    sgsdk_SetWeightsInterpreter 0

    -- launch Simplygon in batch mode with provided setting object
    sgsdk_UseSPL reductionObject
    sgsdk_SetBatchMode true
    sgsdk_ProcessSelectedGeometries()

New method of specifying which color-set to use as vertex weights:

MaxScript
-- creates a reduction pipeline
    reductionPipeline = sgsdk_CreatePipeline "ReductionPipeline"
    ...

    -- enables vertex weights in reducer
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/VertexWeightSettings/UseVertexWeightsInReducer" true

    -- sets which vertex-color-set to be used as weights
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/VertexWeightSettings/WeightsFromColorName" "3"

    -- sets the multiplier
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/VertexWeightSettings/WeightsFromColorMultiplier" 8

    -- sets which interpreter to use
    bResult = sgsdk_SetSetting reductionPipeline "ReductionProcessor/VertexWeightSettings/WeightsFromColorMode" 0
    ...

    -- launch Simplygon with provided setting object
    sgsdk_RunPipelineOnSelection reductionPipeline

For more information about vertex colors as vertex weights, see Colors as vertex weights.