IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Then do whatever you want with it.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Instead of actually drawing something, use your access to the OpenGL context to render the viewport to texture. In other words, override the Hardware / Viewport 2.0 rendering for a some node. Create a custom node that implements MPxHardwareShader specifications described here: Im trying to render a scene with 190 frames for my thesis project, but ever certain amount of frames (every 48 - 80) frames the pc closes maya and sends me. You should probably just set the renderer to Hardware 2.0, save the image as a BMP (which OpenCV reads very quickly anyway), perhaps to a RAM disk like suggested above, and call it a day.
Then access that texture programmatically.Īlternatively, you could write a plugin that wraps another rendering plugin, like Mayatomr, or the Hardware 2.0 renderer, and puts the rendered image into some shared memory space.īut these solutions are so incredibly involved, touching on so many undocumented features. If you're looking for efficiency, you may consider using the OpenMaya packages to access the OpenGL context for the views and render a Viewport 2.0 view to texture.