Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2009-04-19 04:09:47 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2009-04-19 04:09:47 +0400
commite4611218abf717c4d0790f22cc4f44e002380b5c (patch)
tree7e64a9d126d2e2311af39af5d15c79941965955d /source
parentfaef9f0ac77837fc0ff1ab305d68c102c4419ec9 (diff)
BPy
* access to sample buffers count of Lamp
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/Lamp.c28
-rw-r--r--source/blender/python/api2_2x/doc/Lamp.py3
2 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c
index 799833d4ee0..3b7a785f32e 100644
--- a/source/blender/python/api2_2x/Lamp.c
+++ b/source/blender/python/api2_2x/Lamp.c
@@ -191,6 +191,7 @@ static PyObject *Lamp_getTypesConst( void );
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_setIpo( BPy_Lamp * self, PyObject * args );
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 @@ static PyGetSetDef BPy_Lamp_getseters[] = {
(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 @@ static PyObject *Lamp_getSamples( BPy_Lamp * self )
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,6 +1074,23 @@ static int Lamp_setSamples( BPy_Lamp * self, PyObject * value )
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 )
{
diff --git a/source/blender/python/api2_2x/doc/Lamp.py b/source/blender/python/api2_2x/doc/Lamp.py
index 162d94ccff3..878ca53bb15 100644
--- a/source/blender/python/api2_2x/doc/Lamp.py
+++ b/source/blender/python/api2_2x/doc/Lamp.py
@@ -136,6 +136,9 @@ class Lamp:
@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