def connectDevice(): serverAddress = KinectTest_TextFieldGrp_ServerAddress.getText() serverAddress = serverAddress + ":" + str(KinectTest_IntFieldGrp_Port.getValue1()) pm.defineDataServer(s=serverAddress,d='KinectCapture') #melGlobals.initVar( 'string[]', 'KinectSkelNames' ) i=0 for i in range(0,24): pm.attachDeviceAttr((KinectSkelNames[i] + ".translateX"),ax=(KinectSkelNames[i] + "_POS:X"),d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_POS:X"),scale=-0.01,d="KinectCapture",at=(KinectSkelNames[i] + ".translateX")) pm.attachDeviceAttr((KinectSkelNames[i] + ".translateY"),ax=(KinectSkelNames[i] + "_POS:Y"),d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_POS:Y"),scale=+0.01,d="KinectCapture",at=(KinectSkelNames[i] + ".translateY")) pm.attachDeviceAttr((KinectSkelNames[i] + ".translateZ"),ax=(KinectSkelNames[i] + "_POS:Z"),d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_POS:Z"),scale=-0.01,d="KinectCapture",at=(KinectSkelNames[i] + ".translateZ")) pm.attachDeviceAttr((KinectSkelNames[i] + ".rotateX"),ax=(KinectSkelNames[i] + "_ORI:X"),d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_ORI:X"),scale=-1.0,d="KinectCapture",at=(KinectSkelNames[i] + ".rotateX")) pm.attachDeviceAttr((KinectSkelNames[i] + ".rotateY"),ax=(KinectSkelNames[i] + "_ORI:Y"),d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_ORI:Y"),scale=-1.0,d="KinectCapture",at=(KinectSkelNames[i] + ".rotateY")) pm.attachDeviceAttr((KinectSkelNames[i] + ".rotateZ"),ax=(KinectSkelNames[i] + "_ORI:Z"),d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_ORI:Z"),scale=-1.0,d="KinectCapture",at=(KinectSkelNames[i] + ".rotateZ")) pm.attachDeviceAttr("KINECT_HAND.translateX",ax="HAND_POS:X",d="KinectCapture") pm.setAttrMapping(ax="HAND_POS:X",scale=1.3,d="KinectCapture",at="KINECT_HAND.translateX") pm.attachDeviceAttr("KINECT_HAND.translateY",ax="HAND_POS:Y",d="KinectCapture") pm.setAttrMapping(ax="HAND_POS:Y",scale=1.3,d="KinectCapture",at="KINECT_HAND.translateY") pm.attachDeviceAttr("KINECT_HAND.translateZ",ax="HAND_POS:Z",d="KinectCapture") pm.setAttrMapping(ax="HAND_POS:Z",scale=1.3,d="KinectCapture",at="KINECT_HAND.translateZ") Recording = True print Recording
def discDevice(): pm.defineDataServer(undefine=True,d='KinectCapture')
def connectDevice(): serverAddress = KinectTest_TextFieldGrp_ServerAddress.getText() serverAddress = serverAddress + ":" + str( KinectTest_IntFieldGrp_Port.getValue1()) pm.defineDataServer(s=serverAddress, d='KinectCapture') #melGlobals.initVar( 'string[]', 'KinectSkelNames' ) i = 0 for i in range(0, 24): pm.attachDeviceAttr((KinectSkelNames[i] + ".translateX"), ax=(KinectSkelNames[i] + "_POS:X"), d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_POS:X"), scale=-0.01, d="KinectCapture", at=(KinectSkelNames[i] + ".translateX")) pm.attachDeviceAttr((KinectSkelNames[i] + ".translateY"), ax=(KinectSkelNames[i] + "_POS:Y"), d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_POS:Y"), scale=+0.01, d="KinectCapture", at=(KinectSkelNames[i] + ".translateY")) pm.attachDeviceAttr((KinectSkelNames[i] + ".translateZ"), ax=(KinectSkelNames[i] + "_POS:Z"), d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_POS:Z"), scale=-0.01, d="KinectCapture", at=(KinectSkelNames[i] + ".translateZ")) pm.attachDeviceAttr((KinectSkelNames[i] + ".rotateX"), ax=(KinectSkelNames[i] + "_ORI:X"), d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_ORI:X"), scale=-1.0, d="KinectCapture", at=(KinectSkelNames[i] + ".rotateX")) pm.attachDeviceAttr((KinectSkelNames[i] + ".rotateY"), ax=(KinectSkelNames[i] + "_ORI:Y"), d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_ORI:Y"), scale=-1.0, d="KinectCapture", at=(KinectSkelNames[i] + ".rotateY")) pm.attachDeviceAttr((KinectSkelNames[i] + ".rotateZ"), ax=(KinectSkelNames[i] + "_ORI:Z"), d="KinectCapture") pm.setAttrMapping(ax=(KinectSkelNames[i] + "_ORI:Z"), scale=-1.0, d="KinectCapture", at=(KinectSkelNames[i] + ".rotateZ")) pm.attachDeviceAttr("KINECT_HAND.translateX", ax="HAND_POS:X", d="KinectCapture") pm.setAttrMapping(ax="HAND_POS:X", scale=1.3, d="KinectCapture", at="KINECT_HAND.translateX") pm.attachDeviceAttr("KINECT_HAND.translateY", ax="HAND_POS:Y", d="KinectCapture") pm.setAttrMapping(ax="HAND_POS:Y", scale=1.3, d="KinectCapture", at="KINECT_HAND.translateY") pm.attachDeviceAttr("KINECT_HAND.translateZ", ax="HAND_POS:Z", d="KinectCapture") pm.setAttrMapping(ax="HAND_POS:Z", scale=1.3, d="KinectCapture", at="KINECT_HAND.translateZ") Recording = True print Recording
def discDevice(): pm.defineDataServer(undefine=True, d='KinectCapture')