Ejemplo n.º 1
0
    def __init__(self):
        super(AttachWidget, self).__init__()
        self.setupUi(self)
        self.setObjectName('AttachTool')
        self.setWindowTitle('Attach Tool')
        #self.setMinimumSize(250, 600)
        #self.setMaximumSize(250, 600)

        layout = QtGui.QVBoxLayout()
        #layout.addWidget(self.compWidget)
        layout.addWidget(self)
        self.setLayout(layout)

        #self.compWidget.widget_groupBox.toggled.connect(self.showAttach)
        self.attachPoint_groupBox.clicked.connect(self.assignObject)
        self.attachPointNode_groupBox.clicked.connect(self.assignObject)
        self.attachOrient_groupBox.clicked.connect(self.assignObject)
        self.attachOrientNode_groupBox.clicked.connect(self.assignObject)
Ejemplo n.º 2
0
    def __init__(self,
                 parent=None,
                 componentDict=None,
                 componentWidget=None,
                 compType='FKComponent',
                 assignPath=None,
                 limb=None,
                 puppet=None):

        super(EditWidget, self).__init__()

        #Init Default variables for Builder
        self.limb = limb
        self.oldLimb = None
        self.puppet = puppet
        self.compType = compType
        self.componentDict = componentDict
        self.componentListWidget = componentWidget

        if assignPath:
            self.compWidget = uic.loadUi(assignPath)

        #Add Hierarchy Widget
        self.hierWidget = uic.loadUi(HIERWIDGET)

        #Create Attach Widget
        attachObj = attachWidget.AttachWidget()
        self.attachWidget = attachObj

        #Add Execute Widget
        self.execWidget = uic.loadUi(EXECWIDGET)

        layout = QtGui.QVBoxLayout()
        if assignPath:
            layout.addWidget(self.compWidget)
        layout.addWidget(self.hierWidget)
        layout.addWidget(self.attachWidget)
        layout.addWidget(self.execWidget)
        self.setLayout(layout)

        #other settings
        #hierWidget width/height
        if assignPath:
            compHeight = self.compWidget.height()
        else:
            compHeight = 0
        height = compHeight + self.hierWidget.height(
        ) + self.attachWidget.height() + self.execWidget.height()
        self.setMinimumSize(500, height - 100)
        self.setMaximumSize(500, height - 100)

        self.settings = QtCore.QSettings()

        #Open in the Middle of the Screen
        screenWidth, screenHeight = self.screenCenter()
        self.move(QtCore.QPoint(screenWidth, screenHeight))

        #create dicts
        self._sceneGroupDict = dict()
        self._hierarchyAttrList = dict()
        self._attachAttrList = dict()

        if assignPath:
            self.compWidget.widget_groupBox.toggled.connect(self.showAttach)
        self.hierWidget.widget_groupBox.toggled.connect(self.showAttach)
        self.attachWidget.widget_groupBox.toggled.connect(self.showAttach)

        #ATTACH
        #attach widget things
        self.attachWidget.attachPoint_groupBox.clicked.connect(
            self.assignObject)
        self.attachWidget.attachPointNode_groupBox.clicked.connect(
            self.assignObject)
        self.attachWidget.attachOrient_groupBox.clicked.connect(
            self.assignObject)
        self.attachWidget.attachOrientNode_groupBox.clicked.connect(
            self.assignObject)

        #ATTACH SENDERS
        self.attachWidget.driven_pushButton.clicked.connect(self.assignObject)
        self.attachWidget.addDrivers_pushButton.clicked.connect(
            self.assignObject)
        self.attachWidget.removeDrivers_pushButton.clicked.connect(
            self.assignObject)
        self.attachWidget.loadConfig_pushButton.clicked.connect(
            self.assignObject)
        self.attachWidget.loadAttachPoint_pushButton.clicked.connect(
            self.assignObject)
        self.attachWidget.loadAttachOrient_pushButton.clicked.connect(
            self.assignObject)

        self.execWidget.cancel_pushButton.clicked.connect(self.close)

        #clean window
        self.slotReset()
        self.update()