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