[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19782] trunk/blender/source/blender/ python/api2_2x: BPy

Nathan Letwory jesterking at letwory.net
Sun Apr 19 02:09:47 CEST 2009


Revision: 19782
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19782
Author:   jesterking
Date:     2009-04-19 02:09:47 +0200 (Sun, 19 Apr 2009)

Log Message:
-----------
BPy
* access to sample buffers count of Lamp

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Lamp.c
    trunk/blender/source/blender/python/api2_2x/doc/Lamp.py

Modified: trunk/blender/source/blender/python/api2_2x/Lamp.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Lamp.c	2009-04-18 17:16:08 UTC (rev 19781)
+++ trunk/blender/source/blender/python/api2_2x/Lamp.c	2009-04-19 00:09:47 UTC (rev 19782)
@@ -191,6 +191,7 @@
 static PyObject *Lamp_getMode( BPy_Lamp * self );
 static PyObject *Lamp_getModesConst( void );
 static PyObject *Lamp_getSamples( BPy_Lamp * self );
+static PyObject *Lamp_getSampleBuffers( BPy_Lamp * self );
 static PyObject *Lamp_getRaySamplesX( BPy_Lamp * self );
 static PyObject *Lamp_getRaySamplesY( BPy_Lamp * self );
 static PyObject *Lamp_getAreaSizeX( BPy_Lamp * self );
@@ -241,6 +242,7 @@
 static int Lamp_setType( BPy_Lamp * self, PyObject * args );
 static int Lamp_setMode( BPy_Lamp * self, PyObject * args );
 static int Lamp_setSamples( BPy_Lamp * self, PyObject * args );
+static int Lamp_setSampleBuffers( BPy_Lamp * self, PyObject * args );
 static int Lamp_setRaySamplesX( BPy_Lamp * self, PyObject * args );
 static int Lamp_setRaySamplesY( BPy_Lamp * self, PyObject * args );
 static int Lamp_setAreaSizeX( BPy_Lamp * self, PyObject * args );
@@ -447,6 +449,10 @@
 	 (getter)Lamp_getSamples, (setter)Lamp_setSamples,
 	 "Lamp shadow map samples",
 	 NULL},
+	{"sampleBuffers",
+	 (getter)Lamp_getSampleBuffers, (setter)Lamp_setSampleBuffers,
+	 "Lamp shadow samples buffers",
+	 NULL},
 	{"raySamplesX",
 	 (getter)Lamp_getRaySamplesX, (setter)Lamp_setRaySamplesX,
 	 "Lamp raytracing samples on the X axis",
@@ -923,6 +929,11 @@
 	return PyInt_FromLong( self->lamp->samp );
 }
 
+static PyObject *Lamp_getSampleBuffers( BPy_Lamp * self )
+{
+	return PyInt_FromLong( self->lamp->buffers );
+}
+
 static PyObject *Lamp_getRaySamplesX( BPy_Lamp * self )
 {
 	return PyInt_FromLong( self->lamp->ray_samp );
@@ -1063,7 +1074,24 @@
 								EXPP_LAMP_SAMPLES_MAX, 'h' );
 }
 
+static int Lamp_setSampleBuffers( BPy_Lamp * self, PyObject * value )
+{
+	int buffers= 1;
+	if( !PyInt_Check ( value ) ) {
+		return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" );
+	}
+	buffers= PyInt_AS_LONG(value);
 
+	if(buffers!=1 && buffers!=4 && buffers!=9) {
+		return EXPP_ReturnIntError( PyExc_TypeError,
+						"expected int argument of value 1, 4 or 9" );
+	}
+
+	self->lamp->buffers= buffers;
+
+	return 0;
+}
+
 static int Lamp_setRaySamplesX( BPy_Lamp * self, PyObject * value )
 {
 	return EXPP_setIValueClamped ( value, &self->lamp->ray_samp, 

Modified: trunk/blender/source/blender/python/api2_2x/doc/Lamp.py
===================================================================
--- trunk/blender/source/blender/python/api2_2x/doc/Lamp.py	2009-04-18 17:16:08 UTC (rev 19781)
+++ trunk/blender/source/blender/python/api2_2x/doc/Lamp.py	2009-04-19 00:09:47 UTC (rev 19782)
@@ -136,6 +136,9 @@
 	@ivar samples:  Lamp shadow map samples.
 	Value is clamped to the range [1,16].
 	@type samples:  int
+	@ivar sampleBuffers:  Lamp amount of shadow map sample buffers.
+	Number of sample buffers for shadow buffer: 1, 4 or 9.
+	@type sampleBuffers:  int
 	@ivar raySamplesX:  Lamp raytracing X samples (X is used for the Y axis with square area lamps).
 	Value is clamped to the range [1,16].
 	@type raySamplesX:  int





More information about the Bf-blender-cvs mailing list