glmLayoutTool
glmLayoutTool command provides a way to query properties on a Simulation Cache Layout.
glmLayoutTool [-cacheProxy string] [-layoutJSON string] [-layoutRootNodeID long] [-dirtyLayoutNodeID long] [-dirtyAssetsRepartition bool] [-selectEntities string] [selectLayoutNodes string] [requestSourceNode string] [-getSelectedEntities bool] [-getSelectedEntitiesIdx bool] [-getRenderingTypes bool] [-getSelectedEntityMeshAssets bool] [-getAvailableMeshAssets bool] [-getAvailableBonesNames bool] [-createRigOrPostureNode bool]
Flags
Long name (short name) | Argument types | Properties | Description |
-cacheProxy (-cp) | string | mandatory | specifies a Simulation Cache Proxy for on which the query apply |
-layoutJSON (-l) | string | specifies the new layout content to use for the cache proxy previz. Note that this only affect the cache proxy display but not the layout editor. |
|
-layoutRootNodeID (-dr) | long | specify the new layout node ID to use. Note that this only affect the cache proxy display but not the layout editor. |
|
-dirtyLayoutNodeID (-dn) | long | specify node(s) for which the cached content should be reloaded/recomputed | |
-dirtyAssetsRepartition (-da) | boolean | specify that the cache proxy's characters and mesh assignations needs to be reloaded for the previz | |
-selectEntities (-se) | string | specify the list of entities' ID to select in Maya | |
-selectLayoutNodes (-sn) | string | specify the nodes ID from which selecting the entities (all entities that executes the given name) | |
-requestSourceNode (-rn) | string | only used in combination with getAvailableMeshAssets, getRenderingTypes and createRigOrPosture | |
-getSelectedEntities (-gse) | boolean | returns the list of currently selected entities ID (i.e. [1001, 2001])' | |
-getSelectedEntitiesIdx (-gsx) | boolean | returns the list of currently selected entities indices in cache (i.e. [0, 1])' | |
-getRenderingTypes (-grt) | boolean | returns the list of rendering types that can be used on the specified node (depends on the characters that are currently selected by the requested node) This flag needs to be used in combination with the requestSourceNode flag |
|
-getSelectedEntityMeshAssets (-gem) | boolean | returns the list of mesh assets on the currently selected entity | |
-getAvailableMeshAssets (-gam) | boolean | returns the list of mesh assets that can be used on the specified node (depends on the characters that are currently selected by the requested node) This flag needs to be used in combination with the requestSourceNode flag |
|
-getAvailableBonesNames (-gab) | boolean | returns the list of bone names that can be used on the specified node (depends on the characters that are currently selected by the requested node) this flag needs to be used in combination with the requestSourceNode flag |
|
-createRigOrPostureNode (-crp) | boolean | specify that a layoutPosture node or layoutRig node needs to be created in Maya This flag needs to be used in combination with the requestSourceNode flag, and works only on Posture or Rig layout nodes |
Return Value
The return value depends on the arguments:
- comma separated list of entities' ID if using the getSelectedEntities argument
- stringArray list of mesh assets if using the getAvailableMeshAssets argument
- stringArray list of rendering types if using the getRenderingTypes argument
- stringArray list of bones names if using the getAvailableBonesNames argument
Python Examples
# select entities in the cache proxycmds.glmLayoutTool(cacheProxy="cacheProxyShape1", selectEntities="1001, 2001")# get the list of meshes used on the selected entitycmds.glmLayoutTool(cacheProxy="cacheProxyShape1", getSelectedEntityMeshAssets=True)
# Result: [0L, 60L, 61L, 92L, 103L, 108L, 110L] ## get the list of rendering types available on the character used for a given node (there must be a unique character selected by the requested node)cmds.glmLayoutTool(cacheProxy="cacheProxyShape1", getRenderingTypes=True, requestSourceNode="18")
# Result: [u'SwordAndShield_attacker', u'SwordAndShiled_defender', u'Sabre_attacker', u'Saber_defender', u'Lance_defender', u'Arrow_attacker'] ## get the list of mesh assets available on the character used for a given node (there must be a unique character selected by the requested node)cmds.glmLayoutTool(cacheProxy="cacheProxyShape1", getAvailableMeshAssets=True, requestSourceNode="18")
# Result: [u'Body', u'eye_R', u'eye_L', u'Leather', u'CoteOfMail', u'Fabrics', u'LightArmor_cuirass', u'LightArmor_shoulder_L', u'LightArmor_Fabrics', u'LightArmor_Tasset_R', u'LightArmor_Tasset_L', u'LightArmor_shoulder_R', u'HeavyArmor_cuirass', u'HeavyArmor_Tassets', u'HeavyArmor_Shoulder_R', u'HeavyArmor_Shoulder_L', u'HeavyArmor_Throat', u'MetalBracer_L', u'MetalBracer_R', u'Lace_R', u'Bracelet_R', u'Lace_L', u'Bracelet_L', u'AttackerSword', u'DefenderSword', u'GladiatorSword', u'DefenderShield_Big', u'AttackerShield_Small', u'AttackerShield_Big', u'Defender_Shield_Round', u'Mustache', u'BeardSmall', u'BeardBig', u'BeardBigger', u'BeardViking', u'Banner', u'Spear1', u'Spear2', u'AttackerHelmet1', u'AttackerHelmet2', u'AttackerHelmet3', u'AttackerHelmet4', u'AttackerHelmet5', u'ArcherHelmet1', u'ArcherHelmet2', u'DefenderHelmet1', u'DefenderHelmet2', u'DefenderHelmet3', u'DefenderHelmet4', u'DefenderHelmet5', u'DefenderHelmet6', u'DefenderHelmet7', u'DoubleBow', u'SimpleBow', u'Quiver', u'Handle', u'pCube1', u'polySurface4'] ## get the list of bones on the character used for a given node (there must be a unique character selected by the requested node)
cmds.glmLayoutTool(cacheProxy="cacheProxyShape1", getAvailableBonesNames=True, requestSourceNode="18")# Result: [u'Reference', u'Hips', u'LeftUpLeg', u'LeftLeg', u'LeftFoot', u'LeftFootThumb1', u'LeftFootThumb2', u'Spine', u'Spine1', u'Spine2', u'Spine3', u'LeftShoulder', u'LeftArm', u'LeftForeArm', u'LeftHand', u'LeftHandMiddle1', u'LeftHandMiddle2', u'LeftHandMiddle3', u'Neck', u'Head', u'RightShoulder', u'RightArm', u'RightForeArm', u'RightHand', u'RightHandMiddle1', u'RightHandMiddle2', u'RightHandMiddle3', u'RightUpLeg', u'RightLeg', u'RightFoot', u'RightFootThumb1', u'RightFootThumb2'] #
# force the previz to reload the character files for a given cache proxy
cmds.glmLayoutTool(cacheProxy="cacheProxyShape1", dirtyAssetsRepartition=True)