Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FC_maya.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions mel/deviceConnector.mel
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,22 @@ 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
{
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)
}
}
}