diff --git a/FC_maya.h b/FC_maya.h index 781bd8a..8d6d0de 100644 --- a/FC_maya.h +++ b/FC_maya.h @@ -15,7 +15,7 @@ //taken from Maya SDK static char program[80]; -static char *server_name = program; +static char *server_name = "program"; static CapChannel px[MAX_MARKERS],py[MAX_MARKERS]; static void get_data(void); static int create_channels(void); diff --git a/mel/deviceConnector.mel b/mel/deviceConnector.mel index 753f347..9cc4077 100644 --- a/mel/deviceConnector.mel +++ b/mel/deviceConnector.mel @@ -99,9 +99,9 @@ proc createDeviceAttributes(string $devaceName, float $attrScale) string $devAttribLs[] = `listInputDeviceAxes $devaceName`; // List all available device Axes - translation, rotation etc. print($devAttribLs); int $devLocCount = `size($devAttribLs)`/2; // Divide by 2 to get number of locators that we need (our server sends only X and Y axes - px and py) - int $counter = 1; + int $counter = 0; - for($counter = 1; $counter <= $devLocCount; $counter++) // Loop for creating and naming locators. If locator exists, do nothing. + for($counter = 0; $counter < $devLocCount; $counter++) // Loop for creating and naming locators. If locator exists, do nothing. { if(`objExists ("devLoc_" + $counter)`) print("Object devLoc_" + $counter + " exists - nothing to do.\n"); else @@ -109,12 +109,12 @@ proc createDeviceAttributes(string $devaceName, float $attrScale) print("devLoc_" + $counter + " created.\n"); spaceLocator -name ("devLoc_" + $counter); } - attachDeviceAttr -d $devaceName -axis ("px" + $counter) ("devLoc_" + $counter + ".translateX"); // Attaching axes to locator X attribute. - attachDeviceAttr -d $devaceName -axis ("py" + $counter) ("devLoc_" + $counter + ".translateY"); // Attaching axes to locator Y attribute. - setAttrMapping -d $devaceName -axis ("px" + $counter) -attribute ("devLoc_" + $counter + ".translateX") -scale $attrScale; // Scale attribute X - setAttrMapping -d $devaceName -axis ("py" + $counter) -attribute ("devLoc_" + $counter + ".translateY") -scale $attrScale; // Scale attribute Y + attachDeviceAttr -d $devaceName -axis ("p" + $counter + "_x") ("devLoc_" + $counter + ".translateX"); // Attaching axes to locator X attribute. + attachDeviceAttr -d $devaceName -axis ("p" + $counter + "_y") ("devLoc_" + $counter + ".translateY"); // Attaching axes to locator Y attribute. + setAttrMapping -d $devaceName -axis ("p" + $counter + "_x") -attribute ("devLoc_" + $counter + ".translateX") -scale $attrScale; // Scale attribute X + setAttrMapping -d $devaceName -axis ("p" + $counter + "_y") -attribute ("devLoc_" + $counter + ".translateY") -scale $attrScale; // Scale attribute Y // SCALE is important, because in many cases server can send huge values. //FaceCap server send point position in pixel position (higher resolution = higher values) } -} \ No newline at end of file +}