<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Draw locator on top of scene in Maya Viewport 2.0 in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/draw-locator-on-top-of-scene-in-maya-viewport-2-0/m-p/7531335#M10962</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a locator node that I am drawing in the scene using&amp;nbsp;MPxDrawOverride. I am thus drawing using the functions provided in the&amp;nbsp;MUIDrawManager, especially&amp;nbsp;MUIDrawManager::mesh(...).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture1.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/424047iFFFC99998FD3F3BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;On the above picture, my locator node is the blue bar that is going through the sphere. But I would like to draw this locator on top of everything in the scene (like one could show a skeleton in xRay). In that case, I want it to appear on top of the sphere at any time, as shown here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture3.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/424052i380EB1E9BFF0C4E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture3.PNG" alt="Capture3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using the&amp;nbsp;&lt;SPAN&gt;MUIDrawManager::beginDrawInXray() and MUIDrawManager::endDrawInXray() function, but what they are doing is that they remove the depth test, so the triangles are drown on top of each other in a random order, which gives something awful&amp;nbsp;like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture2.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/424051i13E350006F98446C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a clean way to draw a custom locator node on top of the scene? Maybe by re-initializing the depth buffer, but how do we have access? Or by rendering twice the scene and super-imposing the two images, but how do you do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Loïc&lt;/P&gt;</description>
    <pubDate>Thu, 09 Nov 2017 17:03:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-11-09T17:03:20Z</dc:date>
    <item>
      <title>Draw locator on top of scene in Maya Viewport 2.0</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/draw-locator-on-top-of-scene-in-maya-viewport-2-0/m-p/7531335#M10962</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a locator node that I am drawing in the scene using&amp;nbsp;MPxDrawOverride. I am thus drawing using the functions provided in the&amp;nbsp;MUIDrawManager, especially&amp;nbsp;MUIDrawManager::mesh(...).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture1.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/424047iFFFC99998FD3F3BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;On the above picture, my locator node is the blue bar that is going through the sphere. But I would like to draw this locator on top of everything in the scene (like one could show a skeleton in xRay). In that case, I want it to appear on top of the sphere at any time, as shown here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture3.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/424052i380EB1E9BFF0C4E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture3.PNG" alt="Capture3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using the&amp;nbsp;&lt;SPAN&gt;MUIDrawManager::beginDrawInXray() and MUIDrawManager::endDrawInXray() function, but what they are doing is that they remove the depth test, so the triangles are drown on top of each other in a random order, which gives something awful&amp;nbsp;like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture2.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/424051i13E350006F98446C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a clean way to draw a custom locator node on top of the scene? Maybe by re-initializing the depth buffer, but how do we have access? Or by rendering twice the scene and super-imposing the two images, but how do you do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Loïc&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 17:03:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/draw-locator-on-top-of-scene-in-maya-viewport-2-0/m-p/7531335#M10962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-09T17:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Draw locator on top of scene in Maya Viewport 2.0</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/draw-locator-on-top-of-scene-in-maya-viewport-2-0/m-p/7539081#M10963</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can't have depth in XRay mode. To do that, usually it should be drawn with a separate empty depth buffer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In theory, you could try to write a custom drawing with DX and OpenGL directly with MPxDrawOverride with a different depth buffer with DX and OpenGL directly, you could look at them to learn how to draw with MPxDrawOverride.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should make it at the front of any other items. Try to draw them at the one of the last passes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also try to create another MRenderOverride to replace VP2 with custom passes for it. I haven't tested them yet, but they should be working .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 12:53:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/draw-locator-on-top-of-scene-in-maya-viewport-2-0/m-p/7539081#M10963</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2017-11-13T12:53:33Z</dc:date>
    </item>
  </channel>
</rss>

