Simplygon MEL Script Reference

<< Click to Display Table of Contents >>

Navigation:  Simplygon Maya >

Simplygon MEL Script Reference

The "Simplygon" command has a number of flags, which can be set from a script, for example: Simplygon -tod "c:/MyTextureOutputFolder" which will override the default texture output folder. Following is a complete list of supported MEL commands:

 

-b, -BatchMode

Force Simplygon to run in batch mode using the current settings, without opening the GUI.

 

-lb, -LockBone [name of bone] [lock]

Lock or unlock a specific bone (and their parents), depending on if lock is true or false. A Locked bone will not be removed when processing a boneLOD in Simplygon.

bonelock

 

Figure 5: For Lock bone (-lb), the specifed bone (and its parent bones) will not be removed when processing a BoneLOD. All removed bones are coloured red.

 

-rb, -RemoveBone [name of bone]

Define which bones to remove when processing a boneLOD in Simplygon. The bone will not be deleted from the mesh, instead, all the mesh's vertices will be disconnected from this bone and connected to the parent bone. The mesh will not respond to animation made by this bone.

boneremove

 

Figure 6: For Remove bone (-rb), the specified bone, and its children, will be removed when processing a BoneLOD. Removed bones are coloured red.

 

-lsv, -LockSetVertices [name of set]

Locks vertices in the named set. These vertices will not be touched when generating the MeshLOD.

lockvertexset

Figure 7: How to create a vertex set in Maya: press "SPACE", right click on "Select" and select "Vertex". Select some vertices on your mesh. Go to "Create->Sets->Set" in the main menu bar. A vertex-set is created and given a name. Use this set-name for locking this vertex set.

 

-mc, -MaterialColor [name of material] [name of channel] [r] [g] [b] [a]

Overrides or creates the color on the specified channel of the material.

 

-mt, -MaterialTexture [name of material] [name of channel] [texture path]

Overrides or sets the texture on the specified channel of the material.

 

-mlt, -MaterialLayeredTexture [name of material] [name of channel] [texture path] [layer] [name of blending type]

Overrides or sets the texture on the specified texture layer of the material.

Blend type can be, add, multiply, subtract and none.

 

-mtn, -MaterialTextureNormals [name of material] [texture path] [ts]

Overrides the normals texture of the material. Set the third parameter, ts, to

true if the normal map is in tangent space.

 

-tcn, -MaterialTextureChannelName [name of material] [name of channel] [name of uvset]

Overrides the UV-set for the material.

 

-tod, -TextureOutputDirectory [absolute path]

Overrides the texture output folder for all processed textures to this absolute path.

 

-caw, -UseColorSetAsWeights [name of set]

Sets which color set to use as vertex weights.

 

-wm, -SetWeightsMultiplier [multiplier]

Sets the weight 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.

 

-wi, -SetWeightsInterpreter [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

 

-ss, -SelectionSet [name of set][ObjectName1|ObjectName2|ObjectNameN]

Creates a Selection Set that can be used for grouping objects. These groups can, if specified in the Simplygon Editor, be used to process objects individually.

 

-cpb, -UseCurrentPoseAsBindPose

Specifies that the skinning data will be extracted from the current pose rather than the bind pose. Please do not use this flag when in bind pose as synchronization issues might appear!

 

-swp, -SkipBlendShapeWeightPostfix

If set, the default prefix in blend shape attribute names ("_LOD", as in Mouth_LOD1) will be removed. Note: if set, all generated target meshes will be left in the scene!

 

-sf, -SettingsFile [path]

Sets the path to the preset/SPL which will be used when processing.

Note: SPL files are only allowed in combination with batch mode

 

-spl, -SPL [name of splObject]

Specifies which SPL object to use (created with spl_Create).

 

Example Code

Batch Mode

To launch Simplygon in Batch/Silent mode, assign your login information to SimplygonSecurity. Thereafter add the batch mode flag and the preset flag followed by the preset path.

SimplygonSecurity -su "username" -sp "password";

Simplygon -b -sf "c:/MyPreset.preset";

 

Material Color Override

To override or create color on a specified channel of a specified material, enter the material name, the name for the channel and the rgba values for a specific color. In the example below we choose to set the diffuse channel of "MyMaterial" to blue.

Simplygon -mc "MyMaterial" "Diffuse" 0 0 1 1

 

Material Texture Override

To override or set the texture on a specified channel of a specified material, enter the name for the material, the name for the channel and the path for the texture. In the example below we choose to set the diffuse

Simplygon -mt "MyMaterial2" "Diffuse" "c:/MyTexture.jpg"

 

Weights Sets

To set the weight multiplier, start by setting which color set to use as vertex weights.

Simplygon -caw "SimplygonColorSet"

Then, set the weight multiplier (a value between 2 and 8):

-wm 8

Set Which interpreter to use (a value between 0 and 2, where 0 is default):

-wi 0

 

Selection Sets

To create a selection set, enter the name of the set to be created followed by a "|" separated list of objects.

Simplygon -ss "SelectionSet1" "pCube1|pCube2|pCube3"