--- /home/bdancer/sources/blender/source/blender/python/api2_2x/Material.c 2009-05-29 16:08:37.000000000 +0400 +++ Material.c 2009-05-30 17:55:30.000000000 +0400 @@ -139,6 +139,12 @@ #define EXPP_MAT_RAYTRANSPGLOSS_MAX 1.0 #define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN 0 #define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX 1024 +#define EXPP_MAT_ANISO_GLOSS_MIR_MIN 0.0 +#define EXPP_MAT_ANISO_GLOSS_MIR_MAX 1.0 +#define EXPP_MAT_ADAPT_THRESH_MIR_MIN 0.0 +#define EXPP_MAT_ADAPT_THRESH_MIR_MAX 1.0 +#define EXPP_MAT_ADAPT_THRESH_TRA_MIN 0.0 +#define EXPP_MAT_ADAPT_THRESH_TRA_MAX 1.0 #define EXPP_MAT_FILTER_MIN 0.0 #define EXPP_MAT_FILTER_MAX 1.0 #define EXPP_MAT_TRANSLUCENCY_MIN 0.0 @@ -598,6 +604,9 @@ static int Material_setGlossMirrSamples( BPy_Material * self, PyObject * value ); static int Material_setGlossTrans( BPy_Material * self, PyObject * value ); static int Material_setGlossTransSamples( BPy_Material * self, PyObject * value ); +static int Material_setAniso( BPy_Material * self, PyObject * value ); +static int Material_setThreshMirr( BPy_Material * self, PyObject * value ); +static int Material_setThreshTrans( BPy_Material * self, PyObject * value ); static int Material_setRigidBodyFriction( BPy_Material * self, PyObject * value ); static int Material_setRigidBodyRestitution( BPy_Material * self, PyObject * value ); @@ -689,6 +698,9 @@ static PyObject *Material_getGlossMirrSamples( BPy_Material * self ); static PyObject *Material_getGlossTrans( BPy_Material * self ); static PyObject *Material_getGlossTransSamples( BPy_Material * self ); +static PyObject *Material_getAniso( BPy_Material * self ); +static PyObject *Material_getThreshMirr( BPy_Material * self ); +static PyObject *Material_getThreshTrans( BPy_Material * self ); static PyObject *Material_getRigidBodyFriction( BPy_Material * self ); static PyObject *Material_getRigidBodyRestitution( BPy_Material * self ); @@ -831,6 +843,12 @@ "() - Return number of sampels for transparent glossiness"}, {"getRayMirrGlossSamples", ( PyCFunction ) Material_getGlossMirrSamples, METH_NOARGS, "() - Return number of sampels for mirror glossiness"}, + {"getAniso", ( PyCFunction ) Material_getAniso, METH_NOARGS, + "() - Return anisotropy value"}, + {"getThreshMirr", ( PyCFunction ) Material_getThreshMirr, METH_NOARGS, + "() - Return threshold below which reflections will not be computed"}, + {"getThreshTrans", ( PyCFunction ) Material_getThreshTrans, METH_NOARGS, + "() - Return threshold below which refractions will not be computed"}, {"getFilter", ( PyCFunction ) Material_getFilter, METH_NOARGS, "() - Return the amount of filtering when transparent raytrace is enabled"}, {"getTranslucency", ( PyCFunction ) Material_getTranslucency, METH_NOARGS, @@ -942,6 +960,12 @@ "(i) - Set number transparent gloss samples - [1, 1024]"}, {"setRayMirrGlossSamples", ( PyCFunction ) Material_setGlossMirrSamples, METH_VARARGS, "(i) - Set number mirror gloss samples - [1, 1024]"}, + {"setAniso", ( PyCFunction ) Material_setAniso, METH_NOARGS, + "() - Set anisotropy - [0.0, 1.0]"}, + {"setThreshMirr", ( PyCFunction ) Material_setThreshMirr, METH_NOARGS, + "() - Set threshold below which reflections will not be computed - [0.0, 1.0]"}, + {"setThreshTrans", ( PyCFunction ) Material_setThreshTrans, METH_NOARGS, + "() - Set threshold below which refractions will not be computed - [0.0, 1.0]"}, {"setFilter", ( PyCFunction ) Matr_oldsetFilter, METH_VARARGS, "(f) - Set the amount of filtering when transparent raytrace is enabled"}, {"setTranslucency", ( PyCFunction ) Matr_oldsetTranslucency, METH_VARARGS, @@ -1169,6 +1193,18 @@ (getter)Material_getGlossMirrSamples, (setter)Material_setGlossMirrSamples, "Refraction glossiness", NULL}, + {"anisotropy", + (getter)Material_getAniso, (setter)Material_setAniso, + "Anisotropy", + NULL}, + {"threshMir", + (getter)Material_getThreshMirr, (setter)Material_setThreshMirr, + "Reflections threshold", + NULL}, + {"threshTra", + (getter)Material_getThreshTrans, (setter)Material_setThreshTrans, + "Refractions threshold", + NULL}, {"rgbCol", (getter)Material_getRGBCol, (setter)Material_setRGBCol, "Diffuse RGB color triplet", @@ -1804,6 +1840,21 @@ return PyInt_FromLong( ( long ) self->material->samp_gloss_tra ); } +static PyObject *Material_getAniso( BPy_Material * self ) +{ + return PyFloat_FromDouble( ( double ) self->material->aniso_gloss_mir ); +} + +static PyObject *Material_getThreshMirr( BPy_Material * self ) +{ + return PyFloat_FromDouble( ( double ) self->material->adapt_thresh_mir ); +} + +static PyObject *Material_getThreshTrans( BPy_Material * self ) +{ + return PyFloat_FromDouble( ( double ) self->material->adapt_thresh_tra ); +} + static PyObject* Material_getRigidBodyFriction( BPy_Material * self ) { return PyFloat_FromDouble( ( double ) self->material->friction ); @@ -2379,6 +2430,27 @@ EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX, 'h' ); } +static int Material_setAniso( BPy_Material * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->material->aniso_gloss_mir, + EXPP_MAT_ANISO_GLOSS_MIR_MIN, + EXPP_MAT_ANISO_GLOSS_MIR_MAX ); +} + +static int Material_setThreshMirr( BPy_Material * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->material->adapt_thresh_mir, + EXPP_MAT_ADAPT_THRESH_MIR_MIN, + EXPP_MAT_ADAPT_THRESH_MIR_MAX ); +} + +static int Material_setThreshTrans( BPy_Material * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->material->adapt_thresh_tra, + EXPP_MAT_ADAPT_THRESH_TRA_MIN, + EXPP_MAT_ADAPT_THRESH_TRA_MAX ); +} + static int Material_setRigidBodyFriction( BPy_Material * self, PyObject * value ) { return EXPP_setFloatClamped ( value, &self->material->friction,