How to find face neighbours in Maya?
<p>I have a problem where I need to select faces that are next to one pre-selected face.</p>

<p>This may be done easily but the problem is that when I get a neighbour face I need to know in which direction it is facing. </p>

<p>So now I am able to select faces which are connected with an edge but I can't get the face that is for example left or right from the first selected face. I have tried multiple approaches but can't find the solution.</p>

<p><strong>I tried with:</strong></p>

<ol>
<li><p><strong>pickWalk -</strong> <code>cmds.pickWalk()</code>- problem with this is that it's behavior can't be predicted, since it walks the mesh from the camera perspective.</p></li>
<li><p><strong>polyInfo -</strong> <code>cmds.polyInfo()</code>- this is a very useful function and closest to the answer. In this approach I try to extract edges from a face and then see which are neighbours to that face with <code>edgeToFace()</code>. This works well but doesn't solve my problem. To elaborate, when <code>polyInfo</code> returns faces that share edges, it doesn't return them in a way that I can always know that <code>edgesList[0]</code> (for example) is the edge that points left or right. Hence if I use this on different faces the resulting face may be facing in a different direction in each case.</p></li>
<li><p><strong>Hard way</strong> with many conversions from vertex to edge then to face etc. But still again it's the same problem where I don't know which edge is the top or left one.</p></li>
<li><p><code>conectedFaces()</code>method who i call on selected face and it returns faces which are connected to first face,but still it`s the same problem,i dont know which face is facing which way.</p></li>
</ol>

<p>To be clear I'm not using a pre-selected list of faces and checking them, but I need to know the faces without knowing or keeping their names somewhere. Does someone know a way that works with selection of faces?</p>

<p>To elaborate my question I made an image to make it clear:</p>

<p><img src="https://i.stack.imgur.com/yieGn.png" alt="example"></p>

<p>As you can see from the example if there is selected face I need to select any of pointed faces, but that must be exact face I want to select. Other methods select all neighbour faces, but I need method that I can say "select right" and will select right one from first selected face.</p>