===Python API===
authorKen Hughes <khughes@pacific.edu>
Thu, 27 Apr 2006 20:24:27 +0000 (20:24 +0000)
committerKen Hughes <khughes@pacific.edu>
Thu, 27 Apr 2006 20:24:27 +0000 (20:24 +0000)
Added render.getRenderWinSize() method, to complement render.setRenderWinSize()

source/blender/python/api2_2x/doc/Render.py
source/blender/python/api2_2x/sceneRender.c

index 4ac67421214f5dd204b9ee30f25ac161b53985c7..09d6a0bac62cf1ca9364f8a006dc50f6e63cad75 100644 (file)
@@ -349,6 +349,13 @@ class RenderData:
     @param size: can be 25, 50, 75 or 100 (percent).
     """
 
+  def getRenderWinSize():
+    """
+    Get the size of the render window.
+    @rtype: int
+    @return: window size; can be 25, 50, 75 or 100 (percent).
+    """
+
   def enableFieldRendering(toggle):
     """
     Enable/disable field rendering
index 57cf4c22ae3feb3e7d92b3f174edb267d47a00ea..413c2c6a3f3e79c5c2ae7e200b25357bad36a5bc 100644 (file)
@@ -147,6 +147,7 @@ static PyObject *RenderData_EnableRayTracing( BPy_RenderData * self,
                                              PyObject * args );
 static PyObject *RenderData_EnableRadiosityRender( BPy_RenderData * self,
                                                   PyObject * args );
+static PyObject *RenderData_GetRenderWinSize( BPy_RenderData * self );
 static PyObject *RenderData_SetRenderWinSize( BPy_RenderData * self,
                                              PyObject * args );
 static PyObject *RenderData_EnableFieldRendering( BPy_RenderData * self,
@@ -351,9 +352,12 @@ static PyMethodDef BPy_RenderData_methods[] = {
        {"enableRadiosityRender",
         ( PyCFunction ) RenderData_EnableRadiosityRender, METH_VARARGS,
         "(bool) - enable/disable radiosity rendering\n"},
+       {"getRenderWinSize", ( PyCFunction ) RenderData_GetRenderWinSize,
+        METH_NOARGS,
+        "() - get the size of the render window\n"},
        {"setRenderWinSize", ( PyCFunction ) RenderData_SetRenderWinSize,
         METH_VARARGS,
-        "(enum) - get/set the size of the render window\n"},
+        "(int) - set the size of the render window\n"},
        {"enableFieldRendering",
         ( PyCFunction ) RenderData_EnableFieldRendering, METH_VARARGS,
         "(bool) - enable/disable field rendering\n"},
@@ -1350,6 +1354,12 @@ PyObject *RenderData_SetRenderWinSize( BPy_RenderData * self, PyObject * args )
 
        return EXPP_incr_ret( Py_None );
 }
+//
+//------------------------------------RenderData.GetRenderWinSize() -----
+PyObject *RenderData_GetRenderWinSize( BPy_RenderData * self )
+{
+       return PyInt_FromLong( (long) self->renderContext->size );
+}
 
 //------------------------------------RenderData.EnableFieldRendering() -
 PyObject *RenderData_EnableFieldRendering( BPy_RenderData * self,