# 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
# 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. |
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.
# 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.
# Get materials for mesh
Returns a string array of material-names for the processed mesh.
# Get material-ids for mesh
Returns a int array of material-ids for the processed mesh.
# Get materials
Returns a string array of material-names from the most recent Simplygon run.
# Get material channels for material
Returns a string array of material-channels from the given material.
# Get texture-path for material-channel
Returns a string array of texture-paths from the given material-channel.
# 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.
# Get material for mesh (deprecated)
Returns the first/only material-name for the processed mesh.
# Mesh reuses material (deprecated)
Returns a the name of the material that the mesh is reusing, empty if not reusing.