터치디자이너 pygetwindow(다른 프로젝트 창 활성화 시키기)
PyGetWindow
A simple, cross-platform module for obtaining GUI information on application's windows.
pypi.org
appName table DAT에 있는 이름을 받아옴.
udpin 에서 신호를 받아옴.
현재 구조는 신호 값이 1일 때 app1을 실행시키고 그 외에는 app2를 실행시킴.
*controller -> datToChop CHOP
*pygetWindow -> chopExecute CHOP
*appName -> table DAT
아래는 기본적인 구조를 정리한 것.
pyGetWindow는 chop execute임 스크립트의 내용은 아래와 같음.
ctrl = op('controller')['chan1']
app1 = op('appName')[1,0]
app2 = op('appName')[1,1]
import pygetwindow as gw
def onValueChange(channel, sampleIndex, val, prev):
gw.getAllWindows()
appList = gw.getAllTitles()
if app1 and app2 in appList:
if ctrl ==1:
window1 = gw.getWindowsWithTitle(str(app1))[0]
if window1.isActive is False:
window1.activate()
print('1')
if ctrl == -1:
window2 = gw.getWindowsWithTitle(str(app2))[0]
if window2.isActive is False:
window2.activate()
print('2')
return
*놀라운 사실 한 가지는 perform mode에서 창을 resize하게 되면
터디가 제대로 작동하지 않을 수 있다. perform mode의 창의 사이즈를 변경하지 말도록.
이번에 테스트 해보면서 가장 문제를 많이 일으켜서 고생했다.
udp 신호는 packet sender를 다운 받아서 테스트 해 봄.
아래 링크 첨부.
Packet Sender - Free utility to for sending / receiving of network packets. TCP, UDP, SSL.
Packet Sender is a free utility to for sending / receiving of network packets. Support for TCP, UDP, and SSL.
PacketSender.com