コード例 #1
0
ファイル: prefsaver.py プロジェクト: Italic-/maya-prefs
    def addControl(self, control, uiType, defaultValue=None):

        if not UIType.isTypeOf(uiType, UIType.TypesAll):
            message('Cannot add unknown control type ({0}) for {1}. Skipped'.format(uiType, str(control)))
            return

        if UIType.isTypeOf(uiType, UIType.TypesPYQT | UIType.TypesPYSIDE):
            controller = ctrl_qt.getController(uiType, control, defaultValue)
            if controller:
                self.controllers.append(controller)
            else:
                message('Failed to add controller (type={0}) for {1}'.format(uiType, str(control)))
            return

        if UIType.isTypeOf(uiType, UIType.TypesM):
            if ctrl_maya:
                self.controllers.append(ctrl_maya.getController(uiType, control, defaultValue))
            else:
                message('Failed to add controller (type={0}) for {1}'.format(uiType, str(control)))
            return

        if UIType.isTypeOf(uiType, UIType.TypesPM):
            if ctrl_pymel:
                self.controllers.append(ctrl_pymel.getController(uiType, control, defaultValue))
            else:
                message('Failed to add controller (type={0}) for {1}'.format(uiType, str(control)))
            return

        assert False, 'Failed to add a controller.'
コード例 #2
0
    def addControl(self, control, uiType, defaultValue=None):

        if not UIType.isTypeOf(uiType, UIType.TypesAll):
            message('Cannot add unknown control type ({0}) for {1}. Skipped'.
                    format(uiType, str(control)))
            return

        if UIType.isTypeOf(uiType, UIType.TypesPYQT | UIType.TypesPYSIDE):
            controller = ctrl_qt.getController(uiType, control, defaultValue)
            if controller:
                self.controllers.append(controller)
            else:
                message('Failed to add controller (type={0}) for {1}'.format(
                    uiType, str(control)))
            return

        if UIType.isTypeOf(uiType, UIType.TypesM):
            if ctrl_maya:
                self.controllers.append(
                    ctrl_maya.getController(uiType, control, defaultValue))
            else:
                message('Failed to add controller (type={0}) for {1}'.format(
                    uiType, str(control)))
            return

        if UIType.isTypeOf(uiType, UIType.TypesPM):
            if ctrl_pymel:
                self.controllers.append(
                    ctrl_pymel.getController(uiType, control, defaultValue))
            else:
                message('Failed to add controller (type={0}) for {1}'.format(
                    uiType, str(control)))
            return

        assert False, 'Failed to add a controller.'
コード例 #3
0
ファイル: ctrl_qt.py プロジェクト: youndoldman/fxpt
def getController(uiType, control, defaultValue):

    if uiType in constructors:

        if UIType.isTypeOf(uiType, UIType.TypesPYQT):
            if _PyQt4:
                return constructors[uiType](_PyQt4, control, defaultValue)
            else:
                message('Cannot create controller: PyQt is not available.')
                return

        if UIType.isTypeOf(uiType, UIType.TypesPYSIDE):
            if _PySide:
                return constructors[uiType](_PySide, control, defaultValue)
            else:
                message('Cannot create controller: PySide is not available.')
                return
コード例 #4
0
ファイル: ctrl_qt.py プロジェクト: theetcher/fxpt
def getController(uiType, control, defaultValue):

    if uiType in constructors:

        if UIType.isTypeOf(uiType, UIType.TypesPYQT):
            if _PyQt4:
                return constructors[uiType](_PyQt4, control, defaultValue)
            else:
                message('Cannot create controller: PyQt is not available.')
                return

        if UIType.isTypeOf(uiType, UIType.TypesPYSIDE):
            if _PySide:
                return constructors[uiType](_PySide, control, defaultValue)
            else:
                message('Cannot create controller: PySide is not available.')
                return