Object Sets are maya’s way to store selection of items in a set. By default, it’s mainly for selecting. But we’ve extended on that premise for more functionality. Specifically, keying, resetting and most importantly for sorting sets when working in a complex scene.

When an object set has a set type, it will be named as such. For example if you make a set called ‘armStuff’ as a animation type set, it’s maya name will be ‘armStuff_animSet’, if you change the set type, the name will change as well.

Several functions will not function on reference sets or on maya default sets.

‘qss’ means quick select set and are specific maya set type. Some tools (non cgm) require qss sets for them to see them.

Superclass : MetaClass/cgmNode

Subclass:  None


  • setName – name of an existing object set or a new name to be created.
  • setType– (‘animation’,’layout’,’modeling’,’td’,’fx’,’lighting’,False(default) – ‘Type of set you want set to
  • qssState – (bool) – Whether the set should be a qss set or not.
  • value – (string,float,int,list) – the information to be stored at call


  • qssState– (isQss,makeQss)
    • isQss– return if an object is qss
    • makeQss-changes the state
  • objectSetType(getSetType,doSetType)
    • getSetType– returns set type
    • doSetType(setType) – change set type
  • value(getList,doSetList)
    • getList – get a list of the items in a list
    • doSetList – declares the contents of a list


  • getParents() – sets can be nested, this returns a parent if there is one
  • addObj(obj) – append a value
  • addSelected()  – add selected items. Selection query includes channel box attributes
  • removeObj(obj) – remove an object from the set
  • removeSelected()
  • purge() – purge a set of all data
  • copy() – duplicate a set
  • select() – select the set items
  • selectSelf() – select the set itself
  • key(*args,**kws) – key the set members with the flags provided
  • reset() – resets set members with Morgan Loomis’ great tool
  • deleteKey(*args,**kws) – mc.cutKey(*args,**kws) pass through
  • deleteCurrentKey() – delete’s set member key at the current time position


from cgm.core import cgm_Meta as cgmM
import maya.cmds as mc

if mc.objExists('cgmTestSet'):#If the set already exists
    mc.delete('cgmTestSet')#delete it

pCube = cgmMeta(mc.polyCube()[0],name = 'pCube')
#Make and initialize a cube to work with

ObjectSetInstance = cgmM.cgmObjectSet(setName = 'cgmTestSet',qssState = True)
#Make a set and initialize it
MayaDefaultSet = cgmM.cgmObjectSet('defaultObjectSet')

assert MayaDefaultSet.mayaSetState == True 
#The default set is a maya default set
assert ObjectSetInstance.mayaSetState == False
#Ours is not

assert MayaDefaultSet.qssState == False 
#The default state is not a qss set
assert ObjectSetInstance.qssState == True 
#Ours is...
ObjectSetInstance.qssState = False
assert ObjectSetInstance.qssState == False 
#Until we declare it not to be

assert ObjectSetInstance.objectSetType == False 
#No type right now
ObjectSetInstance.objectSetType = 'animation'
assert ObjectSetInstance.objectSetType == 'animation' 
#Now it is

assert not ObjectSetInstance.value 
#No value now
assert ObjectSetInstance.doesContain(pCube.mNode) 
#Now has our cube
print ObjectSetInstance.value

ObjectSetInstance.value = [pCube.mNode+'.tx',pCube.mNode+'.ty']
#redeclare it's contents to a couple of attributes