[Bf-python] Added shader settings to BPy Materials

Campbell Barton cbarton at metavr.com
Mon Jun 6 03:16:48 CEST 2005


Hi, Im crossposting from the bugtracker here hope nobody minds-
Patch is on-
https://projects.blender.org/tracker/index.php?func=detail&aid=2703&group_id=9&atid=127
______

Hi All - I was writing a povray exporter and saw that many settings were 
missing form the Python Material API, so I added them.

Added get/set and class vars for all of the following.
static PyObject *Material_getSpecShader( BPy_Material * self );
static PyObject *Material_getDiffuseShader( BPy_Material * self );
static PyObject *Material_getRoughness( BPy_Material * self );
static PyObject *Material_getSpecSize( BPy_Material * self );
static PyObject *Material_getDiffuseSize( BPy_Material * self );
static PyObject *Material_getSpecSmooth( BPy_Material * self );
static PyObject *Material_getDiffuseSmooth( BPy_Material * self );
static PyObject *Material_getDiffuseDarkness( BPy_Material * self );
static PyObject *Material_getRefracIndex( BPy_Material * self );
static PyObject *Material_getRms( BPy_Material * self );
static PyObject *Material_getFilter( BPy_Material * self );
static PyObject *Material_getTranslucency( BPy_Material * self );

the 2 shader get/sets accept ints, a Material.Shaders dict has been 
added that holds the ints for specylar and diffuse shaders.

Also cleaned up the Material code a bit- Mode dict had items being added 
Multiple Times and was Called Lamp_Mode, rather then Material_Mode, aslo 
some docstrings had not been modified (.nrighs was refered tro multiple 
times)

- Cam



More information about the Bf-python mailing list