765df7afcf9c8976782b37780eca08a8dfc5634e
[blender.git] / source / blender / python / mathutils / mathutils_Vector.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19  * All rights reserved.
20  *
21  *
22  * Contributor(s): Willian P. Germano, Joseph Gilbert, Ken Hughes, Alex Fraser, Campbell Barton
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 /** \file blender/python/mathutils/mathutils_Vector.c
28  *  \ingroup pymathutils
29  */
30
31
32 #include <Python.h>
33
34 #include "mathutils.h"
35
36 #include "BLI_math.h"
37 #include "BLI_utildefines.h"
38 #include "BLI_dynstr.h"
39
40 #define MAX_DIMENSIONS 4
41
42 /* Swizzle axes get packed into a single value that is used as a closure. Each
43    axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is
44    used as a sentinel: if it is unset, the axis is not valid. */
45 #define SWIZZLE_BITS_PER_AXIS 3
46 #define SWIZZLE_VALID_AXIS 0x4
47 #define SWIZZLE_AXIS       0x3
48
49 static PyObject *Vector_copy(VectorObject *self);
50 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits);
51 static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat);
52
53 /* Supports 2D, 3D, and 4D vector objects both int and float values
54  * accepted. Mixed float and int values accepted. Ints are parsed to float
55  */
56 static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
57 {
58         float *vec = NULL;
59         int size = 3; /* default to a 3D vector */
60
61         switch (PyTuple_GET_SIZE(args)) {
62         case 0:
63                 vec = PyMem_Malloc(size * sizeof(float));
64
65                 if (vec == NULL) {
66                         PyErr_SetString(PyExc_MemoryError,
67                                                         "Vector(): "
68                                                         "problem allocating pointer space");
69                         return NULL;
70                 }
71
72                 fill_vn_fl(vec, size, 0.0f);
73                 break;
74         case 1:
75                 if ((size = mathutils_array_parse_alloc(&vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) {
76                         if (vec) {
77                                 PyMem_Free(vec);
78                         }
79                         return NULL;
80                 }
81                 break;
82         default:
83                 PyErr_SetString(PyExc_TypeError,
84                                 "mathutils.Vector(): "
85                                 "more then a single arg given");
86                 return NULL;
87         }
88         return Vector_CreatePyObject(vec, size, Py_NEW, type);
89 }
90
91 static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *self)
92 {
93         PyObject *ret = Vector_copy(self);
94         PyObject *ret_dummy = vec_func(ret);
95         if (ret_dummy) {
96                 Py_DECREF(ret_dummy);
97                 return (PyObject *)ret;
98         }
99         else { /* error */
100                 Py_DECREF(ret);
101                 return NULL;
102         }
103 }
104
105 /*-----------------------CLASS-METHODS----------------------------*/
106 PyDoc_STRVAR(C_Vector_Fill_doc,
107 ".. classmethod:: Fill(size, fill=0.0)\n"
108 "\n"
109 "   Create a vector of length size with all values set to fill.\n"
110 "\n"
111 "   :arg size: The length of the vector to be created.\n"
112 "   :type size: int\n"
113 "   :arg fill: The value used to fill the vector.\n"
114 "   :type fill: float\n"
115 );
116 static PyObject *C_Vector_Fill(PyObject *cls, PyObject *args)
117 {
118         float *vec;
119         int size;
120         float fill = 0.0f;
121
122         if (!PyArg_ParseTuple(args, "i|f:Vector.Fill", &size, &fill)) {
123                 return NULL;
124         }
125
126         if (size < 2) {
127                 PyErr_SetString(PyExc_RuntimeError,
128                                 "Vector(): invalid size");
129                 return NULL;
130         }
131
132         vec = PyMem_Malloc(size * sizeof(float));
133
134         if (vec == NULL) {
135                 PyErr_SetString(PyExc_MemoryError,
136                                                 "Vector.Fill(): "
137                                 "problem allocating pointer space");
138                 return NULL;
139         }
140
141         fill_vn_fl(vec, size, fill);
142
143         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
144 }
145
146 PyDoc_STRVAR(C_Vector_Range_doc,
147 ".. classmethod:: Range(start=0, stop, step=1)\n"
148 "\n"
149 "   Create a filled with a range of values.\n"
150 "\n"
151 "   :arg start: The start of the range used to fill the vector.\n"
152 "   :type start: int\n"
153 "   :arg stop: The end of the range used to fill the vector.\n"
154 "   :type stop: int\n"
155 "   :arg step: The step between successive values in the vector.\n"
156 "   :type step: int\n"
157 );
158 static PyObject *C_Vector_Range(PyObject *cls, PyObject *args)
159 {
160         float *vec;
161         int stop, size;
162         int start = 0;
163         int step = 1;
164
165         if (!PyArg_ParseTuple(args, "i|ii:Vector.Range", &start, &stop, &step)) {
166                 return NULL;
167         }
168
169         switch (PyTuple_GET_SIZE(args)) {
170         case 1:
171                 size = start;
172                 start = 0;
173                 break;
174         case 2:
175                 if (start >= stop) {
176                         PyErr_SetString(PyExc_RuntimeError,
177                                         "Start value is larger "
178                                         "than the stop value");
179                         return NULL;
180                 }
181
182                 size = stop - start;
183                 break;
184         default:
185                 if (start >= stop) {
186                         PyErr_SetString(PyExc_RuntimeError,
187                                         "Start value is larger "
188                                         "than the stop value");
189                         return NULL;
190                 }
191
192                 size = (stop - start);
193
194                 if ((size % step) != 0)
195                         size += step;
196
197                 size /= step;
198
199                 break;
200         }
201
202         if (size < 2) {
203                 PyErr_SetString(PyExc_RuntimeError,
204                                 "Vector(): invalid size");
205                 return NULL;
206         }
207
208         vec = PyMem_Malloc(size * sizeof(float));
209
210         if (vec == NULL) {
211                 PyErr_SetString(PyExc_MemoryError,
212                                 "Vector.Range(): "
213                                 "problem allocating pointer space");
214                 return NULL;
215         }
216
217         range_vn_fl(vec, size, (float)start, (float)step);
218
219         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
220 }
221
222 PyDoc_STRVAR(C_Vector_Linspace_doc,
223 ".. classmethod:: Linspace(start, stop, size)\n"
224 "\n"
225 "   Create a vector of the specified size which is filled with linearly spaced values between start and stop values.\n"
226 "\n"
227 "   :arg start: The start of the range used to fill the vector.\n"
228 "   :type start: int\n"
229 "   :arg stop: The end of the range used to fill the vector.\n"
230 "   :type stop: int\n"
231 "   :arg size: The size of the vector to be created.\n"
232 "   :type size: int\n"
233 );
234 static PyObject *C_Vector_Linspace(PyObject *cls, PyObject *args)
235 {
236         float *vec;
237         int size;
238         float start, end, step;
239
240         if (!PyArg_ParseTuple(args, "ffi:Vector.Linspace", &start, &end, &size)) {
241                 return NULL;
242         }
243
244         if (size < 2) {
245                 PyErr_SetString(PyExc_RuntimeError,
246                                 "Vector.Linspace(): invalid size");
247                 return NULL;
248         }
249
250         step = (end - start)/(float)(size-1);
251
252         vec = PyMem_Malloc(size * sizeof(float));
253
254         if (vec == NULL) {
255                 PyErr_SetString(PyExc_MemoryError,
256                                 "Vector.Linspace(): "
257                                 "problem allocating pointer space");
258                 return NULL;
259         }
260
261         range_vn_fl(vec, size, start, step);
262
263         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
264 }
265
266 PyDoc_STRVAR(C_Vector_Repeat_doc,
267 ".. classmethod:: Repeat(vector, size)\n"
268 "\n"
269 "   Create a vector by repeating the values in vector until the required size is reached.\n"
270 "\n"
271 "   :arg tuple: The vector to draw values from.\n"
272 "   :type tuple: :class:`mathutils.Vector`\n"
273 "   :arg size: The size of the vector to be created.\n"
274 "   :type size: int\n"
275 );
276 static PyObject *C_Vector_Repeat(PyObject *cls, PyObject *args)
277 {
278         float *vec;
279         float *iter_vec = NULL;
280         int i, size, value_size;
281         PyObject *value;
282
283         if (!PyArg_ParseTuple(args, "Oi:Vector.Repeat", &value, &size)) {
284                 return NULL;
285         }
286
287         if (size < 2) {
288                 PyErr_SetString(PyExc_RuntimeError,
289                                 "Vector.Repeat(): invalid size");
290                 return NULL;
291         }
292
293         if ((value_size = mathutils_array_parse_alloc(&iter_vec, 2, value,
294                                                       "Vector.Repeat(vector, size), invalid 'vector' arg")) == -1)
295         {
296                 PyMem_Free(iter_vec);
297                 return NULL;
298         }
299
300         if (iter_vec == NULL) {
301                 PyErr_SetString(PyExc_MemoryError,
302                                 "Vector.Repeat(): "
303                                 "problem allocating pointer space");
304                 return NULL;
305         }
306
307         vec = PyMem_Malloc(size * sizeof(float));
308
309         if (vec == NULL) {
310                 PyErr_SetString(PyExc_MemoryError,
311                                 "Vector.Repeat(): "
312                                 "problem allocating pointer space");
313                 return NULL;
314         }
315
316         i = 0;
317         while (i < size) {
318                 vec[i] = iter_vec[i % value_size];
319                 i++;
320         }
321
322         PyMem_Free(iter_vec);
323
324         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
325 }
326
327 /*-----------------------------METHODS---------------------------- */
328 PyDoc_STRVAR(Vector_zero_doc,
329 ".. method:: zero()\n"
330 "\n"
331 "   Set all values to zero.\n"
332 );
333 static PyObject *Vector_zero(VectorObject *self)
334 {
335         fill_vn_fl(self->vec, self->size, 0.0f);
336
337         if (BaseMath_WriteCallback(self) == -1)
338                 return NULL;
339
340         Py_RETURN_NONE;
341 }
342
343 PyDoc_STRVAR(Vector_normalize_doc,
344 ".. method:: normalize()\n"
345 "\n"
346 "   Normalize the vector, making the length of the vector always 1.0.\n"
347 "\n"
348 "   .. warning:: Normalizing a vector where all values are zero has no effect.\n"
349 "\n"
350 "   .. note:: Normalize works for vectors of all sizes,\n"
351 "      however 4D Vectors w axis is left untouched.\n"
352 );
353 static PyObject *Vector_normalize(VectorObject *self)
354 {
355         int size = (self->size == 4 ? 3 : self->size);
356         if (BaseMath_ReadCallback(self) == -1)
357                 return NULL;
358
359         normalize_vn(self->vec, size);
360
361         (void)BaseMath_WriteCallback(self);
362         Py_RETURN_NONE;
363 }
364 PyDoc_STRVAR(Vector_normalized_doc,
365 ".. method:: normalized()\n"
366 "\n"
367 "   Return a new, normalized vector.\n"
368 "\n"
369 "   :return: a normalized copy of the vector\n"
370 "   :rtype: :class:`Vector`\n"
371 );
372 static PyObject *Vector_normalized(VectorObject *self)
373 {
374         return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self);
375 }
376
377 PyDoc_STRVAR(Vector_resize_doc,
378 ".. method:: resize(size=3)\n"
379 "\n"
380 "   Resize the vector to have size number of elements.\n"
381 );
382 static PyObject *Vector_resize(VectorObject *self, PyObject *value)
383 {
384         int size;
385
386         if (self->wrapped == Py_WRAP) {
387                 PyErr_SetString(PyExc_TypeError,
388                                 "Vector.resize(): "
389                                 "cannot resize wrapped data - only python vectors");
390                 return NULL;
391         }
392         if (self->cb_user) {
393                 PyErr_SetString(PyExc_TypeError,
394                                 "Vector.resize(): "
395                                 "cannot resize a vector that has an owner");
396                 return NULL;
397         }
398
399         if ((size = PyLong_AsLong(value)) == -1) {
400                 PyErr_SetString(PyExc_TypeError,
401                                 "Vector.resize(size): "
402                                 "expected size argument to be an integer");
403                 return NULL;
404         }
405
406         if (size < 2) {
407                 PyErr_SetString(PyExc_RuntimeError,
408                                 "Vector.resize(): invalid size");
409                 return NULL;
410         }
411
412         self->vec = PyMem_Realloc(self->vec, (size * sizeof(float)));
413         if (self->vec == NULL) {
414                 PyErr_SetString(PyExc_MemoryError,
415                                                 "Vector.resize(): "
416                                 "problem allocating pointer space");
417                 return NULL;
418         }
419
420         /* If the vector has increased in length, set all new elements to 0.0f */
421         if (size > self->size) {
422                 fill_vn_fl(self->vec + self->size, size - self->size, 0.0f);
423         }
424
425         self->size = size;
426         Py_RETURN_NONE;
427 }
428
429 PyDoc_STRVAR(Vector_resized_doc,
430 ".. method:: resized(size=3)\n"
431 "\n"
432 "   Return a resized copy of the vector with size number of elements.\n"
433 "\n"
434 "   :return: a new vector\n"
435 "   :rtype: :class:`Vector`\n"
436 );
437 static PyObject *Vector_resized(VectorObject *self, PyObject *value)
438 {
439         int size;
440         float *vec;
441
442         /*if (!PyArg_ParseTuple(args, "i:resize", &size))
443                 return NULL;*/
444         if ((size = PyLong_AsLong(value)) == -1) {
445                 return NULL;
446         }
447
448         if (size < 2) {
449                 PyErr_SetString(PyExc_RuntimeError,
450                                 "Vector.resized(): invalid size");
451                 return NULL;
452         }
453
454         vec = PyMem_Malloc(size * sizeof(float));
455
456         if (vec == NULL) {
457                 PyErr_SetString(PyExc_MemoryError,
458                                 "Vector.resized(): "
459                                 "problem allocating pointer space");
460                 return NULL;
461         }
462
463         fill_vn_fl(vec, size, 0.0f);
464         memcpy(vec, self->vec, self->size * sizeof(float));
465
466         return Vector_CreatePyObject_alloc(vec, size, NULL);
467 }
468
469 PyDoc_STRVAR(Vector_resize_2d_doc,
470 ".. method:: resize_2d()\n"
471 "\n"
472 "   Resize the vector to 2D  (x, y).\n"
473 );
474 static PyObject *Vector_resize_2d(VectorObject *self)
475 {
476         if (self->wrapped == Py_WRAP) {
477                 PyErr_SetString(PyExc_TypeError,
478                                 "Vector.resize_2d(): "
479                                 "cannot resize wrapped data - only python vectors");
480                 return NULL;
481         }
482         if (self->cb_user) {
483                 PyErr_SetString(PyExc_TypeError,
484                                 "Vector.resize_2d(): "
485                                 "cannot resize a vector that has an owner");
486                 return NULL;
487         }
488
489         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
490         if (self->vec == NULL) {
491                 PyErr_SetString(PyExc_MemoryError,
492                                 "Vector.resize_2d(): "
493                                 "problem allocating pointer space");
494                 return NULL;
495         }
496
497         self->size = 2;
498         Py_RETURN_NONE;
499 }
500
501 PyDoc_STRVAR(Vector_resize_3d_doc,
502 ".. method:: resize_3d()\n"
503 "\n"
504 "   Resize the vector to 3D  (x, y, z).\n"
505 );
506 static PyObject *Vector_resize_3d(VectorObject *self)
507 {
508         if (self->wrapped == Py_WRAP) {
509                 PyErr_SetString(PyExc_TypeError,
510                                 "Vector.resize_3d(): "
511                                 "cannot resize wrapped data - only python vectors");
512                 return NULL;
513         }
514         if (self->cb_user) {
515                 PyErr_SetString(PyExc_TypeError,
516                                 "Vector.resize_3d(): "
517                                 "cannot resize a vector that has an owner");
518                 return NULL;
519         }
520
521         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
522         if (self->vec == NULL) {
523                 PyErr_SetString(PyExc_MemoryError,
524                                 "Vector.resize_3d(): "
525                                 "problem allocating pointer space");
526                 return NULL;
527         }
528
529         if (self->size == 2)
530                 self->vec[2] = 0.0f;
531
532         self->size = 3;
533         Py_RETURN_NONE;
534 }
535
536 PyDoc_STRVAR(Vector_resize_4d_doc,
537 ".. method:: resize_4d()\n"
538 "\n"
539 "   Resize the vector to 4D (x, y, z, w).\n"
540 );
541 static PyObject *Vector_resize_4d(VectorObject *self)
542 {
543         if (self->wrapped == Py_WRAP) {
544                 PyErr_SetString(PyExc_TypeError,
545                                 "Vector.resize_4d(): "
546                                 "cannot resize wrapped data - only python vectors");
547                 return NULL;
548         }
549         if (self->cb_user) {
550                 PyErr_SetString(PyExc_TypeError,
551                                 "Vector.resize_4d(): "
552                                 "cannot resize a vector that has an owner");
553                 return NULL;
554         }
555
556         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
557         if (self->vec == NULL) {
558                 PyErr_SetString(PyExc_MemoryError,
559                                 "Vector.resize_4d(): "
560                                 "problem allocating pointer space");
561                 return NULL;
562         }
563
564         if (self->size == 2) {
565                 self->vec[2] = 0.0f;
566                 self->vec[3] = 1.0f;
567         }
568         else if (self->size == 3) {
569                 self->vec[3] = 1.0f;
570         }
571         self->size = 4;
572         Py_RETURN_NONE;
573 }
574 PyDoc_STRVAR(Vector_to_2d_doc,
575 ".. method:: to_2d()\n"
576 "\n"
577 "   Return a 2d copy of the vector.\n"
578 "\n"
579 "   :return: a new vector\n"
580 "   :rtype: :class:`Vector`\n"
581 );
582 static PyObject *Vector_to_2d(VectorObject *self)
583 {
584         if (BaseMath_ReadCallback(self) == -1)
585                 return NULL;
586
587         return Vector_CreatePyObject(self->vec, 2, Py_NEW, Py_TYPE(self));
588 }
589 PyDoc_STRVAR(Vector_to_3d_doc,
590 ".. method:: to_3d()\n"
591 "\n"
592 "   Return a 3d copy of the vector.\n"
593 "\n"
594 "   :return: a new vector\n"
595 "   :rtype: :class:`Vector`\n"
596 );
597 static PyObject *Vector_to_3d(VectorObject *self)
598 {
599         float tvec[3] = {0.0f};
600
601         if (BaseMath_ReadCallback(self) == -1)
602                 return NULL;
603
604         memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 3));
605         return Vector_CreatePyObject(tvec, 3, Py_NEW, Py_TYPE(self));
606 }
607 PyDoc_STRVAR(Vector_to_4d_doc,
608 ".. method:: to_4d()\n"
609 "\n"
610 "   Return a 4d copy of the vector.\n"
611 "\n"
612 "   :return: a new vector\n"
613 "   :rtype: :class:`Vector`\n"
614 );
615 static PyObject *Vector_to_4d(VectorObject *self)
616 {
617         float tvec[4] = {0.0f, 0.0f, 0.0f, 1.0f};
618
619         if (BaseMath_ReadCallback(self) == -1)
620                 return NULL;
621
622         memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 4));
623         return Vector_CreatePyObject(tvec, 4, Py_NEW, Py_TYPE(self));
624 }
625
626 PyDoc_STRVAR(Vector_to_tuple_doc,
627 ".. method:: to_tuple(precision=-1)\n"
628 "\n"
629 "   Return this vector as a tuple with.\n"
630 "\n"
631 "   :arg precision: The number to round the value to in [-1, 21].\n"
632 "   :type precision: int\n"
633 "   :return: the values of the vector rounded by *precision*\n"
634 "   :rtype: tuple\n"
635 );
636 /* note: BaseMath_ReadCallback must be called beforehand */
637 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits)
638 {
639         PyObject *ret;
640         int i;
641
642         ret = PyTuple_New(self->size);
643
644         if (ndigits >= 0) {
645                 for (i = 0; i < self->size; i++) {
646                         PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(double_round((double)self->vec[i], ndigits)));
647                 }
648         }
649         else {
650                 for (i = 0; i < self->size; i++) {
651                         PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(self->vec[i]));
652                 }
653         }
654
655         return ret;
656 }
657
658 static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
659 {
660         int ndigits = 0;
661
662         if (!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits))
663                 return NULL;
664
665         if (ndigits > 22 || ndigits < 0) {
666                 PyErr_SetString(PyExc_ValueError,
667                                 "Vector.to_tuple(ndigits): "
668                                 "ndigits must be between 0 and 21");
669                 return NULL;
670         }
671
672         if (PyTuple_GET_SIZE(args) == 0)
673                 ndigits = -1;
674
675         if (BaseMath_ReadCallback(self) == -1)
676                 return NULL;
677
678         return Vector_to_tuple_ext(self, ndigits);
679 }
680
681 PyDoc_STRVAR(Vector_to_track_quat_doc,
682 ".. method:: to_track_quat(track, up)\n"
683 "\n"
684 "   Return a quaternion rotation from the vector and the track and up axis.\n"
685 "\n"
686 "   :arg track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].\n"
687 "   :type track: string\n"
688 "   :arg up: Up axis in ['X', 'Y', 'Z'].\n"
689 "   :type up: string\n"
690 "   :return: rotation from the vector and the track and up axis.\n"
691 "   :rtype: :class:`Quaternion`\n"
692 );
693 static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
694 {
695         float vec[3], quat[4];
696         const char *strack, *sup;
697         short track = 2, up = 1;
698
699         if (!PyArg_ParseTuple(args, "|ss:to_track_quat", &strack, &sup))
700                 return NULL;
701
702         if (self->size != 3) {
703                 PyErr_SetString(PyExc_TypeError,
704                                 "Vector.to_track_quat(): "
705                                 "only for 3D vectors");
706                 return NULL;
707         }
708
709         if (BaseMath_ReadCallback(self) == -1)
710                 return NULL;
711
712         if (strack) {
713                 const char *axis_err_msg = "only X, -X, Y, -Y, Z or -Z for track axis";
714
715                 if (strlen(strack) == 2) {
716                         if (strack[0] == '-') {
717                                 switch (strack[1]) {
718                                         case 'X':
719                                                 track = 3;
720                                                 break;
721                                         case 'Y':
722                                                 track = 4;
723                                                 break;
724                                         case 'Z':
725                                                 track = 5;
726                                                 break;
727                                         default:
728                                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
729                                                 return NULL;
730                                 }
731                         }
732                         else {
733                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
734                                 return NULL;
735                         }
736                 }
737                 else if (strlen(strack) == 1) {
738                         switch (strack[0]) {
739                         case '-':
740                         case 'X':
741                                 track = 0;
742                                 break;
743                         case 'Y':
744                                 track = 1;
745                                 break;
746                         case 'Z':
747                                 track = 2;
748                                 break;
749                         default:
750                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
751                                 return NULL;
752                         }
753                 }
754                 else {
755                         PyErr_SetString(PyExc_ValueError, axis_err_msg);
756                         return NULL;
757                 }
758         }
759
760         if (sup) {
761                 const char *axis_err_msg = "only X, Y or Z for up axis";
762                 if (strlen(sup) == 1) {
763                         switch (*sup) {
764                         case 'X':
765                                 up = 0;
766                                 break;
767                         case 'Y':
768                                 up = 1;
769                                 break;
770                         case 'Z':
771                                 up = 2;
772                                 break;
773                         default:
774                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
775                                 return NULL;
776                         }
777                 }
778                 else {
779                         PyErr_SetString(PyExc_ValueError, axis_err_msg);
780                         return NULL;
781                 }
782         }
783
784         if (track == up) {
785                 PyErr_SetString(PyExc_ValueError,
786                                 "Can't have the same axis for track and up");
787                 return NULL;
788         }
789
790         /*
791                 flip vector around, since vectoquat expect a vector from target to tracking object
792                 and the python function expects the inverse (a vector to the target).
793         */
794         negate_v3_v3(vec, self->vec);
795
796         vec_to_quat(quat, vec, track, up);
797
798         return Quaternion_CreatePyObject(quat, Py_NEW, NULL);
799 }
800
801 /*
802  * Vector.reflect(mirror): return a reflected vector on the mirror normal
803  *  vec - ((2 * DotVecs(vec, mirror)) * mirror)
804  */
805 PyDoc_STRVAR(Vector_reflect_doc,
806 ".. method:: reflect(mirror)\n"
807 "\n"
808 "   Return the reflection vector from the *mirror* argument.\n"
809 "\n"
810 "   :arg mirror: This vector could be a normal from the reflecting surface.\n"
811 "   :type mirror: :class:`Vector`\n"
812 "   :return: The reflected vector matching the size of this vector.\n"
813 "   :rtype: :class:`Vector`\n"
814 );
815 static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
816 {
817         int value_size;
818         float mirror[3], vec[3];
819         float reflect[3] = {0.0f};
820         float tvec[MAX_DIMENSIONS];
821
822         if (BaseMath_ReadCallback(self) == -1)
823                 return NULL;
824
825         if ((value_size = mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1)
826                 return NULL;
827
828         if (self->size < 2 || self->size > 4) {
829                 PyErr_SetString(PyExc_ValueError,
830                                 "Vector must be 2D, 3D or 4D");
831                 return NULL;
832         }
833
834         mirror[0] = tvec[0];
835         mirror[1] = tvec[1];
836         if (value_size > 2)             mirror[2] = tvec[2];
837         else                                    mirror[2] = 0.0;
838
839         vec[0] = self->vec[0];
840         vec[1] = self->vec[1];
841         if (self->size > 2)             vec[2] = self->vec[2];
842         else                                    vec[2] = 0.0;
843
844         normalize_v3(mirror);
845         reflect_v3_v3v3(reflect, vec, mirror);
846
847         return Vector_CreatePyObject(reflect, self->size, Py_NEW, Py_TYPE(self));
848 }
849
850 PyDoc_STRVAR(Vector_cross_doc,
851 ".. method:: cross(other)\n"
852 "\n"
853 "   Return the cross product of this vector and another.\n"
854 "\n"
855 "   :arg other: The other vector to perform the cross product with.\n"
856 "   :type other: :class:`Vector`\n"
857 "   :return: The cross product.\n"
858 "   :rtype: :class:`Vector`\n"
859 "\n"
860 "   .. note:: both vectors must be 3D\n"
861 );
862 static PyObject *Vector_cross(VectorObject *self, PyObject *value)
863 {
864         VectorObject *ret;
865         float tvec[MAX_DIMENSIONS];
866
867         if (BaseMath_ReadCallback(self) == -1)
868                 return NULL;
869
870         if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1)
871                 return NULL;
872
873         if (self->size != 3) {
874                 PyErr_SetString(PyExc_ValueError,
875                                 "Vector must be 3D");
876                 return NULL;
877         }
878
879         ret = (VectorObject *)Vector_CreatePyObject(NULL, 3, Py_NEW, Py_TYPE(self));
880         cross_v3_v3v3(ret->vec, self->vec, tvec);
881         return (PyObject *)ret;
882 }
883
884 PyDoc_STRVAR(Vector_dot_doc,
885 ".. method:: dot(other)\n"
886 "\n"
887 "   Return the dot product of this vector and another.\n"
888 "\n"
889 "   :arg other: The other vector to perform the dot product with.\n"
890 "   :type other: :class:`Vector`\n"
891 "   :return: The dot product.\n"
892 "   :rtype: :class:`Vector`\n"
893 );
894 static PyObject *Vector_dot(VectorObject *self, PyObject *value)
895 {
896         float *tvec;
897
898         if (BaseMath_ReadCallback(self) == -1)
899                 return NULL;
900
901         if (mathutils_array_parse_alloc(&tvec, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1) {
902                 goto cleanup;
903         }
904
905         return PyFloat_FromDouble(dot_vn_vn(self->vec, tvec, self->size));
906
907 cleanup:
908         PyMem_Free(tvec);
909         return NULL;
910 }
911
912 PyDoc_STRVAR(Vector_angle_doc,
913 ".. function:: angle(other, fallback)\n"
914 "\n"
915 "   Return the angle between two vectors.\n"
916 "\n"
917 "   :arg other: another vector to compare the angle with\n"
918 "   :type other: :class:`Vector`\n"
919 "   :arg fallback: return this value when the angle cant be calculated\n"
920 "      (zero length vector)\n"
921 "   :type fallback: any\n"
922 "   :return: angle in radians or fallback when given\n"
923 "   :rtype: float\n"
924 "\n"
925 "   .. note:: Zero length vectors raise an :exc:`AttributeError`.\n"
926 );
927 static PyObject *Vector_angle(VectorObject *self, PyObject *args)
928 {
929         const int size = MIN2(self->size, 3); /* 4D angle makes no sense */
930         float tvec[MAX_DIMENSIONS];
931         PyObject *value;
932         double dot = 0.0f, dot_self = 0.0f, dot_other = 0.0f;
933         int x;
934         PyObject *fallback = NULL;
935
936         if (!PyArg_ParseTuple(args, "O|O:angle", &value, &fallback))
937                 return NULL;
938
939         if (BaseMath_ReadCallback(self) == -1)
940                 return NULL;
941
942         /* don't use clamped size, rule of thumb is vector sizes must match,
943          * even though n this case 'w' is ignored */
944         if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.angle(other), invalid 'other' arg") == -1)
945                 return NULL;
946
947         if (self->size > 4) {
948                 PyErr_SetString(PyExc_ValueError,
949                                 "Vector must be 2D, 3D or 4D");
950                 return NULL;
951         }
952
953         for (x = 0; x < size; x++) {
954                 dot_self  += (double)self->vec[x] * (double)self->vec[x];
955                 dot_other += (double)tvec[x]      * (double)tvec[x];
956                 dot       += (double)self->vec[x] * (double)tvec[x];
957         }
958
959         if (!dot_self || !dot_other) {
960                 /* avoid exception */
961                 if (fallback) {
962                         Py_INCREF(fallback);
963                         return fallback;
964                 }
965                 else {
966                         PyErr_SetString(PyExc_ValueError,
967                                         "Vector.angle(other): "
968                                         "zero length vectors have no valid angle");
969                         return NULL;
970                 }
971         }
972
973         return PyFloat_FromDouble(saacos(dot / (sqrt(dot_self) * sqrt(dot_other))));
974 }
975
976 PyDoc_STRVAR(Vector_rotation_difference_doc,
977 ".. function:: rotation_difference(other)\n"
978 "\n"
979 "   Returns a quaternion representing the rotational difference between this\n"
980 "   vector and another.\n"
981 "\n"
982 "   :arg other: second vector.\n"
983 "   :type other: :class:`Vector`\n"
984 "   :return: the rotational difference between the two vectors.\n"
985 "   :rtype: :class:`Quaternion`\n"
986 "\n"
987 "   .. note:: 2D vectors raise an :exc:`AttributeError`.\n"
988 );
989 static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
990 {
991         float quat[4], vec_a[3], vec_b[3];
992
993         if (self->size < 3 || self->size > 4) {
994                 PyErr_SetString(PyExc_ValueError,
995                                 "vec.difference(value): "
996                                 "expects both vectors to be size 3 or 4");
997                 return NULL;
998         }
999
1000         if (BaseMath_ReadCallback(self) == -1)
1001                 return NULL;
1002
1003         if (mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1)
1004                 return NULL;
1005
1006         normalize_v3_v3(vec_a, self->vec);
1007         normalize_v3(vec_b);
1008
1009         rotation_between_vecs_to_quat(quat, vec_a, vec_b);
1010
1011         return Quaternion_CreatePyObject(quat, Py_NEW, NULL);
1012 }
1013
1014 PyDoc_STRVAR(Vector_project_doc,
1015 ".. function:: project(other)\n"
1016 "\n"
1017 "   Return the projection of this vector onto the *other*.\n"
1018 "\n"
1019 "   :arg other: second vector.\n"
1020 "   :type other: :class:`Vector`\n"
1021 "   :return: the parallel projection vector\n"
1022 "   :rtype: :class:`Vector`\n"
1023 );
1024 static PyObject *Vector_project(VectorObject *self, PyObject *value)
1025 {
1026         const int size = self->size;
1027         float tvec[MAX_DIMENSIONS];
1028         float vec[MAX_DIMENSIONS];
1029         double dot = 0.0f, dot2 = 0.0f;
1030         int x;
1031
1032         if (BaseMath_ReadCallback(self) == -1)
1033                 return NULL;
1034
1035         if (mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1)
1036                 return NULL;
1037
1038         if (self->size > 4) {
1039                 PyErr_SetString(PyExc_ValueError,
1040                                 "Vector must be 2D, 3D or 4D");
1041                 return NULL;
1042         }
1043
1044         if (BaseMath_ReadCallback(self) == -1)
1045                 return NULL;
1046
1047         //get dot products
1048         for (x = 0; x < size; x++) {
1049                 dot += (double)(self->vec[x] * tvec[x]);
1050                 dot2 += (double)(tvec[x] * tvec[x]);
1051         }
1052         //projection
1053         dot /= dot2;
1054         for (x = 0; x < size; x++) {
1055                 vec[x] = (float)dot * tvec[x];
1056         }
1057         return Vector_CreatePyObject(vec, size, Py_NEW, Py_TYPE(self));
1058 }
1059
1060 PyDoc_STRVAR(Vector_lerp_doc,
1061 ".. function:: lerp(other, factor)\n"
1062 "\n"
1063 "   Returns the interpolation of two vectors.\n"
1064 "\n"
1065 "   :arg other: value to interpolate with.\n"
1066 "   :type other: :class:`Vector`\n"
1067 "   :arg factor: The interpolation value in [0.0, 1.0].\n"
1068 "   :type factor: float\n"
1069 "   :return: The interpolated rotation.\n"
1070 "   :rtype: :class:`Vector`\n"
1071 );
1072 static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
1073 {
1074         const int size = self->size;
1075         PyObject *value = NULL;
1076         float fac, ifac;
1077         float *tvec, *vec;
1078         int x;
1079
1080         if (!PyArg_ParseTuple(args, "Of:lerp", &value, &fac))
1081                 return NULL;
1082
1083         if (mathutils_array_parse_alloc(&tvec, size, value, "Vector.lerp(other), invalid 'other' arg") == -1) {
1084                 goto cleanup;
1085         }
1086
1087         if (BaseMath_ReadCallback(self) == -1) {
1088                 goto cleanup;
1089         }
1090
1091         vec = PyMem_Malloc(size * sizeof(float));
1092         if (vec == NULL) {
1093                 PyErr_SetString(PyExc_MemoryError,
1094                                 "Vector.lerp(): "
1095                                 "problem allocating pointer space");
1096                 return NULL;
1097         }
1098
1099         ifac = 1.0f - fac;
1100
1101         for (x = 0; x < size; x++) {
1102                 vec[x] = (ifac * self->vec[x]) + (fac * tvec[x]);
1103         }
1104
1105         PyMem_Free(tvec);
1106
1107         return Vector_CreatePyObject_alloc(vec, size, Py_TYPE(self));
1108
1109 cleanup:
1110         PyMem_Free(tvec);
1111         return NULL;
1112 }
1113
1114 PyDoc_STRVAR(Vector_rotate_doc,
1115 ".. function:: rotate(other)\n"
1116 "\n"
1117 "   Return vector by a rotation value.\n"
1118 "\n"
1119 "   :arg other: rotation component of mathutils value\n"
1120 "   :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
1121 );
1122 static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
1123 {
1124         float other_rmat[3][3];
1125
1126         if (BaseMath_ReadCallback(self) == -1)
1127                 return NULL;
1128
1129         if (mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1)
1130                 return NULL;
1131
1132         if (self->size < 3 || self->size > 4) {
1133                 PyErr_SetString(PyExc_ValueError,
1134                                 "Vector must be 3D or 4D");
1135                 return NULL;
1136         }
1137
1138         mul_m3_v3(other_rmat, self->vec);
1139
1140         (void)BaseMath_WriteCallback(self);
1141         Py_RETURN_NONE;
1142 }
1143
1144 PyDoc_STRVAR(Vector_copy_doc,
1145 ".. function:: copy()\n"
1146 "\n"
1147 "   Returns a copy of this vector.\n"
1148 "\n"
1149 "   :return: A copy of the vector.\n"
1150 "   :rtype: :class:`Vector`\n"
1151 "\n"
1152 "   .. note:: use this to get a copy of a wrapped vector with\n"
1153 "      no reference to the original data.\n"
1154 );
1155 static PyObject *Vector_copy(VectorObject *self)
1156 {
1157         if (BaseMath_ReadCallback(self) == -1)
1158                 return NULL;
1159
1160         return Vector_CreatePyObject(self->vec, self->size, Py_NEW, Py_TYPE(self));
1161 }
1162
1163 static PyObject *Vector_repr(VectorObject *self)
1164 {
1165         PyObject *ret, *tuple;
1166
1167         if (BaseMath_ReadCallback(self) == -1)
1168                 return NULL;
1169
1170         tuple = Vector_to_tuple_ext(self, -1);
1171         ret = PyUnicode_FromFormat("Vector(%R)", tuple);
1172         Py_DECREF(tuple);
1173         return ret;
1174 }
1175
1176 static PyObject *Vector_str(VectorObject *self)
1177 {
1178         int i;
1179
1180         DynStr *ds;
1181
1182         if (BaseMath_ReadCallback(self) == -1)
1183                 return NULL;
1184
1185         ds = BLI_dynstr_new();
1186
1187         BLI_dynstr_append(ds, "<Vector (");
1188
1189         for (i = 0; i < self->size; i++) {
1190                 BLI_dynstr_appendf(ds, i ? ", %.4f" : "%.4f", self->vec[i]);
1191         }
1192
1193         BLI_dynstr_append(ds, ")>");
1194
1195         return mathutils_dynstr_to_py(ds); /* frees ds */
1196 }
1197
1198
1199 /* Sequence Protocol */
1200 /* sequence length len(vector) */
1201 static int Vector_len(VectorObject *self)
1202 {
1203         return self->size;
1204 }
1205 /* sequence accessor (get): vector[index] */
1206 static PyObject *vector_item_internal(VectorObject *self, int i, const int is_attr)
1207 {
1208         if (i < 0)      i = self->size-i;
1209
1210         if (i < 0 || i >= self->size) {
1211                 if (is_attr)    {
1212                         PyErr_Format(PyExc_AttributeError,
1213                                      "Vector.%c: unavailable on %dd vector",
1214                                      *(((char *)"xyzw") + i), self->size);
1215                 }
1216                 else {
1217                         PyErr_SetString(PyExc_IndexError,
1218                                         "vector[index]: out of range");
1219                 }
1220                 return NULL;
1221         }
1222
1223         if (BaseMath_ReadIndexCallback(self, i) == -1)
1224                 return NULL;
1225
1226         return PyFloat_FromDouble(self->vec[i]);
1227 }
1228
1229 static PyObject *Vector_item(VectorObject *self, int i)
1230 {
1231         return vector_item_internal(self, i, FALSE);
1232 }
1233 /* sequence accessor (set): vector[index] = value */
1234 static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, const int is_attr)
1235 {
1236         float scalar;
1237         if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
1238                 PyErr_SetString(PyExc_TypeError,
1239                                 "vector[index] = x: "
1240                                 "index argument not a number");
1241                 return -1;
1242         }
1243
1244         if (i < 0)      i = self->size-i;
1245
1246         if (i < 0 || i >= self->size) {
1247                 if (is_attr) {
1248                         PyErr_Format(PyExc_AttributeError,
1249                                      "Vector.%c = x: unavailable on %dd vector",
1250                                      *(((char *)"xyzw") + i), self->size);
1251                 }
1252                 else {
1253                         PyErr_SetString(PyExc_IndexError,
1254                                         "vector[index] = x: "
1255                                         "assignment index out of range");
1256                 }
1257                 return -1;
1258         }
1259         self->vec[i] = scalar;
1260
1261         if (BaseMath_WriteIndexCallback(self, i) == -1)
1262                 return -1;
1263         return 0;
1264 }
1265
1266 static int Vector_ass_item(VectorObject *self, int i, PyObject *value)
1267 {
1268         return vector_ass_item_internal(self, i, value, FALSE);
1269 }
1270
1271 /* sequence slice (get): vector[a:b] */
1272 static PyObject *Vector_slice(VectorObject *self, int begin, int end)
1273 {
1274         PyObject *tuple;
1275         int count;
1276
1277         if (BaseMath_ReadCallback(self) == -1)
1278                 return NULL;
1279
1280         CLAMP(begin, 0, self->size);
1281         if (end < 0) end = self->size + end + 1;
1282         CLAMP(end, 0, self->size);
1283         begin = MIN2(begin, end);
1284
1285         tuple = PyTuple_New(end - begin);
1286         for (count = begin; count < end; count++) {
1287                 PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(self->vec[count]));
1288         }
1289
1290         return tuple;
1291 }
1292 /* sequence slice (set): vector[a:b] = value */
1293 static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *seq)
1294 {
1295         int size = 0;
1296         float *vec = NULL;
1297
1298         if (BaseMath_ReadCallback(self) == -1)
1299                 return -1;
1300
1301         CLAMP(begin, 0, self->size);
1302         CLAMP(end, 0, self->size);
1303         begin = MIN2(begin, end);
1304
1305         size = (end - begin);
1306         if (mathutils_array_parse_alloc(&vec, size, seq, "vector[begin:end] = [...]") == -1) {
1307                 goto cleanup;
1308         }
1309
1310         if (vec == NULL) {
1311                 PyErr_SetString(PyExc_MemoryError,
1312                                                 "vec[:] = seq: "
1313                                 "problem allocating pointer space");
1314                 return -1;
1315         }
1316
1317         /*parsed well - now set in vector*/
1318         memcpy(self->vec + begin, vec, size * sizeof(float));
1319
1320         if (BaseMath_WriteCallback(self) == -1)
1321                 return -1;
1322
1323         PyMem_Free(vec);
1324
1325         return 0;
1326
1327 cleanup:
1328         PyMem_Free(vec);
1329         return -1;
1330 }
1331
1332 /* Numeric Protocols */
1333 /* addition: obj + obj */
1334 static PyObject *Vector_add(PyObject *v1, PyObject *v2)
1335 {
1336         VectorObject *vec1 = NULL, *vec2 = NULL;
1337         float *vec = NULL;
1338
1339         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1340                 PyErr_Format(PyExc_AttributeError,
1341                              "Vector addition: (%s + %s) "
1342                              "invalid type for this operation",
1343                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1344                 return NULL;
1345         }
1346         vec1 = (VectorObject*)v1;
1347         vec2 = (VectorObject*)v2;
1348
1349         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1350                 return NULL;
1351
1352         /*VECTOR + VECTOR*/
1353         if (vec1->size != vec2->size) {
1354                 PyErr_SetString(PyExc_AttributeError,
1355                                 "Vector addition: "
1356                                 "vectors must have the same dimensions for this operation");
1357                 return NULL;
1358         }
1359
1360         vec = PyMem_Malloc(vec1->size * sizeof(float));
1361
1362         if (vec == NULL) { /*allocation failure*/
1363                 PyErr_SetString(PyExc_MemoryError,
1364                                 "Vector(): "
1365                                 "problem allocating pointer space");
1366                 return NULL;
1367         }
1368
1369         add_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
1370
1371         return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
1372 }
1373
1374 /* addition in-place: obj += obj */
1375 static PyObject *Vector_iadd(PyObject *v1, PyObject *v2)
1376 {
1377         VectorObject *vec1 = NULL, *vec2 = NULL;
1378
1379         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1380                 PyErr_Format(PyExc_AttributeError,
1381                              "Vector addition: (%s += %s) "
1382                              "invalid type for this operation",
1383                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1384                 return NULL;
1385         }
1386         vec1 = (VectorObject*)v1;
1387         vec2 = (VectorObject*)v2;
1388
1389         if (vec1->size != vec2->size) {
1390                 PyErr_SetString(PyExc_AttributeError,
1391                                 "Vector addition: "
1392                                 "vectors must have the same dimensions for this operation");
1393                 return NULL;
1394         }
1395
1396         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1397                 return NULL;
1398
1399         add_vn_vn(vec1->vec, vec2->vec, vec1->size);
1400
1401         (void)BaseMath_WriteCallback(vec1);
1402         Py_INCREF(v1);
1403         return v1;
1404 }
1405
1406 /* subtraction: obj - obj */
1407 static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
1408 {
1409         VectorObject *vec1 = NULL, *vec2 = NULL;
1410         float *vec;
1411
1412         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1413                 PyErr_Format(PyExc_AttributeError,
1414                              "Vector subtraction: (%s - %s) "
1415                              "invalid type for this operation",
1416                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1417                 return NULL;
1418         }
1419         vec1 = (VectorObject*)v1;
1420         vec2 = (VectorObject*)v2;
1421
1422         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1423                 return NULL;
1424
1425         if (vec1->size != vec2->size) {
1426                 PyErr_SetString(PyExc_AttributeError,
1427                                 "Vector subtraction: "
1428                                 "vectors must have the same dimensions for this operation");
1429                 return NULL;
1430         }
1431
1432         vec = PyMem_Malloc(vec1->size * sizeof(float));
1433
1434         if (vec == NULL) { /*allocation failure*/
1435                 PyErr_SetString(PyExc_MemoryError,
1436                                 "Vector(): "
1437                                 "problem allocating pointer space");
1438                 return NULL;
1439         }
1440
1441         sub_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
1442
1443         return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
1444 }
1445
1446 /* subtraction in-place: obj -= obj */
1447 static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
1448 {
1449         VectorObject *vec1 = NULL, *vec2 = NULL;
1450
1451         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1452                 PyErr_Format(PyExc_AttributeError,
1453                              "Vector subtraction: (%s -= %s) "
1454                              "invalid type for this operation",
1455                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1456                 return NULL;
1457         }
1458         vec1 = (VectorObject*)v1;
1459         vec2 = (VectorObject*)v2;
1460
1461         if (vec1->size != vec2->size) {
1462                 PyErr_SetString(PyExc_AttributeError,
1463                                 "Vector subtraction: "
1464                                 "vectors must have the same dimensions for this operation");
1465                 return NULL;
1466         }
1467
1468         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1469                 return NULL;
1470
1471         sub_vn_vn(vec1->vec, vec2->vec, vec1->size);
1472
1473         (void)BaseMath_WriteCallback(vec1);
1474         Py_INCREF(v1);
1475         return v1;
1476 }
1477
1478 /*------------------------obj * obj------------------------------
1479   mulplication*/
1480
1481
1482 /* COLUMN VECTOR Multiplication (Matrix X Vector)
1483  * [1][4][7]   [a]
1484  * [2][5][8] * [b]
1485  * [3][6][9]   [c]
1486  *
1487  * note: vector/matrix multiplication IS NOT COMMUTATIVE!!!!
1488  * note: assume read callbacks have been done first.
1489  */
1490 int column_vector_multiplication(float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
1491 {
1492         float vec_cpy[MAX_DIMENSIONS];
1493         int row, col, z = 0;
1494
1495         if (mat->num_col != vec->size) {
1496                 if (mat->num_col == 4 && vec->size == 3) {
1497                         vec_cpy[3] = 1.0f;
1498                 }
1499                 else {
1500                         PyErr_SetString(PyExc_ValueError,
1501                                         "matrix * vector: "
1502                                                         "len(matrix.col) and len(vector) must be the same, "
1503                                         "except for 4x4 matrix * 3D vector.");
1504                         return -1;
1505                 }
1506         }
1507
1508         memcpy(vec_cpy, vec->vec, vec->size * sizeof(float));
1509
1510         r_vec[3] = 1.0f;
1511
1512         for (row = 0; row < mat->num_row; row++) {
1513                 double dot = 0.0f;
1514                 for (col = 0; col < mat->num_col; col++) {
1515                         dot += (double)(MATRIX_ITEM(mat, row, col) * vec_cpy[col]);
1516                 }
1517                 r_vec[z++] = (float)dot;
1518         }
1519
1520         return 0;
1521 }
1522
1523 static PyObject *vector_mul_float(VectorObject *vec, const float scalar)
1524 {
1525         float *tvec = PyMem_Malloc(vec->size * sizeof(float));
1526
1527         if (tvec == NULL) { /*allocation failure*/
1528                 PyErr_SetString(PyExc_MemoryError,
1529                                 "vec * float: "
1530                                 "problem allocating pointer space");
1531                 return NULL;
1532         }
1533
1534         mul_vn_vn_fl(tvec, vec->vec, vec->size, scalar);
1535         return Vector_CreatePyObject_alloc(tvec, vec->size, Py_TYPE(vec));
1536 }
1537
1538 static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
1539 {
1540         VectorObject *vec1 = NULL, *vec2 = NULL;
1541         float scalar;
1542         int vec_size;
1543
1544         if VectorObject_Check(v1) {
1545                 vec1 = (VectorObject *)v1;
1546                 if (BaseMath_ReadCallback(vec1) == -1)
1547                         return NULL;
1548         }
1549         if VectorObject_Check(v2) {
1550                 vec2 = (VectorObject *)v2;
1551                 if (BaseMath_ReadCallback(vec2) == -1)
1552                         return NULL;
1553         }
1554
1555
1556         /* make sure v1 is always the vector */
1557         if (vec1 && vec2) {
1558                 if (vec1->size != vec2->size) {
1559                         PyErr_SetString(PyExc_ValueError,
1560                                         "Vector multiplication: "
1561                                         "vectors must have the same dimensions for this operation");
1562                         return NULL;
1563                 }
1564
1565                 /*dot product*/
1566                 return PyFloat_FromDouble(dot_vn_vn(vec1->vec, vec2->vec, vec1->size));
1567         }
1568         else if (vec1) {
1569                 if (MatrixObject_Check(v2)) {
1570                         /* VEC * MATRIX */
1571                         float tvec[MAX_DIMENSIONS];
1572
1573                         if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
1574                                 return NULL;
1575                         if (row_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) {
1576                                 return NULL;
1577                         }
1578
1579                         if (((MatrixObject *)v2)->num_row == 4 && vec1->size == 3) {
1580                                 vec_size = 3;
1581                         }
1582                         else {
1583                                 vec_size = ((MatrixObject *)v2)->num_col;
1584                         }
1585
1586                         return Vector_CreatePyObject(tvec, vec_size, Py_NEW, Py_TYPE(vec1));
1587                 }
1588                 else if (QuaternionObject_Check(v2)) {
1589                         /* VEC * QUAT */
1590 /* ------ to be removed ------*/
1591 #if 1
1592                         PyErr_SetString(PyExc_ValueError,
1593                                         "(Vector * Quat) is now removed, reverse the "
1594                                         "order (promoted to an Error for Debug builds)");
1595                         return NULL;
1596 #else
1597                         QuaternionObject *quat2 = (QuaternionObject*)v2;
1598                         float tvec[3];
1599
1600                         if (vec1->size != 3) {
1601                                 PyErr_SetString(PyExc_ValueError,
1602                                                 "Vector multiplication: "
1603                                                 "only 3D vector rotations (with quats) currently supported");
1604                                 return NULL;
1605                         }
1606                         if (BaseMath_ReadCallback(quat2) == -1) {
1607                                 return NULL;
1608                         }
1609
1610                         copy_v3_v3(tvec, vec1->vec);
1611                         mul_qt_v3(quat2->quat, tvec);
1612                         return Vector_CreatePyObject(tvec, 3, Py_NEW, Py_TYPE(vec1));
1613 #endif
1614 /* ------ to be removed ------*/
1615                 }
1616                 else if (((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) == 0) { /* VEC * FLOAT */
1617                         return vector_mul_float(vec1, scalar);
1618                 }
1619         }
1620         else if (vec2) {
1621                 if (((scalar = PyFloat_AsDouble(v1)) == -1.0f && PyErr_Occurred()) == 0) { /* FLOAT * VEC */
1622                         return vector_mul_float(vec2, scalar);
1623                 }
1624         }
1625         else {
1626                 BLI_assert(!"internal error");
1627         }
1628
1629         PyErr_Format(PyExc_TypeError,
1630                      "Vector multiplication: "
1631                      "not supported between '%.200s' and '%.200s' types",
1632                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1633         return NULL;
1634 }
1635
1636 /* mulplication in-place: obj *= obj */
1637 static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
1638 {
1639         VectorObject *vec = (VectorObject *)v1;
1640         float scalar;
1641
1642         if (BaseMath_ReadCallback(vec) == -1)
1643                 return NULL;
1644
1645         /* only support vec*=float and vec*=mat
1646            vec*=vec result is a float so that wont work */
1647         if (MatrixObject_Check(v2)) {
1648 /* ------ to be removed ------*/
1649 #if 1
1650                 PyErr_SetString(PyExc_ValueError,
1651                                                 "(Vector *= Matrix) is now removed, reverse the "
1652                                                 "order (promoted to an Error for Debug builds) "
1653                                                 "and uses the non in-place multiplication.");
1654                 return NULL;
1655 #else
1656                 float rvec[MAX_DIMENSIONS];
1657                 if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
1658                         return NULL;
1659
1660                 if (column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
1661                         return NULL;
1662
1663                 memcpy(vec->vec, rvec, sizeof(float) * vec->size);
1664 #endif
1665 /* ------ to be removed ------*/
1666         }
1667         else if (QuaternionObject_Check(v2)) {
1668                 /* VEC *= QUAT */
1669
1670 /* ------ to be removed ------*/
1671 #if 1
1672                 PyErr_SetString(PyExc_ValueError,
1673                                                 "(Vector *= Quat) is now removed, reverse the "
1674                                                 "order (promoted to an Error for Debug builds) "
1675                                                 "and uses the non in-place multiplication.");
1676                 return NULL;
1677 #else
1678                 QuaternionObject *quat2 = (QuaternionObject*)v2;
1679
1680                 if (vec->size != 3) {
1681                         PyErr_SetString(PyExc_ValueError,
1682                                         "Vector multiplication: "
1683                                         "only 3D vector rotations (with quats) currently supported");
1684                         return NULL;
1685                 }
1686
1687                 if (BaseMath_ReadCallback(quat2) == -1) {
1688                         return NULL;
1689                 }
1690
1691                 mul_qt_v3(quat2->quat, vec->vec);
1692 #endif
1693 /* ------ to be removed ------*/
1694         }
1695         else if (((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) == 0) { /* VEC *= FLOAT */
1696                 mul_vn_fl(vec->vec, vec->size, scalar);
1697         }
1698         else {
1699                 PyErr_Format(PyExc_TypeError,
1700                              "Vector multiplication: (%s *= %s) "
1701                              "invalid type for this operation",
1702                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1703                 return NULL;
1704         }
1705
1706         (void)BaseMath_WriteCallback(vec);
1707         Py_INCREF(v1);
1708         return v1;
1709 }
1710
1711 /* divid: obj / obj */
1712 static PyObject *Vector_div(PyObject *v1, PyObject *v2)
1713 {
1714         float *vec = NULL, scalar;
1715         VectorObject *vec1 = NULL;
1716
1717         if (!VectorObject_Check(v1)) { /* not a vector */
1718                 PyErr_SetString(PyExc_TypeError,
1719                                 "Vector division: "
1720                                 "Vector must be divided by a float");
1721                 return NULL;
1722         }
1723         vec1 = (VectorObject *)v1; /* vector */
1724
1725         if (BaseMath_ReadCallback(vec1) == -1)
1726                 return NULL;
1727
1728         if ((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
1729                 PyErr_SetString(PyExc_TypeError,
1730                                 "Vector division: "
1731                                 "Vector must be divided by a float");
1732                 return NULL;
1733         }
1734
1735         if (scalar == 0.0f) {
1736                 PyErr_SetString(PyExc_ZeroDivisionError,
1737                                 "Vector division: "
1738                                 "divide by zero error");
1739                 return NULL;
1740         }
1741
1742         vec = PyMem_Malloc(vec1->size * sizeof(float));
1743
1744         if (vec == NULL) { /*allocation failure*/
1745                 PyErr_SetString(PyExc_MemoryError,
1746                                 "vec / value: "
1747                                 "problem allocating pointer space");
1748                 return NULL;
1749         }
1750
1751         mul_vn_vn_fl(vec, vec1->vec, vec1->size, 1.0f / scalar);
1752
1753         return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
1754 }
1755
1756 /* divide in-place: obj /= obj */
1757 static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
1758 {
1759         float scalar;
1760         VectorObject *vec1 = (VectorObject*)v1;
1761
1762         if (BaseMath_ReadCallback(vec1) == -1)
1763                 return NULL;
1764
1765         if ((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
1766                 PyErr_SetString(PyExc_TypeError,
1767                                 "Vector division: "
1768                                 "Vector must be divided by a float");
1769                 return NULL;
1770         }
1771
1772         if (scalar == 0.0f) {
1773                 PyErr_SetString(PyExc_ZeroDivisionError,
1774                                 "Vector division: "
1775                                 "divide by zero error");
1776                 return NULL;
1777         }
1778
1779         mul_vn_fl(vec1->vec, vec1->size, 1.0f / scalar);
1780
1781         (void)BaseMath_WriteCallback(vec1);
1782
1783         Py_INCREF(v1);
1784         return v1;
1785 }
1786
1787 /* -obj
1788   returns the negative of this object*/
1789 static PyObject *Vector_neg(VectorObject *self)
1790 {
1791         float *tvec;
1792
1793         if (BaseMath_ReadCallback(self) == -1)
1794                 return NULL;
1795
1796         tvec = PyMem_Malloc(self->size * sizeof(float));
1797         negate_vn_vn(tvec, self->vec, self->size);
1798         return Vector_CreatePyObject_alloc(tvec, self->size, Py_TYPE(self));
1799 }
1800
1801 /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */
1802 static double vec_magnitude_nosqrt(float *data, int size)
1803 {
1804         /*return (double)sqrt(dot);*/
1805         /* warning, line above removed because we are not using the length,
1806            rather the comparing the sizes and for this we do not need the sqrt
1807            for the actual length, the dot must be sqrt'd */
1808         return dot_vn_vn(data, data, size);
1809 }
1810
1811
1812 /*------------------------tp_richcmpr
1813   returns -1 execption, 0 false, 1 true */
1814 static PyObject *Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
1815 {
1816         VectorObject *vecA = NULL, *vecB = NULL;
1817         int result = 0;
1818         double epsilon = .000001f;
1819         double lenA, lenB;
1820
1821         if (!VectorObject_Check(objectA) || !VectorObject_Check(objectB)) {
1822                 if (comparison_type == Py_NE) {
1823                         Py_RETURN_TRUE;
1824                 }
1825                 else {
1826                         Py_RETURN_FALSE;
1827                 }
1828         }
1829         vecA = (VectorObject*)objectA;
1830         vecB = (VectorObject*)objectB;
1831
1832         if (BaseMath_ReadCallback(vecA) == -1 || BaseMath_ReadCallback(vecB) == -1)
1833                 return NULL;
1834
1835         if (vecA->size != vecB->size) {
1836                 if (comparison_type == Py_NE) {
1837                         Py_RETURN_TRUE;
1838                 }
1839                 else {
1840                         Py_RETURN_FALSE;
1841                 }
1842         }
1843
1844         switch (comparison_type) {
1845                 case Py_LT:
1846                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1847                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1848                         if (lenA < lenB) {
1849                                 result = 1;
1850                         }
1851                         break;
1852                 case Py_LE:
1853                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1854                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1855                         if (lenA < lenB) {
1856                                 result = 1;
1857                         }
1858                         else {
1859                                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
1860                         }
1861                         break;
1862                 case Py_EQ:
1863                         result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
1864                         break;
1865                 case Py_NE:
1866                         result = !EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
1867                         break;
1868                 case Py_GT:
1869                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1870                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1871                         if (lenA > lenB) {
1872                                 result = 1;
1873                         }
1874                         break;
1875                 case Py_GE:
1876                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1877                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1878                         if (lenA > lenB) {
1879                                 result = 1;
1880                         }
1881                         else {
1882                                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
1883                         }
1884                         break;
1885                 default:
1886                         printf("The result of the comparison could not be evaluated");
1887                         break;
1888         }
1889         if (result == 1) {
1890                 Py_RETURN_TRUE;
1891         }
1892         else {
1893                 Py_RETURN_FALSE;
1894         }
1895 }
1896
1897 /*-----------------PROTCOL DECLARATIONS--------------------------*/
1898 static PySequenceMethods Vector_SeqMethods = {
1899         (lenfunc) Vector_len,                           /* sq_length */
1900         (binaryfunc) NULL,                                      /* sq_concat */
1901         (ssizeargfunc) NULL,                            /* sq_repeat */
1902         (ssizeargfunc) Vector_item,                     /* sq_item */
1903         NULL,                                                           /* py3 deprecated slice func */
1904         (ssizeobjargproc) Vector_ass_item,      /* sq_ass_item */
1905         NULL,                                                           /* py3 deprecated slice assign func */
1906         (objobjproc) NULL,                                      /* sq_contains */
1907         (binaryfunc) NULL,                                      /* sq_inplace_concat */
1908         (ssizeargfunc) NULL,                            /* sq_inplace_repeat */
1909 };
1910
1911 static PyObject *Vector_subscript(VectorObject *self, PyObject *item)
1912 {
1913         if (PyIndex_Check(item)) {
1914                 Py_ssize_t i;
1915                 i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1916                 if (i == -1 && PyErr_Occurred())
1917                         return NULL;
1918                 if (i < 0)
1919                         i += self->size;
1920                 return Vector_item(self, i);
1921         }
1922         else if (PySlice_Check(item)) {
1923                 Py_ssize_t start, stop, step, slicelength;
1924
1925                 if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
1926                         return NULL;
1927
1928                 if (slicelength <= 0) {
1929                         return PyTuple_New(0);
1930                 }
1931                 else if (step == 1) {
1932                         return Vector_slice(self, start, stop);
1933                 }
1934                 else {
1935                         PyErr_SetString(PyExc_IndexError,
1936                                         "slice steps not supported with vectors");
1937                         return NULL;
1938                 }
1939         }
1940         else {
1941                 PyErr_Format(PyExc_TypeError,
1942                              "vector indices must be integers, not %.200s",
1943                              Py_TYPE(item)->tp_name);
1944                 return NULL;
1945         }
1946 }
1947
1948 static int Vector_ass_subscript(VectorObject *self, PyObject *item, PyObject *value)
1949 {
1950         if (PyIndex_Check(item)) {
1951                 Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1952                 if (i == -1 && PyErr_Occurred())
1953                         return -1;
1954                 if (i < 0)
1955                         i += self->size;
1956                 return Vector_ass_item(self, i, value);
1957         }
1958         else if (PySlice_Check(item)) {
1959                 Py_ssize_t start, stop, step, slicelength;
1960
1961                 if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
1962                         return -1;
1963
1964                 if (step == 1)
1965                         return Vector_ass_slice(self, start, stop, value);
1966                 else {
1967                         PyErr_SetString(PyExc_IndexError,
1968                                         "slice steps not supported with vectors");
1969                         return -1;
1970                 }
1971         }
1972         else {
1973                 PyErr_Format(PyExc_TypeError,
1974                              "vector indices must be integers, not %.200s",
1975                              Py_TYPE(item)->tp_name);
1976                 return -1;
1977         }
1978 }
1979
1980 static PyMappingMethods Vector_AsMapping = {
1981         (lenfunc)Vector_len,
1982         (binaryfunc)Vector_subscript,
1983         (objobjargproc)Vector_ass_subscript
1984 };
1985
1986
1987 static PyNumberMethods Vector_NumMethods = {
1988         (binaryfunc)    Vector_add,     /*nb_add*/
1989         (binaryfunc)    Vector_sub,     /*nb_subtract*/
1990         (binaryfunc)    Vector_mul,     /*nb_multiply*/
1991         NULL,                                                   /*nb_remainder*/
1992         NULL,                                                   /*nb_divmod*/
1993         NULL,                                                   /*nb_power*/
1994         (unaryfunc)     Vector_neg,     /*nb_negative*/
1995         (unaryfunc)     NULL,   /*tp_positive*/
1996         (unaryfunc)     NULL,   /*tp_absolute*/
1997         (inquiry)       NULL,   /*tp_bool*/
1998         (unaryfunc)     NULL,   /*nb_invert*/
1999         NULL,                           /*nb_lshift*/
2000         (binaryfunc)NULL,       /*nb_rshift*/
2001         NULL,                           /*nb_and*/
2002         NULL,                           /*nb_xor*/
2003         NULL,                           /*nb_or*/
2004         NULL,                           /*nb_int*/
2005         NULL,                           /*nb_reserved*/
2006         NULL,                           /*nb_float*/
2007         Vector_iadd,    /* nb_inplace_add */
2008         Vector_isub,    /* nb_inplace_subtract */
2009         Vector_imul,    /* nb_inplace_multiply */
2010         NULL,                           /* nb_inplace_remainder */
2011         NULL,                           /* nb_inplace_power */
2012         NULL,                           /* nb_inplace_lshift */
2013         NULL,                           /* nb_inplace_rshift */
2014         NULL,                           /* nb_inplace_and */
2015         NULL,                           /* nb_inplace_xor */
2016         NULL,                           /* nb_inplace_or */
2017         NULL,                           /* nb_floor_divide */
2018         Vector_div,             /* nb_true_divide */
2019         NULL,                           /* nb_inplace_floor_divide */
2020         Vector_idiv,    /* nb_inplace_true_divide */
2021         NULL,                   /* nb_index */
2022 };
2023
2024 /*------------------PY_OBECT DEFINITION--------------------------*/
2025
2026 /* vector axis, vector.x/y/z/w */
2027
2028 PyDoc_STRVAR(Vector_axis_x_doc, "Vector X axis.\n\n:type: float");
2029 PyDoc_STRVAR(Vector_axis_y_doc, "Vector Y axis.\n\n:type: float");
2030 PyDoc_STRVAR(Vector_axis_z_doc, "Vector Z axis (3D Vectors only).\n\n:type: float");
2031 PyDoc_STRVAR(Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n\n:type: float");
2032
2033 static PyObject *Vector_axis_get(VectorObject *self, void *type)
2034 {
2035         return vector_item_internal(self, GET_INT_FROM_POINTER(type), TRUE);
2036 }
2037
2038 static int Vector_axis_set(VectorObject *self, PyObject *value, void *type)
2039 {
2040         return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, TRUE);
2041 }
2042
2043 /* vector.length */
2044
2045 PyDoc_STRVAR(Vector_length_doc,
2046 "Vector Length.\n\n:type: float"
2047 );
2048 static PyObject *Vector_length_get(VectorObject *self, void *UNUSED(closure))
2049 {
2050         if (BaseMath_ReadCallback(self) == -1)
2051                 return NULL;
2052
2053         return PyFloat_FromDouble(sqrt(dot_vn_vn(self->vec, self->vec, self->size)));
2054 }
2055
2056 static int Vector_length_set(VectorObject *self, PyObject *value)
2057 {
2058         double dot = 0.0f, param;
2059
2060         if (BaseMath_ReadCallback(self) == -1)
2061                 return -1;
2062
2063         if ((param = PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred()) {
2064                 PyErr_SetString(PyExc_TypeError,
2065                                 "length must be set to a number");
2066                 return -1;
2067         }
2068
2069         if (param < 0.0) {
2070                 PyErr_SetString(PyExc_ValueError,
2071                                 "cannot set a vectors length to a negative value");
2072                 return -1;
2073         }
2074         if (param == 0.0) {
2075                 fill_vn_fl(self->vec, self->size, 0.0f);
2076                 return 0;
2077         }
2078
2079         dot = dot_vn_vn(self->vec, self->vec, self->size);
2080
2081         if (!dot) /* cant sqrt zero */
2082                 return 0;
2083
2084         dot = sqrt(dot);
2085
2086         if (dot == param)
2087                 return 0;
2088
2089         dot = dot / param;
2090
2091         mul_vn_fl(self->vec, self->size, 1.0 / dot);
2092
2093         (void)BaseMath_WriteCallback(self); /* checked already */
2094
2095         return 0;
2096 }
2097
2098 /* vector.length_squared */
2099 PyDoc_STRVAR(Vector_length_squared_doc,
2100 "Vector length squared (v.dot(v)).\n\n:type: float"
2101 );
2102 static PyObject *Vector_length_squared_get(VectorObject *self, void *UNUSED(closure))
2103 {
2104         if (BaseMath_ReadCallback(self) == -1)
2105                 return NULL;
2106
2107         return PyFloat_FromDouble(dot_vn_vn(self->vec, self->vec, self->size));
2108 }
2109
2110 /* Get a new Vector according to the provided swizzle. This function has little
2111  * error checking, as we are in control of the inputs: the closure is set by us
2112  * in Vector_createSwizzleGetSeter. */
2113 static PyObject *Vector_swizzle_get(VectorObject *self, void *closure)
2114 {
2115         size_t axis_to;
2116         size_t axis_from;
2117         float vec[MAX_DIMENSIONS];
2118         unsigned int swizzleClosure;
2119
2120         if (BaseMath_ReadCallback(self) == -1)
2121                 return NULL;
2122
2123         /* Unpack the axes from the closure into an array. */
2124         axis_to = 0;
2125         swizzleClosure = GET_INT_FROM_POINTER(closure);
2126         while (swizzleClosure & SWIZZLE_VALID_AXIS) {
2127                 axis_from = swizzleClosure & SWIZZLE_AXIS;
2128                 if (axis_from >= self->size) {
2129                         PyErr_SetString(PyExc_AttributeError,
2130                                         "Vector swizzle: "
2131                                         "specified axis not present");
2132                         return NULL;
2133                 }
2134
2135                 vec[axis_to] = self->vec[axis_from];
2136                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
2137                 axis_to++;
2138         }
2139
2140         return Vector_CreatePyObject(vec, axis_to, Py_NEW, Py_TYPE(self));
2141 }
2142
2143 /* Set the items of this vector using a swizzle.
2144  * - If value is a vector or list this operates like an array copy, except that
2145  *   the destination is effectively re-ordered as defined by the swizzle. At
2146  *   most min(len(source), len(dest)) values will be copied.
2147  * - If the value is scalar, it is copied to all axes listed in the swizzle.
2148  * - If an axis appears more than once in the swizzle, the final occurrence is
2149  *   the one that determines its value.
2150
2151  * Returns 0 on success and -1 on failure. On failure, the vector will be
2152  * unchanged. */
2153 static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure)
2154 {
2155         size_t size_from;
2156         float scalarVal;
2157
2158         size_t axis_from;
2159         size_t axis_to;
2160
2161         unsigned int swizzleClosure;
2162
2163         float tvec[MAX_DIMENSIONS];
2164         float vec_assign[MAX_DIMENSIONS];
2165
2166         if (BaseMath_ReadCallback(self) == -1)
2167                 return -1;
2168
2169         /* Check that the closure can be used with this vector: even 2D vectors have
2170          * swizzles defined for axes z and w, but they would be invalid. */
2171         swizzleClosure = GET_INT_FROM_POINTER(closure);
2172         axis_from = 0;
2173
2174         while (swizzleClosure & SWIZZLE_VALID_AXIS) {
2175                 axis_to = swizzleClosure & SWIZZLE_AXIS;
2176                 if (axis_to >= self->size) {
2177                         PyErr_SetString(PyExc_AttributeError,
2178                                         "Vector swizzle: "
2179                                         "specified axis not present");
2180                         return -1;
2181                 }
2182                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
2183                 axis_from++;
2184         }
2185
2186         if (((scalarVal = PyFloat_AsDouble(value)) == -1 && PyErr_Occurred()) == 0) {
2187                 int i;
2188
2189                 for (i = 0; i < MAX_DIMENSIONS; i++) {
2190                         vec_assign[i] = scalarVal;
2191                 }
2192
2193                 size_from = axis_from;
2194         }
2195         else if ( (PyErr_Clear()), /* run but ignore the result */
2196                   (size_from = mathutils_array_parse(vec_assign, 2, 4, value,
2197                                                    "mathutils.Vector.**** = swizzle assignment")) == -1)
2198         {
2199                 return -1;
2200         }
2201
2202         if (axis_from != size_from) {
2203                 PyErr_SetString(PyExc_AttributeError,
2204                                 "Vector swizzle: size does not match swizzle");
2205                 return -1;
2206         }
2207
2208         /* Copy vector contents onto swizzled axes. */
2209         axis_from = 0;
2210         swizzleClosure = GET_INT_FROM_POINTER(closure);
2211
2212         while (swizzleClosure & SWIZZLE_VALID_AXIS)     {
2213                 axis_to = swizzleClosure & SWIZZLE_AXIS;
2214                 tvec[axis_to] = vec_assign[axis_from];
2215                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
2216                 axis_from++;
2217         }
2218
2219         memcpy(self->vec, tvec, axis_from * sizeof(float));
2220         /* continue with BaseMathObject_WriteCallback at the end */
2221
2222         if (BaseMath_WriteCallback(self) == -1)
2223                 return -1;
2224         else
2225                 return 0;
2226 }
2227
2228 /*****************************************************************************/
2229 /* Python attributes get/set structure:                                      */
2230 /*****************************************************************************/
2231 static PyGetSetDef Vector_getseters[] = {
2232         {(char *)"x", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_x_doc, (void *)0},
2233         {(char *)"y", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_y_doc, (void *)1},
2234         {(char *)"z", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_z_doc, (void *)2},
2235         {(char *)"w", (getter)Vector_axis_get, (setter)Vector_axis_set, Vector_axis_w_doc, (void *)3},
2236         {(char *)"length", (getter)Vector_length_get, (setter)Vector_length_set, Vector_length_doc, NULL},
2237         {(char *)"length_squared", (getter)Vector_length_squared_get, (setter)NULL, Vector_length_squared_doc, NULL},
2238         {(char *)"magnitude", (getter)Vector_length_get, (setter)Vector_length_set, Vector_length_doc, NULL},
2239         {(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
2240         {(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
2241
2242         /* autogenerated swizzle attrs, see python script below */
2243         {(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
2244         {(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
2245         {(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
2246         {(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
2247         {(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
2248         {(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
2249         {(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
2250         {(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
2251         {(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
2252         {(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
2253         {(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
2254         {(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
2255         {(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
2256         {(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
2257         {(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
2258         {(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
2259         {(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
2260         {(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
2261         {(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
2262         {(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
2263         {(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
2264         {(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
2265         {(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
2266         {(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
2267         {(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
2268         {(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
2269         {(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
2270         {(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
2271         {(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
2272         {(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
2273         {(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
2274         {(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
2275         {(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
2276         {(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
2277         {(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
2278         {(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
2279         {(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
2280         {(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
2281         {(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
2282         {(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
2283         {(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
2284         {(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
2285         {(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
2286         {(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
2287         {(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
2288         {(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
2289         {(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
2290         {(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
2291         {(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
2292         {(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
2293         {(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
2294         {(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
2295         {(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
2296         {(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
2297         {(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
2298         {(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
2299         {(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
2300         {(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
2301         {(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
2302         {(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
2303         {(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
2304         {(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
2305         {(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
2306         {(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
2307         {(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
2308         {(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
2309         {(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
2310         {(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
2311         {(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
2312         {(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
2313         {(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
2314         {(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
2315         {(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
2316         {(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
2317         {(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
2318         {(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
2319         {(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
2320         {(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
2321         {(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
2322         {(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
2323         {(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
2324         {(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
2325         {(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
2326         {(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
2327         {(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
2328         {(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
2329         {(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
2330         {(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
2331         {(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
2332         {(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
2333         {(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
2334         {(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
2335         {(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
2336         {(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
2337         {(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
2338         {(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
2339         {(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
2340         {(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
2341         {(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
2342         {(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
2343         {(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
2344         {(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
2345         {(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
2346         {(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
2347         {(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
2348         {(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
2349         {(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
2350         {(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
2351         {(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
2352         {(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
2353         {(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
2354         {(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
2355         {(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
2356         {(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
2357         {(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
2358         {(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
2359         {(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
2360         {(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
2361         {(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
2362         {(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
2363         {(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
2364         {(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
2365         {(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
2366         {(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
2367         {(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
2368         {(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
2369         {(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
2370         {(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
2371         {(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
2372         {(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
2373         {(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
2374         {(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
2375         {(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
2376         {(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
2377         {(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
2378         {(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
2379         {(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
2380         {(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
2381         {(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
2382         {(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
2383         {(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
2384         {(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
2385         {(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
2386         {(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
2387         {(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
2388         {(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
2389         {(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
2390         {(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
2391         {(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
2392         {(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
2393         {(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
2394         {(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
2395         {(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
2396         {(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
2397         {(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
2398         {(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
2399         {(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
2400         {(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
2401         {(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
2402         {(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
2403         {(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
2404         {(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
2405         {(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
2406         {(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
2407         {(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
2408         {(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
2409         {(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
2410         {(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
2411         {(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
2412         {(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
2413         {(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
2414         {(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
2415         {(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
2416         {(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
2417         {(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
2418         {(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
2419         {(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
2420         {(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
2421         {(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
2422         {(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
2423         {(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
2424         {(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
2425         {(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
2426         {(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
2427         {(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
2428         {(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
2429         {(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
2430         {(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
2431         {(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
2432         {(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
2433         {(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
2434         {(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
2435         {(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
2436         {(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
2437         {(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
2438         {(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
2439         {(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
2440         {(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
2441         {(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
2442         {(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
2443         {(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
2444         {(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
2445         {(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
2446         {(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
2447         {(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
2448         {(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
2449         {(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
2450         {(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
2451         {(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
2452         {(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
2453         {(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
2454         {(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
2455         {(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
2456         {(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
2457         {(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
2458         {(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
2459         {(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
2460         {(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
2461         {(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
2462         {(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
2463         {(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
2464         {(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
2465         {(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
2466         {(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
2467         {(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
2468         {(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
2469         {(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
2470         {(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
2471         {(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
2472         {(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
2473         {(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
2474         {(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
2475         {(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
2476         {(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
2477         {(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
2478         {(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
2479         {(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
2480         {(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
2481         {(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
2482         {(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
2483         {(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
2484         {(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
2485         {(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
2486         {(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
2487         {(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
2488         {(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
2489         {(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
2490         {(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
2491         {(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
2492         {(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
2493         {(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
2494         {(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
2495         {(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
2496         {(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
2497         {(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
2498         {(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
2499         {(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
2500         {(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
2501         {(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
2502         {(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
2503         {(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
2504         {(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
2505         {(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
2506         {(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
2507         {(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
2508         {(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
2509         {(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
2510         {(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
2511         {(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
2512         {(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
2513         {(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
2514         {(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
2515         {(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
2516         {(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
2517         {(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
2518         {(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
2519         {(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
2520         {(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
2521         {(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
2522         {(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
2523         {(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
2524         {(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
2525         {(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
2526         {(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
2527         {(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
2528         {(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
2529         {(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
2530         {(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
2531         {(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
2532         {(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
2533         {(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
2534         {(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
2535         {(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
2536         {(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
2537         {(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
2538         {(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
2539         {(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
2540         {(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
2541         {(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
2542         {(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
2543         {(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
2544         {(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
2545         {(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
2546         {(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
2547         {(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
2548         {(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
2549         {(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
2550         {(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
2551         {(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
2552         {(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
2553         {(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
2554         {(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
2555         {(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
2556         {(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
2557         {(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
2558         {(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
2559         {(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
2560         {(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
2561         {(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
2562         {(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
2563         {(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
2564         {(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
2565         {(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
2566         {(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
2567         {(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
2568         {(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
2569         {(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
2570         {(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
2571         {(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
2572         {(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
2573         {(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
2574         {(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
2575         {(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
2576         {(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
2577         {(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
2578         {(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
2579         {NULL, NULL, NULL, NULL, NULL}  /* Sentinel */
2580 };
2581
2582 /* Python script used to make swizzle array */
2583 /*
2584 SWIZZLE_BITS_PER_AXIS = 3
2585 SWIZZLE_VALID_AXIS = 0x4
2586
2587 axis_dict = {}
2588 axis_pos = {'x':0, 'y':1, 'z':2, 'w':3}
2589 axises = 'xyzw'
2590 while len(axises) >= 2:
2591
2592         for axis_0 in axises:
2593                 axis_0_pos = axis_pos[axis_0]
2594                 for axis_1 in axises:
2595                         axis_1_pos = axis_pos[axis_1]
2596                         axis_dict[axis_0 + axis_1] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS))' % (axis_0_pos, axis_1_pos)
2597                         if len(axises)>2:
2598                                 for axis_2 in axises:
2599                                         axis_2_pos = axis_pos[axis_2]
2600                                         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)
2601                                         if len(axises)>3:
2602                                                 for axis_3 in axises:
2603                                                         axis_3_pos = axis_pos[axis_3]
2604                                                         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)
2605
2606         axises = axises[:-1]
2607
2608
2609 items = axis_dict.items()
2610 items.sort(key = lambda a: a[0].replace('x', '0').replace('y', '1').replace('z', '2').replace('w', '3'))
2611
2612 unique = set()
2613 for key, val in items:
2614         num = eval(val)
2615         set_str = 'Vector_setSwizzle' if (len(set(key)) == len(key)) else 'NULL'
2616         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)
2617         unique.add(num)
2618
2619 if len(unique) != len(items):
2620         print "ERROR"
2621 */
2622
2623 /* ROW VECTOR Multiplication - Vector X Matrix
2624  * [x][y][z] * [1][4][7]
2625  *             [2][5][8]
2626  *             [3][6][9]
2627  * vector/matrix multiplication IS NOT COMMUTATIVE!!!! */
2628 static int row_vector_multiplication(float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
2629 {
2630         float vec_cpy[MAX_DIMENSIONS];
2631         int row, col, z = 0, vec_size = vec->size;
2632
2633         if (mat->num_row != vec_size) {
2634                 if (mat->num_row == 4 && vec_size == 3) {
2635                         vec_cpy[3] = 1.0f;
2636                 }
2637                 else {
2638                         PyErr_SetString(PyExc_ValueError,
2639                                         "vector * matrix: matrix column size "
2640                                         "and the vector size must be the same");
2641                         return -1;
2642                 }
2643         }
2644
2645         if (BaseMath_ReadCallback(vec) == -1 || BaseMath_ReadCallback(mat) == -1)
2646                 return -1;
2647
2648         memcpy(vec_cpy, vec->vec, vec_size * sizeof(float));
2649
2650         r_vec[3] = 1.0f;
2651         //muliplication
2652         for (col = 0; col < mat->num_col; col++) {
2653                 double dot = 0.0;
2654                 for (row = 0; row < mat->num_row; row++) {
2655                         dot += MATRIX_ITEM(mat, row, col) * vec_cpy[row];
2656                 }
2657                 r_vec[z++] = (float)dot;
2658         }
2659         return 0;
2660 }
2661
2662 /*----------------------------Vector.negate() -------------------- */
2663 PyDoc_STRVAR(Vector_negate_doc,
2664 ".. method:: negate()\n"
2665 "\n"
2666 "   Set all values to their negative.\n"
2667 );
2668 static PyObject *Vector_negate(VectorObject *self)
2669 {
2670         if (BaseMath_ReadCallback(self) == -1)
2671                 return NULL;
2672
2673         negate_vn(self->vec, self->size);
2674
2675         (void)BaseMath_WriteCallback(self); // already checked for error
2676         Py_RETURN_NONE;
2677 }
2678
2679 static struct PyMethodDef Vector_methods[] = {
2680         /* Class Methods */
2681         {"Fill", (PyCFunction) C_Vector_Fill, METH_VARARGS | METH_CLASS, C_Vector_Fill_doc},
2682         {"Range", (PyCFunction) C_Vector_Range, METH_VARARGS | METH_CLASS, C_Vector_Range_doc},
2683         {"Linspace", (PyCFunction) C_Vector_Linspace, METH_VARARGS | METH_CLASS, C_Vector_Linspace_doc},
2684         {"Repeat", (PyCFunction) C_Vector_Repeat, METH_VARARGS | METH_CLASS, C_Vector_Repeat_doc},
2685
2686         /* in place only */
2687         {"zero", (PyCFunction) Vector_zero, METH_NOARGS, Vector_zero_doc},
2688         {"negate", (PyCFunction) Vector_negate, METH_NOARGS, Vector_negate_doc},
2689
2690         /* operate on original or copy */
2691         {"normalize", (PyCFunction) Vector_normalize, METH_NOARGS, Vector_normalize_doc},
2692         {"normalized", (PyCFunction) Vector_normalized, METH_NOARGS, Vector_normalized_doc},
2693
2694         {"resize", (PyCFunction) Vector_resize, METH_O, Vector_resize_doc},
2695         {"resized", (PyCFunction) Vector_resized, METH_O, Vector_resized_doc},
2696         {"to_2d", (PyCFunction) Vector_to_2d, METH_NOARGS, Vector_to_2d_doc},
2697         {"resize_2d", (PyCFunction) Vector_resize_2d, METH_NOARGS, Vector_resize_2d_doc},
2698         {"to_3d", (PyCFunction) Vector_to_3d, METH_NOARGS, Vector_to_3d_doc},
2699         {"resize_3d", (PyCFunction) Vector_resize_3d, METH_NOARGS, Vector_resize_3d_doc},
2700         {"to_4d", (PyCFunction) Vector_to_4d, METH_NOARGS, Vector_to_4d_doc},
2701         {"resize_4d", (PyCFunction) Vector_resize_4d, METH_NOARGS, Vector_resize_4d_doc},
2702         {"to_tuple", (PyCFunction) Vector_to_tuple, METH_VARARGS, Vector_to_tuple_doc},
2703         {"to_track_quat", (PyCFunction) Vector_to_track_quat, METH_VARARGS, Vector_to_track_quat_doc},
2704
2705         /* operation between 2 or more types  */
2706         {"reflect", (PyCFunction) Vector_reflect, METH_O, Vector_reflect_doc},
2707         {"cross", (PyCFunction) Vector_cross, METH_O, Vector_cross_doc},
2708         {"dot", (PyCFunction) Vector_dot, METH_O, Vector_dot_doc},
2709         {"angle", (PyCFunction) Vector_angle, METH_VARARGS, Vector_angle_doc},
2710         {"rotation_difference", (PyCFunction) Vector_rotation_difference, METH_O, Vector_rotation_difference_doc},
2711         {"project", (PyCFunction) Vector_project, METH_O, Vector_project_doc},
2712         {"lerp", (PyCFunction) Vector_lerp, METH_VARARGS, Vector_lerp_doc},
2713         {"rotate", (PyCFunction) Vector_rotate, METH_O, Vector_rotate_doc},
2714
2715         {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
2716         {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL},
2717         {NULL, NULL, 0, NULL}
2718 };
2719
2720
2721 /* Note
2722  Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
2723  but this means for eg that
2724  vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order
2725 */
2726
2727 PyDoc_STRVAR(vector_doc,
2728 "This object gives access to Vectors in Blender."
2729 );
2730 PyTypeObject vector_Type = {
2731         PyVarObject_HEAD_INIT(NULL, 0)
2732         /*  For printing, in format "<module>.<name>" */
2733         "mathutils.Vector",             /* char *tp_name; */
2734         sizeof(VectorObject),         /* int tp_basicsize; */
2735         0,                          /* tp_itemsize;  For allocation */
2736
2737         /* Methods to implement standard operations */
2738
2739         (destructor) BaseMathObject_dealloc,/* destructor tp_dealloc; */
2740         NULL,                       /* printfunc tp_print; */
2741         NULL,                       /* getattrfunc tp_getattr; */
2742         NULL,                       /* setattrfunc tp_setattr; */
2743         NULL,   /* cmpfunc tp_compare; */
2744         (reprfunc)Vector_repr,     /* reprfunc tp_repr; */
2745
2746         /* Method suites for standard classes */
2747
2748         &Vector_NumMethods,                       /* PyNumberMethods *tp_as_number; */
2749         &Vector_SeqMethods,                       /* PySequenceMethods *tp_as_sequence; */
2750         &Vector_AsMapping,                       /* PyMappingMethods *tp_as_mapping; */
2751
2752         /* More standard operations (here for binary compatibility) */
2753
2754         NULL,                       /* hashfunc tp_hash; */
2755         NULL,                       /* ternaryfunc tp_call; */
2756         (reprfunc)Vector_str,       /* reprfunc tp_str; */
2757         NULL,                       /* getattrofunc tp_getattro; */
2758         NULL,                       /* setattrofunc tp_setattro; */
2759
2760         /* Functions to access object as input/output buffer */
2761         NULL,                       /* PyBufferProcs *tp_as_buffer; */
2762
2763   /*** Flags to define presence of optional/expanded features ***/
2764         Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
2765         vector_doc,                       /*  char *tp_doc;  Documentation string */
2766   /*** Assigned meaning in release 2.0 ***/
2767
2768         /* call function for all accessible objects */
2769         (traverseproc)BaseMathObject_traverse,  //tp_traverse
2770
2771         /* delete references to contained objects */
2772         (inquiry)BaseMathObject_clear,  //tp_clear
2773
2774   /***  Assigned meaning in release 2.1 ***/
2775   /*** rich comparisons ***/
2776         (richcmpfunc)Vector_richcmpr,                       /* richcmpfunc tp_richcompare; */
2777
2778   /***  weak reference enabler ***/
2779         0,                          /* long tp_weaklistoffset; */
2780
2781   /*** Added in release 2.2 ***/
2782         /*   Iterators */
2783         NULL,                       /* getiterfunc tp_iter; */
2784         NULL,                       /* iternextfunc tp_iternext; */
2785
2786   /*** Attribute descriptor and subclassing stuff ***/
2787         Vector_methods,           /* struct PyMethodDef *tp_methods; */
2788         NULL,                       /* struct PyMemberDef *tp_members; */
2789         Vector_getseters,           /* struct PyGetSetDef *tp_getset; */
2790         NULL,                       /* struct _typeobject *tp_base; */
2791         NULL,                       /* PyObject *tp_dict; */
2792         NULL,                       /* descrgetfunc tp_descr_get; */
2793         NULL,                       /* descrsetfunc tp_descr_set; */
2794         0,                          /* long tp_dictoffset; */
2795         NULL,                       /* initproc tp_init; */
2796         NULL,                       /* allocfunc tp_alloc; */
2797         Vector_new,                 /* newfunc tp_new; */
2798         /*  Low-level free-memory routine */
2799         NULL,                       /* freefunc tp_free;  */
2800         /* For PyObject_IS_GC */
2801         NULL,                       /* inquiry tp_is_gc;  */
2802         NULL,                       /* PyObject *tp_bases; */
2803         /* method resolution order */
2804         NULL,                       /* PyObject *tp_mro;  */
2805         NULL,                       /* PyObject *tp_cache; */
2806         NULL,                       /* PyObject *tp_subclasses; */
2807         NULL,                       /* PyObject *tp_weaklist; */
2808         NULL
2809 };
2810
2811 /*------------------------Vector_CreatePyObject (internal)-------------
2812   creates a new vector object
2813   pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
2814  (i.e. it was allocated elsewhere by MEM_mallocN())
2815   pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
2816  (i.e. it must be created here with PyMEM_malloc())*/
2817 PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type)
2818 {
2819         VectorObject *self;
2820
2821         if (size < 2) {
2822                 PyErr_SetString(PyExc_RuntimeError,
2823                                 "Vector(): invalid size");
2824                 return NULL;
2825         }
2826
2827         self = base_type ? (VectorObject *)base_type->tp_alloc(base_type, 0) :
2828                            (VectorObject *)PyObject_GC_New(VectorObject, &vector_Type);
2829
2830         if (self) {
2831                 self->size = size;
2832
2833                 /* init callbacks as NULL */
2834                 self->cb_user = NULL;
2835                 self->cb_type = self->cb_subtype = 0;
2836
2837                 if (type == Py_WRAP) {
2838                         self->vec = vec;
2839                         self->wrapped = Py_WRAP;
2840                 }
2841                 else if (type == Py_NEW) {
2842                         self->vec = PyMem_Malloc(size * sizeof(float));
2843                         if (vec) {
2844                                 memcpy(self->vec, vec, size * sizeof(float));
2845                         }
2846                         else { /* new empty */
2847                                 fill_vn_fl(self->vec, size, 0.0f);
2848                                 if (size == 4) { /* do the homogenous thing */
2849                                         self->vec[3] = 1.0f;
2850                                 }
2851                         }
2852                         self->wrapped = Py_NEW;
2853                 }
2854                 else {
2855                         Py_FatalError("Vector(): invalid type!");
2856                 }
2857         }
2858         return (PyObject *) self;
2859 }
2860
2861 PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype)
2862 {
2863         float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */
2864         VectorObject *self = (VectorObject *)Vector_CreatePyObject(dummy, size, Py_NEW, NULL);
2865         if (self) {
2866                 Py_INCREF(cb_user);
2867                 self->cb_user =                 cb_user;
2868                 self->cb_type =                 (unsigned char)cb_type;
2869                 self->cb_subtype =              (unsigned char)cb_subtype;
2870                 PyObject_GC_Track(self);
2871         }
2872
2873         return (PyObject *)self;
2874 }
2875
2876 PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type)
2877 {
2878         VectorObject *vect_ob;
2879         vect_ob = (VectorObject *)Vector_CreatePyObject(vec, size, Py_WRAP, base_type);
2880         vect_ob->wrapped = Py_NEW;
2881
2882   &n