Esempio n. 1
0
def setKey():
    KeyTypeOptionVar = OptionVarFactory('cgmVar_KeyType', defaultValue=0)
    KeyModeOptionVar = OptionVarFactory('cgmVar_KeyMode', defaultValue=0)

    if not KeyModeOptionVar.value:  #This is default maya keying mode
        selection = mc.ls(sl=True) or []
        if not selection:
            return guiFactory.warning('Nothing selected!')

        if not KeyTypeOptionVar.value:
            mc.setKeyframe(selection)
        else:
            mc.setKeyframe(breakdown=True)
    else:  #Let's check the channel box for objects
        print 'cb mode'
        selection = search.returnSelectedAttributesFromChannelBox(False) or []
        if not selection:
            selection = mc.ls(sl=True) or []
            if not selection:
                return guiFactory.warning('Nothing selected!')

        if not KeyTypeOptionVar.value:
            mc.setKeyframe(selection)
        else:
            mc.setKeyframe(selection, breakdown=True)
Esempio n. 2
0
def setKey():
	KeyTypeOptionVar = OptionVarFactory('cgmVar_KeyType', defaultValue = 0)
	KeyModeOptionVar = OptionVarFactory('cgmVar_KeyMode', defaultValue = 0)	
	
	if not KeyModeOptionVar.value:#This is default maya keying mode
		selection = mc.ls(sl=True) or []
		if not selection:
			return guiFactory.warning('Nothing selected!')
			
		if not KeyTypeOptionVar.value:
			mc.setKeyframe(selection)
		else:
			mc.setKeyframe(breakdown = True)
	else:#Let's check the channel box for objects
		print 'cb mode'
		selection = search.returnSelectedAttributesFromChannelBox(False) or []
		if not selection:
			selection = mc.ls(sl=True) or []
			if not selection:
				return guiFactory.warning('Nothing selected!')
		
		if not KeyTypeOptionVar.value:
			mc.setKeyframe(selection)
		else:
			mc.setKeyframe(selection,breakdown = True)		
Esempio n. 3
0
def deleteKey():
    KeyTypeOptionVar = cgmMeta.cgmOptionVar('cgmVar_KeyType', defaultValue = 0)
    KeyModeOptionVar = cgmMeta.cgmOptionVar('cgmVar_KeyMode', defaultValue = 0)	

    if not KeyModeOptionVar.value:#This is default maya keying mode
        selection = mc.ls(sl=True) or []
        if not selection:
            return log.warning('cgmPuppetKey.deleteKey>>> Nothing l_selected!')

        if not KeyTypeOptionVar.value:
            mc.cutKey(selection)	    
        else:
            mc.cutKey(selection)	    
    else:#Let's check the channel box for objects
        selection = search.returnSelectedAttributesFromChannelBox(False) or []
        if not selection:
            selection = mc.ls(sl=True) or []
            if not selection:
                return log.warning('cgmPuppetKey.deleteKey>>> Nothing l_selected!')

        if not KeyTypeOptionVar.value:
            mc.cutKey(selection)	    
        else:
            mc.cutKey(selection,breakdown = True)	
Esempio n. 4
0
def deleteKey():
    KeyTypeOptionVar = cgmMeta.cgmOptionVar('cgmVar_KeyType', defaultValue = 0)
    KeyModeOptionVar = cgmMeta.cgmOptionVar('cgmVar_KeyMode', defaultValue = 0)	

    if not KeyModeOptionVar.value:#This is default maya keying mode
	selection = mc.ls(sl=True) or []
	if not selection:
	    return log.warning('cgmPuppetKey.deleteKey>>> Nothing l_selected!')

	if not KeyTypeOptionVar.value:
	    mc.cutKey(selection)	    
	else:
	    mc.cutKey(selection)	    
    else:#Let's check the channel box for objects
	selection = search.returnSelectedAttributesFromChannelBox(False) or []
	if not selection:
	    selection = mc.ls(sl=True) or []
	    if not selection:
		return log.warning('cgmPuppetKey.deleteKey>>> Nothing l_selected!')

	if not KeyTypeOptionVar.value:
	    mc.cutKey(selection)	    
	else:
	    mc.cutKey(selection,breakdown = True)