[Bf-blender-cvs] [74dbbae] framebuffer: Make samples an optional argument, default to 0

Campbell Barton noreply at git.blender.org
Mon Oct 19 18:13:31 CEST 2015


Commit: 74dbbae2aa6581c77b1a4712512e7ebb8fd6c74e
Author: Campbell Barton
Date:   Tue Oct 20 03:06:34 2015 +1100
Branches: framebuffer
https://developer.blender.org/rB74dbbae2aa6581c77b1a4712512e7ebb8fd6c74e

Make samples an optional argument, default to 0

===================================================================

M	source/blender/python/intern/gpu_offscreen.c

===================================================================

diff --git a/source/blender/python/intern/gpu_offscreen.c b/source/blender/python/intern/gpu_offscreen.c
index e1a3b57..1468faa 100644
--- a/source/blender/python/intern/gpu_offscreen.c
+++ b/source/blender/python/intern/gpu_offscreen.c
@@ -363,29 +363,29 @@ static PyObject *BPy_GPU_OffScreen_CreatePyObject(GPUOffScreen *ofs)
 }
 
 PyDoc_STRVAR(pygpu_offscreen_new_doc,
-"new(width, height, samples)\n"
+"new(width, height, samples=0)\n"
 "\n"
 "   Return a GPUOffScreen.\n"
 "\n"
 "   :param width: Horizontal dimension of the buffer.\n"
 "   :type width: int`\n"
-"   :param width: Vertical dimension of the buffer.\n"
-"   :type width: int`\n"
-"   :param samples: OpenGL samples to use for MSAA or zero to disable multi-sampling.\n"
+"   :param height: Vertical dimension of the buffer.\n"
+"   :type height: int`\n"
+"   :param samples: OpenGL samples to use for MSAA or zero to disable.\n"
 "   :type samples: int\n"
 "   :return: Newly created off-screen buffer.\n"
-"   :rtype: :class:`GPUOffscreen`\n"
+"   :rtype: :class:`gpu.GPUOffscreen`\n"
 );
 static PyObject *pygpu_offscreen_new(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
 {
 	static const char *kwlist[] = {"width", "height", "samples", NULL};
 
 	GPUOffScreen *ofs;
-	unsigned int width, height, samples;
+	unsigned int width, height, samples = 0;
 	char err_out[256];
 
 	if (!PyArg_ParseTupleAndKeywords(
-	        args, kwds, "iii:new", (char **)(kwlist),
+	        args, kwds, "ii|i:new", (char **)(kwlist),
 	        &width, &height, &samples))
 	{
 		return NULL;




More information about the Bf-blender-cvs mailing list