fake-bpy-module 20240601__py3-none-any.whl → 20240605__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fake-bpy-module might be problematic. Click here for more details.
- aud/__init__.pyi +4 -4
- bl_console_utils/autocomplete/intellisense/__init__.pyi +2 -4
- bl_ui/space_node/__init__.pyi +0 -1
- bl_ui/space_sequencer/__init__.pyi +14 -0
- bl_ui/space_userpref/__init__.pyi +234 -0
- bl_ui/space_view3d/__init__.pyi +810 -0
- bl_ui/space_view3d_toolbar/__init__.pyi +949 -3
- blf/__init__.pyi +4 -4
- bmesh/ops/__init__.pyi +97 -82
- bmesh/types/__init__.pyi +37 -32
- bmesh/utils/__init__.pyi +2 -4
- bpy/app/handlers/__init__.pyi +36 -36
- bpy/ops/action/__init__.pyi +152 -152
- bpy/ops/anim/__init__.pyi +216 -216
- bpy/ops/armature/__init__.pyi +192 -192
- bpy/ops/asset/__init__.pyi +64 -64
- bpy/ops/boid/__init__.pyi +32 -32
- bpy/ops/brush/__init__.pyi +36 -36
- bpy/ops/buttons/__init__.pyi +24 -24
- bpy/ops/cachefile/__init__.pyi +20 -20
- bpy/ops/camera/__init__.pyi +8 -8
- bpy/ops/clip/__init__.pyi +368 -368
- bpy/ops/cloth/__init__.pyi +4 -4
- bpy/ops/collection/__init__.pyi +36 -36
- bpy/ops/console/__init__.pyi +84 -84
- bpy/ops/constraint/__init__.pyi +72 -72
- bpy/ops/curve/__init__.pyi +204 -204
- bpy/ops/curves/__init__.pyi +108 -108
- bpy/ops/cycles/__init__.pyi +12 -12
- bpy/ops/dpaint/__init__.pyi +20 -20
- bpy/ops/ed/__init__.pyi +48 -48
- bpy/ops/export_anim/__init__.pyi +4 -4
- bpy/ops/export_scene/__init__.pyi +8 -8
- bpy/ops/extensions/__init__.pyi +123 -109
- bpy/ops/file/__init__.pyi +160 -160
- bpy/ops/fluid/__init__.pyi +56 -56
- bpy/ops/font/__init__.pyi +92 -92
- bpy/ops/geometry/__init__.pyi +40 -40
- bpy/ops/gizmogroup/__init__.pyi +8 -8
- bpy/ops/gpencil/__init__.pyi +600 -600
- bpy/ops/graph/__init__.pyi +260 -260
- bpy/ops/grease_pencil/__init__.pyi +292 -292
- bpy/ops/image/__init__.pyi +192 -192
- bpy/ops/import_anim/__init__.pyi +4 -4
- bpy/ops/import_curve/__init__.pyi +4 -4
- bpy/ops/import_scene/__init__.pyi +8 -8
- bpy/ops/info/__init__.pyi +28 -28
- bpy/ops/lattice/__init__.pyi +32 -32
- bpy/ops/marker/__init__.pyi +44 -44
- bpy/ops/mask/__init__.pyi +156 -156
- bpy/ops/material/__init__.pyi +12 -12
- bpy/ops/mball/__init__.pyi +32 -32
- bpy/ops/mesh/__init__.pyi +652 -652
- bpy/ops/nla/__init__.pyi +156 -156
- bpy/ops/node/__init__.pyi +416 -416
- bpy/ops/object/__init__.pyi +984 -984
- bpy/ops/outliner/__init__.pyi +284 -284
- bpy/ops/paint/__init__.pyi +220 -220
- bpy/ops/paintcurve/__init__.pyi +32 -32
- bpy/ops/palette/__init__.pyi +28 -28
- bpy/ops/particle/__init__.pyi +144 -144
- bpy/ops/pose/__init__.pyi +156 -156
- bpy/ops/poselib/__init__.pyi +36 -36
- bpy/ops/preferences/__init__.pyi +148 -148
- bpy/ops/ptcache/__init__.pyi +28 -28
- bpy/ops/render/__init__.pyi +48 -48
- bpy/ops/rigidbody/__init__.pyi +52 -52
- bpy/ops/scene/__init__.pyi +148 -192
- bpy/ops/screen/__init__.pyi +156 -156
- bpy/ops/script/__init__.pyi +12 -12
- bpy/ops/sculpt/__init__.pyi +152 -152
- bpy/ops/sculpt_curves/__init__.pyi +16 -16
- bpy/ops/sequencer/__init__.pyi +364 -340
- bpy/ops/sound/__init__.pyi +28 -28
- bpy/ops/spreadsheet/__init__.pyi +16 -16
- bpy/ops/surface/__init__.pyi +24 -24
- bpy/ops/text/__init__.pyi +172 -172
- bpy/ops/text_editor/__init__.pyi +4 -4
- bpy/ops/texture/__init__.pyi +16 -16
- bpy/ops/transform/__init__.pyi +111 -108
- bpy/ops/ui/__init__.pyi +132 -132
- bpy/ops/uilist/__init__.pyi +12 -12
- bpy/ops/uv/__init__.pyi +196 -196
- bpy/ops/view2d/__init__.pyi +56 -56
- bpy/ops/view3d/__init__.pyi +268 -268
- bpy/ops/wm/__init__.pyi +448 -448
- bpy/ops/workspace/__init__.pyi +28 -28
- bpy/ops/world/__init__.pyi +8 -8
- bpy/path/__init__.pyi +18 -18
- bpy/props/__init__.pyi +11 -11
- bpy/types/__init__.pyi +2185 -1933
- bpy/utils/__init__.pyi +4 -4
- bpy_extras/mesh_utils/__init__.pyi +4 -4
- bpy_extras/view3d_utils/__init__.pyi +24 -20
- bpy_types/__init__.pyi +12 -7
- {fake_bpy_module-20240601.dist-info → fake_bpy_module-20240605.dist-info}/METADATA +5 -1
- {fake_bpy_module-20240601.dist-info → fake_bpy_module-20240605.dist-info}/RECORD +108 -108
- freestyle/types/__init__.pyi +64 -64
- freestyle/utils/__init__.pyi +2 -2
- gpu/matrix/__init__.pyi +15 -6
- gpu/state/__init__.pyi +2 -2
- gpu/types/__init__.pyi +6 -4
- gpu_extras/presets/__init__.pyi +8 -4
- imbuf/__init__.pyi +4 -4
- mathutils/__init__.pyi +292 -187
- mathutils/geometry/__init__.pyi +2 -5
- {fake_bpy_module-20240601.dist-info → fake_bpy_module-20240605.dist-info}/WHEEL +0 -0
- {fake_bpy_module-20240601.dist-info → fake_bpy_module-20240605.dist-info}/top_level.txt +0 -0
mathutils/__init__.pyi
CHANGED
|
@@ -58,10 +58,10 @@ class Color:
|
|
|
58
58
|
:type: float
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
|
-
hsv: collections.abc.Sequence[float]
|
|
61
|
+
hsv: Vector | collections.abc.Sequence[float]
|
|
62
62
|
""" HSV Values in [0, 1].
|
|
63
63
|
|
|
64
|
-
:type: collections.abc.Sequence[float]
|
|
64
|
+
:type: Vector | collections.abc.Sequence[float]
|
|
65
65
|
"""
|
|
66
66
|
|
|
67
67
|
is_frozen: bool
|
|
@@ -190,121 +190,140 @@ class Color:
|
|
|
190
190
|
"""
|
|
191
191
|
...
|
|
192
192
|
|
|
193
|
-
def
|
|
193
|
+
def __get__(self, instance, owner) -> Color:
|
|
194
|
+
"""
|
|
195
|
+
|
|
196
|
+
:param instance:
|
|
197
|
+
:param owner:
|
|
198
|
+
:return:
|
|
199
|
+
:rtype: Color
|
|
200
|
+
"""
|
|
201
|
+
...
|
|
202
|
+
|
|
203
|
+
def __set__(self, instance, value: Color | collections.abc.Sequence[float]):
|
|
204
|
+
"""
|
|
205
|
+
|
|
206
|
+
:param instance:
|
|
207
|
+
:param value:
|
|
208
|
+
:type value: Color | collections.abc.Sequence[float]
|
|
209
|
+
"""
|
|
210
|
+
...
|
|
211
|
+
|
|
212
|
+
def __add__(self, other: Color | collections.abc.Sequence[float]) -> Color:
|
|
194
213
|
"""
|
|
195
214
|
|
|
196
215
|
:param other:
|
|
197
|
-
:type other: collections.abc.Sequence[float]
|
|
216
|
+
:type other: Color | collections.abc.Sequence[float]
|
|
198
217
|
:return:
|
|
199
218
|
:rtype: Color
|
|
200
219
|
"""
|
|
201
220
|
...
|
|
202
221
|
|
|
203
|
-
def __sub__(self, other: collections.abc.Sequence[float]
|
|
222
|
+
def __sub__(self, other: Color | collections.abc.Sequence[float]) -> Color:
|
|
204
223
|
"""
|
|
205
224
|
|
|
206
225
|
:param other:
|
|
207
|
-
:type other: collections.abc.Sequence[float]
|
|
226
|
+
:type other: Color | collections.abc.Sequence[float]
|
|
208
227
|
:return:
|
|
209
228
|
:rtype: Color
|
|
210
229
|
"""
|
|
211
230
|
...
|
|
212
231
|
|
|
213
|
-
def __mul__(self, other:
|
|
232
|
+
def __mul__(self, other: float | int) -> Color:
|
|
214
233
|
"""
|
|
215
234
|
|
|
216
235
|
:param other:
|
|
217
|
-
:type other:
|
|
236
|
+
:type other: float | int
|
|
218
237
|
:return:
|
|
219
238
|
:rtype: Color
|
|
220
239
|
"""
|
|
221
240
|
...
|
|
222
241
|
|
|
223
|
-
def __truediv__(self, other:
|
|
242
|
+
def __truediv__(self, other: float | int) -> Color:
|
|
224
243
|
"""
|
|
225
244
|
|
|
226
245
|
:param other:
|
|
227
|
-
:type other:
|
|
246
|
+
:type other: float | int
|
|
228
247
|
:return:
|
|
229
248
|
:rtype: Color
|
|
230
249
|
"""
|
|
231
250
|
...
|
|
232
251
|
|
|
233
|
-
def __radd__(self, other: collections.abc.Sequence[float]
|
|
252
|
+
def __radd__(self, other: Color | collections.abc.Sequence[float]) -> Color:
|
|
234
253
|
"""
|
|
235
254
|
|
|
236
255
|
:param other:
|
|
237
|
-
:type other: collections.abc.Sequence[float]
|
|
256
|
+
:type other: Color | collections.abc.Sequence[float]
|
|
238
257
|
:return:
|
|
239
258
|
:rtype: Color
|
|
240
259
|
"""
|
|
241
260
|
...
|
|
242
261
|
|
|
243
|
-
def __rsub__(self, other: collections.abc.Sequence[float]
|
|
262
|
+
def __rsub__(self, other: Color | collections.abc.Sequence[float]) -> Color:
|
|
244
263
|
"""
|
|
245
264
|
|
|
246
265
|
:param other:
|
|
247
|
-
:type other: collections.abc.Sequence[float]
|
|
266
|
+
:type other: Color | collections.abc.Sequence[float]
|
|
248
267
|
:return:
|
|
249
268
|
:rtype: Color
|
|
250
269
|
"""
|
|
251
270
|
...
|
|
252
271
|
|
|
253
|
-
def __rmul__(self, other:
|
|
272
|
+
def __rmul__(self, other: float | int) -> Color:
|
|
254
273
|
"""
|
|
255
274
|
|
|
256
275
|
:param other:
|
|
257
|
-
:type other:
|
|
276
|
+
:type other: float | int
|
|
258
277
|
:return:
|
|
259
278
|
:rtype: Color
|
|
260
279
|
"""
|
|
261
280
|
...
|
|
262
281
|
|
|
263
|
-
def __rtruediv__(self, other:
|
|
282
|
+
def __rtruediv__(self, other: float | int) -> Color:
|
|
264
283
|
"""
|
|
265
284
|
|
|
266
285
|
:param other:
|
|
267
|
-
:type other:
|
|
286
|
+
:type other: float | int
|
|
268
287
|
:return:
|
|
269
288
|
:rtype: Color
|
|
270
289
|
"""
|
|
271
290
|
...
|
|
272
291
|
|
|
273
|
-
def __iadd__(self, other: collections.abc.Sequence[float]
|
|
292
|
+
def __iadd__(self, other: Color | collections.abc.Sequence[float]) -> Color:
|
|
274
293
|
"""
|
|
275
294
|
|
|
276
295
|
:param other:
|
|
277
|
-
:type other: collections.abc.Sequence[float]
|
|
296
|
+
:type other: Color | collections.abc.Sequence[float]
|
|
278
297
|
:return:
|
|
279
298
|
:rtype: Color
|
|
280
299
|
"""
|
|
281
300
|
...
|
|
282
301
|
|
|
283
|
-
def __isub__(self, other: collections.abc.Sequence[float]
|
|
302
|
+
def __isub__(self, other: Color | collections.abc.Sequence[float]) -> Color:
|
|
284
303
|
"""
|
|
285
304
|
|
|
286
305
|
:param other:
|
|
287
|
-
:type other: collections.abc.Sequence[float]
|
|
306
|
+
:type other: Color | collections.abc.Sequence[float]
|
|
288
307
|
:return:
|
|
289
308
|
:rtype: Color
|
|
290
309
|
"""
|
|
291
310
|
...
|
|
292
311
|
|
|
293
|
-
def __imul__(self, other:
|
|
312
|
+
def __imul__(self, other: float | int) -> Color:
|
|
294
313
|
"""
|
|
295
314
|
|
|
296
315
|
:param other:
|
|
297
|
-
:type other:
|
|
316
|
+
:type other: float | int
|
|
298
317
|
:return:
|
|
299
318
|
:rtype: Color
|
|
300
319
|
"""
|
|
301
320
|
...
|
|
302
321
|
|
|
303
|
-
def __itruediv__(self, other:
|
|
322
|
+
def __itruediv__(self, other: float | int) -> Color:
|
|
304
323
|
"""
|
|
305
324
|
|
|
306
325
|
:param other:
|
|
307
|
-
:type other:
|
|
326
|
+
:type other: float | int
|
|
308
327
|
:return:
|
|
309
328
|
:rtype: Color
|
|
310
329
|
"""
|
|
@@ -391,17 +410,16 @@ class Euler:
|
|
|
391
410
|
|
|
392
411
|
def rotate(
|
|
393
412
|
self,
|
|
394
|
-
other:
|
|
395
|
-
|
|
|
396
|
-
| collections.abc.Sequence[float]
|
|
413
|
+
other: Euler
|
|
414
|
+
| Matrix
|
|
397
415
|
| Quaternion
|
|
398
|
-
| collections.abc.Sequence[float]
|
|
399
|
-
|
|
|
416
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
417
|
+
| collections.abc.Sequence[float],
|
|
400
418
|
):
|
|
401
419
|
"""Rotates the euler by another mathutils value.
|
|
402
420
|
|
|
403
421
|
:param other: rotation component of mathutils value
|
|
404
|
-
:type other:
|
|
422
|
+
:type other: Euler | Matrix | Quaternion | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float]
|
|
405
423
|
"""
|
|
406
424
|
...
|
|
407
425
|
|
|
@@ -444,6 +462,25 @@ class Euler:
|
|
|
444
462
|
"""
|
|
445
463
|
...
|
|
446
464
|
|
|
465
|
+
def __get__(self, instance, owner) -> Euler:
|
|
466
|
+
"""
|
|
467
|
+
|
|
468
|
+
:param instance:
|
|
469
|
+
:param owner:
|
|
470
|
+
:return:
|
|
471
|
+
:rtype: Euler
|
|
472
|
+
"""
|
|
473
|
+
...
|
|
474
|
+
|
|
475
|
+
def __set__(self, instance, value: Euler | collections.abc.Sequence[float]):
|
|
476
|
+
"""
|
|
477
|
+
|
|
478
|
+
:param instance:
|
|
479
|
+
:param value:
|
|
480
|
+
:type value: Euler | collections.abc.Sequence[float]
|
|
481
|
+
"""
|
|
482
|
+
...
|
|
483
|
+
|
|
447
484
|
def __getitem__(self, key: int) -> float:
|
|
448
485
|
"""
|
|
449
486
|
|
|
@@ -523,11 +560,11 @@ class Matrix:
|
|
|
523
560
|
"""
|
|
524
561
|
|
|
525
562
|
@classmethod
|
|
526
|
-
def Diagonal(cls, vector: collections.abc.Sequence[float]
|
|
563
|
+
def Diagonal(cls, vector: Vector | collections.abc.Sequence[float]) -> Matrix:
|
|
527
564
|
"""Create a diagonal (scaling) matrix using the values from the vector.
|
|
528
565
|
|
|
529
566
|
:param vector: The vector of values for the diagonal.
|
|
530
|
-
:type vector: collections.abc.Sequence[float]
|
|
567
|
+
:type vector: Vector | collections.abc.Sequence[float]
|
|
531
568
|
:return: A diagonal matrix.
|
|
532
569
|
:rtype: Matrix
|
|
533
570
|
"""
|
|
@@ -547,23 +584,19 @@ class Matrix:
|
|
|
547
584
|
@classmethod
|
|
548
585
|
def LocRotScale(
|
|
549
586
|
cls,
|
|
550
|
-
location: collections.abc.Sequence[float] |
|
|
551
|
-
rotation: collections.abc.Sequence[float]
|
|
552
|
-
|
|
|
553
|
-
| collections.abc.Sequence[float]
|
|
554
|
-
| Euler
|
|
555
|
-
| None,
|
|
556
|
-
scale: collections.abc.Sequence[float] | Vector | None,
|
|
587
|
+
location: Vector | collections.abc.Sequence[float] | None,
|
|
588
|
+
rotation: Euler | Quaternion | collections.abc.Sequence[float] | None,
|
|
589
|
+
scale: Vector | collections.abc.Sequence[float] | None,
|
|
557
590
|
) -> Matrix:
|
|
558
591
|
"""Create a matrix combining translation, rotation and scale,
|
|
559
592
|
acting as the inverse of the decompose() method.Any of the inputs may be replaced with None if not needed.
|
|
560
593
|
|
|
561
594
|
:param location: The translation component.
|
|
562
|
-
:type location: collections.abc.Sequence[float] |
|
|
595
|
+
:type location: Vector | collections.abc.Sequence[float] | None
|
|
563
596
|
:param rotation: The rotation component.
|
|
564
|
-
:type rotation:
|
|
597
|
+
:type rotation: Euler | Quaternion | collections.abc.Sequence[float] | None
|
|
565
598
|
:param scale: The scale component.
|
|
566
|
-
:type scale: collections.abc.Sequence[float] |
|
|
599
|
+
:type scale: Vector | collections.abc.Sequence[float] | None
|
|
567
600
|
:return: Combined transformation matrix.
|
|
568
601
|
:rtype: Matrix
|
|
569
602
|
"""
|
|
@@ -571,14 +604,14 @@ class Matrix:
|
|
|
571
604
|
|
|
572
605
|
@classmethod
|
|
573
606
|
def OrthoProjection(
|
|
574
|
-
cls, axis:
|
|
607
|
+
cls, axis: Vector | collections.abc.Sequence[float] | str, size: int
|
|
575
608
|
) -> Matrix:
|
|
576
609
|
"""Create a matrix to represent an orthographic projection.
|
|
577
610
|
|
|
578
611
|
:param axis: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],
|
|
579
612
|
where a single axis is for a 2D matrix.
|
|
580
613
|
Or a vector for an arbitrary axis
|
|
581
|
-
:type axis:
|
|
614
|
+
:type axis: Vector | collections.abc.Sequence[float] | str
|
|
582
615
|
:param size: The size of the projection matrix to construct [2, 4].
|
|
583
616
|
:type size: int
|
|
584
617
|
:return: A new projection matrix.
|
|
@@ -591,7 +624,7 @@ class Matrix:
|
|
|
591
624
|
cls,
|
|
592
625
|
angle: float,
|
|
593
626
|
size: int,
|
|
594
|
-
axis:
|
|
627
|
+
axis: Vector | collections.abc.Sequence[float] | str | None,
|
|
595
628
|
) -> Matrix:
|
|
596
629
|
"""Create a matrix representing a rotation.
|
|
597
630
|
|
|
@@ -601,7 +634,7 @@ class Matrix:
|
|
|
601
634
|
:type size: int
|
|
602
635
|
:param axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object
|
|
603
636
|
(optional when size is 2).
|
|
604
|
-
:type axis:
|
|
637
|
+
:type axis: Vector | collections.abc.Sequence[float] | str | None
|
|
605
638
|
:return: A new rotation matrix.
|
|
606
639
|
:rtype: Matrix
|
|
607
640
|
"""
|
|
@@ -612,7 +645,7 @@ class Matrix:
|
|
|
612
645
|
cls,
|
|
613
646
|
factor: float,
|
|
614
647
|
size: int,
|
|
615
|
-
axis: collections.abc.Sequence[float] |
|
|
648
|
+
axis: Vector | collections.abc.Sequence[float] | None,
|
|
616
649
|
) -> Matrix:
|
|
617
650
|
"""Create a matrix representing a scaling.
|
|
618
651
|
|
|
@@ -621,7 +654,7 @@ class Matrix:
|
|
|
621
654
|
:param size: The size of the scale matrix to construct [2, 4].
|
|
622
655
|
:type size: int
|
|
623
656
|
:param axis: Direction to influence scale. (optional).
|
|
624
|
-
:type axis: collections.abc.Sequence[float] |
|
|
657
|
+
:type axis: Vector | collections.abc.Sequence[float] | None
|
|
625
658
|
:return: A new scale matrix.
|
|
626
659
|
:rtype: Matrix
|
|
627
660
|
"""
|
|
@@ -645,11 +678,11 @@ class Matrix:
|
|
|
645
678
|
...
|
|
646
679
|
|
|
647
680
|
@classmethod
|
|
648
|
-
def Translation(cls, vector: collections.abc.Sequence[float]
|
|
681
|
+
def Translation(cls, vector: Vector | collections.abc.Sequence[float]) -> Matrix:
|
|
649
682
|
"""Create a matrix representing a translation.
|
|
650
683
|
|
|
651
684
|
:param vector: The translation vector.
|
|
652
|
-
:type vector: collections.abc.Sequence[float]
|
|
685
|
+
:type vector: Vector | collections.abc.Sequence[float]
|
|
653
686
|
:return: An identity matrix with a translation.
|
|
654
687
|
:rtype: Matrix
|
|
655
688
|
"""
|
|
@@ -703,12 +736,16 @@ class Matrix:
|
|
|
703
736
|
"""Set the matrix to the identity matrix.`Identity matrix <https://en.wikipedia.org/wiki/Identity_matrix>`__ on Wikipedia."""
|
|
704
737
|
...
|
|
705
738
|
|
|
706
|
-
def invert(
|
|
739
|
+
def invert(
|
|
740
|
+
self,
|
|
741
|
+
fallback: Matrix
|
|
742
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]] = None,
|
|
743
|
+
):
|
|
707
744
|
"""Set the matrix to its inverse.`Inverse matrix <https://en.wikipedia.org/wiki/Inverse_matrix>`__ on Wikipedia.
|
|
708
745
|
|
|
709
746
|
:param fallback: Set the matrix to this value when the inverse cannot be calculated
|
|
710
747
|
(instead of raising a `ValueError` exception).
|
|
711
|
-
:type fallback: collections.abc.Sequence[float]
|
|
748
|
+
:type fallback: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
712
749
|
"""
|
|
713
750
|
...
|
|
714
751
|
|
|
@@ -742,12 +779,14 @@ class Matrix:
|
|
|
742
779
|
...
|
|
743
780
|
|
|
744
781
|
def lerp(
|
|
745
|
-
self,
|
|
782
|
+
self,
|
|
783
|
+
other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]],
|
|
784
|
+
factor: float,
|
|
746
785
|
) -> Matrix:
|
|
747
786
|
"""Returns the interpolation of two matrices. Uses polar decomposition, see "Matrix Animation and Polar Decomposition", Shoemake and Duff, 1992.
|
|
748
787
|
|
|
749
788
|
:param other: value to interpolate with.
|
|
750
|
-
:type other: collections.abc.Sequence[float]
|
|
789
|
+
:type other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
751
790
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
752
791
|
:type factor: float
|
|
753
792
|
:return: The interpolated matrix.
|
|
@@ -773,17 +812,16 @@ class Matrix:
|
|
|
773
812
|
|
|
774
813
|
def rotate(
|
|
775
814
|
self,
|
|
776
|
-
other:
|
|
777
|
-
|
|
|
778
|
-
| collections.abc.Sequence[float]
|
|
815
|
+
other: Euler
|
|
816
|
+
| Matrix
|
|
779
817
|
| Quaternion
|
|
780
|
-
| collections.abc.Sequence[float]
|
|
781
|
-
|
|
|
818
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
819
|
+
| collections.abc.Sequence[float],
|
|
782
820
|
):
|
|
783
821
|
"""Rotates the matrix by another mathutils value.
|
|
784
822
|
|
|
785
823
|
:param other: rotation component of mathutils value
|
|
786
|
-
:type other:
|
|
824
|
+
:type other: Euler | Matrix | Quaternion | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float]
|
|
787
825
|
"""
|
|
788
826
|
...
|
|
789
827
|
|
|
@@ -814,7 +852,7 @@ class Matrix:
|
|
|
814
852
|
def to_euler(
|
|
815
853
|
self,
|
|
816
854
|
order: str | None,
|
|
817
|
-
euler_compat: collections.abc.Sequence[float] |
|
|
855
|
+
euler_compat: Euler | collections.abc.Sequence[float] | None,
|
|
818
856
|
) -> Euler:
|
|
819
857
|
"""Return an Euler representation of the rotation matrix
|
|
820
858
|
(3x3 or 4x4 matrix only).
|
|
@@ -825,7 +863,7 @@ class Matrix:
|
|
|
825
863
|
:param euler_compat: Optional euler argument the new euler will be made
|
|
826
864
|
compatible with (no axis flipping between them).
|
|
827
865
|
Useful for converting a series of matrices to animation curves.
|
|
828
|
-
:type euler_compat: collections.abc.Sequence[float] |
|
|
866
|
+
:type euler_compat: Euler | collections.abc.Sequence[float] | None
|
|
829
867
|
:return: Euler representation of the matrix.
|
|
830
868
|
:rtype: Euler
|
|
831
869
|
"""
|
|
@@ -886,6 +924,29 @@ class Matrix:
|
|
|
886
924
|
"""
|
|
887
925
|
...
|
|
888
926
|
|
|
927
|
+
def __get__(self, instance, owner) -> Matrix:
|
|
928
|
+
"""
|
|
929
|
+
|
|
930
|
+
:param instance:
|
|
931
|
+
:param owner:
|
|
932
|
+
:return:
|
|
933
|
+
:rtype: Matrix
|
|
934
|
+
"""
|
|
935
|
+
...
|
|
936
|
+
|
|
937
|
+
def __set__(
|
|
938
|
+
self,
|
|
939
|
+
instance,
|
|
940
|
+
value: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]],
|
|
941
|
+
):
|
|
942
|
+
"""
|
|
943
|
+
|
|
944
|
+
:param instance:
|
|
945
|
+
:param value:
|
|
946
|
+
:type value: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
947
|
+
"""
|
|
948
|
+
...
|
|
949
|
+
|
|
889
950
|
def __getitem__(self, key: int) -> Vector:
|
|
890
951
|
"""
|
|
891
952
|
|
|
@@ -904,53 +965,59 @@ class Matrix:
|
|
|
904
965
|
"""
|
|
905
966
|
...
|
|
906
967
|
|
|
907
|
-
def __add__(
|
|
968
|
+
def __add__(
|
|
969
|
+
self, other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
970
|
+
) -> Matrix:
|
|
908
971
|
"""
|
|
909
972
|
|
|
910
973
|
:param other:
|
|
911
|
-
:type other: collections.abc.Sequence[float]
|
|
974
|
+
:type other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
912
975
|
:return:
|
|
913
976
|
:rtype: Matrix
|
|
914
977
|
"""
|
|
915
978
|
...
|
|
916
979
|
|
|
917
|
-
def __sub__(
|
|
980
|
+
def __sub__(
|
|
981
|
+
self, other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
982
|
+
) -> Matrix:
|
|
918
983
|
"""
|
|
919
984
|
|
|
920
985
|
:param other:
|
|
921
|
-
:type other: collections.abc.Sequence[float]
|
|
986
|
+
:type other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
922
987
|
:return:
|
|
923
988
|
:rtype: Matrix
|
|
924
989
|
"""
|
|
925
990
|
...
|
|
926
991
|
|
|
927
|
-
def __mul__(self, other:
|
|
992
|
+
def __mul__(self, other: float | int) -> Matrix:
|
|
928
993
|
"""
|
|
929
994
|
|
|
930
995
|
:param other:
|
|
931
|
-
:type other:
|
|
996
|
+
:type other: float | int
|
|
932
997
|
:return:
|
|
933
998
|
:rtype: Matrix
|
|
934
999
|
"""
|
|
935
1000
|
...
|
|
936
1001
|
|
|
937
1002
|
@typing.overload
|
|
938
|
-
def __matmul__(
|
|
1003
|
+
def __matmul__(
|
|
1004
|
+
self, other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
1005
|
+
) -> Matrix:
|
|
939
1006
|
"""
|
|
940
1007
|
|
|
941
1008
|
:param other:
|
|
942
|
-
:type other: collections.abc.Sequence[float]
|
|
1009
|
+
:type other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
943
1010
|
:return:
|
|
944
1011
|
:rtype: Matrix
|
|
945
1012
|
"""
|
|
946
1013
|
...
|
|
947
1014
|
|
|
948
1015
|
@typing.overload
|
|
949
|
-
def __matmul__(self, other: collections.abc.Sequence[float]
|
|
1016
|
+
def __matmul__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
950
1017
|
"""
|
|
951
1018
|
|
|
952
1019
|
:param other:
|
|
953
|
-
:type other: collections.abc.Sequence[float]
|
|
1020
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
954
1021
|
:return:
|
|
955
1022
|
:rtype: Vector
|
|
956
1023
|
"""
|
|
@@ -958,55 +1025,59 @@ class Matrix:
|
|
|
958
1025
|
|
|
959
1026
|
def __matmul__(
|
|
960
1027
|
self,
|
|
961
|
-
other:
|
|
962
|
-
|
|
|
963
|
-
| collections.abc.Sequence[float]
|
|
964
|
-
|
|
|
1028
|
+
other: Matrix
|
|
1029
|
+
| Vector
|
|
1030
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
1031
|
+
| collections.abc.Sequence[float],
|
|
965
1032
|
) -> Matrix | Vector:
|
|
966
1033
|
"""
|
|
967
1034
|
|
|
968
1035
|
:param other:
|
|
969
|
-
:type other: collections.abc.Sequence[float] |
|
|
1036
|
+
:type other: Matrix | Vector | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float]
|
|
970
1037
|
:return:
|
|
971
1038
|
:rtype: Matrix | Vector
|
|
972
1039
|
"""
|
|
973
1040
|
...
|
|
974
1041
|
|
|
975
|
-
def __radd__(
|
|
1042
|
+
def __radd__(
|
|
1043
|
+
self, other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
1044
|
+
) -> Matrix:
|
|
976
1045
|
"""
|
|
977
1046
|
|
|
978
1047
|
:param other:
|
|
979
|
-
:type other: collections.abc.Sequence[float]
|
|
1048
|
+
:type other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
980
1049
|
:return:
|
|
981
1050
|
:rtype: Matrix
|
|
982
1051
|
"""
|
|
983
1052
|
...
|
|
984
1053
|
|
|
985
|
-
def __rsub__(
|
|
1054
|
+
def __rsub__(
|
|
1055
|
+
self, other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
1056
|
+
) -> Matrix:
|
|
986
1057
|
"""
|
|
987
1058
|
|
|
988
1059
|
:param other:
|
|
989
|
-
:type other: collections.abc.Sequence[float]
|
|
1060
|
+
:type other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
990
1061
|
:return:
|
|
991
1062
|
:rtype: Matrix
|
|
992
1063
|
"""
|
|
993
1064
|
...
|
|
994
1065
|
|
|
995
|
-
def __rmul__(self, other:
|
|
1066
|
+
def __rmul__(self, other: float | int) -> Matrix:
|
|
996
1067
|
"""
|
|
997
1068
|
|
|
998
1069
|
:param other:
|
|
999
|
-
:type other:
|
|
1070
|
+
:type other: float | int
|
|
1000
1071
|
:return:
|
|
1001
1072
|
:rtype: Matrix
|
|
1002
1073
|
"""
|
|
1003
1074
|
...
|
|
1004
1075
|
|
|
1005
|
-
def __imul__(self, other:
|
|
1076
|
+
def __imul__(self, other: float | int) -> Matrix:
|
|
1006
1077
|
"""
|
|
1007
1078
|
|
|
1008
1079
|
:param other:
|
|
1009
|
-
:type other:
|
|
1080
|
+
:type other: float | int
|
|
1010
1081
|
:return:
|
|
1011
1082
|
:rtype: Matrix
|
|
1012
1083
|
"""
|
|
@@ -1021,10 +1092,10 @@ class Quaternion:
|
|
|
1021
1092
|
:type: float
|
|
1022
1093
|
"""
|
|
1023
1094
|
|
|
1024
|
-
axis:
|
|
1095
|
+
axis: Vector
|
|
1025
1096
|
""" Quaternion axis as a vector.
|
|
1026
1097
|
|
|
1027
|
-
:type:
|
|
1098
|
+
:type: Vector
|
|
1028
1099
|
"""
|
|
1029
1100
|
|
|
1030
1101
|
is_frozen: bool
|
|
@@ -1098,21 +1169,21 @@ class Quaternion:
|
|
|
1098
1169
|
"""
|
|
1099
1170
|
...
|
|
1100
1171
|
|
|
1101
|
-
def cross(self, other: collections.abc.Sequence[float]
|
|
1172
|
+
def cross(self, other: Quaternion | collections.abc.Sequence[float]) -> Quaternion:
|
|
1102
1173
|
"""Return the cross product of this quaternion and another.
|
|
1103
1174
|
|
|
1104
1175
|
:param other: The other quaternion to perform the cross product with.
|
|
1105
|
-
:type other: collections.abc.Sequence[float]
|
|
1176
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1106
1177
|
:return: The cross product.
|
|
1107
1178
|
:rtype: Quaternion
|
|
1108
1179
|
"""
|
|
1109
1180
|
...
|
|
1110
1181
|
|
|
1111
|
-
def dot(self, other: collections.abc.Sequence[float]
|
|
1182
|
+
def dot(self, other: Quaternion | collections.abc.Sequence[float]) -> float:
|
|
1112
1183
|
"""Return the dot product of this quaternion and another.
|
|
1113
1184
|
|
|
1114
1185
|
:param other: The other quaternion to perform the dot product with.
|
|
1115
|
-
:type other: collections.abc.Sequence[float]
|
|
1186
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1116
1187
|
:return: The dot product.
|
|
1117
1188
|
:rtype: float
|
|
1118
1189
|
"""
|
|
@@ -1168,39 +1239,38 @@ class Quaternion:
|
|
|
1168
1239
|
|
|
1169
1240
|
def rotate(
|
|
1170
1241
|
self,
|
|
1171
|
-
other:
|
|
1172
|
-
|
|
|
1173
|
-
| collections.abc.Sequence[float]
|
|
1242
|
+
other: Euler
|
|
1243
|
+
| Matrix
|
|
1174
1244
|
| Quaternion
|
|
1175
|
-
| collections.abc.Sequence[float]
|
|
1176
|
-
|
|
|
1245
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
1246
|
+
| collections.abc.Sequence[float],
|
|
1177
1247
|
):
|
|
1178
1248
|
"""Rotates the quaternion by another mathutils value.
|
|
1179
1249
|
|
|
1180
1250
|
:param other: rotation component of mathutils value
|
|
1181
|
-
:type other:
|
|
1251
|
+
:type other: Euler | Matrix | Quaternion | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float]
|
|
1182
1252
|
"""
|
|
1183
1253
|
...
|
|
1184
1254
|
|
|
1185
1255
|
def rotation_difference(
|
|
1186
|
-
self, other: collections.abc.Sequence[float]
|
|
1256
|
+
self, other: Quaternion | collections.abc.Sequence[float]
|
|
1187
1257
|
) -> Quaternion:
|
|
1188
1258
|
"""Returns a quaternion representing the rotational difference.
|
|
1189
1259
|
|
|
1190
1260
|
:param other: second quaternion.
|
|
1191
|
-
:type other: collections.abc.Sequence[float]
|
|
1261
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1192
1262
|
:return: the rotational difference between the two quat rotations.
|
|
1193
1263
|
:rtype: Quaternion
|
|
1194
1264
|
"""
|
|
1195
1265
|
...
|
|
1196
1266
|
|
|
1197
1267
|
def slerp(
|
|
1198
|
-
self, other: collections.abc.Sequence[float]
|
|
1268
|
+
self, other: Quaternion | collections.abc.Sequence[float], factor: float
|
|
1199
1269
|
) -> Quaternion:
|
|
1200
1270
|
"""Returns the interpolation of two quaternions.
|
|
1201
1271
|
|
|
1202
1272
|
:param other: value to interpolate with.
|
|
1203
|
-
:type other: collections.abc.Sequence[float]
|
|
1273
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1204
1274
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
1205
1275
|
:type factor: float
|
|
1206
1276
|
:return: The interpolated rotation.
|
|
@@ -1219,7 +1289,7 @@ class Quaternion:
|
|
|
1219
1289
|
def to_euler(
|
|
1220
1290
|
self,
|
|
1221
1291
|
order: str | None,
|
|
1222
|
-
euler_compat: collections.abc.Sequence[float] |
|
|
1292
|
+
euler_compat: Euler | collections.abc.Sequence[float] | None,
|
|
1223
1293
|
) -> Euler:
|
|
1224
1294
|
"""Return Euler representation of the quaternion.
|
|
1225
1295
|
|
|
@@ -1229,7 +1299,7 @@ class Quaternion:
|
|
|
1229
1299
|
:param euler_compat: Optional euler argument the new euler will be made
|
|
1230
1300
|
compatible with (no axis flipping between them).
|
|
1231
1301
|
Useful for converting a series of matrices to animation curves.
|
|
1232
|
-
:type euler_compat: collections.abc.Sequence[float] |
|
|
1302
|
+
:type euler_compat: Euler | collections.abc.Sequence[float] | None
|
|
1233
1303
|
:return: Euler representation of the quaternion.
|
|
1234
1304
|
:rtype: Euler
|
|
1235
1305
|
"""
|
|
@@ -1268,6 +1338,25 @@ class Quaternion:
|
|
|
1268
1338
|
"""
|
|
1269
1339
|
...
|
|
1270
1340
|
|
|
1341
|
+
def __get__(self, instance, owner) -> Quaternion:
|
|
1342
|
+
"""
|
|
1343
|
+
|
|
1344
|
+
:param instance:
|
|
1345
|
+
:param owner:
|
|
1346
|
+
:return:
|
|
1347
|
+
:rtype: Quaternion
|
|
1348
|
+
"""
|
|
1349
|
+
...
|
|
1350
|
+
|
|
1351
|
+
def __set__(self, instance, value: Quaternion | collections.abc.Sequence[float]):
|
|
1352
|
+
"""
|
|
1353
|
+
|
|
1354
|
+
:param instance:
|
|
1355
|
+
:param value:
|
|
1356
|
+
:type value: Quaternion | collections.abc.Sequence[float]
|
|
1357
|
+
"""
|
|
1358
|
+
...
|
|
1359
|
+
|
|
1271
1360
|
def __len__(self) -> int:
|
|
1272
1361
|
"""
|
|
1273
1362
|
|
|
@@ -1299,36 +1388,36 @@ class Quaternion:
|
|
|
1299
1388
|
...
|
|
1300
1389
|
|
|
1301
1390
|
def __add__(
|
|
1302
|
-
self, other: collections.abc.Sequence[float]
|
|
1391
|
+
self, other: Quaternion | collections.abc.Sequence[float]
|
|
1303
1392
|
) -> Quaternion:
|
|
1304
1393
|
"""
|
|
1305
1394
|
|
|
1306
1395
|
:param other:
|
|
1307
|
-
:type other: collections.abc.Sequence[float]
|
|
1396
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1308
1397
|
:return:
|
|
1309
1398
|
:rtype: Quaternion
|
|
1310
1399
|
"""
|
|
1311
1400
|
...
|
|
1312
1401
|
|
|
1313
1402
|
def __sub__(
|
|
1314
|
-
self, other: collections.abc.Sequence[float]
|
|
1403
|
+
self, other: Quaternion | collections.abc.Sequence[float]
|
|
1315
1404
|
) -> Quaternion:
|
|
1316
1405
|
"""
|
|
1317
1406
|
|
|
1318
1407
|
:param other:
|
|
1319
|
-
:type other: collections.abc.Sequence[float]
|
|
1408
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1320
1409
|
:return:
|
|
1321
1410
|
:rtype: Quaternion
|
|
1322
1411
|
"""
|
|
1323
1412
|
...
|
|
1324
1413
|
|
|
1325
1414
|
def __mul__(
|
|
1326
|
-
self, other:
|
|
1415
|
+
self, other: Quaternion | collections.abc.Sequence[float] | float | int
|
|
1327
1416
|
) -> Quaternion:
|
|
1328
1417
|
"""
|
|
1329
1418
|
|
|
1330
1419
|
:param other:
|
|
1331
|
-
:type other:
|
|
1420
|
+
:type other: Quaternion | collections.abc.Sequence[float] | float | int
|
|
1332
1421
|
:return:
|
|
1333
1422
|
:rtype: Quaternion
|
|
1334
1423
|
"""
|
|
@@ -1336,87 +1425,83 @@ class Quaternion:
|
|
|
1336
1425
|
|
|
1337
1426
|
@typing.overload
|
|
1338
1427
|
def __matmul__(
|
|
1339
|
-
self, other: collections.abc.Sequence[float]
|
|
1428
|
+
self, other: Quaternion | collections.abc.Sequence[float]
|
|
1340
1429
|
) -> Quaternion:
|
|
1341
1430
|
"""
|
|
1342
1431
|
|
|
1343
1432
|
:param other:
|
|
1344
|
-
:type other: collections.abc.Sequence[float]
|
|
1433
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1345
1434
|
:return:
|
|
1346
1435
|
:rtype: Quaternion
|
|
1347
1436
|
"""
|
|
1348
1437
|
...
|
|
1349
1438
|
|
|
1350
1439
|
@typing.overload
|
|
1351
|
-
def __matmul__(self, other: collections.abc.Sequence[float]
|
|
1440
|
+
def __matmul__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
1352
1441
|
"""
|
|
1353
1442
|
|
|
1354
1443
|
:param other:
|
|
1355
|
-
:type other: collections.abc.Sequence[float]
|
|
1444
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
1356
1445
|
:return:
|
|
1357
1446
|
:rtype: Vector
|
|
1358
1447
|
"""
|
|
1359
1448
|
...
|
|
1360
1449
|
|
|
1361
1450
|
def __matmul__(
|
|
1362
|
-
self,
|
|
1363
|
-
|
|
1364
|
-
| Vector
|
|
1365
|
-
| collections.abc.Sequence[float]
|
|
1366
|
-
| Quaternion,
|
|
1367
|
-
) -> Vector | Quaternion:
|
|
1451
|
+
self, other: Quaternion | Vector | collections.abc.Sequence[float]
|
|
1452
|
+
) -> Quaternion | Vector:
|
|
1368
1453
|
"""
|
|
1369
1454
|
|
|
1370
1455
|
:param other:
|
|
1371
|
-
:type other:
|
|
1456
|
+
:type other: Quaternion | Vector | collections.abc.Sequence[float]
|
|
1372
1457
|
:return:
|
|
1373
|
-
:rtype:
|
|
1458
|
+
:rtype: Quaternion | Vector
|
|
1374
1459
|
"""
|
|
1375
1460
|
...
|
|
1376
1461
|
|
|
1377
1462
|
def __radd__(
|
|
1378
|
-
self, other: collections.abc.Sequence[float]
|
|
1463
|
+
self, other: Quaternion | collections.abc.Sequence[float]
|
|
1379
1464
|
) -> Quaternion:
|
|
1380
1465
|
"""
|
|
1381
1466
|
|
|
1382
1467
|
:param other:
|
|
1383
|
-
:type other: collections.abc.Sequence[float]
|
|
1468
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1384
1469
|
:return:
|
|
1385
1470
|
:rtype: Quaternion
|
|
1386
1471
|
"""
|
|
1387
1472
|
...
|
|
1388
1473
|
|
|
1389
1474
|
def __rsub__(
|
|
1390
|
-
self, other: collections.abc.Sequence[float]
|
|
1475
|
+
self, other: Quaternion | collections.abc.Sequence[float]
|
|
1391
1476
|
) -> Quaternion:
|
|
1392
1477
|
"""
|
|
1393
1478
|
|
|
1394
1479
|
:param other:
|
|
1395
|
-
:type other: collections.abc.Sequence[float]
|
|
1480
|
+
:type other: Quaternion | collections.abc.Sequence[float]
|
|
1396
1481
|
:return:
|
|
1397
1482
|
:rtype: Quaternion
|
|
1398
1483
|
"""
|
|
1399
1484
|
...
|
|
1400
1485
|
|
|
1401
1486
|
def __rmul__(
|
|
1402
|
-
self, other:
|
|
1487
|
+
self, other: Quaternion | collections.abc.Sequence[float] | float | int
|
|
1403
1488
|
) -> Quaternion:
|
|
1404
1489
|
"""
|
|
1405
1490
|
|
|
1406
1491
|
:param other:
|
|
1407
|
-
:type other:
|
|
1492
|
+
:type other: Quaternion | collections.abc.Sequence[float] | float | int
|
|
1408
1493
|
:return:
|
|
1409
1494
|
:rtype: Quaternion
|
|
1410
1495
|
"""
|
|
1411
1496
|
...
|
|
1412
1497
|
|
|
1413
1498
|
def __imul__(
|
|
1414
|
-
self, other:
|
|
1499
|
+
self, other: Quaternion | collections.abc.Sequence[float] | float | int
|
|
1415
1500
|
) -> Quaternion:
|
|
1416
1501
|
"""
|
|
1417
1502
|
|
|
1418
1503
|
:param other:
|
|
1419
|
-
:type other:
|
|
1504
|
+
:type other: Quaternion | collections.abc.Sequence[float] | float | int
|
|
1420
1505
|
:return:
|
|
1421
1506
|
:rtype: Quaternion
|
|
1422
1507
|
"""
|
|
@@ -2545,13 +2630,13 @@ class Vector:
|
|
|
2545
2630
|
|
|
2546
2631
|
def angle(
|
|
2547
2632
|
self,
|
|
2548
|
-
other: collections.abc.Sequence[float]
|
|
2633
|
+
other: Vector | collections.abc.Sequence[float],
|
|
2549
2634
|
fallback: typing.Any = None,
|
|
2550
2635
|
) -> float:
|
|
2551
2636
|
"""Return the angle between two vectors.
|
|
2552
2637
|
|
|
2553
2638
|
:param other: another vector to compare the angle with
|
|
2554
|
-
:type other: collections.abc.Sequence[float]
|
|
2639
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2555
2640
|
:param fallback: return this when the angle can't be calculated (zero length vector),
|
|
2556
2641
|
(instead of raising a `ValueError`).
|
|
2557
2642
|
:type fallback: typing.Any
|
|
@@ -2561,12 +2646,12 @@ class Vector:
|
|
|
2561
2646
|
...
|
|
2562
2647
|
|
|
2563
2648
|
def angle_signed(
|
|
2564
|
-
self, other: collections.abc.Sequence[float]
|
|
2649
|
+
self, other: Vector | collections.abc.Sequence[float], fallback: typing.Any
|
|
2565
2650
|
) -> float:
|
|
2566
2651
|
"""Return the signed angle between two 2D vectors (clockwise is positive).
|
|
2567
2652
|
|
|
2568
2653
|
:param other: another vector to compare the angle with
|
|
2569
|
-
:type other: collections.abc.Sequence[float]
|
|
2654
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2570
2655
|
:param fallback: return this when the angle can't be calculated (zero length vector),
|
|
2571
2656
|
(instead of raising a `ValueError`).
|
|
2572
2657
|
:type fallback: typing.Any
|
|
@@ -2583,21 +2668,21 @@ class Vector:
|
|
|
2583
2668
|
"""
|
|
2584
2669
|
...
|
|
2585
2670
|
|
|
2586
|
-
def cross(self, other: collections.abc.Sequence[float]
|
|
2671
|
+
def cross(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2587
2672
|
"""Return the cross product of this vector and another.
|
|
2588
2673
|
|
|
2589
2674
|
:param other: The other vector to perform the cross product with.
|
|
2590
|
-
:type other: collections.abc.Sequence[float]
|
|
2675
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2591
2676
|
:return: The cross product.
|
|
2592
2677
|
:rtype: Vector
|
|
2593
2678
|
"""
|
|
2594
2679
|
...
|
|
2595
2680
|
|
|
2596
|
-
def dot(self, other: collections.abc.Sequence[float]
|
|
2681
|
+
def dot(self, other: Vector | collections.abc.Sequence[float]) -> float:
|
|
2597
2682
|
"""Return the dot product of this vector and another.
|
|
2598
2683
|
|
|
2599
2684
|
:param other: The other vector to perform the dot product with.
|
|
2600
|
-
:type other: collections.abc.Sequence[float]
|
|
2685
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2601
2686
|
:return: The dot product.
|
|
2602
2687
|
:rtype: float
|
|
2603
2688
|
"""
|
|
@@ -2612,12 +2697,12 @@ class Vector:
|
|
|
2612
2697
|
...
|
|
2613
2698
|
|
|
2614
2699
|
def lerp(
|
|
2615
|
-
self, other: collections.abc.Sequence[float]
|
|
2700
|
+
self, other: Vector | collections.abc.Sequence[float], factor: float
|
|
2616
2701
|
) -> Vector:
|
|
2617
2702
|
"""Returns the interpolation of two vectors.
|
|
2618
2703
|
|
|
2619
2704
|
:param other: value to interpolate with.
|
|
2620
|
-
:type other: collections.abc.Sequence[float]
|
|
2705
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2621
2706
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
2622
2707
|
:type factor: float
|
|
2623
2708
|
:return: The interpolated vector.
|
|
@@ -2649,21 +2734,21 @@ class Vector:
|
|
|
2649
2734
|
"""
|
|
2650
2735
|
...
|
|
2651
2736
|
|
|
2652
|
-
def project(self, other: collections.abc.Sequence[float]
|
|
2737
|
+
def project(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2653
2738
|
"""Return the projection of this vector onto the other.
|
|
2654
2739
|
|
|
2655
2740
|
:param other: second vector.
|
|
2656
|
-
:type other: collections.abc.Sequence[float]
|
|
2741
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2657
2742
|
:return: the parallel projection vector
|
|
2658
2743
|
:rtype: Vector
|
|
2659
2744
|
"""
|
|
2660
2745
|
...
|
|
2661
2746
|
|
|
2662
|
-
def reflect(self, mirror: collections.abc.Sequence[float]
|
|
2747
|
+
def reflect(self, mirror: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2663
2748
|
"""Return the reflection vector from the mirror argument.
|
|
2664
2749
|
|
|
2665
2750
|
:param mirror: This vector could be a normal from the reflecting surface.
|
|
2666
|
-
:type mirror: collections.abc.Sequence[float]
|
|
2751
|
+
:type mirror: Vector | collections.abc.Sequence[float]
|
|
2667
2752
|
:return: The reflected vector matching the size of this vector.
|
|
2668
2753
|
:rtype: Vector
|
|
2669
2754
|
"""
|
|
@@ -2699,28 +2784,27 @@ class Vector:
|
|
|
2699
2784
|
|
|
2700
2785
|
def rotate(
|
|
2701
2786
|
self,
|
|
2702
|
-
other:
|
|
2703
|
-
|
|
|
2704
|
-
| collections.abc.Sequence[float]
|
|
2787
|
+
other: Euler
|
|
2788
|
+
| Matrix
|
|
2705
2789
|
| Quaternion
|
|
2706
|
-
| collections.abc.Sequence[float]
|
|
2707
|
-
|
|
|
2790
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
2791
|
+
| collections.abc.Sequence[float],
|
|
2708
2792
|
):
|
|
2709
2793
|
"""Rotate the vector by a rotation value.
|
|
2710
2794
|
|
|
2711
2795
|
:param other: rotation component of mathutils value
|
|
2712
|
-
:type other:
|
|
2796
|
+
:type other: Euler | Matrix | Quaternion | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float]
|
|
2713
2797
|
"""
|
|
2714
2798
|
...
|
|
2715
2799
|
|
|
2716
2800
|
def rotation_difference(
|
|
2717
|
-
self, other: collections.abc.Sequence[float]
|
|
2801
|
+
self, other: Vector | collections.abc.Sequence[float]
|
|
2718
2802
|
) -> Quaternion:
|
|
2719
2803
|
"""Returns a quaternion representing the rotational difference between this
|
|
2720
2804
|
vector and another.
|
|
2721
2805
|
|
|
2722
2806
|
:param other: second vector.
|
|
2723
|
-
:type other: collections.abc.Sequence[float]
|
|
2807
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2724
2808
|
:return: the rotational difference between the two vectors.
|
|
2725
2809
|
:rtype: Quaternion
|
|
2726
2810
|
"""
|
|
@@ -2728,14 +2812,14 @@ class Vector:
|
|
|
2728
2812
|
|
|
2729
2813
|
def slerp(
|
|
2730
2814
|
self,
|
|
2731
|
-
other: collections.abc.Sequence[float]
|
|
2815
|
+
other: Vector | collections.abc.Sequence[float],
|
|
2732
2816
|
factor: float,
|
|
2733
2817
|
fallback: typing.Any = None,
|
|
2734
2818
|
) -> Vector:
|
|
2735
2819
|
"""Returns the interpolation of two non-zero vectors (spherical coordinates).
|
|
2736
2820
|
|
|
2737
2821
|
:param other: value to interpolate with.
|
|
2738
|
-
:type other: collections.abc.Sequence[float]
|
|
2822
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2739
2823
|
:param factor: The interpolation value typically in [0.0, 1.0].
|
|
2740
2824
|
:type factor: float
|
|
2741
2825
|
:param fallback: return this when the vector can't be calculated (zero length vector or direct opposites),
|
|
@@ -2803,6 +2887,25 @@ class Vector:
|
|
|
2803
2887
|
"""
|
|
2804
2888
|
...
|
|
2805
2889
|
|
|
2890
|
+
def __get__(self, instance, owner) -> Vector:
|
|
2891
|
+
"""
|
|
2892
|
+
|
|
2893
|
+
:param instance:
|
|
2894
|
+
:param owner:
|
|
2895
|
+
:return:
|
|
2896
|
+
:rtype: Vector
|
|
2897
|
+
"""
|
|
2898
|
+
...
|
|
2899
|
+
|
|
2900
|
+
def __set__(self, instance, value: Vector | collections.abc.Sequence[float]):
|
|
2901
|
+
"""
|
|
2902
|
+
|
|
2903
|
+
:param instance:
|
|
2904
|
+
:param value:
|
|
2905
|
+
:type value: Vector | collections.abc.Sequence[float]
|
|
2906
|
+
"""
|
|
2907
|
+
...
|
|
2908
|
+
|
|
2806
2909
|
def __len__(self) -> int:
|
|
2807
2910
|
"""
|
|
2808
2911
|
|
|
@@ -2841,63 +2944,65 @@ class Vector:
|
|
|
2841
2944
|
"""
|
|
2842
2945
|
...
|
|
2843
2946
|
|
|
2844
|
-
def __add__(self, other: collections.abc.Sequence[float]
|
|
2947
|
+
def __add__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2845
2948
|
"""
|
|
2846
2949
|
|
|
2847
2950
|
:param other:
|
|
2848
|
-
:type other: collections.abc.Sequence[float]
|
|
2951
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2849
2952
|
:return:
|
|
2850
2953
|
:rtype: Vector
|
|
2851
2954
|
"""
|
|
2852
2955
|
...
|
|
2853
2956
|
|
|
2854
|
-
def __sub__(self, other: collections.abc.Sequence[float]
|
|
2957
|
+
def __sub__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2855
2958
|
"""
|
|
2856
2959
|
|
|
2857
2960
|
:param other:
|
|
2858
|
-
:type other: collections.abc.Sequence[float]
|
|
2961
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2859
2962
|
:return:
|
|
2860
2963
|
:rtype: Vector
|
|
2861
2964
|
"""
|
|
2862
2965
|
...
|
|
2863
2966
|
|
|
2864
|
-
def __mul__(self, other:
|
|
2967
|
+
def __mul__(self, other: float | int) -> Vector:
|
|
2865
2968
|
"""
|
|
2866
2969
|
|
|
2867
2970
|
:param other:
|
|
2868
|
-
:type other:
|
|
2971
|
+
:type other: float | int
|
|
2869
2972
|
:return:
|
|
2870
2973
|
:rtype: Vector
|
|
2871
2974
|
"""
|
|
2872
2975
|
...
|
|
2873
2976
|
|
|
2874
|
-
def __truediv__(self, other:
|
|
2977
|
+
def __truediv__(self, other: float | int) -> Vector:
|
|
2875
2978
|
"""
|
|
2876
2979
|
|
|
2877
2980
|
:param other:
|
|
2878
|
-
:type other:
|
|
2981
|
+
:type other: float | int
|
|
2879
2982
|
:return:
|
|
2880
2983
|
:rtype: Vector
|
|
2881
2984
|
"""
|
|
2882
2985
|
...
|
|
2883
2986
|
|
|
2884
2987
|
@typing.overload
|
|
2885
|
-
def __matmul__(self, other: collections.abc.Sequence[float]
|
|
2988
|
+
def __matmul__(self, other: Vector | collections.abc.Sequence[float]) -> float:
|
|
2886
2989
|
"""
|
|
2887
2990
|
|
|
2888
2991
|
:param other:
|
|
2889
|
-
:type other: collections.abc.Sequence[float]
|
|
2992
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2890
2993
|
:return:
|
|
2891
2994
|
:rtype: float
|
|
2892
2995
|
"""
|
|
2893
2996
|
...
|
|
2894
2997
|
|
|
2895
2998
|
@typing.overload
|
|
2896
|
-
def __matmul__(
|
|
2999
|
+
def __matmul__(
|
|
3000
|
+
self, other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
3001
|
+
) -> Vector:
|
|
2897
3002
|
"""
|
|
2898
3003
|
|
|
2899
3004
|
:param other:
|
|
2900
|
-
:type other: collections.abc.Sequence[float]
|
|
3005
|
+
:type other: Matrix | collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
2901
3006
|
:return:
|
|
2902
3007
|
:rtype: Vector
|
|
2903
3008
|
"""
|
|
@@ -2905,95 +3010,95 @@ class Vector:
|
|
|
2905
3010
|
|
|
2906
3011
|
def __matmul__(
|
|
2907
3012
|
self,
|
|
2908
|
-
other:
|
|
3013
|
+
other: Matrix
|
|
2909
3014
|
| Vector
|
|
2910
|
-
| collections.abc.Sequence[float]
|
|
2911
|
-
|
|
|
3015
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
3016
|
+
| collections.abc.Sequence[float],
|
|
2912
3017
|
) -> Vector | float:
|
|
2913
3018
|
"""
|
|
2914
3019
|
|
|
2915
3020
|
:param other:
|
|
2916
|
-
:type other: collections.abc.Sequence[float] |
|
|
3021
|
+
:type other: Matrix | Vector | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float]
|
|
2917
3022
|
:return:
|
|
2918
3023
|
:rtype: Vector | float
|
|
2919
3024
|
"""
|
|
2920
3025
|
...
|
|
2921
3026
|
|
|
2922
|
-
def __radd__(self, other: collections.abc.Sequence[float]
|
|
3027
|
+
def __radd__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2923
3028
|
"""
|
|
2924
3029
|
|
|
2925
3030
|
:param other:
|
|
2926
|
-
:type other: collections.abc.Sequence[float]
|
|
3031
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2927
3032
|
:return:
|
|
2928
3033
|
:rtype: Vector
|
|
2929
3034
|
"""
|
|
2930
3035
|
...
|
|
2931
3036
|
|
|
2932
|
-
def __rsub__(self, other: collections.abc.Sequence[float]
|
|
3037
|
+
def __rsub__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2933
3038
|
"""
|
|
2934
3039
|
|
|
2935
3040
|
:param other:
|
|
2936
|
-
:type other: collections.abc.Sequence[float]
|
|
3041
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2937
3042
|
:return:
|
|
2938
3043
|
:rtype: Vector
|
|
2939
3044
|
"""
|
|
2940
3045
|
...
|
|
2941
3046
|
|
|
2942
|
-
def __rmul__(self, other:
|
|
3047
|
+
def __rmul__(self, other: float | int) -> Vector:
|
|
2943
3048
|
"""
|
|
2944
3049
|
|
|
2945
3050
|
:param other:
|
|
2946
|
-
:type other:
|
|
3051
|
+
:type other: float | int
|
|
2947
3052
|
:return:
|
|
2948
3053
|
:rtype: Vector
|
|
2949
3054
|
"""
|
|
2950
3055
|
...
|
|
2951
3056
|
|
|
2952
|
-
def __rtruediv__(self, other:
|
|
3057
|
+
def __rtruediv__(self, other: float | int) -> Vector:
|
|
2953
3058
|
"""
|
|
2954
3059
|
|
|
2955
3060
|
:param other:
|
|
2956
|
-
:type other:
|
|
3061
|
+
:type other: float | int
|
|
2957
3062
|
:return:
|
|
2958
3063
|
:rtype: Vector
|
|
2959
3064
|
"""
|
|
2960
3065
|
...
|
|
2961
3066
|
|
|
2962
|
-
def __iadd__(self, other: collections.abc.Sequence[float]
|
|
3067
|
+
def __iadd__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2963
3068
|
"""
|
|
2964
3069
|
|
|
2965
3070
|
:param other:
|
|
2966
|
-
:type other: collections.abc.Sequence[float]
|
|
3071
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2967
3072
|
:return:
|
|
2968
3073
|
:rtype: Vector
|
|
2969
3074
|
"""
|
|
2970
3075
|
...
|
|
2971
3076
|
|
|
2972
|
-
def __isub__(self, other: collections.abc.Sequence[float]
|
|
3077
|
+
def __isub__(self, other: Vector | collections.abc.Sequence[float]) -> Vector:
|
|
2973
3078
|
"""
|
|
2974
3079
|
|
|
2975
3080
|
:param other:
|
|
2976
|
-
:type other: collections.abc.Sequence[float]
|
|
3081
|
+
:type other: Vector | collections.abc.Sequence[float]
|
|
2977
3082
|
:return:
|
|
2978
3083
|
:rtype: Vector
|
|
2979
3084
|
"""
|
|
2980
3085
|
...
|
|
2981
3086
|
|
|
2982
|
-
def __imul__(self, other:
|
|
3087
|
+
def __imul__(self, other: float | int) -> Vector:
|
|
2983
3088
|
"""
|
|
2984
3089
|
|
|
2985
3090
|
:param other:
|
|
2986
|
-
:type other:
|
|
3091
|
+
:type other: float | int
|
|
2987
3092
|
:return:
|
|
2988
3093
|
:rtype: Vector
|
|
2989
3094
|
"""
|
|
2990
3095
|
...
|
|
2991
3096
|
|
|
2992
|
-
def __itruediv__(self, other:
|
|
3097
|
+
def __itruediv__(self, other: float | int) -> Vector:
|
|
2993
3098
|
"""
|
|
2994
3099
|
|
|
2995
3100
|
:param other:
|
|
2996
|
-
:type other:
|
|
3101
|
+
:type other: float | int
|
|
2997
3102
|
:return:
|
|
2998
3103
|
:rtype: Vector
|
|
2999
3104
|
"""
|