glmCharacterMaker

The glmCharacterMaker command allows to open a Character File (.gcha) in the Character Maker and also edit its Geometry Nodes.

glmCharacterMaker [-openedFiles] [-currentFile] [-file string] [-fileTab string] [-fileTabNeedsSave string] [-script] [-addSkeleton string int int] [-addGeometry string string string] [-listGeoNodes] [-addGeoNode string string] [-removeGeoNode string string] [-addSkeletonOverride string string] [-addBlindDataOverride string] [-listRenderingTypes] [-queryRenderingType string] [-editRenderingType string string] [-addRenderingType string] [-removeRenderingType string] [-queryProperties string] [-editProperties string string string] [-outputFile string]

Flags

Long name (short name) Argument types Properties Description
-openedFiles (-opf)     Returns the paths of the files currently opened in the Character Maker as a tab. Other flags will be ignored if this flag is set.
-currentFile (-crf)     Returns the path of the file currently active in the Character Maker as a tab. Other flags will be ignored if this flag is set.
-file (-f) string multi-use File paths to the Character Files to open/edit. When editing geometry nodes, only the first file will be taken into account.
-fileTab (-fta) string   Tab file of the Character File to open/edit. The value must be similar to a value returned by the -openedFiles flag.
-fileTabNeedsSave (-fns) string   Returns true if the tab file needs to be saved. The value must be similar to a value returned by the -openedFiles flag.
-script (-scr)     Activate the Character Maker script mode. This flag needs to be set in order to modify a Character File.
-addSkeleton (-ask) string int int int float float needs -script flag Create an automatic Golaem Character File skeleton by reproducing the behavior of the Load Selected Skeleton / Auto Compute Skeleton Mapping buttons. The first argument corresponds to the name of the Maya joint to load as Skeleton root. The second to forth argument are relative to the Load Selected Skeleton procedure: the Detection Mode (0 for Joint orient, 1 for Bind Pose, 2 for Current Value), the Up Axis (0 for X, 1 for Y, 2 for Z) and Front Axis. The fifth and sixth attributes are relative to the Auto Compute Skeleton Mapping procedure: the Auxiliary Detection factor (0.05 per default) and the Roll Max Angle (in °) (3° per default)

-updateSkeleton (-usk)

string int int needs -script flag

Update the Golaem Character File skeleton by reproducing the behavior of the Load Selected Skeleton button when a skeleton is already defined (see Reloading a Skeleton), in order to keep the existing skeleton mapping. The first argument is the name of the Maya joint to load as Skeleton root. The second argument is the detection mode of the load skeleton procedure: 0 for Joint orient, 1 for Bind Pose, 2 for Current Value. The third argument is the remapping mode in the reloading procedure: 0 for Remap by name, 1 for Remap by bone id.

-addGeometry (-age) string string string needs -script flag Create an Automatic Golaem Character File geometry by reproducing the behavior of the Import Geometry button. The first and second arguments are the type and the name of the parent node to which the new nodes will be connected. The third argument corresponds to the name of the Maya mesh or group to load the geometry from.
-listGeoNodes (-lst)   needs -script flag List all the Geometry Nodes in the Character File
-addGeoNode (-agn) string string needs -script flag, multi-use Add a new Geometry Node with the given type and name. The command returns the names of the added nodes.
-removeGeoNode (-rgn) string string needs -script flag, multi-use Remove the Geometry Node with the given type and name. The command returns the names of the removed nodes.
-addSkeletonOverride (-aso) string string needs -script flag Reads a Maya skeleton root hierarchy and adds a new preconfigured Skeleton Override Geometry Node with the given name. Once created, it can be manipulated like any other Geometry Node.
-addBlindDataOverride (-abo) string needs -script flag Reads the Maya scene and adds a new preconfigured Blind Data Override Geometry Node with the given name. Once created, it can be manipulated like any other Geometry Node.
-listRenderingTypes (-lrt)   needs -script flag List all the Rendering Types.
-queryRenderingType (-qrt) string needs -script flag, multi-use List all the properties of the given Rendering Type. Properties are listed as: "property1=value1;property2=value2" etc.
-editRenderingType (-ert) string string needs -script flag, multi-use Edit the properties of a Rendering Type. The first argument is the name of the Rendering Type. The second argument is the properties to change, listed as "property1=value1;property2=value2" etc. 
-addRenderingType (-art) string needs -script flag, multi-use Add a new Rendering Type with the given name. The command returns the names of the added Rendering Types.
-removeRenderingType (-rrt) string needs -script flag, multi-use Remove the Rendering Type with the given name. The command returns the names of the removed Rendering Types.
-queryProperties (-qpr) string needs -script flag, multi-use List all the properties of the given Geometry Node. Properties are listed as: "property1=value1;property2=value2" etc.
-editProperties (-epr) string string string needs -script flag, multi-use Edit the properties of a Geometry Node. The first argument is its type (as given by the -queryProperties flag). The second argument is the name of the node. The third argument is the node properties to change, listed as "property1=value1;property2=value2" etc. The type is needed to avoid any ambiguity when editing the node.
-outputFile (-of) string needs -script flag Save the edited Character File to the given filename.

MEL Examples

string $fileName = "C:/crowdMan_light.gcha";
string $fileName2 = "C:/crowdMan2.gcha";
string $fileName3 = "C:/crowdMan3.gcha";

// Creates a Character automatically from the Maya Character
glmCharacterMaker -script -file "" -addSkeleton "Reference" 0 1 0 0. 0. -addGeometry "CharacterNode" "Character" "MAN_MD_parts" -outputFile $fileName;
// Result: MAN_MD_parts MAN_MD_body_part MAN_MD_head_top_part MAN_MD_torso_undercoat_part MAN_MD_legs_pants_part MAN_MD_legs_shoes_part MAN_MD_Flags [...] MAN_MD_body_textureIdx // 

// Link Geometry File
glmCharacterMaker -script -file $fileName -editProperties "CharacterNode" "Character" "geometry=C:/CMO-man_golaem.gcg,3,5,0,0,1000" -outputFile $fileName;

glmCharacterMaker -script -file $fileName -listGeoNodes;
// Result: Character MAN_MD_parts MAN_MD_body_part MAN_MD_head_top_part MAN_MD_torso_undercoat_part MAN_MD_legs_pants_part MAN_MD_legs_shoes_part [...] MAN_MD_body_legs_foots //

glmCharacterMaker -script -file $fileName -queryProperties "MAN_MD_bodySG" -queryProperties "Character" -queryProperties "MAN_MD_torso_undercoat_part";
// Result: name=Character; type=CharacterNode; child=MAN_MD_parts; geometry=C:/CMO-man_golaem.gcg,3,5,0,0,1000;  name=MAN_MD_torso_undercoat_part; type=AssetGroupNode; parent=MAN_MD_parts; child=MAN_MD_torso_tshirt_std; child=MAN_MD_torso_sweatshirt_standard; weighted=1; weights=50,50 name=MAN_MD_bodySG; type=ShadingGroupNode; parent=MAN_MD_body_head; parent=MAN_MD_body_arms_biceps; parent=MAN_MD_body_arms_hands; parent=MAN_MD_body_legs_full; parent=MAN_MD_body_legs_foots; child=MAN_MD_body; child=MAN_MD_body_textureIdx; // 

glmCharacterMaker -script -file $fileName -editProperties "CharacterNode" "Character" "name=Crowdman_Light" -editProperties "AssetGroupNode" "MAN_MD_legs_pants_part" "name=Underwear;parent=MAN_MD_torso_undercoat_part" -outputFile $fileName2;

glmCharacterMaker -script -file $fileName -addGeoNode "AssetGroupNode" "[Empty]" -addGeoNode "AssetGroupNode" "[Empty]" -editProperties "AssetGroupNode" "[Empty]" "parent=MAN_MD_torso_undercoat_part;child=[Empty]1" -outputFile $fileName2;
// Result: [Empty] [Empty]1 // 

glmCharacterMaker -script -file $fileName2 -removeGeoNode "AssetGroupNode" "[Empty]" -removeGeoNode "AssetGroupNode" "[Empty]1" -outputFile $fileName3;
// Result: [Empty] [Empty]1 // 

glmCharacterMaker -script -file $fileName -listRenderingTypes;

glmCharacterMaker -script -file $fileName -addRenderingType "CrowdManLight" -outputFile $fileName;
// Result: CrowdManLight // 

glmCharacterMaker -script -file $fileName -listRenderingTypes;
// Result: CrowdManLight // 

glmCharacterMaker -script -file $fileName -queryRenderingType "CrowdManLight";
// Result: name=CrowdManLight;parent=-1 // 

glmCharacterMaker -script -file $fileName -editRenderingType "CrowdManLight" "name=CrowdManL;parent=-1;groupWeights=MAN_MD_torso_undercoat_part,15,20" -outputFile $fileName2;

glmCharacterMaker -script -file $fileName2 -queryRenderingType "CrowdManL";
// Result: name=CrowdManL;parent=-1;groupWeights=MAN_MD_torso_undercoat_part,15,20 //

glmCharacterMaker -script -file $fileName -addRenderingType "CrowdMan" -addRenderingType "CrowdMan" -editRenderingType "CrowdMan1" "name=CrowdMan_01;groupWeights=MAN_MD_torso_undercoat_part,33,66;" -outputFile $fileName2;
// Result: CrowdMan CrowdMan1 // 

glmCharacterMaker -script -file $fileName2 -listRenderingTypes;
// Result: CrowdManLight CrowdMan CrowdMan_01 // 

glmCharacterMaker -script -file $fileName2 -queryRenderingType "CrowdMan_01";
// Result: name=CrowdMan_01;parent=-1;groupWeights=MAN_MD_torso_undercoat_part,33,66 // 

glmCharacterMaker -script -file $fileName2 -removeRenderingType "CrowdMan" -removeRenderingType "CrowdMan_01" -outputFile $fileName3;
// Result: CrowdMan CrowdMan_01 // 

glmCharacterMaker -script -file $fileName3 -listRenderingTypes;
// Result: CrowdManLight // 

Python Examples

import maya.cmds as cmds

fileName = "D:/Temp/crowdMan_light.gcha";
fileName2 = "D:/Temp/crowdMan2.gcha";

# Creates a Character automatically from the Maya Character
cmds.glmCharacterMaker(script=True, file="", addSkeleton=["Reference", 0, 1, 0, 0., 0.], addGeometry=["CharacterNode", "Character", "MAN_MD_parts"], outputFile=fileName)
# Result: [u'MAN_MD_parts', u'MAN_MD_body_part', u'MAN_MD_head_top_part', u'MAN_MD_torso_undercoat_part', u'MAN_MD_legs_pants_part', [...], u'MAN_MD_body_textureIdx'] #

// Link Geometry File
cmds.glmCharacterMaker(script=True, file=fileName, editProperties=["CharacterNode","Character","geometry=D:/Temp/CMO-man_golaem.gcg,3,5,0,0,1000"], outputFile=fileName2)

cmds.glmCharacterMaker(script=True, file=fileName, editProperties=["CharacterNode","Character","geometry=D:/Temp/CMO-man_golaem.gcg,3,5,0,0,1000"], outputFile=fileName2)
# Result: [u'name=Character; type=CharacterNode; child=MAN_MD_parts; ', u'name=MAN_MD_torso_undercoat_part; type=AssetGroupNode; parent=MAN_MD_parts; child=MAN_MD_torso_tshirt_std; child=MAN_MD_torso_sweatshirt_standard; weighted=1; weights=50,50', u'name=MAN_MD_bodySG; type=ShadingGroupNode; parent=MAN_MD_body_head; parent=MAN_MD_body_arms_biceps; parent=MAN_MD_body_arms_hands; parent=MAN_MD_body_legs_full; parent=MAN_MD_body_legs_foots; child=MAN_MD_body; child=MAN_MD_body_textureIdx;'] #