Skip to content
On this page

SimplygonQuery command

Description

The SimplygonQuery command provides functionality for fetching information (such as mesh- and material information) that was collected during the last Simplygon call. See the complete list of flags below.

Syntax

MEL
SimplygonQuery -<short/long flag> <arg>;
python
import maya.cmds as cmds
cmds.SimplygonQuery(<short/long flag>=<arg>)

Flags and args

Short flagLong flagArgument(s)Description
verVersion<none>Gets the Simplygon API version.
gpmGetProcessedMeshes<none>Returns a list of processed mesh names from the last run.
spmSelectProcessedMeshes<none>Selects all processed meshes generated by the last Simplygon call.
mrmMeshReusesMaterialstring meshNameReturns material name if the material is shared, otherwise empty string. (deprecated)
rmsMeshReusesMaterialsstring meshNameReturn a list of material names if the material is shared, otherwise empty list. Use this if you expect multi-material meshes back from Simplygon.
gmmGetMaterialForMeshstring meshNameReturns material name for the specified mesh. This can be used for single-material meshes, for example a mesh of which material has gone through material baking. (deprecated)
mfmGetMaterialsForMeshstring meshNameReturn a list of material names for the specified mesh. This can be used for both single- and multi-material meshes, can be used in combination with gmi.
gmiGetMaterialIdsForMeshstring meshNameReturn a list of material ids for multi-material meshes that has not gone through material baking. Material baking will always result in one single material with material id 0 (the material returned by reuse, if any will cover the entire asset).
gmGetMaterials<none>Returns a list of material names from the last run.
gcmGetChannelsForMaterialstring materialNameReturns a list of material channel names for the specified material.
gtcGetTexturePathForChannelstring materialName
string channelName
Returns the texture path for the specified material channel.
gppGetProcessedOutputPaths<none>Returns the processed output file paths.

Examples

This section contains some examples written in MEL and Python. We've left out some parts of the scripts to keep things as simple as possible.

  • import maya.cmds as cmds must be declared at the top of each Python script.
  • reductionPipeline settings-path must be declared for both MEL and Python scripts where it makes sense.
  • a scene-selection is made before each Simplygon-command.

Get processed meshes

Returns a string array of the names of the processed meshes from the most recent Simplygon-command. The result can be used select or rename processed objects.

MEL
// execute SimplygonQuery with gpm-flag
$processedMeshes[] = `SimplygonQuery -gpm`;
python
# execute SimplygonQuery with gpm-flag
processedMeshes = cmds.SimplygonQuery(gpm = True)

Get processed output files

Returns a string array of the names of the processed meshes from the most recent Simplygon-command in combination with -isf and -osf. The resulting file-paths can be used when importing files manually.

MEL
// execute SimplygonQuery with gpp-flag
$processedOutputFilePaths[] = `SimplygonQuery -gpp`;
python
# execute SimplygonQuery with gpp-flag
processedOutputFilePaths = cmds.SimplygonQuery(gpp = True)

Get materials for mesh

Returns a string array of material-names for the processed mesh.

MEL
// execute SimplygonQuery with mfm-flag
$materials[] = `SimplygonQuery -mfm "pCube1_LOD1"`;
python
# execute SimplygonQuery with mfm-flag
materials = cmds.SimplygonQuery(mfm = 'pCube1_LOD1')

Get material-ids for mesh

Returns a int array of material-ids for the processed mesh.

MEL
// execute SimplygonQuery with gmi-flag
$materialIds[] = `SimplygonQuery -gmi "pCube1_LOD1"`;
python
# execute SimplygonQuery with gmi-flag
materialIds = cmds.SimplygonQuery(gmi = 'pCube1_LOD1')

Get materials

Returns a string array of material-names from the most recent Simplygon run.

MEL
// execute SimplygonQuery with gm-flag
$materials[] = `SimplygonQuery -gm`;
python
# execute SimplygonQuery with gm-flag
materials = cmds.SimplygonQuery(gm = True)

Get material channels for material

Returns a string array of material-channels from the given material.

MEL
// execute SimplygonQuery with gcm-flag
$materialChannels[] = `SimplygonQuery -gcm "SimplygonMaterial1"`;
python
# execute SimplygonQuery with gcm-flag
materialChannels = cmds.SimplygonQuery(gcm = 'SimplygonMaterial1')

Get texture-path for material-channel

Returns a string array of texture-paths from the given material-channel.

MEL
// execute SimplygonQuery with gtc-flag
$texturePath = `SimplygonQuery -gtc "SimplygonMaterial1" "Diffuse"`;
python
# execute SimplygonQuery with gtc-flag
texturePath = cmds.SimplygonQuery(gtc = ['SimplygonMaterial1', 'Diffuse'])

Mesh reuses materials

Returns a string array of materials that the mesh is reusing, empty if not reusing. Points into the material list that can be fetched by -gmi.

MEL
// execute SimplygonQuery with rms-flag
$materials[] = `SimplygonQuery -rms "pCube1_LOD1"`;
python
# execute SimplygonQuery with rms-flag
materials = cmds.SimplygonQuery(rms = 'pCube1_LOD1')

Get material for mesh (deprecated)

Returns the first/only material-name for the processed mesh.

MEL
// execute SimplygonQuery with gmm-flag
$material = `SimplygonQuery -gmm "pCube1_LOD1"`;
python
# execute SimplygonQuery with gmm-flag
material = cmds.SimplygonQuery(gmm = 'pCube1_LOD1')

Mesh reuses material (deprecated)

Returns a the name of the material that the mesh is reusing, empty if not reusing.

MEL
// execute SimplygonQuery with mrm-flag
$material = `SimplygonQuery -mrm "pCube1_LOD1"`;
python
# execute SimplygonQuery with mrm-flag
material = cmds.SimplygonQuery(mrm = 'pCube1_LOD1')