[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42856] trunk/blender/source/blender/ python/mathutils: mathutils get/ set function rename + minor changes to matrix functions ( no functional changes)

Campbell Barton ideasman42 at gmail.com
Sat Dec 24 05:58:15 CET 2011


Revision: 42856
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42856
Author:   campbellbarton
Date:     2011-12-24 04:58:01 +0000 (Sat, 24 Dec 2011)
Log Message:
-----------
mathutils get/set function rename + minor changes to matrix functions (no functional changes)

Modified Paths:
--------------
    trunk/blender/source/blender/python/mathutils/mathutils.c
    trunk/blender/source/blender/python/mathutils/mathutils.h
    trunk/blender/source/blender/python/mathutils/mathutils_Color.c
    trunk/blender/source/blender/python/mathutils/mathutils_Euler.c
    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_Vector.c

Modified: trunk/blender/source/blender/python/mathutils/mathutils.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils.c	2011-12-24 03:03:42 UTC (rev 42855)
+++ trunk/blender/source/blender/python/mathutils/mathutils.c	2011-12-24 04:58:01 UTC (rev 42856)
@@ -358,16 +358,16 @@
 }
 
 /* BaseMathObject generic functions for all mathutils types */
-char BaseMathObject_Owner_doc[] = "The item this is wrapping or None  (readonly).";
-PyObject *BaseMathObject_getOwner(BaseMathObject *self, void *UNUSED(closure))
+char BaseMathObject_owner_doc[] = "The item this is wrapping or None  (readonly).";
+PyObject *BaseMathObject_owner_get(BaseMathObject *self, void *UNUSED(closure))
 {
 	PyObject *ret= self->cb_user ? self->cb_user : Py_None;
 	Py_INCREF(ret);
 	return ret;
 }
 
-char BaseMathObject_Wrapped_doc[] = "True when this object wraps external data (readonly).\n\n:type: boolean";
-PyObject *BaseMathObject_getWrapped(BaseMathObject *self, void *UNUSED(closure))
+char BaseMathObject_is_wrapped_doc[] = "True when this object wraps external data (readonly).\n\n:type: boolean";
+PyObject *BaseMathObject_is_wrapped_get(BaseMathObject *self, void *UNUSED(closure))
 {
 	return PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0);
 }

Modified: trunk/blender/source/blender/python/mathutils/mathutils.h
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils.h	2011-12-24 03:03:42 UTC (rev 42855)
+++ trunk/blender/source/blender/python/mathutils/mathutils.h	2011-12-24 04:58:01 UTC (rev 42856)
@@ -39,8 +39,8 @@
 
 struct DynStr;
 
-extern char BaseMathObject_Wrapped_doc[];
-extern char BaseMathObject_Owner_doc[];
+extern char BaseMathObject_is_wrapped_doc[];
+extern char BaseMathObject_owner_doc[];
 
 #define BASE_MATH_MEMBERS(_data)                                                                                 \
 	PyObject_VAR_HEAD                                                                                            \
@@ -67,8 +67,8 @@
 #include "mathutils_geometry.h"
 #include "mathutils_noise.h"
 
-PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * );
-PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void * );
+PyObject *BaseMathObject_owner_get( BaseMathObject * self, void * );
+PyObject *BaseMathObject_is_wrapped_get( BaseMathObject *self, void * );
 
 int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg);
 int BaseMathObject_clear(BaseMathObject *self);

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Color.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Color.c	2011-12-24 03:03:42 UTC (rev 42855)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Color.c	2011-12-24 04:58:01 UTC (rev 42856)
@@ -670,18 +670,18 @@
 };
 
 /* color channel, vector.r/g/b */
-static PyObject *Color_getChannel(ColorObject * self, void *type)
+static PyObject *Color_channel_get(ColorObject * self, void *type)
 {
 	return Color_item(self, GET_INT_FROM_POINTER(type));
 }
 
-static int Color_setChannel(ColorObject * self, PyObject *value, void * type)
+static int Color_channel_set(ColorObject * self, PyObject *value, void * type)
 {
 	return Color_ass_item(self, GET_INT_FROM_POINTER(type), value);
 }
 
 /* color channel (HSV), color.h/s/v */
-static PyObject *Color_getChannelHSV(ColorObject * self, void *type)
+static PyObject *Color_channel_hsv_get(ColorObject * self, void *type)
 {
 	float hsv[3];
 	int i= GET_INT_FROM_POINTER(type);
@@ -694,7 +694,7 @@
 	return PyFloat_FromDouble(hsv[i]);
 }
 
-static int Color_setChannelHSV(ColorObject * self, PyObject *value, void * type)
+static int Color_channel_hsv_set(ColorObject * self, PyObject *value, void * type)
 {
 	float hsv[3];
 	int i= GET_INT_FROM_POINTER(type);
@@ -722,7 +722,7 @@
 }
 
 /* color channel (HSV), color.h/s/v */
-static PyObject *Color_getHSV(ColorObject * self, void *UNUSED(closure))
+static PyObject *Color_hsv_get(ColorObject * self, void *UNUSED(closure))
 {
 	float hsv[3];
 	PyObject *ret;
@@ -739,7 +739,7 @@
 	return ret;
 }
 
-static int Color_setHSV(ColorObject * self, PyObject *value, void *UNUSED(closure))
+static int Color_hsv_set(ColorObject * self, PyObject *value, void *UNUSED(closure))
 {
 	float hsv[3];
 
@@ -762,18 +762,18 @@
 /* Python attributes get/set structure:                                      */
 /*****************************************************************************/
 static PyGetSetDef Color_getseters[] = {
-	{(char *)"r", (getter)Color_getChannel, (setter)Color_setChannel, (char *)"Red color channel.\n\n:type: float", (void *)0},
-	{(char *)"g", (getter)Color_getChannel, (setter)Color_setChannel, (char *)"Green color channel.\n\n:type: float", (void *)1},
-	{(char *)"b", (getter)Color_getChannel, (setter)Color_setChannel, (char *)"Blue color channel.\n\n:type: float", (void *)2},
+	{(char *)"r", (getter)Color_channel_get, (setter)Color_channel_set, (char *)"Red color channel.\n\n:type: float", (void *)0},
+	{(char *)"g", (getter)Color_channel_get, (setter)Color_channel_set, (char *)"Green color channel.\n\n:type: float", (void *)1},
+	{(char *)"b", (getter)Color_channel_get, (setter)Color_channel_set, (char *)"Blue color channel.\n\n:type: float", (void *)2},
 
-	{(char *)"h", (getter)Color_getChannelHSV, (setter)Color_setChannelHSV, (char *)"HSV Hue component in [0, 1].\n\n:type: float", (void *)0},
-	{(char *)"s", (getter)Color_getChannelHSV, (setter)Color_setChannelHSV, (char *)"HSV Saturation component in [0, 1].\n\n:type: float", (void *)1},
-	{(char *)"v", (getter)Color_getChannelHSV, (setter)Color_setChannelHSV, (char *)"HSV Value component in [0, 1].\n\n:type: float", (void *)2},
+	{(char *)"h", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, (char *)"HSV Hue component in [0, 1].\n\n:type: float", (void *)0},
+	{(char *)"s", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, (char *)"HSV Saturation component in [0, 1].\n\n:type: float", (void *)1},
+	{(char *)"v", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, (char *)"HSV Value component in [0, 1].\n\n:type: float", (void *)2},
 
-	{(char *)"hsv", (getter)Color_getHSV, (setter)Color_setHSV, (char *)"HSV Values in [0, 1].\n\n:type: float triplet", (void *)0},
+	{(char *)"hsv", (getter)Color_hsv_get, (setter)Color_hsv_set, (char *)"HSV Values in [0, 1].\n\n:type: float triplet", (void *)0},
 
-	{(char *)"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, BaseMathObject_Wrapped_doc, NULL},
-	{(char *)"owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL},
+	{(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
+	{(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
 	{NULL, NULL, NULL, NULL, NULL}  /* Sentinel */
 };
 

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Euler.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Euler.c	2011-12-24 03:03:42 UTC (rev 42855)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Euler.c	2011-12-24 04:58:01 UTC (rev 42856)
@@ -571,18 +571,18 @@
 /*
  * euler axis, euler.x/y/z
  */
-static PyObject *Euler_getAxis(EulerObject *self, void *type)
+static PyObject *Euler_axis_get(EulerObject *self, void *type)
 {
 	return Euler_item(self, GET_INT_FROM_POINTER(type));
 }
 
-static int Euler_setAxis(EulerObject *self, PyObject *value, void *type)
+static int Euler_axis_set(EulerObject *self, PyObject *value, void *type)
 {
 	return Euler_ass_item(self, GET_INT_FROM_POINTER(type), value);
 }
 
 /* rotation order */
-static PyObject *Euler_getOrder(EulerObject *self, void *UNUSED(closure))
+static PyObject *Euler_order_get(EulerObject *self, void *UNUSED(closure))
 {
 	if (BaseMath_ReadCallback(self) == -1) /* can read order too */
 		return NULL;
@@ -590,7 +590,7 @@
 	return PyUnicode_FromString(euler_order_str(self));
 }
 
-static int Euler_setOrder(EulerObject *self, PyObject *value, void *UNUSED(closure))
+static int Euler_order_set(EulerObject *self, PyObject *value, void *UNUSED(closure))
 {
 	const char *order_str= _PyUnicode_AsString(value);
 	short order= euler_order_from_string(order_str, "euler.order");
@@ -607,13 +607,13 @@
 /* Python attributes get/set structure:                                      */
 /*****************************************************************************/
 static PyGetSetDef Euler_getseters[] = {
-	{(char *)"x", (getter)Euler_getAxis, (setter)Euler_setAxis, (char *)"Euler X axis in radians.\n\n:type: float", (void *)0},
-	{(char *)"y", (getter)Euler_getAxis, (setter)Euler_setAxis, (char *)"Euler Y axis in radians.\n\n:type: float", (void *)1},
-	{(char *)"z", (getter)Euler_getAxis, (setter)Euler_setAxis, (char *)"Euler Z axis in radians.\n\n:type: float", (void *)2},
-	{(char *)"order", (getter)Euler_getOrder, (setter)Euler_setOrder, (char *)"Euler rotation order.\n\n:type: string in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']", (void *)NULL},
+	{(char *)"x", (getter)Euler_axis_get, (setter)Euler_axis_set, (char *)"Euler X axis in radians.\n\n:type: float", (void *)0},
+	{(char *)"y", (getter)Euler_axis_get, (setter)Euler_axis_set, (char *)"Euler Y axis in radians.\n\n:type: float", (void *)1},
+	{(char *)"z", (getter)Euler_axis_get, (setter)Euler_axis_set, (char *)"Euler Z axis in radians.\n\n:type: float", (void *)2},
+	{(char *)"order", (getter)Euler_order_get, (setter)Euler_order_set, (char *)"Euler rotation order.\n\n:type: string in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']", (void *)NULL},
 
-	{(char *)"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, (char *)BaseMathObject_Wrapped_doc, NULL},
-	{(char *)"owner", (getter)BaseMathObject_getOwner, (setter)NULL, (char *)BaseMathObject_Owner_doc, NULL},
+	{(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, (char *)BaseMathObject_is_wrapped_doc, NULL},
+	{(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, (char *)BaseMathObject_owner_doc, NULL},
 	{NULL, NULL, NULL, NULL, NULL}  /* Sentinel */
 };
 


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list