// Pre-render callback // void refreshCompute::preRenderCB(const MString& panelName, void * data) { refreshCompute *thisCompute = (refreshCompute *) data; if (!thisCompute) return; M3dView view; MStatus status = M3dView::getM3dViewFromModelPanel(panelName, view); if (status != MS::kSuccess) return; int width = 0, height = 0; width = view.portWidth( &status ); if (status != MS::kSuccess || (width < 2)) return; height = view.portHeight( &status ); if (status != MS::kSuccess || (height < 2)) return; unsigned int vx,vy,vwidth,vheight; vx = 0; vy = 0; vwidth = width / 2; vheight = height / 2; status = view.pushViewport (vx, vy, vwidth, vheight); if (thisCompute->mBufferOperation != kDrawDepthBuffer) { M3dView view; MStatus status = M3dView::getM3dViewFromModelPanel(panelName, view); MPoint origin; status = view.drawText( MString("Pre render callback: ") + panelName, origin ); } }