// This function is a utility that can be used to extract vector values from // plugs. // private MVector vectorPlugValue(MPlug plug) { if (plug.numChildren == 3) { double x, y, z; MPlug rx = plug.child(0); MPlug ry = plug.child(1); MPlug rz = plug.child(2); x = rx.asDouble(); y = ry.asDouble(); z = rz.asDouble(); MVector result = new MVector(x, y, z); return(result); } else { MGlobal.displayError("Expected 3 children for plug " + plug.name); MVector result = new MVector(0, 0, 0); return(result); } }