Blender V2.61 - r43446

mathutils_Vector.c

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  *
00022  * Contributor(s): Willian P. Germano, Joseph Gilbert, Ken Hughes, Alex Fraser, Campbell Barton
00023  *
00024  * ***** END GPL LICENSE BLOCK *****
00025  */
00026 
00032 #include <Python.h>
00033 
00034 #include "mathutils.h"
00035 
00036 #include "BLI_math.h"
00037 #include "BLI_utildefines.h"
00038 #include "BLI_dynstr.h"
00039 
00040 #define MAX_DIMENSIONS 4
00041 
00042 /* Swizzle axes get packed into a single value that is used as a closure. Each
00043    axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is
00044    used as a sentinel: if it is unset, the axis is not valid. */
00045 #define SWIZZLE_BITS_PER_AXIS 3
00046 #define SWIZZLE_VALID_AXIS 0x4
00047 #define SWIZZLE_AXIS       0x3
00048 
00049 static PyObject *Vector_copy(VectorObject *self);
00050 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits);
00051 static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat);
00052 
00053 /* Supports 2D, 3D, and 4D vector objects both int and float values
00054  * accepted. Mixed float and int values accepted. Ints are parsed to float
00055  */
00056 static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
00057 {
00058     float *vec = NULL;
00059     int size = 3; /* default to a 3D vector */
00060 
00061     switch (PyTuple_GET_SIZE(args)) {
00062     case 0:
00063         vec = PyMem_Malloc(size * sizeof(float));
00064 
00065         if (vec == NULL) {
00066             PyErr_SetString(PyExc_MemoryError,
00067                             "Vector(): "
00068                             "problem allocating pointer space");
00069             return NULL;
00070         }
00071 
00072         fill_vn_fl(vec, size, 0.0f);
00073         break;
00074     case 1:
00075         if ((size = mathutils_array_parse_alloc(&vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) {
00076             if (vec) {
00077                 PyMem_Free(vec);
00078             }
00079             return NULL;
00080         }
00081         break;
00082     default:
00083         PyErr_SetString(PyExc_TypeError,
00084                         "mathutils.Vector(): "
00085                         "more then a single arg given");
00086         return NULL;
00087     }
00088     return Vector_CreatePyObject(vec, size, Py_NEW, type);
00089 }
00090 
00091 static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *self)
00092 {
00093     PyObject *ret = Vector_copy(self);
00094     PyObject *ret_dummy = vec_func(ret);
00095     if (ret_dummy) {
00096         Py_DECREF(ret_dummy);
00097         return (PyObject *)ret;
00098     }
00099     else { /* error */
00100         Py_DECREF(ret);
00101         return NULL;
00102     }
00103 }
00104 
00105 /*-----------------------CLASS-METHODS----------------------------*/
00106 PyDoc_STRVAR(C_Vector_Fill_doc,
00107 ".. classmethod:: Fill(size, fill=0.0)\n"
00108 "\n"
00109 "   Create a vector of length size with all values set to fill.\n"
00110 "\n"
00111 "   :arg size: The length of the vector to be created.\n"
00112 "   :type size: int\n"
00113 "   :arg fill: The value used to fill the vector.\n"
00114 "   :type fill: float\n"
00115 );
00116 static PyObject *C_Vector_Fill(PyObject *cls, PyObject *args)
00117 {
00118     float *vec;
00119     int size;
00120     float fill = 0.0f;
00121 
00122     if (!PyArg_ParseTuple(args, "i|f:Vector.Fill", &size, &fill)) {
00123         return NULL;
00124     }
00125 
00126     if (size < 2) {
00127         PyErr_SetString(PyExc_RuntimeError,
00128                         "Vector(): invalid size");
00129         return NULL;
00130     }
00131 
00132     vec = PyMem_Malloc(size * sizeof(float));
00133 
00134     if (vec == NULL) {
00135         PyErr_SetString(PyExc_MemoryError,
00136                         "Vector.Fill(): "
00137                         "problem allocating pointer space");
00138         return NULL;
00139     }
00140 
00141     fill_vn_fl(vec, size, fill);
00142 
00143     return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
00144 }
00145 
00146 PyDoc_STRVAR(C_Vector_Range_doc,
00147 ".. classmethod:: Range(start=0, stop, step=1)\n"
00148 "\n"
00149 "   Create a filled with a range of values.\n"
00150 "\n"
00151 "   :arg start: The start of the range used to fill the vector.\n"
00152 "   :type start: int\n"
00153 "   :arg stop: The end of the range used to fill the vector.\n"
00154 "   :type stop: int\n"
00155 "   :arg step: The step between successive values in the vector.\n"
00156 "   :type step: int\n"
00157 );
00158 static PyObject *C_Vector_Range(PyObject *cls, PyObject *args)
00159 {
00160     float *vec;
00161     int stop, size;
00162     int start = 0;
00163     int step = 1;
00164 
00165     if (!PyArg_ParseTuple(args, "i|ii:Vector.Range", &start, &stop, &step)) {
00166         return NULL;
00167     }
00168 
00169     switch (PyTuple_GET_SIZE(args)) {
00170     case 1:
00171         size = start;
00172         start = 0;
00173         break;
00174     case 2:
00175         if (start >= stop) {
00176             PyErr_SetString(PyExc_RuntimeError,
00177                             "Start value is larger"
00178                             "than the stop value");
00179             return NULL;
00180         }
00181 
00182         size = stop - start;
00183         break;
00184     default:
00185         if (start >= stop) {
00186             PyErr_SetString(PyExc_RuntimeError,
00187                             "Start value is larger"
00188                             "than the stop value");
00189             return NULL;
00190         }
00191         size = (stop - start)/step;
00192         if (size%step)
00193             size++;
00194         break;
00195     }
00196 
00197     vec = PyMem_Malloc(size * sizeof(float));
00198 
00199     if (vec == NULL) {
00200         PyErr_SetString(PyExc_MemoryError,
00201                         "Vector.Range(): "
00202                         "problem allocating pointer space");
00203         return NULL;
00204     }
00205 
00206     range_vn_fl(vec, size, (float)start, (float)step);
00207 
00208     return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
00209 }
00210 
00211 PyDoc_STRVAR(C_Vector_Linspace_doc,
00212 ".. classmethod:: Linspace(start, stop, size)\n"
00213 "\n"
00214 "   Create a vector of the specified size which is filled with linearly spaced values between start and stop values.\n"
00215 "\n"
00216 "   :arg start: The start of the range used to fill the vector.\n"
00217 "   :type start: int\n"
00218 "   :arg stop: The end of the range used to fill the vector.\n"
00219 "   :type stop: int\n"
00220 "   :arg size: The size of the vector to be created.\n"
00221 "   :type size: int\n"
00222 );
00223 static PyObject *C_Vector_Linspace(PyObject *cls, PyObject *args)
00224 {
00225     float *vec;
00226     int size;
00227     float start, end, step;
00228 
00229     if (!PyArg_ParseTuple(args, "ffi:Vector.Linspace", &start, &end, &size)) {
00230         return NULL;
00231     }
00232 
00233     if (size < 2) {
00234         PyErr_SetString(PyExc_RuntimeError,
00235                         "Vector.Linspace(): invalid size");
00236         return NULL;
00237     }
00238 
00239     step = (end - start)/(float)(size-1);
00240 
00241     vec = PyMem_Malloc(size * sizeof(float));
00242 
00243     if (vec == NULL) {
00244         PyErr_SetString(PyExc_MemoryError,
00245                         "Vector.Linspace(): "
00246                         "problem allocating pointer space");
00247         return NULL;
00248     }
00249 
00250     range_vn_fl(vec, size, start, step);
00251 
00252     return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
00253 }
00254 
00255 PyDoc_STRVAR(C_Vector_Repeat_doc,
00256 ".. classmethod:: Repeat(vector, size)\n"
00257 "\n"
00258 "   Create a vector by repeating the values in vector until the required size is reached.\n"
00259 "\n"
00260 "   :arg tuple: The vector to draw values from.\n"
00261 "   :type tuple: :class:`mathutils.Vector`\n"
00262 "   :arg size: The size of the vector to be created.\n"
00263 "   :type size: int\n"
00264 );
00265 static PyObject *C_Vector_Repeat(PyObject *cls, PyObject *args)
00266 {
00267     float *vec;
00268     float *iter_vec = NULL;
00269     int i, size, value_size;
00270     PyObject *value;
00271 
00272     if (!PyArg_ParseTuple(args, "Oi:Vector.Repeat", &value, &size)) {
00273         return NULL;
00274     }
00275 
00276     if (size < 2) {
00277         PyErr_SetString(PyExc_RuntimeError,
00278                         "Vector.Repeat(): invalid size");
00279         return NULL;
00280     }
00281 
00282     if ((value_size = mathutils_array_parse_alloc(&iter_vec, 2, value,
00283                                                   "Vector.Repeat(vector, size), invalid 'vector' arg")) == -1)
00284     {
00285         PyMem_Free(iter_vec);
00286         return NULL;
00287     }
00288 
00289     if (iter_vec == NULL) {
00290         PyErr_SetString(PyExc_MemoryError,
00291                         "Vector.Repeat(): "
00292                         "problem allocating pointer space");
00293         return NULL;
00294     }
00295 
00296     vec = PyMem_Malloc(size * sizeof(float));
00297 
00298     if (vec == NULL) {
00299         PyErr_SetString(PyExc_MemoryError,
00300                         "Vector.Repeat(): "
00301                         "problem allocating pointer space");
00302         return NULL;
00303     }
00304 
00305     i = 0;
00306     while (i < size) {
00307         vec[i] = iter_vec[i % value_size];
00308         i++;
00309     }
00310 
00311     PyMem_Free(iter_vec);
00312 
00313     return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
00314 }
00315 
00316 /*-----------------------------METHODS---------------------------- */
00317 PyDoc_STRVAR(Vector_zero_doc,
00318 ".. method:: zero()\n"
00319 "\n"
00320 "   Set all values to zero.\n"
00321 );
00322 static PyObject *Vector_zero(VectorObject *self)
00323 {
00324     fill_vn_fl(self->vec, self->size, 0.0f);
00325 
00326     if (BaseMath_WriteCallback(self) == -1)
00327         return NULL;
00328 
00329     Py_RETURN_NONE;
00330 }
00331 
00332 PyDoc_STRVAR(Vector_normalize_doc,
00333 ".. method:: normalize()\n"
00334 "\n"
00335 "   Normalize the vector, making the length of the vector always 1.0.\n"
00336 "\n"
00337 "   .. warning:: Normalizing a vector where all values are zero has no effect.\n"
00338 "\n"
00339 "   .. note:: Normalize works for vectors of all sizes,\n"
00340 "      however 4D Vectors w axis is left untouched.\n"
00341 );
00342 static PyObject *Vector_normalize(VectorObject *self)
00343 {
00344     int size = (self->size == 4 ? 3 : self->size);
00345     if (BaseMath_ReadCallback(self) == -1)
00346         return NULL;
00347 
00348     normalize_vn(self->vec, size);
00349 
00350     (void)BaseMath_WriteCallback(self);
00351     Py_RETURN_NONE;
00352 }
00353 PyDoc_STRVAR(Vector_normalized_doc,
00354 ".. method:: normalized()\n"
00355 "\n"
00356 "   Return a new, normalized vector.\n"
00357 "\n"
00358 "   :return: a normalized copy of the vector\n"
00359 "   :rtype: :class:`Vector`\n"
00360 );
00361 static PyObject *Vector_normalized(VectorObject *self)
00362 {
00363     return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self);
00364 }
00365 
00366 PyDoc_STRVAR(Vector_resize_doc,
00367 ".. method:: resize(size=3)\n"
00368 "\n"
00369 "   Resize the vector to have size number of elements.\n"
00370 "\n"
00371 "   :return: an instance of itself\n"
00372 "   :rtype: :class:`Vector`\n"
00373 );
00374 static PyObject *Vector_resize(VectorObject *self, PyObject *value)
00375 {
00376     int size;
00377 
00378     if (self->wrapped == Py_WRAP) {
00379         PyErr_SetString(PyExc_TypeError,
00380                         "Vector.resize(): "
00381                         "cannot resize wrapped data - only python vectors");
00382         return NULL;
00383     }
00384     if (self->cb_user) {
00385         PyErr_SetString(PyExc_TypeError,
00386                         "Vector.resize(): "
00387                         "cannot resize a vector that has an owner");
00388         return NULL;
00389     }
00390 
00391     if ((size = PyLong_AsLong(value)) == -1) {
00392         PyErr_SetString(PyExc_TypeError,
00393                         "Vector.resize(size): "
00394                         "expected size argument to be an integer");
00395         return NULL;
00396     }
00397 
00398     if (size < 2) {
00399         PyErr_SetString(PyExc_RuntimeError,
00400                         "Vector.resize(): invalid size");
00401         return NULL;
00402     }
00403 
00404     self->vec = PyMem_Realloc(self->vec, (size * sizeof(float)));
00405     if (self->vec == NULL) {
00406         PyErr_SetString(PyExc_MemoryError,
00407                         "Vector.resize(): "
00408                         "problem allocating pointer space");
00409         return NULL;
00410     }
00411 
00412     /* If the vector has increased in length, set all new elements to 0.0f */
00413     if (size > self->size) {
00414         fill_vn_fl(self->vec + self->size, size - self->size, 0.0f);
00415     }
00416 
00417     self->size = size;
00418     Py_RETURN_NONE;
00419 }
00420 
00421 PyDoc_STRVAR(Vector_resized_doc,
00422 ".. method:: resized(size=3)\n"
00423 "\n"
00424 "   Return a resized copy of the vector with size number of elements.\n"
00425 "\n"
00426 "   :return: a new vector\n"
00427 "   :rtype: :class:`Vector`\n"
00428 );
00429 static PyObject *Vector_resized(VectorObject *self, PyObject *value)
00430 {
00431     int size;
00432     float *vec;
00433 
00434     /*if (!PyArg_ParseTuple(args, "i:resize", &size))
00435         return NULL;*/
00436     if ((size = PyLong_AsLong(value)) == -1) {
00437         return NULL;
00438     }
00439 
00440     if (size < 2) {
00441         PyErr_SetString(PyExc_RuntimeError,
00442                         "Vector.resized(): invalid size");
00443         return NULL;
00444     }
00445 
00446     vec = PyMem_Malloc(size * sizeof(float));
00447 
00448     if (vec == NULL) {
00449         PyErr_SetString(PyExc_MemoryError,
00450                         "Vector.resized(): "
00451                         "problem allocating pointer space");
00452         return NULL;
00453     }
00454 
00455     fill_vn_fl(vec, size, 0.0f);
00456     memcpy(vec, self->vec, self->size * sizeof(float));
00457 
00458     return Vector_CreatePyObject_alloc(vec, size, NULL);
00459 }
00460 
00461 PyDoc_STRVAR(Vector_resize_2d_doc,
00462 ".. method:: resize_2d()\n"
00463 "\n"
00464 "   Resize the vector to 2D  (x, y).\n"
00465 "\n"
00466 "   :return: an instance of itself\n"
00467 "   :rtype: :class:`Vector`\n"
00468 );
00469 static PyObject *Vector_resize_2d(VectorObject *self)
00470 {
00471     if (self->wrapped == Py_WRAP) {
00472         PyErr_SetString(PyExc_TypeError,
00473                         "Vector.resize_2d(): "
00474                         "cannot resize wrapped data - only python vectors");
00475         return NULL;
00476     }
00477     if (self->cb_user) {
00478         PyErr_SetString(PyExc_TypeError,
00479                         "Vector.resize_2d(): "
00480                         "cannot resize a vector that has an owner");
00481         return NULL;
00482     }
00483 
00484     self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
00485     if (self->vec == NULL) {
00486         PyErr_SetString(PyExc_MemoryError,
00487                         "Vector.resize_2d(): "
00488                         "problem allocating pointer space");
00489         return NULL;
00490     }
00491 
00492     self->size = 2;
00493     Py_RETURN_NONE;
00494 }
00495 
00496 PyDoc_STRVAR(Vector_resize_3d_doc,
00497 ".. method:: resize_3d()\n"
00498 "\n"
00499 "   Resize the vector to 3D  (x, y, z).\n"
00500 "\n"
00501 "   :return: an instance of itself\n"
00502 "   :rtype: :class:`Vector`\n"
00503 );
00504 static PyObject *Vector_resize_3d(VectorObject *self)
00505 {
00506     if (self->wrapped == Py_WRAP) {
00507         PyErr_SetString(PyExc_TypeError,
00508                         "Vector.resize_3d(): "
00509                         "cannot resize wrapped data - only python vectors");
00510         return NULL;
00511     }
00512     if (self->cb_user) {
00513         PyErr_SetString(PyExc_TypeError,
00514                         "Vector.resize_3d(): "
00515                         "cannot resize a vector that has an owner");
00516         return NULL;
00517     }
00518 
00519     self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
00520     if (self->vec == NULL) {
00521         PyErr_SetString(PyExc_MemoryError,
00522                         "Vector.resize_3d(): "
00523                         "problem allocating pointer space");
00524         return NULL;
00525     }
00526 
00527     if (self->size == 2)
00528         self->vec[2] = 0.0f;
00529 
00530     self->size = 3;
00531     Py_RETURN_NONE;
00532 }
00533 
00534 PyDoc_STRVAR(Vector_resize_4d_doc,
00535 ".. method:: resize_4d()\n"
00536 "\n"
00537 "   Resize the vector to 4D (x, y, z, w).\n"
00538 "\n"
00539 "   :return: an instance of itself\n"
00540 "   :rtype: :class:`Vector`\n"
00541 );
00542 static PyObject *Vector_resize_4d(VectorObject *self)
00543 {
00544     if (self->wrapped == Py_WRAP) {
00545         PyErr_SetString(PyExc_TypeError,
00546                         "Vector.resize_4d(): "
00547                         "cannot resize wrapped data - only python vectors");
00548         return NULL;
00549     }
00550     if (self->cb_user) {
00551         PyErr_SetString(PyExc_TypeError,
00552                         "Vector.resize_4d(): "
00553                         "cannot resize a vector that has an owner");
00554         return NULL;
00555     }
00556 
00557     self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
00558     if (self->vec == NULL) {
00559         PyErr_SetString(PyExc_MemoryError,
00560                         "Vector.resize_4d(): "
00561                         "problem allocating pointer space");
00562         return NULL;
00563     }
00564 
00565     if (self->size == 2) {
00566         self->vec[2] = 0.0f;
00567         self->vec[3] = 1.0f;
00568     }
00569     else if (self->size == 3) {
00570         self->vec[3] = 1.0f;
00571     }
00572     self->size = 4;
00573     Py_RETURN_NONE;
00574 }
00575 PyDoc_STRVAR(Vector_to_2d_doc,
00576 ".. method:: to_2d()\n"
00577 "\n"
00578 "   Return a 2d copy of the vector.\n"
00579 "\n"
00580 "   :return: a new vector\n"
00581 "   :rtype: :class:`Vector`\n"
00582 );
00583 static PyObject *Vector_to_2d(VectorObject *self)
00584 {
00585     if (BaseMath_ReadCallback(self) == -1)
00586         return NULL;
00587 
00588     return Vector_CreatePyObject(self->vec, 2, Py_NEW, Py_TYPE(self));
00589 }
00590 PyDoc_STRVAR(Vector_to_3d_doc,
00591 ".. method:: to_3d()\n"
00592 "\n"
00593 "   Return a 3d copy of the vector.\n"
00594 "\n"
00595 "   :return: a new vector\n"
00596 "   :rtype: :class:`Vector`\n"
00597 );
00598 static PyObject *Vector_to_3d(VectorObject *self)
00599 {
00600     float tvec[3] = {0.0f};
00601 
00602     if (BaseMath_ReadCallback(self) == -1)
00603         return NULL;
00604 
00605     memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 3));
00606     return Vector_CreatePyObject(tvec, 3, Py_NEW, Py_TYPE(self));
00607 }
00608 PyDoc_STRVAR(Vector_to_4d_doc,
00609 ".. method:: to_4d()\n"
00610 "\n"
00611 "   Return a 4d copy of the vector.\n"
00612 "\n"
00613 "   :return: a new vector\n"
00614 "   :rtype: :class:`Vector`\n"
00615 );
00616 static PyObject *Vector_to_4d(VectorObject *self)
00617 {
00618     float tvec[4] = {0.0f, 0.0f, 0.0f, 1.0f};
00619 
00620     if (BaseMath_ReadCallback(self) == -1)
00621         return NULL;
00622 
00623     memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 4));
00624     return Vector_CreatePyObject(tvec, 4, Py_NEW, Py_TYPE(self));
00625 }
00626 
00627 PyDoc_STRVAR(Vector_to_tuple_doc,
00628 ".. method:: to_tuple(precision=-1)\n"
00629 "\n"
00630 "   Return this vector as a tuple with.\n"
00631 "\n"
00632 "   :arg precision: The number to round the value to in [-1, 21].\n"
00633 "   :type precision: int\n"
00634 "   :return: the values of the vector rounded by *precision*\n"
00635 "   :rtype: tuple\n"
00636 );
00637 /* note: BaseMath_ReadCallback must be called beforehand */
00638 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits)
00639 {
00640     PyObject *ret;
00641     int i;
00642 
00643     ret = PyTuple_New(self->size);
00644 
00645     if (ndigits >= 0) {
00646         for (i = 0; i < self->size; i++) {
00647             PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(double_round((double)self->vec[i], ndigits)));
00648         }
00649     }
00650     else {
00651         for (i = 0; i < self->size; i++) {
00652             PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(self->vec[i]));
00653         }
00654     }
00655 
00656     return ret;
00657 }
00658 
00659 static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
00660 {
00661     int ndigits = 0;
00662 
00663     if (!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits))
00664         return NULL;
00665 
00666     if (ndigits > 22 || ndigits < 0) {
00667         PyErr_SetString(PyExc_ValueError,
00668                         "Vector.to_tuple(ndigits): "
00669                         "ndigits must be between 0 and 21");
00670         return NULL;
00671     }
00672 
00673     if (PyTuple_GET_SIZE(args) == 0)
00674         ndigits = -1;
00675 
00676     if (BaseMath_ReadCallback(self) == -1)
00677         return NULL;
00678 
00679     return Vector_to_tuple_ext(self, ndigits);
00680 }
00681 
00682 PyDoc_STRVAR(Vector_to_track_quat_doc,
00683 ".. method:: to_track_quat(track, up)\n"
00684 "\n"
00685 "   Return a quaternion rotation from the vector and the track and up axis.\n"
00686 "\n"
00687 "   :arg track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].\n"
00688 "   :type track: string\n"
00689 "   :arg up: Up axis in ['X', 'Y', 'Z'].\n"
00690 "   :type up: string\n"
00691 "   :return: rotation from the vector and the track and up axis.\n"
00692 "   :rtype: :class:`Quaternion`\n"
00693 );
00694 static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
00695 {
00696     float vec[3], quat[4];
00697     const char *strack, *sup;
00698     short track = 2, up = 1;
00699 
00700     if (!PyArg_ParseTuple(args, "|ss:to_track_quat", &strack, &sup))
00701         return NULL;
00702 
00703     if (self->size != 3) {
00704         PyErr_SetString(PyExc_TypeError,
00705                         "Vector.to_track_quat(): "
00706                         "only for 3D vectors");
00707         return NULL;
00708     }
00709 
00710     if (BaseMath_ReadCallback(self) == -1)
00711         return NULL;
00712 
00713     if (strack) {
00714         const char *axis_err_msg = "only X, -X, Y, -Y, Z or -Z for track axis";
00715 
00716         if (strlen(strack) == 2) {
00717             if (strack[0] == '-') {
00718                 switch (strack[1]) {
00719                     case 'X':
00720                         track = 3;
00721                         break;
00722                     case 'Y':
00723                         track = 4;
00724                         break;
00725                     case 'Z':
00726                         track = 5;
00727                         break;
00728                     default:
00729                         PyErr_SetString(PyExc_ValueError, axis_err_msg);
00730                         return NULL;
00731                 }
00732             }
00733             else {
00734                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
00735                 return NULL;
00736             }
00737         }
00738         else if (strlen(strack) == 1) {
00739             switch (strack[0]) {
00740             case '-':
00741             case 'X':
00742                 track = 0;
00743                 break;
00744             case 'Y':
00745                 track = 1;
00746                 break;
00747             case 'Z':
00748                 track = 2;
00749                 break;
00750             default:
00751                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
00752                 return NULL;
00753             }
00754         }
00755         else {
00756             PyErr_SetString(PyExc_ValueError, axis_err_msg);
00757             return NULL;
00758         }
00759     }
00760 
00761     if (sup) {
00762         const char *axis_err_msg = "only X, Y or Z for up axis";
00763         if (strlen(sup) == 1) {
00764             switch (*sup) {
00765             case 'X':
00766                 up = 0;
00767                 break;
00768             case 'Y':
00769                 up = 1;
00770                 break;
00771             case 'Z':
00772                 up = 2;
00773                 break;
00774             default:
00775                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
00776                 return NULL;
00777             }
00778         }
00779         else {
00780             PyErr_SetString(PyExc_ValueError, axis_err_msg);
00781             return NULL;
00782         }
00783     }
00784 
00785     if (track == up) {
00786         PyErr_SetString(PyExc_ValueError,
00787                         "Can't have the same axis for track and up");
00788         return NULL;
00789     }
00790 
00791     /*
00792         flip vector around, since vectoquat expect a vector from target to tracking object
00793         and the python function expects the inverse (a vector to the target).
00794     */
00795     negate_v3_v3(vec, self->vec);
00796 
00797     vec_to_quat(quat, vec, track, up);
00798 
00799     return Quaternion_CreatePyObject(quat, Py_NEW, NULL);
00800 }
00801 
00802 /*
00803  * Vector.reflect(mirror): return a reflected vector on the mirror normal
00804  *  vec - ((2 * DotVecs(vec, mirror)) * mirror)
00805  */
00806 PyDoc_STRVAR(Vector_reflect_doc,
00807 ".. method:: reflect(mirror)\n"
00808 "\n"
00809 "   Return the reflection vector from the *mirror* argument.\n"
00810 "\n"
00811 "   :arg mirror: This vector could be a normal from the reflecting surface.\n"
00812 "   :type mirror: :class:`Vector`\n"
00813 "   :return: The reflected vector matching the size of this vector.\n"
00814 "   :rtype: :class:`Vector`\n"
00815 );
00816 static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
00817 {
00818     int value_size;
00819     float mirror[3], vec[3];
00820     float reflect[3] = {0.0f};
00821     float tvec[MAX_DIMENSIONS];
00822 
00823     if (BaseMath_ReadCallback(self) == -1)
00824         return NULL;
00825 
00826     if ((value_size = mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1)
00827         return NULL;
00828 
00829     if (self->size < 2 || self->size > 4) {
00830         PyErr_SetString(PyExc_ValueError,
00831                         "Vector must be 2D, 3D or 4D");
00832         return NULL;
00833     }
00834 
00835     mirror[0] = tvec[0];
00836     mirror[1] = tvec[1];
00837     if (value_size > 2)     mirror[2] = tvec[2];
00838     else                    mirror[2] = 0.0;
00839 
00840     vec[0] = self->vec[0];
00841     vec[1] = self->vec[1];
00842     if (self->size > 2)     vec[2] = self->vec[2];
00843     else                    vec[2] = 0.0;
00844 
00845     normalize_v3(mirror);
00846     reflect_v3_v3v3(reflect, vec, mirror);
00847 
00848     return Vector_CreatePyObject(reflect, self->size, Py_NEW, Py_TYPE(self));
00849 }
00850 
00851 PyDoc_STRVAR(Vector_cross_doc,
00852 ".. method:: cross(other)\n"
00853 "\n"
00854 "   Return the cross product of this vector and another.\n"
00855 "\n"
00856 "   :arg other: The other vector to perform the cross product with.\n"
00857 "   :type other: :class:`Vector`\n"
00858 "   :return: The cross product.\n"
00859 "   :rtype: :class:`Vector`\n"
00860 "\n"
00861 "   .. note:: both vectors must be 3D\n"
00862 );
00863 static PyObject *Vector_cross(VectorObject *self, PyObject *value)
00864 {
00865     VectorObject *ret;
00866     float tvec[MAX_DIMENSIONS];
00867 
00868     if (BaseMath_ReadCallback(self) == -1)
00869         return NULL;
00870 
00871     if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1)
00872         return NULL;
00873 
00874     if (self->size != 3) {
00875         PyErr_SetString(PyExc_ValueError,
00876                         "Vector must be 3D");
00877         return NULL;
00878     }
00879 
00880     ret = (VectorObject *)Vector_CreatePyObject(NULL, 3, Py_NEW, Py_TYPE(self));
00881     cross_v3_v3v3(ret->vec, self->vec, tvec);
00882     return (PyObject *)ret;
00883 }
00884 
00885 PyDoc_STRVAR(Vector_dot_doc,
00886 ".. method:: dot(other)\n"
00887 "\n"
00888 "   Return the dot product of this vector and another.\n"
00889 "\n"
00890 "   :arg other: The other vector to perform the dot product with.\n"
00891 "   :type other: :class:`Vector`\n"
00892 "   :return: The dot product.\n"
00893 "   :rtype: :class:`Vector`\n"
00894 );
00895 static PyObject *Vector_dot(VectorObject *self, PyObject *value)
00896 {
00897     float *tvec;
00898 
00899     if (BaseMath_ReadCallback(self) == -1)
00900         return NULL;
00901 
00902     if (mathutils_array_parse_alloc(&tvec, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1) {
00903         goto cleanup;
00904     }
00905 
00906     return PyFloat_FromDouble(dot_vn_vn(self->vec, tvec, self->size));
00907 
00908 cleanup:
00909     PyMem_Free(tvec);
00910     return NULL;
00911 }
00912 
00913 PyDoc_STRVAR(Vector_angle_doc,
00914 ".. function:: angle(other, fallback)\n"
00915 "\n"
00916 "   Return the angle between two vectors.\n"
00917 "\n"
00918 "   :arg other: another vector to compare the angle with\n"
00919 "   :type other: :class:`Vector`\n"
00920 "   :arg fallback: return this value when the angle cant be calculated\n"
00921 "      (zero length vector)\n"
00922 "   :type fallback: any\n"
00923 "   :return: angle in radians or fallback when given\n"
00924 "   :rtype: float\n"
00925 "\n"
00926 "   .. note:: Zero length vectors raise an :exc:`AttributeError`.\n"
00927 );
00928 static PyObject *Vector_angle(VectorObject *self, PyObject *args)
00929 {
00930     const int size = MIN2(self->size, 3); /* 4D angle makes no sense */
00931     float tvec[MAX_DIMENSIONS];
00932     PyObject *value;
00933     double dot = 0.0f, dot_self = 0.0f, dot_other = 0.0f;
00934     int x;
00935     PyObject *fallback = NULL;
00936 
00937     if (!PyArg_ParseTuple(args, "O|O:angle", &value, &fallback))
00938         return NULL;
00939 
00940     if (BaseMath_ReadCallback(self) == -1)
00941         return NULL;
00942 
00943     /* don't use clamped size, rule of thumb is vector sizes must match,
00944      * even though n this case 'w' is ignored */
00945     if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.angle(other), invalid 'other' arg") == -1)
00946         return NULL;
00947 
00948     if (self->size > 4) {
00949         PyErr_SetString(PyExc_ValueError,
00950                         "Vector must be 2D, 3D or 4D");
00951         return NULL;
00952     }
00953 
00954     for (x = 0; x < size; x++) {
00955         dot_self  += (double)self->vec[x] * (double)self->vec[x];
00956         dot_other += (double)tvec[x]      * (double)tvec[x];
00957         dot       += (double)self->vec[x] * (double)tvec[x];
00958     }
00959 
00960     if (!dot_self || !dot_other) {
00961         /* avoid exception */
00962         if (fallback) {
00963             Py_INCREF(fallback);
00964             return fallback;
00965         }
00966         else {
00967             PyErr_SetString(PyExc_ValueError,
00968                             "Vector.angle(other): "
00969                             "zero length vectors have no valid angle");
00970             return NULL;
00971         }
00972     }
00973 
00974     return PyFloat_FromDouble(saacos(dot / (sqrt(dot_self) * sqrt(dot_other))));
00975 }
00976 
00977 PyDoc_STRVAR(Vector_rotation_difference_doc,
00978 ".. function:: rotation_difference(other)\n"
00979 "\n"
00980 "   Returns a quaternion representing the rotational difference between this\n"
00981 "   vector and another.\n"
00982 "\n"
00983 "   :arg other: second vector.\n"
00984 "   :type other: :class:`Vector`\n"
00985 "   :return: the rotational difference between the two vectors.\n"
00986 "   :rtype: :class:`Quaternion`\n"
00987 "\n"
00988 "   .. note:: 2D vectors raise an :exc:`AttributeError`.\n"
00989 );
00990 static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
00991 {
00992     float quat[4], vec_a[3], vec_b[3];
00993 
00994     if (self->size < 3 || self->size > 4) {
00995         PyErr_SetString(PyExc_ValueError,
00996                         "vec.difference(value): "
00997                         "expects both vectors to be size 3 or 4");
00998         return NULL;
00999     }
01000 
01001     if (BaseMath_ReadCallback(self) == -1)
01002         return NULL;
01003 
01004     if (mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1)
01005         return NULL;
01006 
01007     normalize_v3_v3(vec_a, self->vec);
01008     normalize_v3(vec_b);
01009 
01010     rotation_between_vecs_to_quat(quat, vec_a, vec_b);
01011 
01012     return Quaternion_CreatePyObject(quat, Py_NEW, NULL);
01013 }
01014 
01015 PyDoc_STRVAR(Vector_project_doc,
01016 ".. function:: project(other)\n"
01017 "\n"
01018 "   Return the projection of this vector onto the *other*.\n"
01019 "\n"
01020 "   :arg other: second vector.\n"
01021 "   :type other: :class:`Vector`\n"
01022 "   :return: the parallel projection vector\n"
01023 "   :rtype: :class:`Vector`\n"
01024 );
01025 static PyObject *Vector_project(VectorObject *self, PyObject *value)
01026 {
01027     const int size = self->size;
01028     float tvec[MAX_DIMENSIONS];
01029     float vec[MAX_DIMENSIONS];
01030     double dot = 0.0f, dot2 = 0.0f;
01031     int x;
01032 
01033     if (BaseMath_ReadCallback(self) == -1)
01034         return NULL;
01035 
01036     if (mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1)
01037         return NULL;
01038 
01039     if (self->size > 4) {
01040         PyErr_SetString(PyExc_ValueError,
01041                         "Vector must be 2D, 3D or 4D");
01042         return NULL;
01043     }
01044 
01045     if (BaseMath_ReadCallback(self) == -1)
01046         return NULL;
01047 
01048     //get dot products
01049     for (x = 0; x < size; x++) {
01050         dot += (double)(self->vec[x] * tvec[x]);
01051         dot2 += (double)(tvec[x] * tvec[x]);
01052     }
01053     //projection
01054     dot /= dot2;
01055     for (x = 0; x < size; x++) {
01056         vec[x] = (float)dot * tvec[x];
01057     }
01058     return Vector_CreatePyObject(vec, size, Py_NEW, Py_TYPE(self));
01059 }
01060 
01061 PyDoc_STRVAR(Vector_lerp_doc,
01062 ".. function:: lerp(other, factor)\n"
01063 "\n"
01064 "   Returns the interpolation of two vectors.\n"
01065 "\n"
01066 "   :arg other: value to interpolate with.\n"
01067 "   :type other: :class:`Vector`\n"
01068 "   :arg factor: The interpolation value in [0.0, 1.0].\n"
01069 "   :type factor: float\n"
01070 "   :return: The interpolated rotation.\n"
01071 "   :rtype: :class:`Vector`\n"
01072 );
01073 static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
01074 {
01075     const int size = self->size;
01076     PyObject *value = NULL;
01077     float fac, ifac;
01078     float *tvec, *vec;
01079     int x;
01080 
01081     if (!PyArg_ParseTuple(args, "Of:lerp", &value, &fac))
01082         return NULL;
01083 
01084     if (mathutils_array_parse_alloc(&tvec, size, value, "Vector.lerp(other), invalid 'other' arg") == -1) {
01085         goto cleanup;
01086     }
01087 
01088     if (BaseMath_ReadCallback(self) == -1) {
01089         goto cleanup;
01090     }
01091 
01092     vec = PyMem_Malloc(size * sizeof(float));
01093     if (vec == NULL) {
01094         PyErr_SetString(PyExc_MemoryError,
01095                         "Vector.lerp(): "
01096                         "problem allocating pointer space");
01097         return NULL;
01098     }
01099 
01100     ifac = 1.0f - fac;
01101 
01102     for (x = 0; x < size; x++) {
01103         vec[x] = (ifac * self->vec[x]) + (fac * tvec[x]);
01104     }
01105 
01106     PyMem_Free(tvec);
01107 
01108     return Vector_CreatePyObject_alloc(vec, size, Py_TYPE(self));
01109 
01110 cleanup:
01111     PyMem_Free(tvec);
01112     return NULL;
01113 }
01114 
01115 PyDoc_STRVAR(Vector_rotate_doc,
01116 ".. function:: rotate(other)\n"
01117 "\n"
01118 "   Return vector by a rotation value.\n"
01119 "\n"
01120 "   :arg other: rotation component of mathutils value\n"
01121 "   :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
01122 );
01123 static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
01124 {
01125     float other_rmat[3][3];
01126 
01127     if (BaseMath_ReadCallback(self) == -1)
01128         return NULL;
01129 
01130     if (mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1)
01131         return NULL;
01132 
01133     if (self->size < 3 || self->size > 4) {
01134         PyErr_SetString(PyExc_ValueError,
01135                         "Vector must be 3D or 4D");
01136         return NULL;
01137     }
01138 
01139     mul_m3_v3(other_rmat, self->vec);
01140 
01141     (void)BaseMath_WriteCallback(self);
01142     Py_RETURN_NONE;
01143 }
01144 
01145 PyDoc_STRVAR(Vector_copy_doc,
01146 ".. function:: copy()\n"
01147 "\n"
01148 "   Returns a copy of this vector.\n"
01149 "\n"
01150 "   :return: A copy of the vector.\n"
01151 "   :rtype: :class:`Vector`\n"
01152 "\n"
01153 "   .. note:: use this to get a copy of a wrapped vector with\n"
01154 "      no reference to the original data.\n"
01155 );
01156 static PyObject *Vector_copy(VectorObject *self)
01157 {
01158     if (BaseMath_ReadCallback(self) == -1)
01159         return NULL;
01160 
01161     return Vector_CreatePyObject(self->vec, self->size, Py_NEW, Py_TYPE(self));
01162 }
01163 
01164 static PyObject *Vector_repr(VectorObject *self)
01165 {
01166     PyObject *ret, *tuple;
01167 
01168     if (BaseMath_ReadCallback(self) == -1)
01169         return NULL;
01170 
01171     tuple = Vector_to_tuple_ext(self, -1);
01172     ret = PyUnicode_FromFormat("Vector(%R)", tuple);
01173     Py_DECREF(tuple);
01174     return ret;
01175 }
01176 
01177 static PyObject *Vector_str(VectorObject *self)
01178 {
01179     int i;
01180 
01181     DynStr *ds;
01182 
01183     if (BaseMath_ReadCallback(self) == -1)
01184         return NULL;
01185 
01186     ds = BLI_dynstr_new();
01187 
01188     BLI_dynstr_append(ds, "<Vector (");
01189 
01190     for (i = 0; i < self->size; i++) {
01191         BLI_dynstr_appendf(ds, i ? ", %.4f" : "%.4f", self->vec[i]);
01192     }
01193 
01194     BLI_dynstr_append(ds, ")>");
01195 
01196     return mathutils_dynstr_to_py(ds); /* frees ds */
01197 }
01198 
01199 
01200 /* Sequence Protocol */
01201 /* sequence length len(vector) */
01202 static int Vector_len(VectorObject *self)
01203 {
01204     return self->size;
01205 }
01206 /* sequence accessor (get): vector[index] */
01207 static PyObject *vector_item_internal(VectorObject *self, int i, const int is_attr)
01208 {
01209     if (i < 0)  i = self->size-i;
01210 
01211     if (i < 0 || i >= self->size) {
01212         if (is_attr)    {
01213             PyErr_Format(PyExc_AttributeError,
01214                          "Vector.%c: unavailable on %dd vector",
01215                          *(((char *)"xyzw") + i), self->size);
01216         }
01217         else {
01218             PyErr_SetString(PyExc_IndexError,
01219                             "vector[index]: out of range");
01220         }
01221         return NULL;
01222     }
01223 
01224     if (BaseMath_ReadIndexCallback(self, i) == -1)
01225         return NULL;
01226 
01227     return PyFloat_FromDouble(self->vec[i]);
01228 }
01229 
01230 static PyObject *Vector_item(VectorObject *self, int i)
01231 {
01232     return vector_item_internal(self, i, FALSE);
01233 }
01234 /* sequence accessor (set): vector[index] = value */
01235 static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, const int is_attr)
01236 {
01237     float scalar;
01238     if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
01239         PyErr_SetString(PyExc_TypeError,
01240                         "vector[index] = x: "
01241                         "index argument not a number");
01242         return -1;
01243     }
01244 
01245     if (i < 0)  i = self->size-i;
01246 
01247     if (i < 0 || i >= self->size) {
01248         if (is_attr) {
01249             PyErr_Format(PyExc_AttributeError,
01250                          "Vector.%c = x: unavailable on %dd vector",
01251                          *(((char *)"xyzw") + i), self->size);
01252         }
01253         else {
01254             PyErr_SetString(PyExc_IndexError,
01255                             "vector[index] = x: "
01256                             "assignment index out of range");
01257         }
01258         return -1;
01259     }
01260     self->vec[i] = scalar;
01261 
01262     if (BaseMath_WriteIndexCallback(self, i) == -1)
01263         return -1;
01264     return 0;
01265 }
01266 
01267 static int Vector_ass_item(VectorObject *self, int i, PyObject *value)
01268 {
01269     return vector_ass_item_internal(self, i, value, FALSE);
01270 }
01271 
01272 /* sequence slice (get): vector[a:b] */
01273 static PyObject *Vector_slice(VectorObject *self, int begin, int end)
01274 {
01275     PyObject *tuple;
01276     int count;
01277 
01278     if (BaseMath_ReadCallback(self) == -1)
01279         return NULL;
01280 
01281     CLAMP(begin, 0, self->size);
01282     if (end < 0) end = self->size + end + 1;
01283     CLAMP(end, 0, self->size);
01284     begin = MIN2(begin, end);
01285 
01286     tuple = PyTuple_New(end - begin);
01287     for (count = begin; count < end; count++) {
01288         PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(self->vec[count]));
01289     }
01290 
01291     return tuple;
01292 }
01293 /* sequence slice (set): vector[a:b] = value */
01294 static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *seq)
01295 {
01296     int size = 0;
01297     float *vec = NULL;
01298 
01299     if (BaseMath_ReadCallback(self) == -1)
01300         return -1;
01301 
01302     CLAMP(begin, 0, self->size);
01303     CLAMP(end, 0, self->size);
01304     begin = MIN2(begin, end);
01305 
01306     size = (end - begin);
01307     if (mathutils_array_parse_alloc(&vec, size, seq, "vector[begin:end] = [...]") == -1) {
01308         goto cleanup;
01309     }
01310 
01311     if (vec == NULL) {
01312         PyErr_SetString(PyExc_MemoryError,
01313                         "vec[:] = seq: "
01314                         "problem allocating pointer space");
01315         return -1;
01316     }
01317 
01318     /*parsed well - now set in vector*/
01319     memcpy(self->vec + begin, vec, size * sizeof(float));
01320 
01321     if (BaseMath_WriteCallback(self) == -1)
01322         return -1;
01323 
01324     PyMem_Free(vec);
01325 
01326     return 0;
01327 
01328 cleanup:
01329     PyMem_Free(vec);
01330     return -1;
01331 }
01332 
01333 /* Numeric Protocols */
01334 /* addition: obj + obj */
01335 static PyObject *Vector_add(PyObject *v1, PyObject *v2)
01336 {
01337     VectorObject *vec1 = NULL, *vec2 = NULL;
01338     float *vec = NULL;
01339 
01340     if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
01341         PyErr_Format(PyExc_AttributeError,
01342                      "Vector addition: (%s + %s) "
01343                      "invalid type for this operation",
01344                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
01345         return NULL;
01346     }
01347     vec1 = (VectorObject*)v1;
01348     vec2 = (VectorObject*)v2;
01349 
01350     if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
01351         return NULL;
01352 
01353     /*VECTOR + VECTOR*/
01354     if (vec1->size != vec2->size) {
01355         PyErr_SetString(PyExc_AttributeError,
01356                         "Vector addition: "
01357                         "vectors must have the same dimensions for this operation");
01358         return NULL;
01359     }
01360 
01361     vec = PyMem_Malloc(vec1->size * sizeof(float));
01362 
01363     if (vec == NULL) { /*allocation failure*/
01364         PyErr_SetString(PyExc_MemoryError,
01365                         "Vector(): "
01366                         "problem allocating pointer space");
01367         return NULL;
01368     }
01369 
01370     add_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
01371 
01372     return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
01373 }
01374 
01375 /* addition in-place: obj += obj */
01376 static PyObject *Vector_iadd(PyObject *v1, PyObject *v2)
01377 {
01378     VectorObject *vec1 = NULL, *vec2 = NULL;
01379 
01380     if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
01381         PyErr_Format(PyExc_AttributeError,
01382                      "Vector addition: (%s += %s) "
01383                      "invalid type for this operation",
01384                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
01385         return NULL;
01386     }
01387     vec1 = (VectorObject*)v1;
01388     vec2 = (VectorObject*)v2;
01389 
01390     if (vec1->size != vec2->size) {
01391         PyErr_SetString(PyExc_AttributeError,
01392                         "Vector addition: "
01393                         "vectors must have the same dimensions for this operation");
01394         return NULL;
01395     }
01396 
01397     if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
01398         return NULL;
01399 
01400     add_vn_vn(vec1->vec, vec2->vec, vec1->size);
01401 
01402     (void)BaseMath_WriteCallback(vec1);
01403     Py_INCREF(v1);
01404     return v1;
01405 }
01406 
01407 /* subtraction: obj - obj */
01408 static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
01409 {
01410     VectorObject *vec1 = NULL, *vec2 = NULL;
01411     float *vec;
01412 
01413     if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
01414         PyErr_Format(PyExc_AttributeError,
01415                      "Vector subtraction: (%s - %s) "
01416                      "invalid type for this operation",
01417                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
01418         return NULL;
01419     }
01420     vec1 = (VectorObject*)v1;
01421     vec2 = (VectorObject*)v2;
01422 
01423     if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
01424         return NULL;
01425 
01426     if (vec1->size != vec2->size) {
01427         PyErr_SetString(PyExc_AttributeError,
01428                         "Vector subtraction: "
01429                         "vectors must have the same dimensions for this operation");
01430         return NULL;
01431     }
01432 
01433     vec = PyMem_Malloc(vec1->size * sizeof(float));
01434 
01435     if (vec == NULL) { /*allocation failure*/
01436         PyErr_SetString(PyExc_MemoryError,
01437                         "Vector(): "
01438                         "problem allocating pointer space");
01439         return NULL;
01440     }
01441 
01442     sub_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
01443 
01444     return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
01445 }
01446 
01447 /* subtraction in-place: obj -= obj */
01448 static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
01449 {
01450     VectorObject *vec1 = NULL, *vec2 = NULL;
01451 
01452     if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
01453         PyErr_Format(PyExc_AttributeError,
01454                      "Vector subtraction: (%s -= %s) "
01455                      "invalid type for this operation",
01456                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
01457         return NULL;
01458     }
01459     vec1 = (VectorObject*)v1;
01460     vec2 = (VectorObject*)v2;
01461 
01462     if (vec1->size != vec2->size) {
01463         PyErr_SetString(PyExc_AttributeError,
01464                         "Vector subtraction: "
01465                         "vectors must have the same dimensions for this operation");
01466         return NULL;
01467     }
01468 
01469     if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
01470         return NULL;
01471 
01472     sub_vn_vn(vec1->vec, vec2->vec, vec1->size);
01473 
01474     (void)BaseMath_WriteCallback(vec1);
01475     Py_INCREF(v1);
01476     return v1;
01477 }
01478 
01479 /*------------------------obj * obj------------------------------
01480   mulplication*/
01481 
01482 
01483 /* COLUMN VECTOR Multiplication (Matrix X Vector)
01484  * [1][4][7]   [a]
01485  * [2][5][8] * [b]
01486  * [3][6][9]   [c]
01487  *
01488  * note: vector/matrix multiplication IS NOT COMMUTATIVE!!!!
01489  * note: assume read callbacks have been done first.
01490  */
01491 int column_vector_multiplication(float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
01492 {
01493     float vec_cpy[MAX_DIMENSIONS];
01494     int row, col, z = 0;
01495 
01496     if (mat->num_col != vec->size) {
01497         if (mat->num_col == 4 && vec->size == 3) {
01498             vec_cpy[3] = 1.0f;
01499         }
01500         else {
01501             PyErr_SetString(PyExc_TypeError,
01502                             "matrix * vector: "
01503                             "len(matrix.col) and len(vector) must be the same, "
01504                             "except for 4x4 matrix * 3D vector.");
01505             return -1;
01506         }
01507     }
01508 
01509     memcpy(vec_cpy, vec->vec, vec->size * sizeof(float));
01510 
01511     r_vec[3] = 1.0f;
01512 
01513     for (row = 0; row < mat->num_row; row++) {
01514         double dot = 0.0f;
01515         for (col = 0; col < mat->num_col; col++) {
01516             dot += (double)(MATRIX_ITEM(mat, row, col) * vec_cpy[col]);
01517         }
01518         r_vec[z++] = (float)dot;
01519     }
01520 
01521     return 0;
01522 }
01523 
01524 static PyObject *vector_mul_float(VectorObject *vec, const float scalar)
01525 {
01526     float *tvec = PyMem_Malloc(vec->size * sizeof(float));
01527 
01528     if (tvec == NULL) { /*allocation failure*/
01529         PyErr_SetString(PyExc_MemoryError,
01530                         "vec * float: "
01531                         "problem allocating pointer space");
01532         return NULL;
01533     }
01534 
01535     mul_vn_vn_fl(tvec, vec->vec, vec->size, scalar);
01536     return Vector_CreatePyObject_alloc(tvec, vec->size, Py_TYPE(vec));
01537 }
01538 
01539 static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
01540 {
01541     VectorObject *vec1 = NULL, *vec2 = NULL;
01542     float scalar;
01543     int vec_size;
01544 
01545     if VectorObject_Check(v1) {
01546         vec1 = (VectorObject *)v1;
01547         if (BaseMath_ReadCallback(vec1) == -1)
01548             return NULL;
01549     }
01550     if VectorObject_Check(v2) {
01551         vec2 = (VectorObject *)v2;
01552         if (BaseMath_ReadCallback(vec2) == -1)
01553             return NULL;
01554     }
01555 
01556 
01557     /* make sure v1 is always the vector */
01558     if (vec1 && vec2) {
01559         if (vec1->size != vec2->size) {
01560             PyErr_SetString(PyExc_ValueError,
01561                             "Vector multiplication: "
01562                             "vectors must have the same dimensions for this operation");
01563             return NULL;
01564         }
01565 
01566         /*dot product*/
01567         return PyFloat_FromDouble(dot_vn_vn(vec1->vec, vec2->vec, vec1->size));
01568     }
01569     else if (vec1) {
01570         if (MatrixObject_Check(v2)) {
01571             /* VEC * MATRIX */
01572             float tvec[MAX_DIMENSIONS];
01573 
01574             if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
01575                 return NULL;
01576             if (row_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) {
01577                 return NULL;
01578             }
01579 
01580             if (((MatrixObject *)v2)->num_row == 4 && vec1->size == 3) {
01581                 vec_size = 3;
01582             }
01583             else {
01584                 vec_size = ((MatrixObject *)v2)->num_col;
01585             }
01586 
01587             return Vector_CreatePyObject(tvec, vec_size, Py_NEW, Py_TYPE(vec1));
01588         }
01589         else if (QuaternionObject_Check(v2)) {
01590             /* VEC * QUAT */
01591 /* ------ to be removed ------*/
01592 #if 1
01593             PyErr_SetString(PyExc_ValueError,
01594                             "(Vector * Quat) is now removed, reverse the "
01595                             "order (promoted to an Error for Debug builds)");
01596             return NULL;
01597 #else
01598             QuaternionObject *quat2 = (QuaternionObject*)v2;
01599             float tvec[3];
01600 
01601             if (vec1->size != 3) {
01602                 PyErr_SetString(PyExc_ValueError,
01603                                 "Vector multiplication: "
01604                                 "only 3D vector rotations (with quats) currently supported");
01605                 return NULL;
01606             }
01607             if (BaseMath_ReadCallback(quat2) == -1) {
01608                 return NULL;
01609             }
01610 
01611             copy_v3_v3(tvec, vec1->vec);
01612             mul_qt_v3(quat2->quat, tvec);
01613             return Vector_CreatePyObject(tvec, 3, Py_NEW, Py_TYPE(vec1));
01614 #endif
01615 /* ------ to be removed ------*/
01616         }
01617         else if (((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) == 0) { /* VEC * FLOAT */
01618             return vector_mul_float(vec1, scalar);
01619         }
01620     }
01621     else if (vec2) {
01622         if (((scalar = PyFloat_AsDouble(v1)) == -1.0f && PyErr_Occurred()) == 0) { /* FLOAT * VEC */
01623             return vector_mul_float(vec2, scalar);
01624         }
01625     }
01626     else {
01627         BLI_assert(!"internal error");
01628     }
01629 
01630     PyErr_Format(PyExc_TypeError,
01631                  "Vector multiplication: "
01632                  "not supported between '%.200s' and '%.200s' types",
01633                  Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
01634     return NULL;
01635 }
01636 
01637 /* mulplication in-place: obj *= obj */
01638 static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
01639 {
01640     VectorObject *vec = (VectorObject *)v1;
01641     float scalar;
01642 
01643     if (BaseMath_ReadCallback(vec) == -1)
01644         return NULL;
01645 
01646     /* only support vec*=float and vec*=mat
01647        vec*=vec result is a float so that wont work */
01648     if (MatrixObject_Check(v2)) {
01649 /* ------ to be removed ------*/
01650 #if 1
01651         PyErr_SetString(PyExc_ValueError,
01652                         "(Vector *= Matrix) is now removed, reverse the "
01653                         "order (promoted to an Error for Debug builds) "
01654                         "and uses the non in-place multiplication.");
01655         return NULL;
01656 #else
01657         float rvec[MAX_DIMENSIONS];
01658         if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
01659             return NULL;
01660 
01661         if (column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
01662             return NULL;
01663 
01664         memcpy(vec->vec, rvec, sizeof(float) * vec->size);
01665 #endif
01666 /* ------ to be removed ------*/
01667     }
01668     else if (QuaternionObject_Check(v2)) {
01669         /* VEC *= QUAT */
01670 
01671 /* ------ to be removed ------*/
01672 #if 1
01673         PyErr_SetString(PyExc_ValueError,
01674                         "(Vector *= Quat) is now removed, reverse the "
01675                         "order (promoted to an Error for Debug builds) "
01676                         "and uses the non in-place multiplication.");
01677         return NULL;
01678 #else
01679         QuaternionObject *quat2 = (QuaternionObject*)v2;
01680 
01681         if (vec->size != 3) {
01682             PyErr_SetString(PyExc_ValueError,
01683                             "Vector multiplication: "
01684                             "only 3D vector rotations (with quats) currently supported");
01685             return NULL;
01686         }
01687 
01688         if (BaseMath_ReadCallback(quat2) == -1) {
01689             return NULL;
01690         }
01691 
01692         mul_qt_v3(quat2->quat, vec->vec);
01693 #endif
01694 /* ------ to be removed ------*/
01695     }
01696     else if (((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) == 0) { /* VEC *= FLOAT */
01697         mul_vn_fl(vec->vec, vec->size, scalar);
01698     }
01699     else {
01700         PyErr_Format(PyExc_TypeError,
01701                      "Vector multiplication: (%s *= %s) "
01702                      "invalid type for this operation",
01703                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
01704         return NULL;
01705     }
01706 
01707     (void)BaseMath_WriteCallback(vec);
01708     Py_INCREF(v1);
01709     return v1;
01710 }
01711 
01712 /* divid: obj / obj */
01713 static PyObject *Vector_div(PyObject *v1, PyObject *v2)
01714 {
01715     float *vec = NULL, scalar;
01716     VectorObject *vec1 = NULL;
01717 
01718     if (!VectorObject_Check(v1)) { /* not a vector */
01719         PyErr_SetString(PyExc_TypeError,
01720                         "Vector division: "
01721                         "Vector must be divided by a float");
01722         return NULL;
01723     }
01724     vec1 = (VectorObject *)v1; /* vector */
01725 
01726     if (BaseMath_ReadCallback(vec1) == -1)
01727         return NULL;
01728 
01729     if ((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
01730         PyErr_SetString(PyExc_TypeError,
01731                         "Vector division: "
01732                         "Vector must be divided by a float");
01733         return NULL;
01734     }
01735 
01736     if (scalar == 0.0f) {
01737         PyErr_SetString(PyExc_ZeroDivisionError,
01738                         "Vector division: "
01739                         "divide by zero error");
01740         return NULL;
01741     }
01742 
01743     vec = PyMem_Malloc(vec1->size * sizeof(float));
01744 
01745     if (vec == NULL) { /*allocation failure*/
01746         PyErr_SetString(PyExc_MemoryError,
01747                         "vec / value: "
01748                         "problem allocating pointer space");
01749         return NULL;
01750     }
01751 
01752     mul_vn_vn_fl(vec, vec1->vec, vec1->size, 1.0f / scalar);
01753 
01754     return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
01755 }
01756 
01757 /* divide in-place: obj /= obj */
01758 static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
01759 {
01760     float scalar;
01761     VectorObject *vec1 = (VectorObject*)v1;
01762 
01763     if (BaseMath_ReadCallback(vec1) == -1)
01764         return NULL;
01765 
01766     if ((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
01767         PyErr_SetString(PyExc_TypeError,
01768                         "Vector division: "
01769                         "Vector must be divided by a float");
01770         return NULL;
01771     }
01772 
01773     if (scalar == 0.0f) {
01774         PyErr_SetString(PyExc_ZeroDivisionError,
01775                         "Vector division: "
01776                         "divide by zero error");
01777         return NULL;
01778     }
01779 
01780     mul_vn_fl(vec1->vec, vec1->size, 1.0f / scalar);
01781 
01782     (void)BaseMath_WriteCallback(vec1);
01783 
01784     Py_INCREF(v1);
01785     return v1;
01786 }
01787 
01788 /* -obj
01789   returns the negative of this object*/
01790 static PyObject *Vector_neg(VectorObject *self)
01791 {
01792     float *tvec;
01793 
01794     if (BaseMath_ReadCallback(self) == -1)
01795         return NULL;
01796 
01797     tvec = PyMem_Malloc(self->size * sizeof(float));
01798     negate_vn_vn(tvec, self->vec, self->size);
01799     return Vector_CreatePyObject_alloc(tvec, self->size, Py_TYPE(self));
01800 }
01801 
01802 /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */
01803 static double vec_magnitude_nosqrt(float *data, int size)
01804 {
01805     /*return (double)sqrt(dot);*/
01806     /* warning, line above removed because we are not using the length,
01807        rather the comparing the sizes and for this we do not need the sqrt
01808        for the actual length, the dot must be sqrt'd */
01809     return dot_vn_vn(data, data, size);
01810 }
01811 
01812 
01813 /*------------------------tp_richcmpr
01814   returns -1 execption, 0 false, 1 true */
01815 static PyObject *Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
01816 {
01817     VectorObject *vecA = NULL, *vecB = NULL;
01818     int result = 0;
01819     double epsilon = .000001f;
01820     double lenA, lenB;
01821 
01822     if (!VectorObject_Check(objectA) || !VectorObject_Check(objectB)) {
01823         if (comparison_type == Py_NE) {
01824             Py_RETURN_TRUE;
01825         }
01826         else {
01827             Py_RETURN_FALSE;
01828         }
01829     }
01830     vecA = (VectorObject*)objectA;
01831     vecB = (VectorObject*)objectB;
01832 
01833     if (BaseMath_ReadCallback(vecA) == -1 || BaseMath_ReadCallback(vecB) == -1)
01834         return NULL;
01835 
01836     if (vecA->size != vecB->size) {
01837         if (comparison_type == Py_NE) {
01838             Py_RETURN_TRUE;
01839         }
01840         else {
01841             Py_RETURN_FALSE;
01842         }
01843     }
01844 
01845     switch (comparison_type) {
01846         case Py_LT:
01847             lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
01848             lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
01849             if (lenA < lenB) {
01850                 result = 1;
01851             }
01852             break;
01853         case Py_LE:
01854             lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
01855             lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
01856             if (lenA < lenB) {
01857                 result = 1;
01858             }
01859             else {
01860                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
01861             }
01862             break;
01863         case Py_EQ:
01864             result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
01865             break;
01866         case Py_NE:
01867             result = !EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
01868             break;
01869         case Py_GT:
01870             lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
01871             lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
01872             if (lenA > lenB) {
01873                 result = 1;
01874             }
01875             break;
01876         case Py_GE:
01877             lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
01878             lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
01879             if (lenA > lenB) {
01880                 result = 1;
01881             }
01882             else {
01883                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
01884             }
01885             break;
01886         default:
01887             printf("The result of the comparison could not be evaluated");
01888             break;
01889     }
01890     if (result == 1) {
01891         Py_RETURN_TRUE;
01892     }
01893     else {
01894         Py_RETURN_FALSE;
01895     }
01896 }
01897 
01898 /*-----------------PROTCOL DECLARATIONS--------------------------*/
01899 static PySequenceMethods Vector_SeqMethods = {
01900     (lenfunc) Vector_len,               /* sq_length */
01901     (binaryfunc) NULL,                  /* sq_concat */
01902     (ssizeargfunc) NULL,                /* sq_repeat */
01903     (ssizeargfunc) Vector_item,         /* sq_item */
01904     NULL,                               /* py3 deprecated slice func */
01905     (ssizeobjargproc) Vector_ass_item,  /* sq_ass_item */
01906     NULL,                               /* py3 deprecated slice assign func */
01907     (objobjproc) NULL,                  /* sq_contains */
01908     (binaryfunc) NULL,                  /* sq_inplace_concat */
01909     (ssizeargfunc) NULL,                /* sq_inplace_repeat */
01910 };
01911 
01912 static PyObject *Vector_subscript(VectorObject *self, PyObject *item)
01913 {
01914     if (PyIndex_Check(item)) {
01915         Py_ssize_t i;
01916         i = PyNumber_AsSsize_t(item, PyExc_IndexError);
01917         if (i == -1 && PyErr_Occurred())
01918             return NULL;
01919         if (i < 0)
01920             i += self->size;
01921         return Vector_item(self, i);
01922     }
01923     else if (PySlice_Check(item)) {
01924         Py_ssize_t start, stop, step, slicelength;
01925 
01926         if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
01927             return NULL;
01928 
01929         if (slicelength <= 0) {
01930             return PyTuple_New(0);
01931         }
01932         else if (step == 1) {
01933             return Vector_slice(self, start, stop);
01934         }
01935         else {
01936             PyErr_SetString(PyExc_IndexError,
01937                             "slice steps not supported with vectors");
01938             return NULL;
01939         }
01940     }
01941     else {
01942         PyErr_Format(PyExc_TypeError,
01943                      "vector indices must be integers, not %.200s",
01944                      Py_TYPE(item)->tp_name);
01945         return NULL;
01946     }
01947 }
01948 
01949 static int Vector_ass_subscript(VectorObject *self, PyObject *item, PyObject *value)
01950 {
01951     if (PyIndex_Check(item)) {
01952         Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
01953         if (i == -1 && PyErr_Occurred())
01954             return -1;
01955         if (i < 0)
01956             i += self->size;
01957         return Vector_ass_item(self, i, value);
01958     }
01959     else if (PySlice_Check(item)) {
01960         Py_ssize_t start, stop, step, slicelength;
01961 
01962         if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
01963             return -1;
01964 
01965         if (step == 1)
01966             return Vector_ass_slice(self, start, stop, value);
01967         else {
01968             PyErr_SetString(PyExc_IndexError,
01969                             "slice steps not supported with vectors");
01970             return -1;
01971         }
01972     }
01973     else {
01974         PyErr_Format(PyExc_TypeError,
01975                      "vector indices must be integers, not %.200s",
01976                      Py_TYPE(item)->tp_name);
01977         return -1;
01978     }
01979 }
01980 
01981 static PyMappingMethods Vector_AsMapping = {
01982     (lenfunc)Vector_len,
01983     (binaryfunc)Vector_subscript,
01984     (objobjargproc)Vector_ass_subscript
01985 };
01986 
01987 
01988 static PyNumberMethods Vector_NumMethods = {
01989     (binaryfunc)    Vector_add, /*nb_add*/
01990     (binaryfunc)    Vector_sub, /*nb_subtract*/
01991     (binaryfunc)    Vector_mul, /*nb_multiply*/
01992     NULL,                           /*nb_remainder*/
01993     NULL,                           /*nb_divmod*/
01994     NULL,                           /*nb_power*/
01995     (unaryfunc)     Vector_neg, /*nb_negative*/
01996     (unaryfunc)     NULL,   /*tp_positive*/
01997     (unaryfunc)     NULL,   /*tp_absolute*/
01998     (inquiry)   NULL,   /*tp_bool*/
01999     (unaryfunc) NULL,   /*nb_invert*/
02000     NULL,               /*nb_lshift*/
02001     (binaryfunc)NULL,   /*nb_rshift*/
02002     NULL,               /*nb_and*/
02003     NULL,               /*nb_xor*/
02004     NULL,               /*nb_or*/
02005     NULL,               /*nb_int*/
02006     NULL,               /*nb_reserved*/
02007     NULL,               /*nb_float*/
02008     Vector_iadd,    /* nb_inplace_add */
02009     Vector_isub,    /* nb_inplace_subtract */
02010     Vector_imul,    /* nb_inplace_multiply */
02011     NULL,               /* nb_inplace_remainder */
02012     NULL,               /* nb_inplace_power */
02013     NULL,               /* nb_inplace_lshift */
02014     NULL,               /* nb_inplace_rshift */
02015     NULL,               /* nb_inplace_and */
02016     NULL,               /* nb_inplace_xor */
02017     NULL,               /* nb_inplace_or */
02018     NULL,               /* nb_floor_divide */
02019     Vector_div,     /* nb_true_divide */
02020     NULL,               /* nb_inplace_floor_divide */
02021     Vector_idiv,    /* nb_inplace_true_divide */
02022     NULL,           /* nb_index */
02023 };
02024 
02025 /*------------------PY_OBECT DEFINITION--------------------------*/
02026 
02027 /* vector axis, vector.x/y/z/w */
02028 
02029 PyDoc_STRVAR(Vector_axis_x_doc, "Vector X axis.\n\n:type: float");
02030 PyDoc_STRVAR(Vector_axis_y_doc, "Vector Y axis.\n\n:type: float");
02031 PyDoc_STRVAR(Vector_axis_z_doc, "Vector Z axis (3D Vectors only).\n\n:type: float");
02032 PyDoc_STRVAR(Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n\n:type: float");
02033 
02034 static PyObject *Vector_axis_get(VectorObject *self, void *type)
02035 {
02036     return vector_item_internal(self, GET_INT_FROM_POINTER(type), TRUE);
02037 }
02038 
02039 static int Vector_axis_set(VectorObject *self, PyObject *value, void *type)
02040 {
02041     return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, TRUE);
02042 }
02043 
02044 /* vector.length */
02045 
02046 PyDoc_STRVAR(Vector_length_doc,
02047 "Vector Length.\n\n:type: float"
02048 );
02049 static PyObject *Vector_length_get(VectorObject *self, void *UNUSED(closure))
02050 {
02051     if (BaseMath_ReadCallback(self) == -1)
02052         return NULL;
02053 
02054     return PyFloat_FromDouble(sqrt(dot_vn_vn(self->vec, self->vec, self->size)));
02055 }
02056 
02057 static int Vector_length_set(VectorObject *self, PyObject *value)
02058 {
02059     double dot = 0.0f, param;
02060 
02061     if (BaseMath_ReadCallback(self) == -1)
02062         return -1;
02063 
02064     if ((param = PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred()) {
02065         PyErr_SetString(PyExc_TypeError,
02066                         "length must be set to a number");
02067         return -1;
02068     }
02069 
02070     if (param < 0.0) {
02071         PyErr_SetString(PyExc_ValueError,
02072                         "cannot set a vectors length to a negative value");
02073         return -1;
02074     }
02075     if (param == 0.0) {
02076         fill_vn_fl(self->vec, self->size, 0.0f);
02077         return 0;
02078     }
02079 
02080     dot = dot_vn_vn(self->vec, self->vec, self->size);
02081 
02082     if (!dot) /* cant sqrt zero */
02083         return 0;
02084 
02085     dot = sqrt(dot);
02086 
02087     if (dot == param)
02088         return 0;
02089 
02090     dot = dot / param;
02091 
02092     mul_vn_fl(self->vec, self->size, 1.0 / dot);
02093 
02094     (void)BaseMath_WriteCallback(self); /* checked already */
02095 
02096     return 0;
02097 }
02098 
02099 /* vector.length_squared */
02100 PyDoc_STRVAR(Vector_length_squared_doc,
02101 "Vector length squared (v.dot(v)).\n\n:type: float"
02102 );
02103 static PyObject *Vector_length_squared_get(VectorObject *self, void *UNUSED(closure))
02104 {
02105     if (BaseMath_ReadCallback(self) == -1)
02106         return NULL;
02107 
02108     return PyFloat_FromDouble(dot_vn_vn(self->vec, self->vec, self->size));
02109 }
02110 
02111 /* Get a new Vector according to the provided swizzle. This function has little
02112  * error checking, as we are in control of the inputs: the closure is set by us
02113  * in Vector_createSwizzleGetSeter. */
02114 static PyObject *Vector_swizzle_get(VectorObject *self, void *closure)
02115 {
02116     size_t axis_to;
02117     size_t axis_from;
02118     float vec[MAX_DIMENSIONS];
02119     unsigned int swizzleClosure;
02120 
02121     if (BaseMath_ReadCallback(self) == -1)
02122         return NULL;
02123 
02124     /* Unpack the axes from the closure into an array. */
02125     axis_to = 0;
02126     swizzleClosure = GET_INT_FROM_POINTER(closure);
02127     while (swizzleClosure & SWIZZLE_VALID_AXIS) {
02128         axis_from = swizzleClosure & SWIZZLE_AXIS;
02129         if (axis_from >= self->size) {
02130             PyErr_SetString(PyExc_AttributeError,
02131                             "Vector swizzle: "
02132                             "specified axis not present");
02133             return NULL;
02134         }
02135 
02136         vec[axis_to] = self->vec[axis_from];
02137         swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
02138         axis_to++;
02139     }
02140 
02141     return Vector_CreatePyObject(vec, axis_to, Py_NEW, Py_TYPE(self));
02142 }
02143 
02144 /* Set the items of this vector using a swizzle.
02145  * - If value is a vector or list this operates like an array copy, except that
02146  *   the destination is effectively re-ordered as defined by the swizzle. At
02147  *   most min(len(source), len(dest)) values will be copied.
02148  * - If the value is scalar, it is copied to all axes listed in the swizzle.
02149  * - If an axis appears more than once in the swizzle, the final occurrence is
02150  *   the one that determines its value.
02151 
02152  * Returns 0 on success and -1 on failure. On failure, the vector will be
02153  * unchanged. */
02154 static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure)
02155 {
02156     size_t size_from;
02157     float scalarVal;
02158 
02159     size_t axis_from;
02160     size_t axis_to;
02161 
02162     unsigned int swizzleClosure;
02163 
02164     float tvec[MAX_DIMENSIONS];
02165     float vec_assign[MAX_DIMENSIONS];
02166 
02167     if (BaseMath_ReadCallback(self) == -1)
02168         return -1;
02169 
02170     /* Check that the closure can be used with this vector: even 2D vectors have
02171      * swizzles defined for axes z and w, but they would be invalid. */
02172     swizzleClosure = GET_INT_FROM_POINTER(closure);
02173     axis_from = 0;
02174 
02175     while (swizzleClosure & SWIZZLE_VALID_AXIS) {
02176         axis_to = swizzleClosure & SWIZZLE_AXIS;
02177         if (axis_to >= self->size) {
02178             PyErr_SetString(PyExc_AttributeError,
02179                             "Vector swizzle: "
02180                             "specified axis not present");
02181             return -1;
02182         }
02183         swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
02184         axis_from++;
02185     }
02186 
02187     if (((scalarVal = PyFloat_AsDouble(value)) == -1 && PyErr_Occurred()) == 0) {
02188         int i;
02189 
02190         for (i = 0; i < MAX_DIMENSIONS; i++) {
02191             vec_assign[i] = scalarVal;
02192         }
02193 
02194         size_from = axis_from;
02195     }
02196     else if ( (PyErr_Clear()), /* run but ignore the result */
02197               (size_from = mathutils_array_parse(vec_assign, 2, 4, value,
02198                                                "mathutils.Vector.**** = swizzle assignment")) == -1)
02199     {
02200         return -1;
02201     }
02202 
02203     if (axis_from != size_from) {
02204         PyErr_SetString(PyExc_AttributeError,
02205                         "Vector swizzle: size does not match swizzle");
02206         return -1;
02207     }
02208 
02209     /* Copy vector contents onto swizzled axes. */
02210     axis_from = 0;
02211     swizzleClosure = GET_INT_FROM_POINTER(closure);
02212 
02213     while (swizzleClosure & SWIZZLE_VALID_AXIS) {
02214         axis_to = swizzleClosure & SWIZZLE_AXIS;
02215         tvec[axis_to] = vec_assign[axis_from];
02216         swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
02217         axis_from++;
02218     }
02219 
02220     memcpy(self->vec, tvec, axis_from * sizeof(float));
02221     /* continue with BaseMathObject_WriteCallback at the end */
02222 
02223     if (BaseMath_WriteCallback(self) == -1)
02224         return -1;
02225     else
02226         return 0;
02227 }
02228 
02229 /*****************************************************************************/
02230 /* Python attributes get/set structure:                                      */
02231 /*****************************************************************************/
02232 static PyGetSetDef Vector_getseters[] = {
02233     {(char *)"x", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_x_doc, (void *)0},
02234     {(char *)"y", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_y_doc, (void *)1},
02235     {(char *)"z", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_z_doc, (void *)2},
02236     {(char *)"w", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_w_doc, (void *)3},
02237     {(char *)"length", (getter)Vector_length_get, (setter)Vector_length_set, Vector_length_doc, NULL},
02238     {(char *)"length_squared", (getter)Vector_length_squared_get, (setter)NULL, Vector_length_squared_doc, NULL},
02239     {(char *)"magnitude", (getter)Vector_length_get, (setter)Vector_length_set, Vector_length_doc, NULL},
02240     {(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
02241     {(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
02242 
02243     /* autogenerated swizzle attrs, see python script below */
02244     {(char *)"xx",   (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 36
02245     {(char *)"xxx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 292
02246     {(char *)"xxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2340
02247     {(char *)"xxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2852
02248     {(char *)"xxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3364
02249     {(char *)"xxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3876
02250     {(char *)"xxy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 356
02251     {(char *)"xxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2404
02252     {(char *)"xxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2916
02253     {(char *)"xxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3428
02254     {(char *)"xxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3940
02255     {(char *)"xxz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 420
02256     {(char *)"xxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2468
02257     {(char *)"xxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2980
02258     {(char *)"xxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3492
02259     {(char *)"xxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4004
02260     {(char *)"xxw",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 484
02261     {(char *)"xxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2532
02262     {(char *)"xxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3044
02263     {(char *)"xxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3556
02264     {(char *)"xxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4068
02265     {(char *)"xy",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 44
02266     {(char *)"xyx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 300
02267     {(char *)"xyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2348
02268     {(char *)"xyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2860
02269     {(char *)"xyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3372
02270     {(char *)"xyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3884
02271     {(char *)"xyy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 364
02272     {(char *)"xyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2412
02273     {(char *)"xyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2924
02274     {(char *)"xyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3436
02275     {(char *)"xyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3948
02276     {(char *)"xyz",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 428
02277     {(char *)"xyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2476
02278     {(char *)"xyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2988
02279     {(char *)"xyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3500
02280     {(char *)"xyzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4012
02281     {(char *)"xyw",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 492
02282     {(char *)"xywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2540
02283     {(char *)"xywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3052
02284     {(char *)"xywz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3564
02285     {(char *)"xyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4076
02286     {(char *)"xz",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 52
02287     {(char *)"xzx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 308
02288     {(char *)"xzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2356
02289     {(char *)"xzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2868
02290     {(char *)"xzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3380
02291     {(char *)"xzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3892
02292     {(char *)"xzy",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 372
02293     {(char *)"xzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2420
02294     {(char *)"xzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2932
02295     {(char *)"xzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3444
02296     {(char *)"xzyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3956
02297     {(char *)"xzz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 436
02298     {(char *)"xzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2484
02299     {(char *)"xzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2996
02300     {(char *)"xzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3508
02301     {(char *)"xzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4020
02302     {(char *)"xzw",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 500
02303     {(char *)"xzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2548
02304     {(char *)"xzwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3060
02305     {(char *)"xzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3572
02306     {(char *)"xzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4084
02307     {(char *)"xw",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 60
02308     {(char *)"xwx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 316
02309     {(char *)"xwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2364
02310     {(char *)"xwxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2876
02311     {(char *)"xwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3388
02312     {(char *)"xwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3900
02313     {(char *)"xwy",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 380
02314     {(char *)"xwyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2428
02315     {(char *)"xwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2940
02316     {(char *)"xwyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3452
02317     {(char *)"xwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3964
02318     {(char *)"xwz",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 444
02319     {(char *)"xwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2492
02320     {(char *)"xwzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3004
02321     {(char *)"xwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3516
02322     {(char *)"xwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4028
02323     {(char *)"xww",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 508
02324     {(char *)"xwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2556
02325     {(char *)"xwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3068
02326     {(char *)"xwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3580
02327     {(char *)"xwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4092
02328     {(char *)"yx",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 37
02329     {(char *)"yxx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 293
02330     {(char *)"yxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2341
02331     {(char *)"yxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2853
02332     {(char *)"yxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3365
02333     {(char *)"yxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3877
02334     {(char *)"yxy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 357
02335     {(char *)"yxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2405
02336     {(char *)"yxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2917
02337     {(char *)"yxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3429
02338     {(char *)"yxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3941
02339     {(char *)"yxz",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 421
02340     {(char *)"yxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2469
02341     {(char *)"yxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2981
02342     {(char *)"yxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3493
02343     {(char *)"yxzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4005
02344     {(char *)"yxw",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 485
02345     {(char *)"yxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2533
02346     {(char *)"yxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3045
02347     {(char *)"yxwz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3557
02348     {(char *)"yxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4069
02349     {(char *)"yy",   (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 45
02350     {(char *)"yyx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 301
02351     {(char *)"yyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2349
02352     {(char *)"yyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2861
02353     {(char *)"yyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3373
02354     {(char *)"yyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3885
02355     {(char *)"yyy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 365
02356     {(char *)"yyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2413
02357     {(char *)"yyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2925
02358     {(char *)"yyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3437
02359     {(char *)"yyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3949
02360     {(char *)"yyz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 429
02361     {(char *)"yyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2477
02362     {(char *)"yyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2989
02363     {(char *)"yyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3501
02364     {(char *)"yyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4013
02365     {(char *)"yyw",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 493
02366     {(char *)"yywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2541
02367     {(char *)"yywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3053
02368     {(char *)"yywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3565
02369     {(char *)"yyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4077
02370     {(char *)"yz",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 53
02371     {(char *)"yzx",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 309
02372     {(char *)"yzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2357
02373     {(char *)"yzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2869
02374     {(char *)"yzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3381
02375     {(char *)"yzxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3893
02376     {(char *)"yzy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 373
02377     {(char *)"yzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2421
02378     {(char *)"yzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2933
02379     {(char *)"yzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3445
02380     {(char *)"yzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3957
02381     {(char *)"yzz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 437
02382     {(char *)"yzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2485
02383     {(char *)"yzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2997
02384     {(char *)"yzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3509
02385     {(char *)"yzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4021
02386     {(char *)"yzw",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 501
02387     {(char *)"yzwx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2549
02388     {(char *)"yzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3061
02389     {(char *)"yzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3573
02390     {(char *)"yzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4085
02391     {(char *)"yw",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 61
02392     {(char *)"ywx",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 317
02393     {(char *)"ywxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2365
02394     {(char *)"ywxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2877
02395     {(char *)"ywxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3389
02396     {(char *)"ywxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3901
02397     {(char *)"ywy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 381
02398     {(char *)"ywyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2429
02399     {(char *)"ywyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2941
02400     {(char *)"ywyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3453
02401     {(char *)"ywyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3965
02402     {(char *)"ywz",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 445
02403     {(char *)"ywzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2493
02404     {(char *)"ywzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3005
02405     {(char *)"ywzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3517
02406     {(char *)"ywzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4029
02407     {(char *)"yww",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 509
02408     {(char *)"ywwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2557
02409     {(char *)"ywwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3069
02410     {(char *)"ywwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3581
02411     {(char *)"ywww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4093
02412     {(char *)"zx",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 38
02413     {(char *)"zxx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 294
02414     {(char *)"zxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2342
02415     {(char *)"zxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2854
02416     {(char *)"zxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3366
02417     {(char *)"zxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3878
02418     {(char *)"zxy",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 358
02419     {(char *)"zxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2406
02420     {(char *)"zxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2918
02421     {(char *)"zxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3430
02422     {(char *)"zxyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3942
02423     {(char *)"zxz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 422
02424     {(char *)"zxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2470
02425     {(char *)"zxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2982
02426     {(char *)"zxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3494
02427     {(char *)"zxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4006
02428     {(char *)"zxw",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 486
02429     {(char *)"zxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2534
02430     {(char *)"zxwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3046
02431     {(char *)"zxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3558
02432     {(char *)"zxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4070
02433     {(char *)"zy",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 46
02434     {(char *)"zyx",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 302
02435     {(char *)"zyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2350
02436     {(char *)"zyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2862
02437     {(char *)"zyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3374
02438     {(char *)"zyxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3886
02439     {(char *)"zyy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 366
02440     {(char *)"zyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2414
02441     {(char *)"zyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2926
02442     {(char *)"zyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3438
02443     {(char *)"zyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3950
02444     {(char *)"zyz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 430
02445     {(char *)"zyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2478
02446     {(char *)"zyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2990
02447     {(char *)"zyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3502
02448     {(char *)"zyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4014
02449     {(char *)"zyw",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 494
02450     {(char *)"zywx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2542
02451     {(char *)"zywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3054
02452     {(char *)"zywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3566
02453     {(char *)"zyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4078
02454     {(char *)"zz",   (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 54
02455     {(char *)"zzx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 310
02456     {(char *)"zzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2358
02457     {(char *)"zzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2870
02458     {(char *)"zzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3382
02459     {(char *)"zzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3894
02460     {(char *)"zzy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 374
02461     {(char *)"zzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2422
02462     {(char *)"zzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2934
02463     {(char *)"zzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3446
02464     {(char *)"zzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3958
02465     {(char *)"zzz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 438
02466     {(char *)"zzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2486
02467     {(char *)"zzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2998
02468     {(char *)"zzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3510
02469     {(char *)"zzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4022
02470     {(char *)"zzw",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 502
02471     {(char *)"zzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2550
02472     {(char *)"zzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3062
02473     {(char *)"zzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3574
02474     {(char *)"zzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4086
02475     {(char *)"zw",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 62
02476     {(char *)"zwx",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 318
02477     {(char *)"zwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2366
02478     {(char *)"zwxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2878
02479     {(char *)"zwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3390
02480     {(char *)"zwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3902
02481     {(char *)"zwy",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 382
02482     {(char *)"zwyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2430
02483     {(char *)"zwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2942
02484     {(char *)"zwyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3454
02485     {(char *)"zwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3966
02486     {(char *)"zwz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 446
02487     {(char *)"zwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2494
02488     {(char *)"zwzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3006
02489     {(char *)"zwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3518
02490     {(char *)"zwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4030
02491     {(char *)"zww",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 510
02492     {(char *)"zwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2558
02493     {(char *)"zwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3070
02494     {(char *)"zwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3582
02495     {(char *)"zwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4094
02496     {(char *)"wx",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 39
02497     {(char *)"wxx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 295
02498     {(char *)"wxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2343
02499     {(char *)"wxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2855
02500     {(char *)"wxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3367
02501     {(char *)"wxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3879
02502     {(char *)"wxy",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 359
02503     {(char *)"wxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2407
02504     {(char *)"wxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2919
02505     {(char *)"wxyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3431
02506     {(char *)"wxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3943
02507     {(char *)"wxz",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 423
02508     {(char *)"wxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2471
02509     {(char *)"wxzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2983
02510     {(char *)"wxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3495
02511     {(char *)"wxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4007
02512     {(char *)"wxw",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 487
02513     {(char *)"wxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2535
02514     {(char *)"wxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3047
02515     {(char *)"wxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3559
02516     {(char *)"wxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4071
02517     {(char *)"wy",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 47
02518     {(char *)"wyx",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 303
02519     {(char *)"wyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2351
02520     {(char *)"wyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2863
02521     {(char *)"wyxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3375
02522     {(char *)"wyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3887
02523     {(char *)"wyy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 367
02524     {(char *)"wyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2415
02525     {(char *)"wyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2927
02526     {(char *)"wyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3439
02527     {(char *)"wyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3951
02528     {(char *)"wyz",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 431
02529     {(char *)"wyzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2479
02530     {(char *)"wyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2991
02531     {(char *)"wyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3503
02532     {(char *)"wyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4015
02533     {(char *)"wyw",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 495
02534     {(char *)"wywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2543
02535     {(char *)"wywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3055
02536     {(char *)"wywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3567
02537     {(char *)"wyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4079
02538     {(char *)"wz",   (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 55
02539     {(char *)"wzx",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 311
02540     {(char *)"wzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2359
02541     {(char *)"wzxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2871
02542     {(char *)"wzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3383
02543     {(char *)"wzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3895
02544     {(char *)"wzy",  (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 375
02545     {(char *)"wzyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2423
02546     {(char *)"wzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2935
02547     {(char *)"wzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3447
02548     {(char *)"wzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3959
02549     {(char *)"wzz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 439
02550     {(char *)"wzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2487
02551     {(char *)"wzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2999
02552     {(char *)"wzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3511
02553     {(char *)"wzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4023
02554     {(char *)"wzw",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 503
02555     {(char *)"wzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2551
02556     {(char *)"wzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3063
02557     {(char *)"wzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3575
02558     {(char *)"wzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4087
02559     {(char *)"ww",   (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 63
02560     {(char *)"wwx",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 319
02561     {(char *)"wwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2367
02562     {(char *)"wwxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2879
02563     {(char *)"wwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3391
02564     {(char *)"wwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3903
02565     {(char *)"wwy",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 383
02566     {(char *)"wwyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2431
02567     {(char *)"wwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2943
02568     {(char *)"wwyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3455
02569     {(char *)"wwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3967
02570     {(char *)"wwz",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 447
02571     {(char *)"wwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2495
02572     {(char *)"wwzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3007
02573     {(char *)"wwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3519
02574     {(char *)"wwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4031
02575     {(char *)"www",  (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 511
02576     {(char *)"wwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2559
02577     {(char *)"wwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3071
02578     {(char *)"wwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3583
02579     {(char *)"wwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4095
02580     {NULL, NULL, NULL, NULL, NULL}  /* Sentinel */
02581 };
02582 
02583 /* Python script used to make swizzle array */
02584 /*
02585 SWIZZLE_BITS_PER_AXIS = 3
02586 SWIZZLE_VALID_AXIS = 0x4
02587 
02588 axis_dict = {}
02589 axis_pos = {'x':0, 'y':1, 'z':2, 'w':3}
02590 axises = 'xyzw'
02591 while len(axises) >= 2:
02592 
02593     for axis_0 in axises:
02594         axis_0_pos = axis_pos[axis_0]
02595         for axis_1 in axises:
02596             axis_1_pos = axis_pos[axis_1]
02597             axis_dict[axis_0 + axis_1] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS))' % (axis_0_pos, axis_1_pos)
02598             if len(axises)>2:
02599                 for axis_2 in axises:
02600                     axis_2_pos = axis_pos[axis_2]
02601                     axis_dict[axis_0 + axis_1 + axis_2] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)))' % (axis_0_pos, axis_1_pos, axis_2_pos)
02602                     if len(axises)>3:
02603                         for axis_3 in axises:
02604                             axis_3_pos = axis_pos[axis_3]
02605                             axis_dict[axis_0 + axis_1 + axis_2 + axis_3] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  ' % (axis_0_pos, axis_1_pos, axis_2_pos, axis_3_pos)
02606 
02607     axises = axises[:-1]
02608 
02609 
02610 items = axis_dict.items()
02611 items.sort(key = lambda a: a[0].replace('x', '0').replace('y', '1').replace('z', '2').replace('w', '3'))
02612 
02613 unique = set()
02614 for key, val in items:
02615     num = eval(val)
02616     set_str = 'Vector_setSwizzle' if (len(set(key)) == len(key)) else 'NULL'
02617     print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)%s, NULL, SET_INT_IN_POINTER(%s)}, // %s' % (key, (' '*(4-len(key))), set_str, axis_dict[key], num)
02618     unique.add(num)
02619 
02620 if len(unique) != len(items):
02621     print "ERROR"
02622 */
02623 
02624 /* ROW VECTOR Multiplication - Vector X Matrix
02625  * [x][y][z] * [1][4][7]
02626  *             [2][5][8]
02627  *             [3][6][9]
02628  * vector/matrix multiplication IS NOT COMMUTATIVE!!!! */
02629 static int row_vector_multiplication(float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
02630 {
02631     float vec_cpy[MAX_DIMENSIONS];
02632     int row, col, z = 0, vec_size = vec->size;
02633 
02634     if (mat->num_row != vec_size) {
02635         if (mat->num_row == 4 && vec_size == 3) {
02636             vec_cpy[3] = 1.0f;
02637         }
02638         else {
02639             PyErr_SetString(PyExc_ValueError,
02640                             "vector * matrix: matrix column size "
02641                             "and the vector size must be the same");
02642             return -1;
02643         }
02644     }
02645 
02646     if (BaseMath_ReadCallback(vec) == -1 || BaseMath_ReadCallback(mat) == -1)
02647         return -1;
02648 
02649     memcpy(vec_cpy, vec->vec, vec_size * sizeof(float));
02650 
02651     r_vec[3] = 1.0f;
02652     //muliplication
02653     for (col = 0; col < mat->num_col; col++) {
02654         double dot = 0.0;
02655         for (row = 0; row < mat->num_row; row++) {
02656             dot += MATRIX_ITEM(mat, row, col) * vec_cpy[row];
02657         }
02658         r_vec[z++] = (float)dot;
02659     }
02660     return 0;
02661 }
02662 
02663 /*----------------------------Vector.negate() -------------------- */
02664 PyDoc_STRVAR(Vector_negate_doc,
02665 ".. method:: negate()\n"
02666 "\n"
02667 "   Set all values to their negative.\n"
02668 "\n"
02669 "   :return: an instance of itself\n"
02670 "   :rtype: :class:`Vector`\n"
02671 );
02672 static PyObject *Vector_negate(VectorObject *self)
02673 {
02674     if (BaseMath_ReadCallback(self) == -1)
02675         return NULL;
02676 
02677     negate_vn(self->vec, self->size);
02678 
02679     (void)BaseMath_WriteCallback(self); // already checked for error
02680     Py_RETURN_NONE;
02681 }
02682 
02683 static struct PyMethodDef Vector_methods[] = {
02684     /* Class Methods */
02685     {"Fill", (PyCFunction) C_Vector_Fill, METH_VARARGS | METH_CLASS, C_Vector_Fill_doc},
02686     {"Range", (PyCFunction) C_Vector_Range, METH_VARARGS | METH_CLASS, C_Vector_Range_doc},
02687     {"Linspace", (PyCFunction) C_Vector_Linspace, METH_VARARGS | METH_CLASS, C_Vector_Linspace_doc},
02688     {"Repeat", (PyCFunction) C_Vector_Repeat, METH_VARARGS | METH_CLASS, C_Vector_Repeat_doc},
02689 
02690     /* in place only */
02691     {"zero", (PyCFunction) Vector_zero, METH_NOARGS, Vector_zero_doc},
02692     {"negate", (PyCFunction) Vector_negate, METH_NOARGS, Vector_negate_doc},
02693 
02694     /* operate on original or copy */
02695     {"normalize", (PyCFunction) Vector_normalize, METH_NOARGS, Vector_normalize_doc},
02696     {"normalized", (PyCFunction) Vector_normalized, METH_NOARGS, Vector_normalized_doc},
02697 
02698     {"resize", (PyCFunction) Vector_resize, METH_O, Vector_resize_doc},
02699     {"resized", (PyCFunction) Vector_resized, METH_O, Vector_resized_doc},
02700     {"to_2d", (PyCFunction) Vector_to_2d, METH_NOARGS, Vector_to_2d_doc},
02701     {"resize_2d", (PyCFunction) Vector_resize_2d, METH_NOARGS, Vector_resize_2d_doc},
02702     {"to_3d", (PyCFunction) Vector_to_3d, METH_NOARGS, Vector_to_3d_doc},
02703     {"resize_3d", (PyCFunction) Vector_resize_3d, METH_NOARGS, Vector_resize_3d_doc},
02704     {"to_4d", (PyCFunction) Vector_to_4d, METH_NOARGS, Vector_to_4d_doc},
02705     {"resize_4d", (PyCFunction) Vector_resize_4d, METH_NOARGS, Vector_resize_4d_doc},
02706     {"to_tuple", (PyCFunction) Vector_to_tuple, METH_VARARGS, Vector_to_tuple_doc},
02707     {"to_track_quat", (PyCFunction) Vector_to_track_quat, METH_VARARGS, Vector_to_track_quat_doc},
02708 
02709     /* operation between 2 or more types  */
02710     {"reflect", (PyCFunction) Vector_reflect, METH_O, Vector_reflect_doc},
02711     {"cross", (PyCFunction) Vector_cross, METH_O, Vector_cross_doc},
02712     {"dot", (PyCFunction) Vector_dot, METH_O, Vector_dot_doc},
02713     {"angle", (PyCFunction) Vector_angle, METH_VARARGS, Vector_angle_doc},
02714     {"rotation_difference", (PyCFunction) Vector_rotation_difference, METH_O, Vector_rotation_difference_doc},
02715     {"project", (PyCFunction) Vector_project, METH_O, Vector_project_doc},
02716     {"lerp", (PyCFunction) Vector_lerp, METH_VARARGS, Vector_lerp_doc},
02717     {"rotate", (PyCFunction) Vector_rotate, METH_O, Vector_rotate_doc},
02718 
02719     {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
02720     {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL},
02721     {NULL, NULL, 0, NULL}
02722 };
02723 
02724 
02725 /* Note
02726  Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
02727  but this means for eg that
02728  vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order
02729 */
02730 
02731 PyDoc_STRVAR(vector_doc,
02732 "This object gives access to Vectors in Blender."
02733 );
02734 PyTypeObject vector_Type = {
02735     PyVarObject_HEAD_INIT(NULL, 0)
02736     /*  For printing, in format "<module>.<name>" */
02737     "mathutils.Vector",             /* char *tp_name; */
02738     sizeof(VectorObject),         /* int tp_basicsize; */
02739     0,                          /* tp_itemsize;  For allocation */
02740 
02741     /* Methods to implement standard operations */
02742 
02743     (destructor) BaseMathObject_dealloc,/* destructor tp_dealloc; */
02744     NULL,                       /* printfunc tp_print; */
02745     NULL,                       /* getattrfunc tp_getattr; */
02746     NULL,                       /* setattrfunc tp_setattr; */
02747     NULL,   /* cmpfunc tp_compare; */
02748     (reprfunc)Vector_repr,     /* reprfunc tp_repr; */
02749 
02750     /* Method suites for standard classes */
02751 
02752     &Vector_NumMethods,                       /* PyNumberMethods *tp_as_number; */
02753     &Vector_SeqMethods,                       /* PySequenceMethods *tp_as_sequence; */
02754     &Vector_AsMapping,                       /* PyMappingMethods *tp_as_mapping; */
02755 
02756     /* More standard operations (here for binary compatibility) */
02757 
02758     NULL,                       /* hashfunc tp_hash; */
02759     NULL,                       /* ternaryfunc tp_call; */
02760     (reprfunc)Vector_str,       /* reprfunc tp_str; */
02761     NULL,                       /* getattrofunc tp_getattro; */
02762     NULL,                       /* setattrofunc tp_setattro; */
02763 
02764     /* Functions to access object as input/output buffer */
02765     NULL,                       /* PyBufferProcs *tp_as_buffer; */
02766 
02767   /*** Flags to define presence of optional/expanded features ***/
02768     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
02769     vector_doc,                       /*  char *tp_doc;  Documentation string */
02770   /*** Assigned meaning in release 2.0 ***/
02771 
02772     /* call function for all accessible objects */
02773     (traverseproc)BaseMathObject_traverse,  //tp_traverse
02774 
02775     /* delete references to contained objects */
02776     (inquiry)BaseMathObject_clear,  //tp_clear
02777 
02778   /***  Assigned meaning in release 2.1 ***/
02779   /*** rich comparisons ***/
02780     (richcmpfunc)Vector_richcmpr,                       /* richcmpfunc tp_richcompare; */
02781 
02782   /***  weak reference enabler ***/
02783     0,                          /* long tp_weaklistoffset; */
02784 
02785   /*** Added in release 2.2 ***/
02786     /*   Iterators */
02787     NULL,                       /* getiterfunc tp_iter; */
02788     NULL,                       /* iternextfunc tp_iternext; */
02789 
02790   /*** Attribute descriptor and subclassing stuff ***/
02791     Vector_methods,           /* struct PyMethodDef *tp_methods; */
02792     NULL,                       /* struct PyMemberDef *tp_members; */
02793     Vector_getseters,           /* struct PyGetSetDef *tp_getset; */
02794     NULL,                       /* struct _typeobject *tp_base; */
02795     NULL,                       /* PyObject *tp_dict; */
02796     NULL,                       /* descrgetfunc tp_descr_get; */
02797     NULL,                       /* descrsetfunc tp_descr_set; */
02798     0,                          /* long tp_dictoffset; */
02799     NULL,                       /* initproc tp_init; */
02800     NULL,                       /* allocfunc tp_alloc; */
02801     Vector_new,                 /* newfunc tp_new; */
02802     /*  Low-level free-memory routine */
02803     NULL,                       /* freefunc tp_free;  */
02804     /* For PyObject_IS_GC */
02805     NULL,                       /* inquiry tp_is_gc;  */
02806     NULL,                       /* PyObject *tp_bases; */
02807     /* method resolution order */
02808     NULL,                       /* PyObject *tp_mro;  */
02809     NULL,                       /* PyObject *tp_cache; */
02810     NULL,                       /* PyObject *tp_subclasses; */
02811     NULL,                       /* PyObject *tp_weaklist; */
02812     NULL
02813 };
02814 
02815 /*------------------------Vector_CreatePyObject (internal)-------------
02816   creates a new vector object
02817   pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
02818  (i.e. it was allocated elsewhere by MEM_mallocN())
02819   pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
02820  (i.e. it must be created here with PyMEM_malloc())*/
02821 PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type)
02822 {
02823     VectorObject *self;
02824 
02825     if (size < 2) {
02826         PyErr_SetString(PyExc_RuntimeError,
02827                         "Vector(): invalid size");
02828         return NULL;
02829     }
02830 
02831     self = base_type ? (VectorObject *)base_type->tp_alloc(base_type, 0) :
02832                        (VectorObject *)PyObject_GC_New(VectorObject, &vector_Type);
02833 
02834     if (self) {
02835         self->size = size;
02836 
02837         /* init callbacks as NULL */
02838         self->cb_user = NULL;
02839         self->cb_type = self->cb_subtype = 0;
02840 
02841         if (type == Py_WRAP) {
02842             self->vec = vec;
02843             self->wrapped = Py_WRAP;
02844         }
02845         else if (type == Py_NEW) {
02846             self->vec = PyMem_Malloc(size * sizeof(float));
02847             if (vec) {
02848                 memcpy(self->vec, vec, size * sizeof(float));
02849             }
02850             else { /* new empty */
02851                 fill_vn_fl(self->vec, size, 0.0f);
02852                 if (size == 4) { /* do the homogenous thing */
02853                     self->vec[3] = 1.0f;
02854                 }
02855             }
02856             self->wrapped = Py_NEW;
02857         }
02858         else {
02859             Py_FatalError("Vector(): invalid type!");
02860         }
02861     }
02862     return (PyObject *) self;
02863 }
02864 
02865 PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype)
02866 {
02867     float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */
02868     VectorObject *self = (VectorObject *)Vector_CreatePyObject(dummy, size, Py_NEW, NULL);
02869     if (self) {
02870         Py_INCREF(cb_user);
02871         self->cb_user =         cb_user;
02872         self->cb_type =         (unsigned char)cb_type;
02873         self->cb_subtype =      (unsigned char)cb_subtype;
02874         PyObject_GC_Track(self);
02875     }
02876 
02877     return (PyObject *)self;
02878 }
02879 
02880 PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type)
02881 {
02882     VectorObject *vect_ob;
02883     vect_ob = (VectorObject *)Vector_CreatePyObject(vec, size, Py_WRAP, base_type);
02884     vect_ob->wrapped = Py_NEW;
02885 
02886     return (PyObject *)vect_ob;
02887 }