Discussion:
[Maya-Python] Draw Image new maya API, viewport 2.0
Dilen Shah
2016-12-26 11:28:18 UTC
Permalink
Hey guys,

I am trying to draw an image in viewport 2.0 but can't seem to find any
information on it.

Before in M3dView ,

view = OpenMayaUI.M3dView().active3dView()
image = OpenMaya.MImage()
image.readFromFile(IMAGEPATH)

view.writeColorBuffer(image, x, y)

This used to work perfectly and still does in legacy viewport code, but in
viewport 2.0 I can't seem to get it as this method is obselete now.

And in the autodesk reference it says: Use MHWRender::MQuadRender
<http://help.autodesk.com/cloudhelp/2016/ENU/Maya-SDK/cpp_ref/class_m_h_w_render_1_1_m_quad_render.html> operation
inside MHWRender::MRenderOverride
<http://help.autodesk.com/cloudhelp/2016/ENU/Maya-SDK/cpp_ref/class_m_h_w_render_1_1_m_render_override.html>
instead
I can't seem to understand how I can do it using this. Please let me know
how this can be solved.

Thanks in advance.

Dilen.
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f999ee3c-6a6a-42a5-bff9-1e003b728ad6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Yafes Sahin' via Python Programming for Autodesk Maya
2017-10-04 00:39:03 UTC
Permalink
Would be nice to have a follow up on that!
Post by Dilen Shah
Hey guys,
I am trying to draw an image in viewport 2.0 but can't seem to find any
information on it.
Before in M3dView ,
view = OpenMayaUI.M3dView().active3dView()
image = OpenMaya.MImage()
image.readFromFile(IMAGEPATH)
view.writeColorBuffer(image, x, y)
This used to work perfectly and still does in legacy viewport code, but in
viewport 2.0 I can't seem to get it as this method is obselete now.
And in the autodesk reference it says: Use MHWRender::MQuadRender
<http://help.autodesk.com/cloudhelp/2016/ENU/Maya-SDK/cpp_ref/class_m_h_w_render_1_1_m_quad_render.html> operation
inside MHWRender::MRenderOverride
<http://help.autodesk.com/cloudhelp/2016/ENU/Maya-SDK/cpp_ref/class_m_h_w_render_1_1_m_render_override.html>
instead
I can't seem to understand how I can do it using this. Please let me know
how this can be solved.
Thanks in advance.
Dilen.
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/de46ae2a-9f9a-4fa3-b345-c8efdf4efa09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...