I think you're just better off coding it in C++ :D. Especially locators, 
much faster, but other than that, I noticed that for VP2.0 override (at 
least for c++) you have to have the draw function for VP1.0 implemented too 
otherwise you cannot select the locator (even though one of to new API 
changes in Maya 2016 is the selection handling in VP2.0)

For drawing in VP2.0 I don't use the legacy draw method any more. Just 
the  MHWRender::MUIDrawManager in the override

J

On Sunday, July 19, 2015 at 1:27:13 PM UTC+2, [email protected] wrote:
>
> Hi guys, 
>
>   I know that it's been a while since this post was created, but I found 
> it looking in internet for some solution about this in python. 
>
>  I can't believe that I couldnt find any example yet about this in python. 
> Even I was checking Python API 2.0 just to check if there was something new 
> that makes this works. 
>
>  I made a simle MPxLocator that draws a simple line. That's all. I'm not 
> drawing geometry or creating any specific shader. Just this: 
>
>
>     def draw(self, view, path, style, status): 
>         view.beginGL() 
>         glFT.glBegin(OpenMayaRender.MGL_LINES) 
>         glFT.glVertex3f(self.outX, 
>                         self.outY, 
>                         self.outZ) 
>         glFT.glVertex3f(self.targetPosX, 
>                         self.targetPosY, 
>                         self.targetPosZ) 
>         glFT.glEnd() 
>         view.endGL() 
>
>
> So, my question is: 
>
> does anyone know if the implementation of the override functions is 
> already possible in python?  If it's so, it'd be really helpful some 
> example. 
>
>  Thanks! 
>
>
>
>
>
>
> > thanks for the reply. I got it. 
> > 
> > 
> > Just waiting for some python support i hope :) 
> > 
> > 
> > D. 
> > 
> > On Friday, January 16, 2015 at 8:50:35 PM UTC+1, Janos Hunyadi wrote: 
> > There are a bunch more functions you can use with the overrides, but 
> those two are that does the heavy lifting 
> > 
> > 
> > 
> http://help.autodesk.com/view/MAYAUL/2015/ENU/?guid=__cpp_ref_class_m_h_w_render_1_1_m_px_draw_override_html
>  
> > 
> > J 
> > 
> > On Friday, January 16, 2015 at 9:47:30 AM UTC+1, Dilen Shah wrote: 
> > Hey Janos, 
> > 
> > 
> > Thanks for the reply, 
> > 
> > 
> > So I need the functions class MPxDrawOverride and the following 
> functions right: 
> > 1. prepareForDraw() 
> > 2. addUIDrawables 
> > 
> > 
> > Thats it right, I still dont have a 2015 version so just preparing my 
> scripts before I get it. 
> > 
> > 
> > Let me know. 
> > 
> > 
> > D.  
> > 
> > On Thursday, January 15, 2015 at 2:21:12 PM UTC+1, Janos Hunyadi wrote: 
> > Only works in C++ at the moment to my knowledge. You need to take the 
> basic MPxLocatorNode and add an MPxDrawOverride to make it work it in VP 
> 2.0. 
> > You don't need to use the legacy draw method. Just use the overrides 
> addUIDrawables() function and do your drawing there, after you prepared 
> your data for caching in the prepareForDraw() function. 
> > 
> > 
> > J 
> > 
> > On Thursday, January 15, 2015 at 11:29:41 AM UTC+1, Dilen Shah wrote: 
> > Hey guys, 
> > 
> > 
> > So I have written many nodes with open gl draw functions for Maya 2014. 
> > 
> > 
> > For Maya 2015, I was reading the footPrintNode.cpp file in the devkit of 
> maya 2015 folder and I found that there is a Viewport 2.0 Implementation 
> override and it has a set of classes and functions and also added lines in 
> the initialize plugin function. 
> > 
> > 
> > So my question is, I went though the scripted footPrintNode.py in Maya 
> 2015 and there is no Viewport 2.0 implementation, so can anyone tell me 
> what I need to do for it. Do I need to add it by translating c++ to python 
> for all my gl shapes in Maya 2015? 
> > 
> > 
> > Thank you and let me know if you dont understand my question would like 
> to solve this problem. 
> > 
> > 
> > D. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/96a8fad1-db36-4d0c-a66b-8e563dc95cfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to