[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42115] trunk/blender/source: rename mathutils constructors to match other parts of the bpy/api ( no functional changes)
Campbell Barton
ideasman42 at gmail.com
Thu Nov 24 05:45:48 CET 2011
Revision: 42115
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42115
Author: campbellbarton
Date: 2011-11-24 04:45:36 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
rename mathutils constructors to match other parts of the bpy/api (no functional changes)
Modified Paths:
--------------
trunk/blender/source/blender/python/intern/bpy_rna.c
trunk/blender/source/blender/python/mathutils/mathutils_Color.c
trunk/blender/source/blender/python/mathutils/mathutils_Color.h
trunk/blender/source/blender/python/mathutils/mathutils_Euler.c
trunk/blender/source/blender/python/mathutils/mathutils_Euler.h
trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c
trunk/blender/source/blender/python/mathutils/mathutils_Matrix.h
trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.c
trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.h
trunk/blender/source/blender/python/mathutils/mathutils_Vector.c
trunk/blender/source/blender/python/mathutils/mathutils_Vector.h
trunk/blender/source/blender/python/mathutils/mathutils_geometry.c
trunk/blender/source/gameengine/Converter/BL_ArmatureChannel.cpp
trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
trunk/blender/source/gameengine/Ketsji/KX_ObjectActuator.cpp
trunk/blender/source/gameengine/Ketsji/KX_PyMath.cpp
Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c 2011-11-24 04:12:16 UTC (rev 42114)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c 2011-11-24 04:45:36 UTC (rev 42115)
@@ -619,11 +619,11 @@
case PROP_ALL_VECTOR_SUBTYPES:
if (len>=2 && len <= 4) {
if (is_thick) {
- ret= newVectorObject(NULL, len, Py_NEW, NULL);
+ ret= Vector_CreatePyObject(NULL, len, Py_NEW, NULL);
RNA_property_float_get_array(ptr, prop, ((VectorObject *)ret)->vec);
}
else {
- PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_VEC);
+ PyObject *vec_cb= Vector_CreatePyObject_cb(ret, len, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_VEC);
Py_DECREF(ret); /* the vector owns now */
ret= vec_cb; /* return the vector instead */
}
@@ -632,22 +632,22 @@
case PROP_MATRIX:
if (len==16) {
if (is_thick) {
- ret= newMatrixObject(NULL, 4, 4, Py_NEW, NULL);
+ ret= Matrix_CreatePyObject(NULL, 4, 4, Py_NEW, NULL);
RNA_property_float_get_array(ptr, prop, ((MatrixObject *)ret)->contigPtr);
}
else {
- PyObject *mat_cb= newMatrixObject_cb(ret, 4,4, mathutils_rna_matrix_cb_index, FALSE);
+ PyObject *mat_cb= Matrix_CreatePyObject_cb(ret, 4,4, mathutils_rna_matrix_cb_index, FALSE);
Py_DECREF(ret); /* the matrix owns now */
ret= mat_cb; /* return the matrix instead */
}
}
else if (len==9) {
if (is_thick) {
- ret= newMatrixObject(NULL, 3, 3, Py_NEW, NULL);
+ ret= Matrix_CreatePyObject(NULL, 3, 3, Py_NEW, NULL);
RNA_property_float_get_array(ptr, prop, ((MatrixObject *)ret)->contigPtr);
}
else {
- PyObject *mat_cb= newMatrixObject_cb(ret, 3,3, mathutils_rna_matrix_cb_index, FALSE);
+ PyObject *mat_cb= Matrix_CreatePyObject_cb(ret, 3,3, mathutils_rna_matrix_cb_index, FALSE);
Py_DECREF(ret); /* the matrix owns now */
ret= mat_cb; /* return the matrix instead */
}
@@ -661,23 +661,23 @@
PropertyRNA *prop_eul_order= NULL;
short order= pyrna_rotation_euler_order_get(ptr, &prop_eul_order, EULER_ORDER_XYZ);
- ret= newEulerObject(NULL, order, Py_NEW, NULL); // TODO, get order from RNA
+ ret= Euler_CreatePyObject(NULL, order, Py_NEW, NULL); // TODO, get order from RNA
RNA_property_float_get_array(ptr, prop, ((EulerObject *)ret)->eul);
}
else {
/* order will be updated from callback on use */
- PyObject *eul_cb= newEulerObject_cb(ret, EULER_ORDER_XYZ, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_EUL); // TODO, get order from RNA
+ PyObject *eul_cb= Euler_CreatePyObject_cb(ret, EULER_ORDER_XYZ, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_EUL); // TODO, get order from RNA
Py_DECREF(ret); /* the euler owns now */
ret= eul_cb; /* return the euler instead */
}
}
else if (len==4) {
if (is_thick) {
- ret= newQuaternionObject(NULL, Py_NEW, NULL);
+ ret= Quaternion_CreatePyObject(NULL, Py_NEW, NULL);
RNA_property_float_get_array(ptr, prop, ((QuaternionObject *)ret)->quat);
}
else {
- PyObject *quat_cb= newQuaternionObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_QUAT);
+ PyObject *quat_cb= Quaternion_CreatePyObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_QUAT);
Py_DECREF(ret); /* the quat owns now */
ret= quat_cb; /* return the quat instead */
}
@@ -687,11 +687,11 @@
case PROP_COLOR_GAMMA:
if (len==3) { /* color */
if (is_thick) {
- ret= newColorObject(NULL, Py_NEW, NULL); // TODO, get order from RNA
+ ret= Color_CreatePyObject(NULL, Py_NEW, NULL); // TODO, get order from RNA
RNA_property_float_get_array(ptr, prop, ((ColorObject *)ret)->col);
}
else {
- PyObject *col_cb= newColorObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_COLOR);
+ PyObject *col_cb= Color_CreatePyObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_COLOR);
Py_DECREF(ret); /* the color owns now */
ret= col_cb; /* return the color instead */
}
@@ -4543,15 +4543,15 @@
switch(RNA_property_subtype(prop)) {
#ifdef USE_MATHUTILS
case PROP_ALL_VECTOR_SUBTYPES:
- ret= newVectorObject(data, len, Py_NEW, NULL);
+ ret= Vector_CreatePyObject(data, len, Py_NEW, NULL);
break;
case PROP_MATRIX:
if (len==16) {
- ret= newMatrixObject(data, 4, 4, Py_NEW, NULL);
+ ret= Matrix_CreatePyObject(data, 4, 4, Py_NEW, NULL);
break;
}
else if (len==9) {
- ret= newMatrixObject(data, 3, 3, Py_NEW, NULL);
+ ret= Matrix_CreatePyObject(data, 3, 3, Py_NEW, NULL);
break;
}
/* pass through */
Modified: trunk/blender/source/blender/python/mathutils/mathutils_Color.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Color.c 2011-11-24 04:12:16 UTC (rev 42114)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Color.c 2011-11-24 04:45:36 UTC (rev 42115)
@@ -61,7 +61,7 @@
"more then a single arg given");
return NULL;
}
- return newColorObject(col, Py_NEW, type);
+ return Color_CreatePyObject(col, Py_NEW, type);
}
//-----------------------------METHODS----------------------------
@@ -104,7 +104,7 @@
if (BaseMath_ReadCallback(self) == -1)
return NULL;
- return newColorObject(self->col, Py_NEW, Py_TYPE(self));
+ return Color_CreatePyObject(self->col, Py_NEW, Py_TYPE(self));
}
//----------------------------print object (internal)--------------
@@ -384,7 +384,7 @@
add_vn_vnvn(col, color1->col, color2->col, COLOR_SIZE);
- return newColorObject(col, Py_NEW, Py_TYPE(v1));
+ return Color_CreatePyObject(col, Py_NEW, Py_TYPE(v1));
}
/* addition in-place: obj += obj */
@@ -433,7 +433,7 @@
sub_vn_vnvn(col, color1->col, color2->col, COLOR_SIZE);
- return newColorObject(col, Py_NEW, Py_TYPE(v1));
+ return Color_CreatePyObject(col, Py_NEW, Py_TYPE(v1));
}
/* subtraction in-place: obj -= obj */
@@ -465,7 +465,7 @@
{
float tcol[COLOR_SIZE];
mul_vn_vn_fl(tcol, color->col, COLOR_SIZE, scalar);
- return newColorObject(tcol, Py_NEW, Py_TYPE(color));
+ return Color_CreatePyObject(tcol, Py_NEW, Py_TYPE(color));
}
@@ -612,7 +612,7 @@
return NULL;
negate_vn_vn(tcol, self->col, COLOR_SIZE);
- return newColorObject(tcol, Py_NEW, Py_TYPE(self));
+ return Color_CreatePyObject(tcol, Py_NEW, Py_TYPE(self));
}
@@ -821,13 +821,13 @@
NULL, //tp_weaklist
NULL //tp_del
};
-//------------------------newColorObject (internal)-------------
+//------------------------Color_CreatePyObject (internal)-------------
//creates a new color object
/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
(i.e. it was allocated elsewhere by MEM_mallocN())
pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
(i.e. it must be created here with PyMEM_malloc())*/
-PyObject *newColorObject(float *col, int type, PyTypeObject *base_type)
+PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type)
{
ColorObject *self;
@@ -860,9 +860,9 @@
return (PyObject *)self;
}
-PyObject *newColorObject_cb(PyObject *cb_user, int cb_type, int cb_subtype)
+PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype)
{
- ColorObject *self= (ColorObject *)newColorObject(NULL, Py_NEW, NULL);
+ ColorObject *self= (ColorObject *)Color_CreatePyObject(NULL, Py_NEW, NULL);
if (self) {
Py_INCREF(cb_user);
self->cb_user= cb_user;
Modified: trunk/blender/source/blender/python/mathutils/mathutils_Color.h
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Color.h 2011-11-24 04:12:16 UTC (rev 42114)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Color.h 2011-11-24 04:45:36 UTC (rev 42115)
@@ -48,7 +48,7 @@
blender (stored in blend_data). This is an either/or struct not both*/
//prototypes
-PyObject *newColorObject( float *col, int type, PyTypeObject *base_type);
-PyObject *newColorObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
+PyObject *Color_CreatePyObject( float *col, int type, PyTypeObject *base_type);
+PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
#endif /* MATHUTILS_COLOR_H */
Modified: trunk/blender/source/blender/python/mathutils/mathutils_Euler.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Euler.c 2011-11-24 04:12:16 UTC (rev 42114)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Euler.c 2011-11-24 04:45:36 UTC (rev 42115)
@@ -71,7 +71,7 @@
return NULL;
break;
}
- return newEulerObject(eul, order, Py_NEW, type);
+ return Euler_CreatePyObject(eul, order, Py_NEW, type);
}
/* internal use, assume read callback is done */
@@ -142,7 +142,7 @@
eulO_to_quat(quat, self->eul, self->order);
- return newQuaternionObject(quat, Py_NEW, NULL);
+ return Quaternion_CreatePyObject(quat, Py_NEW, NULL);
}
//return a matrix representation of the euler
@@ -163,7 +163,7 @@
eulO_to_mat3((float (*)[3])mat, self->eul, self->order);
- return newMatrixObject(mat, 3, 3 , Py_NEW, NULL);
+ return Matrix_CreatePyObject(mat, 3, 3 , Py_NEW, NULL);
}
PyDoc_STRVAR(Euler_zero_doc,
@@ -293,7 +293,7 @@
if (BaseMath_ReadCallback(self) == -1)
return NULL;
- return newEulerObject(self->eul, self->order, Py_NEW, Py_TYPE(self));
+ return Euler_CreatePyObject(self->eul, self->order, Py_NEW, Py_TYPE(self));
}
//----------------------------print object (internal)--------------
@@ -664,13 +664,13 @@
NULL, //tp_weaklist
NULL //tp_del
};
-//------------------------newEulerObject (internal)-------------
+//------------------------Euler_CreatePyObject (internal)-------------
//creates a new euler object
/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
(i.e. it was allocated elsewhere by MEM_mallocN())
pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
(i.e. it must be created here with PyMEM_malloc())*/
-PyObject *newEulerObject(float *eul, short order, int type, PyTypeObject *base_type)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list