title: In Maya, how to query the world space coordinates of the control points of a curve using MEL
body: <p>I created a curve using the EP curve tool. Then I tried to query the world space coordinates of the control points of this curve by using the following MEL commands:</p>
  
  <pre><code>createNode curveInfo;
  connectAttr curveShape1.worldSpace curveInfo1.inputCurve;
  getAttr "curveInfo1.cp[*]";
  </code></pre>
  
  <p>but it just printed out the cv coordinates in the object space, say results like:</p>
  
  <pre><code>// Result: 0 0 0 1 0 0 2 0 0 3 0 0 //
  </code></pre>
  
  <p>Acoording to Maya documentation, the “curve” command can be used to query world space positions, here is a snippet from the documentation:</p>
  
  <blockquote>
    <p>createNode curveInfo; </p>
    
    <p>connectAttr curveShape1.worldSpace curveInfo1.inputCurve;</p>
    
    <p>getAttr “curveInfo1.knots[*]”;</p>
    
    <p>// This sequence creates a curve info node, connects the info node to the
    curve and queries the knot vector of the curve using the curve info node.
    You can use the curve info node to query other attributes such as
    world space CV values and arc length.</p>
  </blockquote>
  
  <p>How to use the “curve” command to query world space positions?</p>
  
  <p>I also tried using the “xform” command, but it seems that it does not work for my curve. The result is like:</p>
  
  <pre><code>xform -q -t -ws curve1;
  // Result: 0 0 0 //
  </code></pre>