diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_armature_api.c | 2 | ||||
-rw-r--r-- | source/blender/python/generic/euler.c | 2 | ||||
-rw-r--r-- | source/blender/python/generic/matrix.c | 25 | ||||
-rw-r--r-- | source/blender/python/generic/quat.c | 2 | ||||
-rw-r--r-- | source/blender/python/generic/vector.c | 2 |
5 files changed, 27 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c index 22bd7313166..f3983a43b4f 100644 --- a/source/blender/makesrna/intern/rna_armature_api.c +++ b/source/blender/makesrna/intern/rna_armature_api.c @@ -58,7 +58,7 @@ void RNA_api_armature_edit_bone(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "align_roll", "rna_EditBone_align_roll"); - RNA_def_function_ui_description(func, "Align the bone to a localspace vector."); + RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis points in the direction of the vector given."); parm= RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); } diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index f6f2e337211..ae7a6783358 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -541,7 +541,7 @@ static PyGetSetDef Euler_getseters[] = { {"z", (getter)Euler_getAxis, (setter)Euler_setAxis, "Euler Z axis", (void *)2}, {"wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, "True when this wraps blenders internal data", NULL}, - {"__owner__", (getter)BaseMathObject_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, + {"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index dcd1057f881..074a397b6d9 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -1129,12 +1129,33 @@ static PyObject *Matrix_getColSize( MatrixObject * self, void *type ) return PyLong_FromLong((long) self->colSize); } +static PyObject *Matrix_getMedianScale( MatrixObject * self, void *type ) +{ + float mat[3][3]; + + if(!BaseMath_ReadCallback(self)) + return NULL; + + /*must be 3-4 cols, 3-4 rows, square matrix*/ + if(self->colSize == 4 && self->rowSize == 4) + copy_m3_m4(mat, (float (*)[4])*self->matrix); + else if(self->colSize == 3 && self->rowSize == 3) + copy_m3_m3(mat, (float (*)[3])*self->matrix); + else { + PyErr_SetString(PyExc_AttributeError, "Matrix.median_scale: inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); + return NULL; + } + + return PyFloat_FromDouble(mat3_to_scale(mat)); +} + /*****************************************************************************/ /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef Matrix_getseters[] = { - {"rowSize", (getter)Matrix_getRowSize, (setter)NULL, "", NULL}, - {"colSize", (getter)Matrix_getColSize, (setter)NULL, "", NULL}, + {"row_size", (getter)Matrix_getRowSize, (setter)NULL, "", NULL}, + {"col_size", (getter)Matrix_getColSize, (setter)NULL, "", NULL}, + {"median_scale", (getter)Matrix_getMedianScale, (setter)NULL, "", NULL}, {"wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, "", NULL}, {"_owner",(getter)BaseMathObject_getOwner, (setter)NULL, "", NULL}, diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 2ee78235224..e739e1a5036 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -739,7 +739,7 @@ static PyGetSetDef Quaternion_getseters[] = { (getter)BaseMathObject_getWrapped, (setter)NULL, "True when this wraps blenders internal data", NULL}, - {"__owner__", + {"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index ae2c96fa86a..0713d60c6c2 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -1421,7 +1421,7 @@ static PyGetSetDef Vector_getseters[] = { (getter)BaseMathObject_getWrapped, (setter)NULL, "True when this wraps blenders internal data", NULL}, - {"__owner__", + {"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, |