Hi, I wrote a small procedure to retrieve the world space center of a three point arc given three world space positions.
CODE
global proc float[] bhCofArc(float $bhPt1[], float $bhPt2[], float $bhPt3[])
{
string $bhTempArc = "tempArc_arc_00_ALIGN";
createNode makeThreePointCircularArc -n $bhTempArc;
setAttr ($bhTempArc + ".p1x") $bhPt1[0];
setAttr ($bhTempArc + ".p1y") $bhPt1[1];
setAttr ($bhTempArc + ".p1z") $bhPt1[2];
setAttr ($bhTempArc + ".p2x") $bhPt2[0];
setAttr ($bhTempArc + ".p2y") $bhPt2[1];
setAttr ($bhTempArc + ".p2z") $bhPt2[2];
setAttr ($bhTempArc + ".p3x") $bhPt3[0];
setAttr ($bhTempArc + ".p3y") $bhPt3[1];
setAttr ($bhTempArc + ".p3z") $bhPt3[2];
setAttr ($bhTempArc + ".nodeState") 0;
float $bhAimPos[] = getAttr($bhTempArc + ".center")
;
delete $bhTempArc;
return $bhAimPos;
}
the code i used before to define the points was:
CODE
setAttr ($bhTempArc + ".pt1") $bhPt1[0] $bhPt1[1] $bhPt1[2];
but for some reason this only set the x and y translates, leaving z at zero.
I got that fixed now with some convoluted code, but when I try to retrieve the center value I just get 0 0 0.
After some tries, I found out the node itself just isn`t updating after I set the points.
I tried adding the following code just before retrieving the center:
CODE
setAttr ($bhTempArc + ".nodeState") 0;
but that only worked sporadically...
However, if I skip the delete command and connect the arc.center to a locator.translate I can visually see the values and see they are zero. When I execute the ...nodeState") 0;
command from maya it always works.
Currently I am working with cutter and send the commands to maya 2009 through a commandPort.
Is there another MEL command to force maya to update a node? Or perhaps to set the pt1 pt2 and pt3 values on creation?
Am I doing something wrong here or is it a bug?
Bas