title: How to find all upstream DG nodes with maya python api?
body: <p>I can use </p>
  
  <pre><code>hypershade -listUpstreamNodes
  </code></pre>
  
  <p>to get them, but this command is not available in maya batch mode.
  i guess i should use  <a href="http://download.autodesk.com/us/maya/2011help/API/class_m_it_dependency_graph.html" rel="nofollow">MItDependencyGraph</a> ? can someone give me a short example ? thanks !</p>
  
  <p>ps: i want to find all anim curves on anim controls( they may be in anim layers). another place i can use this is find all shading nodes associated with a given mesh. i don't want to use listConnections or connectionInfo multiple times and write a long function to do it.</p>