Merge branch 'master' into blender2.8
This commit is contained in:
@@ -706,12 +706,12 @@ PyDoc_STRVAR(Color_channel_b_doc, "Blue color channel.\n\n:type: float");
|
||||
|
||||
static PyObject *Color_channel_get(ColorObject *self, void *type)
|
||||
{
|
||||
return Color_item(self, GET_INT_FROM_POINTER(type));
|
||||
return Color_item(self, POINTER_AS_INT(type));
|
||||
}
|
||||
|
||||
static int Color_channel_set(ColorObject *self, PyObject *value, void *type)
|
||||
{
|
||||
return Color_ass_item(self, GET_INT_FROM_POINTER(type), value);
|
||||
return Color_ass_item(self, POINTER_AS_INT(type), value);
|
||||
}
|
||||
|
||||
/* color channel (HSV), color.h/s/v */
|
||||
@@ -722,7 +722,7 @@ PyDoc_STRVAR(Color_channel_hsv_v_doc, "HSV Value component in [0, 1].\n\n:type:
|
||||
static PyObject *Color_channel_hsv_get(ColorObject *self, void *type)
|
||||
{
|
||||
float hsv[3];
|
||||
int i = GET_INT_FROM_POINTER(type);
|
||||
int i = POINTER_AS_INT(type);
|
||||
|
||||
if (BaseMath_ReadCallback(self) == -1)
|
||||
return NULL;
|
||||
@@ -735,7 +735,7 @@ static PyObject *Color_channel_hsv_get(ColorObject *self, void *type)
|
||||
static int Color_channel_hsv_set(ColorObject *self, PyObject *value, void *type)
|
||||
{
|
||||
float hsv[3];
|
||||
int i = GET_INT_FROM_POINTER(type);
|
||||
int i = POINTER_AS_INT(type);
|
||||
float f = PyFloat_AsDouble(value);
|
||||
|
||||
if (f == -1 && PyErr_Occurred()) {
|
||||
|
@@ -612,12 +612,12 @@ PyDoc_STRVAR(Euler_axis_doc,
|
||||
);
|
||||
static PyObject *Euler_axis_get(EulerObject *self, void *type)
|
||||
{
|
||||
return Euler_item(self, GET_INT_FROM_POINTER(type));
|
||||
return Euler_item(self, POINTER_AS_INT(type));
|
||||
}
|
||||
|
||||
static int Euler_axis_set(EulerObject *self, PyObject *value, void *type)
|
||||
{
|
||||
return Euler_ass_item(self, GET_INT_FROM_POINTER(type), value);
|
||||
return Euler_ass_item(self, POINTER_AS_INT(type), value);
|
||||
}
|
||||
|
||||
/* rotation order */
|
||||
|
@@ -1083,12 +1083,12 @@ PyDoc_STRVAR(Quaternion_axis_doc,
|
||||
);
|
||||
static PyObject *Quaternion_axis_get(QuaternionObject *self, void *type)
|
||||
{
|
||||
return Quaternion_item(self, GET_INT_FROM_POINTER(type));
|
||||
return Quaternion_item(self, POINTER_AS_INT(type));
|
||||
}
|
||||
|
||||
static int Quaternion_axis_set(QuaternionObject *self, PyObject *value, void *type)
|
||||
{
|
||||
return Quaternion_ass_item(self, GET_INT_FROM_POINTER(type), value);
|
||||
return Quaternion_ass_item(self, POINTER_AS_INT(type), value);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(Quaternion_magnitude_doc,
|
||||
|
@@ -2224,12 +2224,12 @@ PyDoc_STRVAR(Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n\n:type: floa
|
||||
|
||||
static PyObject *Vector_axis_get(VectorObject *self, void *type)
|
||||
{
|
||||
return vector_item_internal(self, GET_INT_FROM_POINTER(type), true);
|
||||
return vector_item_internal(self, POINTER_AS_INT(type), true);
|
||||
}
|
||||
|
||||
static int Vector_axis_set(VectorObject *self, PyObject *value, void *type)
|
||||
{
|
||||
return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, true);
|
||||
return vector_ass_item_internal(self, POINTER_AS_INT(type), value, true);
|
||||
}
|
||||
|
||||
/* vector.length */
|
||||
@@ -2372,7 +2372,7 @@ static PyObject *Vector_swizzle_get(VectorObject *self, void *closure)
|
||||
|
||||
/* Unpack the axes from the closure into an array. */
|
||||
axis_to = 0;
|
||||
swizzleClosure = GET_INT_FROM_POINTER(closure);
|
||||
swizzleClosure = POINTER_AS_INT(closure);
|
||||
while (swizzleClosure & SWIZZLE_VALID_AXIS) {
|
||||
axis_from = swizzleClosure & SWIZZLE_AXIS;
|
||||
if (axis_from >= self->size) {
|
||||
@@ -2419,7 +2419,7 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
|
||||
|
||||
/* Check that the closure can be used with this vector: even 2D vectors have
|
||||
* swizzles defined for axes z and w, but they would be invalid. */
|
||||
swizzleClosure = GET_INT_FROM_POINTER(closure);
|
||||
swizzleClosure = POINTER_AS_INT(closure);
|
||||
axis_from = 0;
|
||||
|
||||
while (swizzleClosure & SWIZZLE_VALID_AXIS) {
|
||||
@@ -2458,7 +2458,7 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
|
||||
|
||||
/* Copy vector contents onto swizzled axes. */
|
||||
axis_from = 0;
|
||||
swizzleClosure = GET_INT_FROM_POINTER(closure);
|
||||
swizzleClosure = POINTER_AS_INT(closure);
|
||||
|
||||
/* We must first copy current vec into tvec, else some org values may be lost.
|
||||
* See [#31760].
|
||||
@@ -2488,9 +2488,9 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
|
||||
#define _SWIZZLE3(a, b, c) (_SWIZZLE2(a, b) | (((c) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)))
|
||||
#define _SWIZZLE4(a, b, c, d) (_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3)))
|
||||
|
||||
#define SWIZZLE2(a, b) SET_INT_IN_POINTER(_SWIZZLE2(a, b))
|
||||
#define SWIZZLE3(a, b, c) SET_INT_IN_POINTER(_SWIZZLE3(a, b, c))
|
||||
#define SWIZZLE4(a, b, c, d) SET_INT_IN_POINTER(_SWIZZLE4(a, b, c, d))
|
||||
#define SWIZZLE2(a, b) POINTER_FROM_INT(_SWIZZLE2(a, b))
|
||||
#define SWIZZLE3(a, b, c) POINTER_FROM_INT(_SWIZZLE3(a, b, c))
|
||||
#define SWIZZLE4(a, b, c, d) POINTER_FROM_INT(_SWIZZLE4(a, b, c, d))
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Python attributes get/set structure: */
|
||||
|
Reference in New Issue
Block a user