def StartPreviewClick(): global previewing global index global RevThread global HandMask isHandMask = HandMask.isChecked() if not previewing: if (script.GetPickedObjectName() == ""): return if RevThread != None: return previewing = not previewing RecordBtn.setEnabled(False) PreviewBtn.setText("Stop Preview") RevThread = DataRecvThread(1) RevThread.connect() RevThread.start() script.SetDataWithParent([[1, 1], [5, 1], [6, 5], [7, 6], [2, 1], [3, 2], [4, 3], [8, 1], [23, 8], [24, 23], [20, 24], [15, 20], [19, 24], [12, 19], [13, 12], [14, 13], [18, 24], [9, 18], [10, 9], [11, 10], [17, 7], [16, 4]]) script.SetRotationOrder(0) try: script.BeginMocapAPI(script.GetPickedObjectName(), False, False) script.SetActivePart(script.GetPickedObjectName(), False, False, False, False, isHandMask, isHandMask, False, False, True, False) scriptEvent.Append("Timer", "Loop()", [1, -1]) except: debugMsg("Wrong Target") else: RecordBtn.setEnabled(True) PreviewBtn.setText("Start Preview") previewing = not previewing Stop() script.Stop() scriptEvent.StopTimer() RevThread.disconnect() RevThread.quit() RevThread.wait() RevThread = None # CacheBuf = MyCacheBuffer() script.EndCommand() # # global testbool # if not testbool: # testbool = True global isTpose if not isTpose: isTpose = True
def hideEvent(self,event): super(rlWidget, self).hideEvent(event) self.device.stop() scriptEvent.StopTimer() for i in range(len(self.relatedWidgetList)): self.relatedWidgetList[i].hide()
def hideEvent(self,event): super(rlWidget, self).hideEvent(event) #debugMsg(self.findChildren(QtWidgets.QWidget, "aaa")) ''' childrenList = self.findChildren(QtWidgets.QWidget) for i in range(len(childrenList)): childrenList[i].hide() #debugMsg(childrenList[i]) ''' self.device.stop() scriptEvent.StopTimer() for i in range(len(self.relatedWidgetList)): self.relatedWidgetList[i].hide()
def stop(): device.stop() scriptEvent.StopTimer()