Added missing mode rayShadow and updated docs, "NoSpecular" was also missing from the docs too.

This commit is contained in:
2005-12-20 06:50:13 +00:00
parent bbb00043cd
commit 73fa63751f
2 changed files with 13 additions and 6 deletions

View File

@@ -84,6 +84,7 @@
#define EXPP_LAMP_MODE_DEEPSHADOW 1024
#define EXPP_LAMP_MODE_NODIFFUSE 2048
#define EXPP_LAMP_MODE_NOSPECULAR 4096
#define EXPP_LAMP_MODE_SHAD_RAY 8192
/* Lamp MIN, MAX values */
#define EXPP_LAMP_SAMPLES_MIN 1
@@ -781,8 +782,8 @@ static PyObject *Lamp_ModesDict( void )
PyInt_FromLong( EXPP_LAMP_MODE_ONLYSHADOW ) );
PyConstant_Insert( c, "NoDiffuse",
PyInt_FromLong( EXPP_LAMP_MODE_NODIFFUSE ) );
PyConstant_Insert( c, "NoSpecular",
PyInt_FromLong( EXPP_LAMP_MODE_NOSPECULAR ) );
PyConstant_Insert( c, "RayShadow",
PyInt_FromLong( EXPP_LAMP_MODE_SHAD_RAY ) );
}
return Modes;
@@ -1165,7 +1166,8 @@ static int Lamp_setMode( BPy_Lamp * self, PyObject * value )
| EXPP_LAMP_MODE_SPHERE
| EXPP_LAMP_MODE_SQUARE
| EXPP_LAMP_MODE_NODIFFUSE
| EXPP_LAMP_MODE_NOSPECULAR;
| EXPP_LAMP_MODE_NOSPECULAR
| EXPP_LAMP_MODE_SHAD_RAY;
if( !PyInt_CheckExact ( value ) ) {
char errstr[128];
@@ -1550,7 +1552,7 @@ static PyObject *Lamp_insertIpoKey( BPy_Lamp * self, PyObject * args )
static PyObject *Lamp_getModesConst( void )
{
PyObject * attr = Py_BuildValue
( "{s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h}",
( "{s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h}",
"Shadows", EXPP_LAMP_MODE_SHADOWS, "Halo",
EXPP_LAMP_MODE_HALO, "Layer", EXPP_LAMP_MODE_LAYER,
"Quad", EXPP_LAMP_MODE_QUAD, "Negative",
@@ -1559,7 +1561,8 @@ static PyObject *Lamp_getModesConst( void )
EXPP_LAMP_MODE_SPHERE, "Square",
EXPP_LAMP_MODE_SQUARE, "NoDiffuse",
EXPP_LAMP_MODE_NODIFFUSE, "NoSpecular",
EXPP_LAMP_MODE_NOSPECULAR );
EXPP_LAMP_MODE_NOSPECULAR, "RayShadow",
EXPP_LAMP_MODE_SHAD_RAY);
if( !attr )
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
@@ -1804,6 +1807,8 @@ static PyObject *Lamp_oldsetMode( BPy_Lamp * self, PyObject * args )
flag |= ( short ) EXPP_LAMP_MODE_NODIFFUSE;
else if( !strcmp( name, "NoSpecular" ) )
flag |= ( short ) EXPP_LAMP_MODE_NOSPECULAR;
else if( !strcmp( name, "RayShadow" ) )
flag |= ( short ) EXPP_LAMP_MODE_SHAD_RAY;
else
return EXPP_ReturnPyObjError( PyExc_AttributeError,
"unknown lamp flag argument" );

View File

@@ -14,7 +14,7 @@ Example::
from Blender import Lamp
l = Lamp.New('Spot') # create new 'Spot' lamp data
l.setMode('square', 'shadow') # set these two lamp mode flags
l.setMode('Square', 'Shadow') # set these two lamp mode flags
ob = Object.New('Lamp') # create new lamp object
ob.link(l) # link lamp obj with lamp data
@@ -36,6 +36,8 @@ Example::
- 'OnlyShadow'
- 'Sphere'
- 'Square'
- 'NoDiffuse'
- 'RayShadow'
"""
def New (type = 'Lamp', name = 'LampData'):