Iím trying to develop a script in python that will allow me to save eight different camera views in one single big picture. This picture should display them so that I can import them into the stereoscopic player. Iím just getting into the matter and donít have much experience in python, but Iím pretty sure that there must be some way to solve this.
import maya.cmds as cmds
import maya.mel as mm
import maya.OpenMaya as api
import maya.OpenMayaUI as apiUI
# read the color buffer from the view, and save the MImage to disk
view = apiUI.M3dView.active3dView()
wrapper = api.MImage()
scriptUtilw = api.MScriptUtil()
scriptUtilh = api.MScriptUtil()
wPtr = scriptUtilw.asUintPtr()
hPtr = scriptUtilh.asUintPtr()
twidth = scriptUtilw.getUint(wPtr)
theight = scriptUtilh.getUint(hPtr)
I call the size of the viewpoint and set the picture 4 times as wide as twice as tall so I can display four camera views in a row.
I tried, after creating the picture, to put the views on their designated spot or implement them as a texture. But so far I canít find a function to do so, neither in python nor inside the Maya API. I thought about using writeColorBuffer to save the color-information from the camera onto the wrapper picture but that didnít work.
I hope you might be able to help me figure out hot to transfer the views on the big picture. I go with any solution as long as the performance desnít break in too much.
Thanks in advance