コード例 #1
0
    def buildMatchLayout(self, parent):

        MatchColumn = MelColumnLayout(parent)

        #>>>  Tag Section
        guiFactory.lineSubBreak()
        guiFactory.doButton2(
            MatchColumn, 'Tag it', lambda *a: locinatorLib.doTagObjects(self),
            "Tag the selected objects to the first locator in the selection set. After this relationship is set up, you can match objects to that locator."
        )

        #>>>  Purge Section
        guiFactory.lineSubBreak()
        self.helpBlurbs.extend(
            guiFactory.instructions(
                "  Purge all traces of cgmThinga tools from the object",
                vis=self.ShowHelpOption))
        guiFactory.doButton2(MatchColumn, 'Purge it',
                             lambda *a: locinatorLib.doPurgeCGMAttrs(self),
                             "Clean it")

        guiFactory.lineBreak()

        #>>> Update Section
        guiFactory.lineSubBreak()
        guiFactory.doButton2(
            MatchColumn, 'Update Selected',
            lambda *a: locinatorLib.doUpdateLoc(self),
            "Only works with locators created with this tool")
コード例 #2
0
ファイル: locinator.py プロジェクト: GuidoPollini/MuTools
	def buildMatchLayout(self,parent):

		MatchColumn = MelColumnLayout(parent)

		#>>>  Tag Section
		guiFactory.lineSubBreak()
		guiFactory.doButton2(MatchColumn,'Tag it',
		                     lambda *a: locinatorLib.doTagObjects(self),
				             "Tag the selected objects to the first locator in the selection set. After this relationship is set up, you can match objects to that locator.")


		#>>>  Purge Section
		guiFactory.lineSubBreak()
		self.helpBlurbs.extend(guiFactory.instructions("  Purge all traces of cgmThinga tools from the object",vis = self.ShowHelpOption))
		guiFactory.doButton2(MatchColumn,'Purge it',
		                     lambda *a: locinatorLib.doPurgeCGMAttrs(self),
				             "Clean it")

		guiFactory.lineBreak()

		#>>> Update Section
		guiFactory.lineSubBreak()
		guiFactory.doButton2(MatchColumn,'Update Selected',
		                     lambda *a: locinatorLib.doUpdateLoc(self),
				             "Only works with locators created with this tool")
コード例 #3
0
    def buildTimeSubMenu(self, parent):
        self.containerName = MelColumnLayout(parent, ut='cgmUISubTemplate')
        # Time Submenu
        mc.setParent(self.containerName)
        self.helpBlurbs.extend(
            guiFactory.instructions(" Set your time range",
                                    vis=self.ShowHelpOption))

        timelineInfo = search.returnTimelineInfo()

        # TimeInput Row
        TimeInputRow = MelHSingleStretchLayout(self.containerName,
                                               ut='cgmUISubTemplate')
        self.timeSubMenu.append(TimeInputRow)
        MelSpacer(TimeInputRow)
        MelLabel(TimeInputRow, l='start')

        self.startFrameField = MelIntField(TimeInputRow,
                                           'cgmLocWinStartFrameField',
                                           width=40,
                                           value=timelineInfo['rangeStart'])
        TimeInputRow.setStretchWidget(MelSpacer(TimeInputRow))
        MelLabel(TimeInputRow, l='end')

        self.endFrameField = MelIntField(TimeInputRow,
                                         'cgmLocWinEndFrameField',
                                         width=40,
                                         value=timelineInfo['rangeEnd'])

        MelSpacer(TimeInputRow)
        TimeInputRow.layout()

        MelSeparator(self.containerName,
                     ut='cgmUISubTemplate',
                     style='none',
                     height=5)

        # Button Row
        TimeButtonRow = MelHSingleStretchLayout(self.containerName,
                                                padding=1,
                                                ut='cgmUISubTemplate')
        MelSpacer(TimeButtonRow, w=2)
        currentRangeButton = guiFactory.doButton2(
            TimeButtonRow, 'Current Range',
            lambda *a: locinatorLib.setGUITimeRangeToCurrent(self),
            'Sets the time range to the current slider range')
        TimeButtonRow.setStretchWidget(MelSpacer(TimeButtonRow, w=2))
        sceneRangeButton = guiFactory.doButton2(
            TimeButtonRow, 'Scene Range',
            lambda *a: locinatorLib.setGUITimeRangeToScene(self),
            'Sets the time range to the current slider range')
        MelSpacer(TimeButtonRow, w=2)

        TimeButtonRow.layout()

        #>>> Base Settings Flags
        self.KeyingModeCollection = MelRadioCollection()
        self.KeyingModeCollectionChoices = []
        if not mc.optionVar(ex='cgmVar_LocinatorKeyingMode'):
            mc.optionVar(iv=('cgmVar_LocinatorKeyingMode', 0))
        guiFactory.appendOptionVarList(self, 'cgmVar_LocinatorKeyingMode')

        KeysSettingsFlagsRow = MelHSingleStretchLayout(self.containerName,
                                                       ut='cgmUISubTemplate',
                                                       padding=2)
        MelSpacer(KeysSettingsFlagsRow, w=2)
        KeysSettingsFlagsRow.setStretchWidget(
            MelLabel(KeysSettingsFlagsRow, l='Anim Option: ', align='right'))
        self.keyingOptions = ['Keys', 'All']
        for item in self.keyingOptions:
            cnt = self.keyingOptions.index(item)
            self.KeyingModeCollectionChoices.append(
                self.KeyingModeCollection.createButton(
                    KeysSettingsFlagsRow,
                    label=self.keyingOptions[cnt],
                    onCommand=Callback(guiFactory.toggleOptionVarState,
                                       self.keyingOptions[cnt],
                                       self.keyingOptions,
                                       'cgmVar_LocinatorKeyingMode', True)))
            MelSpacer(KeysSettingsFlagsRow, w=5)
        mc.radioCollection(self.KeyingModeCollection,
                           edit=True,
                           sl=(self.KeyingModeCollectionChoices[(mc.optionVar(
                               q='cgmVar_LocinatorKeyingMode'))]))

        KeysSettingsFlagsRow.layout()

        #>>> Base Settings Flags
        self.KeyingTargetCollection = MelRadioCollection()
        self.KeyingTargetCollectionChoices = []
        if not mc.optionVar(ex='cgmVar_LocinatorKeyingTarget'):
            mc.optionVar(iv=('cgmVar_LocinatorKeyingTarget', 0))
        guiFactory.appendOptionVarList(self, 'cgmVar_LocinatorKeyingTarget')

        BakeSettingsFlagsRow = MelHSingleStretchLayout(self.containerName,
                                                       ut='cgmUISubTemplate',
                                                       padding=2)
        MelSpacer(BakeSettingsFlagsRow, w=2)
        BakeSettingsFlagsRow.setStretchWidget(
            MelLabel(BakeSettingsFlagsRow, l='From: ', align='right'))
        MelSpacer(BakeSettingsFlagsRow)
        self.keyTargetOptions = ['source', 'self']
        for item in self.keyTargetOptions:
            cnt = self.keyTargetOptions.index(item)
            self.KeyingTargetCollectionChoices.append(
                self.KeyingTargetCollection.createButton(
                    BakeSettingsFlagsRow,
                    label=self.keyTargetOptions[cnt],
                    onCommand=Callback(guiFactory.toggleOptionVarState,
                                       self.keyTargetOptions[cnt],
                                       self.keyTargetOptions,
                                       'cgmVar_LocinatorKeyingTarget', True)))
            MelSpacer(BakeSettingsFlagsRow, w=5)
        mc.radioCollection(
            self.KeyingTargetCollection,
            edit=True,
            sl=(self.KeyingTargetCollectionChoices[(mc.optionVar(
                q='cgmVar_LocinatorKeyingTarget'))]))

        BakeSettingsFlagsRow.layout()

        return self.containerName
コード例 #4
0
ファイル: locinator.py プロジェクト: GuidoPollini/MuTools
	def buildTimeSubMenu(self,parent):
		self.containerName = MelColumnLayout(parent,ut='cgmUISubTemplate')
		# Time Submenu
		mc.setParent(self.containerName)
		self.helpBlurbs.extend(guiFactory.instructions(" Set your time range",vis = self.ShowHelpOption))

		timelineInfo = search.returnTimelineInfo()


		# TimeInput Row
		TimeInputRow = MelHSingleStretchLayout(self.containerName,ut='cgmUISubTemplate')
		self.timeSubMenu.append( TimeInputRow )
		MelSpacer(TimeInputRow)
		MelLabel(TimeInputRow,l='start')

		self.startFrameField = MelIntField(TimeInputRow,'cgmLocWinStartFrameField',
	                                       width = 40,
	                                       value= timelineInfo['rangeStart'])
		TimeInputRow.setStretchWidget( MelSpacer(TimeInputRow) )
		MelLabel(TimeInputRow,l='end')

		self.endFrameField = MelIntField(TimeInputRow,'cgmLocWinEndFrameField',
	                                     width = 40,
	                                     value= timelineInfo['rangeEnd'])

		MelSpacer(TimeInputRow)
		TimeInputRow.layout()

		MelSeparator(self.containerName,ut = 'cgmUISubTemplate',style='none',height = 5)
		

		# Button Row
		TimeButtonRow = MelHSingleStretchLayout(self.containerName,padding = 1, ut='cgmUISubTemplate')
		MelSpacer(TimeButtonRow,w=2)
		currentRangeButton = guiFactory.doButton2(TimeButtonRow,'Current Range',
	                                              lambda *a: locinatorLib.setGUITimeRangeToCurrent(self),
	                                              'Sets the time range to the current slider range')
		TimeButtonRow.setStretchWidget( MelSpacer(TimeButtonRow,w=2) )
		sceneRangeButton = guiFactory.doButton2(TimeButtonRow,'Scene Range',
	                                            lambda *a: locinatorLib.setGUITimeRangeToScene(self),
	                                            'Sets the time range to the current slider range')
		MelSpacer(TimeButtonRow,w=2)
		
		TimeButtonRow.layout()

		
		#>>> Base Settings Flags
		self.KeyingModeCollection = MelRadioCollection()
		self.KeyingModeCollectionChoices = []		
		if not mc.optionVar( ex='cgmVar_LocinatorKeyingMode' ):
			mc.optionVar( iv=('cgmVar_LocinatorKeyingMode', 0) )
		guiFactory.appendOptionVarList(self,'cgmVar_LocinatorKeyingMode')	
			
		
		KeysSettingsFlagsRow = MelHSingleStretchLayout(self.containerName,ut='cgmUISubTemplate',padding = 2)
		MelSpacer(KeysSettingsFlagsRow,w=2)	
		KeysSettingsFlagsRow.setStretchWidget( MelLabel(KeysSettingsFlagsRow,l='Anim Option: ',align='right') )
		self.keyingOptions = ['Keys','All']
		for item in self.keyingOptions:
			cnt = self.keyingOptions.index(item)
			self.KeyingModeCollectionChoices.append(self.KeyingModeCollection.createButton(KeysSettingsFlagsRow,label=self.keyingOptions[cnt],
			                                                                               onCommand = Callback(guiFactory.toggleOptionVarState,self.keyingOptions[cnt],self.keyingOptions,'cgmVar_LocinatorKeyingMode',True)))
			MelSpacer(KeysSettingsFlagsRow,w=5)
		mc.radioCollection(self.KeyingModeCollection ,edit=True,sl= (self.KeyingModeCollectionChoices[ (mc.optionVar(q='cgmVar_LocinatorKeyingMode')) ]))
		
		KeysSettingsFlagsRow.layout()

		#>>> Base Settings Flags
		self.KeyingTargetCollection = MelRadioCollection()
		self.KeyingTargetCollectionChoices = []		
		if not mc.optionVar( ex='cgmVar_LocinatorKeyingTarget' ):
			mc.optionVar( iv=('cgmVar_LocinatorKeyingTarget', 0) )
		guiFactory.appendOptionVarList(self,'cgmVar_LocinatorKeyingTarget')	
			
		
		BakeSettingsFlagsRow = MelHSingleStretchLayout(self.containerName,ut='cgmUISubTemplate',padding = 2)
		MelSpacer(BakeSettingsFlagsRow,w=2)	
		BakeSettingsFlagsRow.setStretchWidget( MelLabel(BakeSettingsFlagsRow,l='From: ',align='right') )
		MelSpacer(BakeSettingsFlagsRow)
		self.keyTargetOptions = ['source','self']
		for item in self.keyTargetOptions:
			cnt = self.keyTargetOptions.index(item)
			self.KeyingTargetCollectionChoices.append(self.KeyingTargetCollection.createButton(BakeSettingsFlagsRow,label=self.keyTargetOptions[cnt],
		                                                                                       onCommand = Callback(guiFactory.toggleOptionVarState,self.keyTargetOptions[cnt],self.keyTargetOptions,'cgmVar_LocinatorKeyingTarget',True)))
			MelSpacer(BakeSettingsFlagsRow,w=5)
		mc.radioCollection(self.KeyingTargetCollection ,edit=True,sl= (self.KeyingTargetCollectionChoices[ (mc.optionVar(q='cgmVar_LocinatorKeyingTarget')) ]))
		
		BakeSettingsFlagsRow.layout()
		
		return self.containerName