Simplygon SoftImage

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Simplygon SoftImage

Installation

Pre-built executable versions of the plugin is provided with the SDK and located in the subdirectory "SimplygonSDK->SoftimagePlugins(Platform)" within MyDocuments Folder.

To install the plugin for use in Softimage, please copy the plugin file (.dll) into the "Application/Plugins"

directory of your Softimage installation directory. The Softimage directory defaults to "C:/Program Files/Autodesk/Softimage [version of Softimage]/Application/Plugins". It is also possible to use the user plugin directory which usually is located at "C:/Users/[user name]/Autodesk/Softimage_[version of Softimage]/Application/Plugins". In Softimage, go to File->Plug-in Manager and verify that the Simplygon plugin has been loaded. The plugin is built and tested for Softimage 2013 SP1 and 2014.

 

Using Softimage plugin through Simplygon Editor

In Softimage, select the objects you want to process, and select "Run Simplygon" from the "Simplygon" menu. This will open the Simplygon Editor where you can process models and import them back to Softimage.

 

Running Simplygon with Python

The Softimage plugin exports a number of script functions that can be accessed via Python, VB- and Java script. The script functions can from Python be accessed by calling "Application.ExecuteScriptCommand" together with the desired script string and an array of parameters or by calling the function directly from "Application".

 

Example code

The example below shows how to use Simplygon through Python. The script will start a processing in batch mode based on the settings stored in "MySettings.ini" and then return the result back to Softimage automatically. The settings file is in ASCII format and can be edited with any text editor, it can also be saved out directly from the Simplygon Editor by going to "File->Save Settings".

 

ret = Application.sgsdk_BatchMode( True )

Application.LogMessage(ret)

ret = Application.sgsdk_ImportSimplygonSettings( "C:\\MySettings.ini" )

Application.LogMessage(ret)

ret = Application.sgsdk_ProcessSelectedGeometries( )

Application.LogMessage(ret)

 

It is also possible to get and set individual settings by calling "sgsdk_GetSimplygonSettingsString" and "sgsdk_SetSimplygonSettingsString":

 

ret = Application.sgsdk_GetSimplygonSettingsString( "AutoLODSection/TangentSpaceType" )

Application.LogMessage(ret)

ret = Application.sgsdk_SetSimplygonSettingsString( "LODCollectionSection/LODCount", "3" )

Application.LogMessage(ret)

ret = Application.sgsdk_GetSimplygonSettingsString( "LODCollectionSection/LODCount" )

Application.LogMessage(ret)

 

Script functions

This is the comprehensive list of the available commands:

sgsdk_Reset ()

Resets all settings to default.

 

sgsdk_ProcessSelectedGeometries ()

Processes the currently selected geometries and creates LODs.

 

sgsdk_BatchMode ( bool enable )

Sets batch mode to enabled or disabled (True, False).

 

sgsdk_ImportSimplygonSettings ( string inputpath )

Loads a pre-defined settings file from the specified file.

 

sgsdk_ExportSimplygonSettings ( string outputpath )

Saves a settings file to the specified file path.

 

sgsdk_SetSimplygonSettingsString ( string name, string value )

Sets a named setting to the specified value.

 

sgsdk_GetSimplygonSettingsString ( string name )

Gets the value of the named setting.

 

sgsdk_SetUseColorChannelAsWeights ( string channelname )

Specifies that the specified vertex color channel will be used as vertex weights. The original vertex color channel will not be passed on to Simplygon.

 

sgsdk_GetUseColorChannelAsWeights ( )

Returns which channel that is to be used as vertex weights.

 

sgsdk_SetWeightsMultiplier ( int multiplier )

Sets the weights multiplier. The lower bound of the weights is (1/multiplier) and the upper bound is (multiplier). The multiplier must be in the range 2-8.

 

sgsdk_SetWeightsInterpreter ( int interpreter )

Sets which interpreter to use when interpreting vertex colors as weights.

0: Black: reduce more | White: reduce less

1: Black: unchanged | White: reduce less

2: Black: reduce more | White: unchanged

 

sgsdk_MaterialColor( string materialname, string channelname, float r, float g, float b, float a )

Overrides or creates a color on the specified channel for the specified material.

 

sgsdk_MaterialTexture ( string materialname, string channelname, string texturename, string blendtype, int layer )

Overrides the texture on the specified texture layer of the material. Blend type can be, add, multiply, subtract and none.

 

sgsdk_MaterialTextureLevel ( string materialname, string channelname, int layer, int level )

Overrides the texture level (UV) on the specified channel and texture layer of the material.

 

sgsdk_SetLockOnBone ( string bonename, bool lock )

If lock is true, the specified bone will be locked during reduction.