I'm working with Maya 2012 and what I want to do is render a camera view. I have found that it's possible to do this using the MEL command 'render' (calling it through python). However, as far as I know, this command renders the image and saves it to disk while only returning the path to the saved image.
Example:
import maya.cmds as cmds
import cv2 as cv
pathToFile = cmds.render()
renderImage = cv.imread(pathToFile)
Since I'm interested in using the image to perform various computer vision algorithms, saving it to disk and then reading it from disk creates an unnecessary computational overhead.
Is it possible to render a camera and store the image in a variable without the need to do this? This would allow for a quicker loop between rendering and analysing the render image.
In case someone comes upon this question in the future: I tried the ram disk approach (using dataram RAMDisk) which was suggested and it did not yield any speed increase, unfortunately.