Python API

----------
Bugfix #18044: missing return statements in getter for displacement modifier
caused incorrect values to be returned.
This commit is contained in:
Ken Hughes 2008-12-15 05:30:09 +00:00
parent e7c0666d96
commit ba6972eb4d
2 changed files with 4 additions and 4 deletions

@ -909,18 +909,18 @@ static PyObject *displace_getter( BPy_Modifier * self, int type )
switch( type ) { switch( type ) {
case EXPP_MOD_TEXTURE: case EXPP_MOD_TEXTURE:
if (md->texture) Texture_CreatePyObject( md->texture ); if (md->texture) return Texture_CreatePyObject( md->texture );
else Py_RETURN_NONE; else Py_RETURN_NONE;
case EXPP_MOD_STRENGTH: case EXPP_MOD_STRENGTH:
return PyFloat_FromDouble( (double)md->strength ); return PyFloat_FromDouble( (double)md->strength );
case EXPP_MOD_DIRECTION: case EXPP_MOD_DIRECTION:
PyInt_FromLong( md->direction ); return PyInt_FromLong( md->direction );
case EXPP_MOD_VERTGROUP: case EXPP_MOD_VERTGROUP:
return PyString_FromString( md->defgrp_name ) ; return PyString_FromString( md->defgrp_name ) ;
case EXPP_MOD_MID_LEVEL: case EXPP_MOD_MID_LEVEL:
return PyFloat_FromDouble( (double)md->midlevel ); return PyFloat_FromDouble( (double)md->midlevel );
case EXPP_MOD_MAPPING: case EXPP_MOD_MAPPING:
PyInt_FromLong( md->texmapping ); return PyInt_FromLong( md->texmapping );
case EXPP_MOD_OBJECT: case EXPP_MOD_OBJECT:
return Object_CreatePyObject( md->map_object ); return Object_CreatePyObject( md->map_object );
case EXPP_MOD_UVLAYER: case EXPP_MOD_UVLAYER:

@ -129,7 +129,7 @@ Example::
- UVLAYER - Used for Displace only - UVLAYER - Used for Displace only
- MID_LEVEL - Used for Displace only (float [0.0, 1.0], default: 0.5) - MID_LEVEL - Used for Displace only (float [0.0, 1.0], default: 0.5)
- STRENGTH - Used for Displace only (float [-1000.0, 1000.0, default: 1.0) - STRENGTH - Used for Displace only (float [-1000.0, 1000.0, default: 1.0)
- TEXTURE - Used for Displace only (string) - TEXTURE - Used for Displace only (Texture object)
- MAPPING - Used for Displace only - MAPPING - Used for Displace only
- DIRECTION - Used for Displace only - DIRECTION - Used for Displace only