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
SimplygonQuery -<short/long flag> <arg>;
import maya.cmds as cmds
cmds.SimplygonQuery(<short/long flag>=<arg>)
Flags and args
Short flag | Long flag | Argument(s) | Description |
---|---|---|---|
ver | Version | <none> | Gets the Simplygon API version. |
gpm | GetProcessedMeshes | <none> | Returns a list of processed mesh names from the last run. |
spm | SelectProcessedMeshes | <none> | Selects all processed meshes generated by the last Simplygon call. |
mrm | MeshReusesMaterial | string meshName | Returns material name if the material is shared, otherwise empty string. (deprecated) |
rms | MeshReusesMaterials | string meshName | Return a list of material names if the material is shared, otherwise empty list. Use this if you expect multi-material meshes back from Simplygon. |
gmm | GetMaterialForMesh | string meshName | Returns 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) |
mfm | GetMaterialsForMesh | string meshName | Return 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. |
gmi | GetMaterialIdsForMesh | string meshName | Return 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). |
gm | GetMaterials | <none> | Returns a list of material names from the last run. |
gcm | GetChannelsForMaterial | string materialName | Returns a list of material channel names for the specified material. |
gtc | GetTexturePathForChannel | string materialName string channelName | Returns the texture path for the specified material channel. |
gpp | GetProcessedOutputPaths | <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.
// execute SimplygonQuery with gpm-flag
$processedMeshes[] = `SimplygonQuery -gpm`;
# 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.
// execute SimplygonQuery with gpp-flag
$processedOutputFilePaths[] = `SimplygonQuery -gpp`;
# 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.
// execute SimplygonQuery with mfm-flag
$materials[] = `SimplygonQuery -mfm "pCube1_LOD1"`;
# 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.
// execute SimplygonQuery with gmi-flag
$materialIds[] = `SimplygonQuery -gmi "pCube1_LOD1"`;
# 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.
// execute SimplygonQuery with gm-flag
$materials[] = `SimplygonQuery -gm`;
# 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.
// execute SimplygonQuery with gcm-flag
$materialChannels[] = `SimplygonQuery -gcm "SimplygonMaterial1"`;
# 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.
// execute SimplygonQuery with gtc-flag
$texturePath = `SimplygonQuery -gtc "SimplygonMaterial1" "Diffuse"`;
# 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.
// execute SimplygonQuery with rms-flag
$materials[] = `SimplygonQuery -rms "pCube1_LOD1"`;
# 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.
// execute SimplygonQuery with gmm-flag
$material = `SimplygonQuery -gmm "pCube1_LOD1"`;
# 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.
// execute SimplygonQuery with mrm-flag
$material = `SimplygonQuery -mrm "pCube1_LOD1"`;
# execute SimplygonQuery with mrm-flag
material = cmds.SimplygonQuery(mrm = 'pCube1_LOD1')