I have a procedure that gives me the distance of 2 objects by simply creating a distance between node for 2 given objects. It also names the DB node as well. I have set it up to return a string value with the name of the DB node
I'd like to know how I could store the return value in string in order to use the string in other procedures.
The example below is the script as it stands, with a sample execution line. I've also written out the method I am trying to use to capture the returned string.
global proc string measure2Points (string $itemA, string $itemB, string $name)
string $dbNode = `createNode distanceBetween -n $name`;
connectAttr ($itemA + ".worldMatrix") ($dbNode + ".inMatrix1");
connectAttr ($itemB + ".worldMatrix") ($dbNode + ".inMatrix2");
connectAttr ($itemA + ".rotatePivotTranslate") ($dbNode + ".point1");
connectAttr ($itemB + ".rotatePivotTranslate") ($dbNode + ".point2");
//execute the command bellow and all works fine...
measure2Points ("pSphere1","pSphere2" ,"distBet_sphere1tosphere2");
//But, when I need to call the 'distance between' node itself, a syntax error is registered
string $dbName = `measure2Points ("locator4", "locator5", "db_locs")`;
// Error: Syntax error //