fake-bpy-module 20240224__py3-none-any.whl → 20240326__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.
- addon_utils/__init__.pyi +54 -10
- animsys_refactor/__init__.pyi +36 -6
- aud/__init__.pyi +132 -125
- bgl/__init__.pyi +2545 -546
- bl_app_override/__init__.pyi +14 -3
- bl_app_override/helpers/__init__.pyi +24 -2
- bl_app_template_utils/__init__.pyi +19 -4
- bl_console_utils/autocomplete/complete_calltip/__init__.pyi +24 -5
- bl_console_utils/autocomplete/complete_import/__init__.pyi +14 -3
- bl_console_utils/autocomplete/complete_namespace/__init__.pyi +24 -5
- bl_console_utils/autocomplete/intellisense/__init__.pyi +9 -2
- bl_i18n_utils/bl_extract_messages/__init__.pyi +74 -15
- bl_i18n_utils/merge_po/__init__.pyi +4 -1
- bl_i18n_utils/settings/__init__.pyi +53 -6
- bl_i18n_utils/utils/__init__.pyi +332 -44
- bl_i18n_utils/utils_cli/__init__.pyi +29 -6
- bl_i18n_utils/utils_languages_menu/__init__.pyi +4 -1
- bl_i18n_utils/utils_rtl/__init__.pyi +9 -2
- bl_keymap_utils/io/__init__.pyi +44 -9
- bl_keymap_utils/keymap_from_toolbar/__init__.pyi +4 -1
- bl_keymap_utils/keymap_hierarchy/__init__.pyi +4 -1
- bl_keymap_utils/platform_helpers/__init__.pyi +9 -2
- bl_keymap_utils/versioning/__init__.pyi +4 -1
- bl_math/__init__.pyi +3 -3
- bl_operators/__init__.pyi +9 -2
- bl_operators/add_mesh_torus/__init__.pyi +171 -37
- bl_operators/anim/__init__.pyi +1065 -226
- bl_operators/assets/__init__.pyi +427 -92
- bl_operators/bmesh/find_adjacent/__init__.pyi +44 -9
- bl_operators/clip/__init__.pyi +1342 -287
- bl_operators/console/__init__.pyi +647 -140
- bl_operators/constraint/__init__.pyi +524 -112
- bl_operators/file/__init__.pyi +396 -84
- bl_operators/freestyle/__init__.pyi +532 -113
- bl_operators/geometry_nodes/__init__.pyi +2412 -596
- bl_operators/image/__init__.pyi +380 -82
- bl_operators/mesh/__init__.pyi +401 -85
- bl_operators/node/__init__.pyi +1756 -384
- bl_operators/object/__init__.pyi +2022 -552
- bl_operators/object_align/__init__.pyi +145 -31
- bl_operators/object_quick_effects/__init__.pyi +555 -124
- bl_operators/object_randomize_transform/__init__.pyi +136 -32
- bl_operators/presets/__init__.pyi +3516 -708
- bl_operators/rigidbody/__init__.pyi +401 -85
- bl_operators/screen_play_rendered_anim/__init__.pyi +129 -29
- bl_operators/sequencer/__init__.pyi +731 -149
- bl_operators/spreadsheet/__init__.pyi +145 -30
- bl_operators/userpref/__init__.pyi +3416 -824
- bl_operators/uvcalc_follow_active/__init__.pyi +149 -32
- bl_operators/uvcalc_lightmap/__init__.pyi +187 -34
- bl_operators/uvcalc_transform/__init__.pyi +344 -73
- bl_operators/vertexpaint_dirt/__init__.pyi +140 -30
- bl_operators/view3d/__init__.pyi +697 -146
- bl_operators/wm/__init__.pyi +6287 -1533
- bl_previews_utils/bl_previews_render/__init__.pyi +34 -7
- bl_rna_utils/data_path/__init__.pyi +12 -2
- bl_text_utils/external_editor/__init__.pyi +4 -1
- bl_ui/__init__.pyi +504 -106
- bl_ui/anim/__init__.pyi +164 -33
- bl_ui/asset_shelf/__init__.pyi +146 -31
- bl_ui/generic_ui_list/__init__.pyi +471 -99
- bl_ui/node_add_menu/__init__.pyi +196 -40
- bl_ui/node_add_menu_compositor/__init__.pyi +3017 -621
- bl_ui/node_add_menu_geometry/__init__.pyi +8060 -1625
- bl_ui/node_add_menu_shader/__init__.pyi +1709 -348
- bl_ui/node_add_menu_texture/__init__.pyi +1502 -305
- bl_ui/properties_animviz/__init__.pyi +32 -2
- bl_ui/properties_collection/__init__.pyi +787 -179
- bl_ui/properties_constraint/__init__.pyi +28635 -5523
- bl_ui/properties_data_armature/__init__.pyi +1905 -448
- bl_ui/properties_data_bone/__init__.pyi +1560 -336
- bl_ui/properties_data_camera/__init__.pyi +2269 -494
- bl_ui/properties_data_curve/__init__.pyi +2362 -534
- bl_ui/properties_data_curves/__init__.pyi +951 -203
- bl_ui/properties_data_empty/__init__.pyi +317 -69
- bl_ui/properties_data_gpencil/__init__.pyi +2924 -734
- bl_ui/properties_data_grease_pencil/__init__.pyi +1631 -188
- bl_ui/properties_data_lattice/__init__.pyi +472 -104
- bl_ui/properties_data_light/__init__.pyi +1570 -337
- bl_ui/properties_data_lightprobe/__init__.pyi +938 -208
- bl_ui/properties_data_mesh/__init__.pyi +3205 -767
- bl_ui/properties_data_metaball/__init__.pyi +774 -170
- bl_ui/properties_data_modifier/__init__.pyi +1554 -328
- bl_ui/properties_data_pointcloud/__init__.pyi +821 -194
- bl_ui/properties_data_shaderfx/__init__.pyi +154 -34
- bl_ui/properties_data_speaker/__init__.pyi +782 -168
- bl_ui/properties_data_volume/__init__.pyi +1243 -281
- bl_ui/properties_freestyle/__init__.pyi +4071 -1030
- bl_ui/properties_grease_pencil_common/__init__.pyi +2399 -483
- bl_ui/properties_mask_common/__init__.pyi +1256 -249
- bl_ui/properties_material/__init__.pyi +2351 -542
- bl_ui/properties_material_gpencil/__init__.pyi +1590 -365
- bl_ui/properties_object/__init__.pyi +2179 -512
- bl_ui/properties_output/__init__.pyi +2956 -705
- bl_ui/properties_paint_common/__init__.pyi +947 -140
- bl_ui/properties_particle/__init__.pyi +8322 -1970
- bl_ui/properties_physics_cloth/__init__.pyi +2254 -508
- bl_ui/properties_physics_common/__init__.pyi +200 -44
- bl_ui/properties_physics_dynamicpaint/__init__.pyi +4454 -965
- bl_ui/properties_physics_field/__init__.pyi +1695 -364
- bl_ui/properties_physics_fluid/__init__.pyi +6127 -1280
- bl_ui/properties_physics_geometry_nodes/__init__.pyi +157 -32
- bl_ui/properties_physics_rigidbody/__init__.pyi +1254 -278
- bl_ui/properties_physics_rigidbody_constraint/__init__.pyi +2053 -483
- bl_ui/properties_physics_softbody/__init__.pyi +2394 -542
- bl_ui/properties_render/__init__.pyi +8312 -1933
- bl_ui/properties_scene/__init__.pyi +2211 -539
- bl_ui/properties_texture/__init__.pyi +4185 -1013
- bl_ui/properties_view_layer/__init__.pyi +2803 -664
- bl_ui/properties_workspace/__init__.pyi +626 -148
- bl_ui/properties_world/__init__.pyi +1092 -234
- bl_ui/space_clip/__init__.pyi +11475 -2805
- bl_ui/space_console/__init__.pyi +967 -202
- bl_ui/space_dopesheet/__init__.pyi +4260 -966
- bl_ui/space_filebrowser/__init__.pyi +4852 -1187
- bl_ui/space_graph/__init__.pyi +3251 -702
- bl_ui/space_image/__init__.pyi +12219 -2968
- bl_ui/space_info/__init__.pyi +964 -200
- bl_ui/space_nla/__init__.pyi +2756 -584
- bl_ui/space_node/__init__.pyi +5661 -1265
- bl_ui/space_outliner/__init__.pyi +2294 -478
- bl_ui/space_properties/__init__.pyi +417 -92
- bl_ui/space_sequencer/__init__.pyi +12436 -3009
- bl_ui/space_spreadsheet/__init__.pyi +184 -36
- bl_ui/space_statusbar/__init__.pyi +135 -30
- bl_ui/space_text/__init__.pyi +2556 -542
- bl_ui/space_time/__init__.pyi +1151 -243
- bl_ui/space_toolsystem_common/__init__.pyi +368 -66
- bl_ui/space_toolsystem_toolbar/__init__.pyi +1378 -228
- bl_ui/space_topbar/__init__.pyi +4214 -887
- bl_ui/space_userpref/__init__.pyi +13920 -3468
- bl_ui/space_view3d/__init__.pyi +43701 -10599
- bl_ui/space_view3d_toolbar/__init__.pyi +16380 -3860
- bl_ui/utils/__init__.pyi +42 -4
- bl_ui_utils/bug_report_url/__init__.pyi +4 -1
- bl_ui_utils/layout/__init__.pyi +4 -1
- blend_render_info/__init__.pyi +13 -3
- blf/__init__.pyi +5 -7
- bmesh/__init__.pyi +7 -7
- bmesh/geometry/__init__.pyi +5 -5
- bmesh/ops/__init__.pyi +490 -504
- bmesh/types/__init__.pyi +268 -262
- bmesh/utils/__init__.pyi +55 -55
- bpy/__init__.pyi +2 -2
- bpy/app/__init__.pyi +4 -5
- bpy/app/handlers/__init__.pyi +36 -36
- bpy/app/icons/__init__.pyi +8 -10
- bpy/app/timers/__init__.pyi +9 -11
- bpy/app/translations/__init__.pyi +20 -22
- bpy/msgbus/__init__.pyi +3 -12
- bpy/ops/action/__init__.pyi +350 -305
- bpy/ops/anim/__init__.pyi +464 -426
- bpy/ops/armature/__init__.pyi +392 -360
- bpy/ops/asset/__init__.pyi +166 -129
- bpy/ops/boid/__init__.pyi +64 -37
- bpy/ops/brush/__init__.pyi +78 -72
- bpy/ops/buttons/__init__.pyi +136 -122
- bpy/ops/cachefile/__init__.pyi +128 -123
- bpy/ops/camera/__init__.pyi +22 -24
- bpy/ops/clip/__init__.pyi +844 -735
- bpy/ops/cloth/__init__.pyi +10 -11
- bpy/ops/collection/__init__.pyi +38 -38
- bpy/ops/console/__init__.pyi +170 -141
- bpy/ops/constraint/__init__.pyi +156 -159
- bpy/ops/curve/__init__.pyi +518 -461
- bpy/ops/curves/__init__.pyi +188 -159
- bpy/ops/cycles/__init__.pyi +20 -18
- bpy/ops/dpaint/__init__.pyi +40 -30
- bpy/ops/ed/__init__.pyi +136 -107
- bpy/ops/export_anim/__init__.pyi +18 -19
- bpy/ops/export_mesh/__init__.pyi +26 -27
- bpy/ops/export_scene/__init__.pyi +313 -334
- bpy/ops/file/__init__.pyi +394 -304
- bpy/ops/fluid/__init__.pyi +114 -63
- bpy/ops/font/__init__.pyi +272 -245
- bpy/ops/geometry/__init__.pyi +92 -87
- bpy/ops/gizmogroup/__init__.pyi +24 -21
- bpy/ops/gpencil/__init__.pyi +1530 -1476
- bpy/ops/graph/__init__.pyi +680 -659
- bpy/ops/grease_pencil/__init__.pyi +510 -390
- bpy/ops/image/__init__.pyi +650 -603
- bpy/ops/import_anim/__init__.pyi +26 -27
- bpy/ops/import_curve/__init__.pyi +6 -7
- bpy/ops/import_mesh/__init__.pyi +18 -21
- bpy/ops/import_scene/__init__.pyi +86 -95
- bpy/ops/info/__init__.pyi +68 -55
- bpy/ops/lattice/__init__.pyi +70 -63
- bpy/ops/marker/__init__.pyi +110 -111
- bpy/ops/mask/__init__.pyi +352 -308
- bpy/ops/material/__init__.pyi +24 -12
- bpy/ops/mball/__init__.pyi +72 -75
- bpy/ops/mesh/__init__.pyi +2052 -2088
- bpy/ops/nla/__init__.pyi +369 -313
- bpy/ops/node/__init__.pyi +944 -805
- bpy/ops/object/__init__.pyi +2662 -2461
- bpy/ops/outliner/__init__.pyi +582 -431
- bpy/ops/paint/__init__.pyi +605 -516
- bpy/ops/paintcurve/__init__.pyi +72 -60
- bpy/ops/palette/__init__.pyi +54 -46
- bpy/ops/particle/__init__.pyi +302 -245
- bpy/ops/pose/__init__.pyi +366 -330
- bpy/ops/poselib/__init__.pyi +78 -64
- bpy/ops/preferences/__init__.pyi +361 -341
- bpy/ops/ptcache/__init__.pyi +56 -38
- bpy/ops/render/__init__.pyi +120 -117
- bpy/ops/rigidbody/__init__.pyi +114 -97
- bpy/ops/scene/__init__.pyi +302 -240
- bpy/ops/screen/__init__.pyi +414 -363
- bpy/ops/script/__init__.pyi +20 -18
- bpy/ops/sculpt/__init__.pyi +414 -452
- bpy/ops/sculpt_curves/__init__.pyi +42 -43
- bpy/ops/sequencer/__init__.pyi +1094 -1053
- bpy/ops/sound/__init__.pyi +214 -206
- bpy/ops/spreadsheet/__init__.pyi +34 -28
- bpy/ops/surface/__init__.pyi +108 -114
- bpy/ops/text/__init__.pyi +432 -350
- bpy/ops/text_editor/__init__.pyi +10 -11
- bpy/ops/texture/__init__.pyi +32 -21
- bpy/ops/transform/__init__.pyi +801 -854
- bpy/ops/ui/__init__.pyi +254 -185
- bpy/ops/uilist/__init__.pyi +20 -23
- bpy/ops/uv/__init__.pyi +618 -626
- bpy/ops/view2d/__init__.pyi +162 -161
- bpy/ops/view3d/__init__.pyi +669 -658
- bpy/ops/wm/__init__.pyi +2433 -2415
- bpy/ops/workspace/__init__.pyi +54 -31
- bpy/ops/world/__init__.pyi +8 -4
- bpy/path/__init__.pyi +111 -68
- bpy/props/__init__.pyi +263 -267
- bpy/types/__init__.pyi +86789 -85719
- bpy/utils/__init__.pyi +265 -123
- bpy/utils/previews/__init__.pyi +103 -17
- bpy/utils/units/__init__.pyi +19 -22
- bpy_extras/__init__.pyi +0 -4
- bpy_extras/anim_utils/__init__.pyi +11 -46
- bpy_extras/asset_utils/__init__.pyi +3 -12
- bpy_extras/id_map_utils/__init__.pyi +0 -2
- bpy_extras/image_utils/__init__.pyi +2 -2
- bpy_extras/io_utils/__init__.pyi +30 -27
- bpy_extras/keyconfig_utils/__init__.pyi +4 -1
- bpy_extras/mesh_utils/__init__.pyi +18 -18
- bpy_extras/node_utils/__init__.pyi +4 -3
- bpy_extras/object_utils/__init__.pyi +25 -26
- bpy_extras/view3d_utils/__init__.pyi +33 -38
- bpy_restrict_state/__init__.pyi +14 -1
- bpy_types/__init__.pyi +3873 -997
- console_python/__init__.pyi +41 -7
- console_shell/__init__.pyi +24 -5
- {fake_bpy_module-20240224.dist-info → fake_bpy_module-20240326.dist-info}/METADATA +1 -1
- fake_bpy_module-20240326.dist-info/RECORD +343 -0
- {fake_bpy_module-20240224.dist-info → fake_bpy_module-20240326.dist-info}/WHEEL +1 -1
- freestyle/chainingiterators/__init__.pyi +50 -52
- freestyle/functions/__init__.pyi +303 -207
- freestyle/predicates/__init__.pyi +299 -115
- freestyle/shaders/__init__.pyi +49 -80
- freestyle/types/__init__.pyi +465 -472
- freestyle/utils/ContextFunctions/__init__.pyi +9 -9
- freestyle/utils/__init__.pyi +28 -18
- gpu/capabilities/__init__.pyi +27 -19
- gpu/matrix/__init__.pyi +14 -16
- gpu/platform/__init__.pyi +5 -5
- gpu/shader/__init__.pyi +2 -5
- gpu/state/__init__.pyi +1 -1
- gpu/texture/__init__.pyi +3 -3
- gpu/types/__init__.pyi +54 -85
- gpu_extras/batch/__init__.pyi +27 -5
- gpu_extras/presets/__init__.pyi +52 -14
- graphviz_export/__init__.pyi +9 -2
- idprop/types/__init__.pyi +36 -12
- imbuf/__init__.pyi +8 -9
- imbuf/types/__init__.pyi +8 -15
- keyingsets_builtins/__init__.pyi +3149 -701
- keyingsets_utils/__init__.pyi +69 -14
- mathutils/__init__.pyi +502 -427
- mathutils/bvhtree/__init__.pyi +28 -32
- mathutils/geometry/__init__.pyi +177 -186
- mathutils/kdtree/__init__.pyi +16 -18
- mathutils/noise/__init__.pyi +47 -48
- nodeitems_builtins/__init__.pyi +50 -10
- nodeitems_utils/__init__.pyi +58 -10
- rna_info/__init__.pyi +230 -26
- rna_keymap_ui/__init__.pyi +29 -6
- rna_prop_ui/__init__.pyi +69 -12
- rna_xml/__init__.pyi +29 -6
- sys_info/__init__.pyi +4 -1
- bpy_extras/bmesh_utils/__init__.pyi +0 -6
- bpy_extras/extensions/__init__.pyi +0 -4
- bpy_extras/extensions/junction_module/__init__.pyi +0 -12
- bpy_extras/node_shader_utils/__init__.pyi +0 -131
- bpy_extras/wm_utils/__init__.pyi +0 -4
- bpy_extras/wm_utils/progress_report/__init__.pyi +0 -29
- fake_bpy_module-20240224.dist-info/RECORD +0 -349
- {fake_bpy_module-20240224.dist-info → fake_bpy_module-20240326.dist-info}/top_level.txt +0 -0
mathutils/__init__.pyi
CHANGED
|
@@ -28,10 +28,10 @@ class Color:
|
|
|
28
28
|
:type: float
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
|
-
hsv: typing.Union[
|
|
31
|
+
hsv: typing.Union[typing.Sequence[float], Vector]
|
|
32
32
|
""" HSV Values in [0, 1].
|
|
33
33
|
|
|
34
|
-
:type: typing.Union[
|
|
34
|
+
:type: typing.Union[typing.Sequence[float], Vector]
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
37
|
is_frozen: bool
|
|
@@ -73,197 +73,221 @@ class Color:
|
|
|
73
73
|
:type: float
|
|
74
74
|
"""
|
|
75
75
|
|
|
76
|
-
def copy(self) ->
|
|
76
|
+
def copy(self) -> float:
|
|
77
77
|
"""Returns a copy of this color.
|
|
78
78
|
|
|
79
|
-
:rtype: 'Color'
|
|
80
79
|
:return: A copy of the color.
|
|
80
|
+
:rtype: Color
|
|
81
81
|
"""
|
|
82
82
|
...
|
|
83
83
|
|
|
84
|
-
def freeze(self):
|
|
84
|
+
def freeze(self) -> Color:
|
|
85
85
|
"""Make this object immutable.After this the object can be hashed, used in dictionaries & sets.
|
|
86
86
|
|
|
87
87
|
:return: An instance of this object.
|
|
88
88
|
"""
|
|
89
89
|
...
|
|
90
90
|
|
|
91
|
-
def from_aces_to_scene_linear(self)
|
|
91
|
+
def from_aces_to_scene_linear(self):
|
|
92
92
|
"""Convert from ACES2065-1 linear to scene linear color space.
|
|
93
93
|
|
|
94
|
-
:rtype: 'Color'
|
|
95
94
|
:return: A color in scene linear color space.
|
|
95
|
+
:rtype: Color
|
|
96
96
|
"""
|
|
97
97
|
...
|
|
98
98
|
|
|
99
|
-
def from_rec709_linear_to_scene_linear(self) ->
|
|
99
|
+
def from_rec709_linear_to_scene_linear(self) -> Color:
|
|
100
100
|
"""Convert from Rec.709 linear color space to scene linear color space.
|
|
101
101
|
|
|
102
|
-
:rtype: 'Color'
|
|
103
102
|
:return: A color in scene linear color space.
|
|
103
|
+
:rtype: Color
|
|
104
104
|
"""
|
|
105
105
|
...
|
|
106
106
|
|
|
107
|
-
def from_scene_linear_to_aces(self) ->
|
|
107
|
+
def from_scene_linear_to_aces(self) -> Color:
|
|
108
108
|
"""Convert from scene linear to ACES2065-1 linear color space.
|
|
109
109
|
|
|
110
|
-
:rtype: 'Color'
|
|
111
110
|
:return: A color in ACES2065-1 linear color space.
|
|
111
|
+
:rtype: Color
|
|
112
112
|
"""
|
|
113
113
|
...
|
|
114
114
|
|
|
115
|
-
def from_scene_linear_to_rec709_linear(self) ->
|
|
115
|
+
def from_scene_linear_to_rec709_linear(self) -> Color:
|
|
116
116
|
"""Convert from scene linear to Rec.709 linear color space.
|
|
117
117
|
|
|
118
|
-
:rtype: 'Color'
|
|
119
118
|
:return: A color in Rec.709 linear color space.
|
|
119
|
+
:rtype: Color
|
|
120
120
|
"""
|
|
121
121
|
...
|
|
122
122
|
|
|
123
|
-
def from_scene_linear_to_srgb(self) ->
|
|
123
|
+
def from_scene_linear_to_srgb(self) -> Color:
|
|
124
124
|
"""Convert from scene linear to sRGB color space.
|
|
125
125
|
|
|
126
|
-
:rtype: 'Color'
|
|
127
126
|
:return: A color in sRGB color space.
|
|
127
|
+
:rtype: Color
|
|
128
128
|
"""
|
|
129
129
|
...
|
|
130
130
|
|
|
131
|
-
def from_scene_linear_to_xyz_d65(self) ->
|
|
131
|
+
def from_scene_linear_to_xyz_d65(self) -> Color:
|
|
132
132
|
"""Convert from scene linear to CIE XYZ (Illuminant D65) color space.
|
|
133
133
|
|
|
134
|
-
:rtype: 'Color'
|
|
135
134
|
:return: A color in XYZ color space.
|
|
135
|
+
:rtype: Color
|
|
136
136
|
"""
|
|
137
137
|
...
|
|
138
138
|
|
|
139
|
-
def from_srgb_to_scene_linear(self) ->
|
|
139
|
+
def from_srgb_to_scene_linear(self) -> Color:
|
|
140
140
|
"""Convert from sRGB to scene linear color space.
|
|
141
141
|
|
|
142
|
-
:rtype: 'Color'
|
|
143
142
|
:return: A color in scene linear color space.
|
|
143
|
+
:rtype: Color
|
|
144
144
|
"""
|
|
145
145
|
...
|
|
146
146
|
|
|
147
|
-
def from_xyz_d65_to_scene_linear(self) ->
|
|
147
|
+
def from_xyz_d65_to_scene_linear(self) -> Color:
|
|
148
148
|
"""Convert from CIE XYZ (Illuminant D65) to scene linear color space.
|
|
149
149
|
|
|
150
|
-
:rtype: 'Color'
|
|
151
150
|
:return: A color in scene linear color space.
|
|
151
|
+
:rtype: Color
|
|
152
152
|
"""
|
|
153
153
|
...
|
|
154
154
|
|
|
155
|
-
def __init__(self, rgb=(0.0, 0.0, 0.0))
|
|
155
|
+
def __init__(self, rgb=(0.0, 0.0, 0.0)):
|
|
156
156
|
"""
|
|
157
157
|
|
|
158
|
-
:
|
|
158
|
+
:param rgb:
|
|
159
159
|
"""
|
|
160
160
|
...
|
|
161
161
|
|
|
162
|
-
def __add__(
|
|
162
|
+
def __add__(
|
|
163
|
+
self, other: typing.Union[typing.Sequence[float], Color]
|
|
164
|
+
) -> typing.Union[typing.Sequence[float], Color]:
|
|
163
165
|
"""
|
|
164
166
|
|
|
165
167
|
:param other:
|
|
166
|
-
:type other: typing.Union[
|
|
167
|
-
:
|
|
168
|
+
:type other: typing.Union[typing.Sequence[float], Color]
|
|
169
|
+
:return:
|
|
170
|
+
:rtype: Color
|
|
168
171
|
"""
|
|
169
172
|
...
|
|
170
173
|
|
|
171
|
-
def __sub__(
|
|
174
|
+
def __sub__(
|
|
175
|
+
self, other: typing.Union[typing.Sequence[float], Color]
|
|
176
|
+
) -> typing.Union[typing.Sequence[float], Color]:
|
|
172
177
|
"""
|
|
173
178
|
|
|
174
179
|
:param other:
|
|
175
|
-
:type other: typing.Union[
|
|
176
|
-
:
|
|
180
|
+
:type other: typing.Union[typing.Sequence[float], Color]
|
|
181
|
+
:return:
|
|
182
|
+
:rtype: Color
|
|
177
183
|
"""
|
|
178
184
|
...
|
|
179
185
|
|
|
180
|
-
def __mul__(self, other: typing.Union[
|
|
186
|
+
def __mul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
181
187
|
"""
|
|
182
188
|
|
|
183
189
|
:param other:
|
|
184
|
-
:type other: typing.Union[
|
|
185
|
-
:
|
|
190
|
+
:type other: typing.Union[int, float]
|
|
191
|
+
:return:
|
|
192
|
+
:rtype: Color
|
|
186
193
|
"""
|
|
187
194
|
...
|
|
188
195
|
|
|
189
|
-
def __truediv__(self, other: typing.Union[
|
|
196
|
+
def __truediv__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
190
197
|
"""
|
|
191
198
|
|
|
192
199
|
:param other:
|
|
193
|
-
:type other: typing.Union[
|
|
194
|
-
:
|
|
200
|
+
:type other: typing.Union[int, float]
|
|
201
|
+
:return:
|
|
202
|
+
:rtype: Color
|
|
195
203
|
"""
|
|
196
204
|
...
|
|
197
205
|
|
|
198
|
-
def __radd__(
|
|
206
|
+
def __radd__(
|
|
207
|
+
self, other: typing.Union[typing.Sequence[float], Color]
|
|
208
|
+
) -> typing.Union[typing.Sequence[float], Color]:
|
|
199
209
|
"""
|
|
200
210
|
|
|
201
211
|
:param other:
|
|
202
|
-
:type other: typing.Union[
|
|
203
|
-
:
|
|
212
|
+
:type other: typing.Union[typing.Sequence[float], Color]
|
|
213
|
+
:return:
|
|
214
|
+
:rtype: Color
|
|
204
215
|
"""
|
|
205
216
|
...
|
|
206
217
|
|
|
207
|
-
def __rsub__(
|
|
218
|
+
def __rsub__(
|
|
219
|
+
self, other: typing.Union[typing.Sequence[float], Color]
|
|
220
|
+
) -> typing.Union[typing.Sequence[float], Color]:
|
|
208
221
|
"""
|
|
209
222
|
|
|
210
223
|
:param other:
|
|
211
|
-
:type other: typing.Union[
|
|
212
|
-
:
|
|
224
|
+
:type other: typing.Union[typing.Sequence[float], Color]
|
|
225
|
+
:return:
|
|
226
|
+
:rtype: Color
|
|
213
227
|
"""
|
|
214
228
|
...
|
|
215
229
|
|
|
216
|
-
def __rmul__(self, other: typing.Union[
|
|
230
|
+
def __rmul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
217
231
|
"""
|
|
218
232
|
|
|
219
233
|
:param other:
|
|
220
|
-
:type other: typing.Union[
|
|
221
|
-
:
|
|
234
|
+
:type other: typing.Union[int, float]
|
|
235
|
+
:return:
|
|
236
|
+
:rtype: Color
|
|
222
237
|
"""
|
|
223
238
|
...
|
|
224
239
|
|
|
225
|
-
def __rtruediv__(self, other: typing.Union[
|
|
240
|
+
def __rtruediv__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
226
241
|
"""
|
|
227
242
|
|
|
228
243
|
:param other:
|
|
229
|
-
:type other: typing.Union[
|
|
230
|
-
:
|
|
244
|
+
:type other: typing.Union[int, float]
|
|
245
|
+
:return:
|
|
246
|
+
:rtype: Color
|
|
231
247
|
"""
|
|
232
248
|
...
|
|
233
249
|
|
|
234
|
-
def __iadd__(
|
|
250
|
+
def __iadd__(
|
|
251
|
+
self, other: typing.Union[typing.Sequence[float], Color]
|
|
252
|
+
) -> typing.Union[typing.Sequence[float], Color]:
|
|
235
253
|
"""
|
|
236
254
|
|
|
237
255
|
:param other:
|
|
238
|
-
:type other: typing.Union[
|
|
239
|
-
:
|
|
256
|
+
:type other: typing.Union[typing.Sequence[float], Color]
|
|
257
|
+
:return:
|
|
258
|
+
:rtype: Color
|
|
240
259
|
"""
|
|
241
260
|
...
|
|
242
261
|
|
|
243
|
-
def __isub__(
|
|
262
|
+
def __isub__(
|
|
263
|
+
self, other: typing.Union[typing.Sequence[float], Color]
|
|
264
|
+
) -> typing.Union[typing.Sequence[float], Color]:
|
|
244
265
|
"""
|
|
245
266
|
|
|
246
267
|
:param other:
|
|
247
|
-
:type other: typing.Union[
|
|
248
|
-
:
|
|
268
|
+
:type other: typing.Union[typing.Sequence[float], Color]
|
|
269
|
+
:return:
|
|
270
|
+
:rtype: Color
|
|
249
271
|
"""
|
|
250
272
|
...
|
|
251
273
|
|
|
252
|
-
def __imul__(self, other: typing.Union[
|
|
274
|
+
def __imul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
253
275
|
"""
|
|
254
276
|
|
|
255
277
|
:param other:
|
|
256
|
-
:type other: typing.Union[
|
|
257
|
-
:
|
|
278
|
+
:type other: typing.Union[int, float]
|
|
279
|
+
:return:
|
|
280
|
+
:rtype: Color
|
|
258
281
|
"""
|
|
259
282
|
...
|
|
260
283
|
|
|
261
|
-
def __itruediv__(self, other: typing.Union[
|
|
284
|
+
def __itruediv__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
262
285
|
"""
|
|
263
286
|
|
|
264
287
|
:param other:
|
|
265
|
-
:type other: typing.Union[
|
|
266
|
-
:
|
|
288
|
+
:type other: typing.Union[int, float]
|
|
289
|
+
:return:
|
|
290
|
+
:rtype: Color
|
|
267
291
|
"""
|
|
268
292
|
...
|
|
269
293
|
|
|
@@ -288,11 +312,8 @@ class Euler:
|
|
|
288
312
|
:type: bool
|
|
289
313
|
"""
|
|
290
314
|
|
|
291
|
-
order:
|
|
292
|
-
""" Euler rotation order.
|
|
293
|
-
|
|
294
|
-
:type: str
|
|
295
|
-
"""
|
|
315
|
+
order: typing.Any
|
|
316
|
+
""" Euler rotation order."""
|
|
296
317
|
|
|
297
318
|
owner: typing.Any
|
|
298
319
|
""" The item this is wrapping or None (read-only)."""
|
|
@@ -315,15 +336,15 @@ class Euler:
|
|
|
315
336
|
:type: float
|
|
316
337
|
"""
|
|
317
338
|
|
|
318
|
-
def copy(self) ->
|
|
339
|
+
def copy(self) -> float:
|
|
319
340
|
"""Returns a copy of this euler.
|
|
320
341
|
|
|
321
|
-
:rtype: 'Euler'
|
|
322
342
|
:return: A copy of the euler.
|
|
343
|
+
:rtype: Euler
|
|
323
344
|
"""
|
|
324
345
|
...
|
|
325
346
|
|
|
326
|
-
def freeze(self):
|
|
347
|
+
def freeze(self) -> Euler:
|
|
327
348
|
"""Make this object immutable.After this the object can be hashed, used in dictionaries & sets.
|
|
328
349
|
|
|
329
350
|
:return: An instance of this object.
|
|
@@ -335,25 +356,24 @@ class Euler:
|
|
|
335
356
|
so interpolating between them works as intended.
|
|
336
357
|
|
|
337
358
|
:param other:
|
|
338
|
-
:type other:
|
|
339
359
|
"""
|
|
340
360
|
...
|
|
341
361
|
|
|
342
362
|
def rotate(
|
|
343
363
|
self,
|
|
344
364
|
other: typing.Union[
|
|
345
|
-
"Euler",
|
|
346
|
-
"Matrix",
|
|
347
|
-
"Quaternion",
|
|
348
365
|
typing.Sequence[float],
|
|
366
|
+
Euler,
|
|
349
367
|
typing.Sequence[float],
|
|
368
|
+
Quaternion,
|
|
350
369
|
typing.Sequence[float],
|
|
370
|
+
Matrix,
|
|
351
371
|
],
|
|
352
372
|
):
|
|
353
373
|
"""Rotates the euler by another mathutils value.
|
|
354
374
|
|
|
355
375
|
:param other: rotation component of mathutils value
|
|
356
|
-
:type other: typing.Union[
|
|
376
|
+
:type other: typing.Union[typing.Sequence[float], Euler, typing.Sequence[float], Quaternion, typing.Sequence[float], Matrix]
|
|
357
377
|
"""
|
|
358
378
|
...
|
|
359
379
|
|
|
@@ -368,19 +388,19 @@ class Euler:
|
|
|
368
388
|
"""
|
|
369
389
|
...
|
|
370
390
|
|
|
371
|
-
def to_matrix(self) ->
|
|
391
|
+
def to_matrix(self) -> float:
|
|
372
392
|
"""Return a matrix representation of the euler.
|
|
373
393
|
|
|
374
|
-
:rtype: 'Matrix'
|
|
375
394
|
:return: A 3x3 rotation matrix representation of the euler.
|
|
395
|
+
:rtype: Matrix
|
|
376
396
|
"""
|
|
377
397
|
...
|
|
378
398
|
|
|
379
|
-
def to_quaternion(self) ->
|
|
399
|
+
def to_quaternion(self) -> Matrix:
|
|
380
400
|
"""Return a quaternion representation of the euler.
|
|
381
401
|
|
|
382
|
-
:rtype: 'Quaternion'
|
|
383
402
|
:return: Quaternion representation of the euler.
|
|
403
|
+
:rtype: Quaternion
|
|
384
404
|
"""
|
|
385
405
|
...
|
|
386
406
|
|
|
@@ -388,10 +408,11 @@ class Euler:
|
|
|
388
408
|
"""Set all values to zero."""
|
|
389
409
|
...
|
|
390
410
|
|
|
391
|
-
def __init__(self, angles=(0.0, 0.0, 0.0), order="XYZ")
|
|
411
|
+
def __init__(self, angles=(0.0, 0.0, 0.0), order="XYZ"):
|
|
392
412
|
"""
|
|
393
413
|
|
|
394
|
-
:
|
|
414
|
+
:param angles:
|
|
415
|
+
:param order:
|
|
395
416
|
"""
|
|
396
417
|
...
|
|
397
418
|
|
|
@@ -400,11 +421,8 @@ class Matrix:
|
|
|
400
421
|
matrices from 2x2 up to 4x4.
|
|
401
422
|
"""
|
|
402
423
|
|
|
403
|
-
col:
|
|
404
|
-
""" Access the matrix by columns, 3x3 and 4x4 only, (read-only).
|
|
405
|
-
|
|
406
|
-
:type: 'Matrix'
|
|
407
|
-
"""
|
|
424
|
+
col: typing.Any
|
|
425
|
+
""" Access the matrix by columns, 3x3 and 4x4 only, (read-only)."""
|
|
408
426
|
|
|
409
427
|
is_frozen: bool
|
|
410
428
|
""" True when this object has been frozen (read-only).
|
|
@@ -457,86 +475,83 @@ class Matrix:
|
|
|
457
475
|
owner: typing.Any
|
|
458
476
|
""" The item this is wrapping or None (read-only)."""
|
|
459
477
|
|
|
460
|
-
row:
|
|
461
|
-
""" Access the matrix by rows (default), (read-only).
|
|
478
|
+
row: typing.Any
|
|
479
|
+
""" Access the matrix by rows (default), (read-only)."""
|
|
462
480
|
|
|
463
|
-
:
|
|
464
|
-
"""
|
|
465
|
-
|
|
466
|
-
translation: "Vector"
|
|
481
|
+
translation: Vector
|
|
467
482
|
""" The translation component of the matrix.
|
|
468
483
|
|
|
469
|
-
:type:
|
|
484
|
+
:type: Vector
|
|
470
485
|
"""
|
|
471
486
|
|
|
487
|
+
@classmethod
|
|
472
488
|
def Diagonal(
|
|
473
|
-
|
|
474
|
-
) ->
|
|
489
|
+
cls, vector: typing.Union[typing.Sequence[float], Vector]
|
|
490
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
475
491
|
"""Create a diagonal (scaling) matrix using the values from the vector.
|
|
476
492
|
|
|
477
493
|
:param vector: The vector of values for the diagonal.
|
|
478
|
-
:type vector: typing.Union[
|
|
479
|
-
:rtype: 'Matrix'
|
|
494
|
+
:type vector: typing.Union[typing.Sequence[float], Vector]
|
|
480
495
|
:return: A diagonal matrix.
|
|
496
|
+
:rtype: Matrix
|
|
481
497
|
"""
|
|
482
498
|
...
|
|
483
499
|
|
|
484
|
-
|
|
500
|
+
@classmethod
|
|
501
|
+
def Identity(cls, size: int) -> int:
|
|
485
502
|
"""Create an identity matrix.
|
|
486
503
|
|
|
487
504
|
:param size: The size of the identity matrix to construct [2, 4].
|
|
488
505
|
:type size: int
|
|
489
|
-
:rtype: 'Matrix'
|
|
490
506
|
:return: A new identity matrix.
|
|
507
|
+
:rtype: Matrix
|
|
491
508
|
"""
|
|
492
509
|
...
|
|
493
510
|
|
|
511
|
+
@classmethod
|
|
494
512
|
def LocRotScale(
|
|
495
|
-
|
|
496
|
-
location
|
|
497
|
-
rotation: typing.
|
|
498
|
-
typing.
|
|
499
|
-
"Euler", "Quaternion", typing.Sequence[float], typing.Sequence[float]
|
|
500
|
-
]
|
|
513
|
+
cls,
|
|
514
|
+
location,
|
|
515
|
+
rotation: typing.Union[
|
|
516
|
+
typing.Sequence[float], Quaternion, typing.Sequence[float], Euler
|
|
501
517
|
],
|
|
502
|
-
scale
|
|
503
|
-
)
|
|
518
|
+
scale,
|
|
519
|
+
):
|
|
504
520
|
"""Create a matrix combining translation, rotation and scale,
|
|
505
521
|
acting as the inverse of the decompose() method.Any of the inputs may be replaced with None if not needed.
|
|
506
522
|
|
|
507
523
|
:param location: The translation component.
|
|
508
|
-
:type location: typing.Optional['Vector']
|
|
509
524
|
:param rotation: The rotation component.
|
|
510
|
-
:type rotation: typing.
|
|
525
|
+
:type rotation: typing.Union[typing.Sequence[float], Quaternion, typing.Sequence[float], Euler]
|
|
511
526
|
:param scale: The scale component.
|
|
512
|
-
:type scale: typing.Optional['Vector']
|
|
513
|
-
:rtype: 'Matrix'
|
|
514
527
|
:return: Combined transformation matrix.
|
|
515
528
|
"""
|
|
516
529
|
...
|
|
517
530
|
|
|
531
|
+
@classmethod
|
|
518
532
|
def OrthoProjection(
|
|
519
|
-
|
|
520
|
-
) ->
|
|
533
|
+
cls, axis: typing.Union[str, typing.Sequence[float], Vector], size: int
|
|
534
|
+
) -> int:
|
|
521
535
|
"""Create a matrix to represent an orthographic projection.
|
|
522
536
|
|
|
523
537
|
:param axis: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],
|
|
524
538
|
where a single axis is for a 2D matrix.
|
|
525
539
|
Or a vector for an arbitrary axis
|
|
526
|
-
:type axis: typing.Union[
|
|
540
|
+
:type axis: typing.Union[str, typing.Sequence[float], Vector]
|
|
527
541
|
:param size: The size of the projection matrix to construct [2, 4].
|
|
528
542
|
:type size: int
|
|
529
|
-
:rtype: 'Matrix'
|
|
530
543
|
:return: A new projection matrix.
|
|
544
|
+
:rtype: Matrix
|
|
531
545
|
"""
|
|
532
546
|
...
|
|
533
547
|
|
|
548
|
+
@classmethod
|
|
534
549
|
def Rotation(
|
|
535
|
-
|
|
550
|
+
cls,
|
|
536
551
|
angle: float,
|
|
537
552
|
size: int,
|
|
538
|
-
axis: typing.Union[
|
|
539
|
-
) ->
|
|
553
|
+
axis: typing.Union[str, typing.Sequence[float], Vector],
|
|
554
|
+
) -> typing.Union[str, typing.Sequence[float], Vector]:
|
|
540
555
|
"""Create a matrix representing a rotation.
|
|
541
556
|
|
|
542
557
|
:param angle: The angle of rotation desired, in radians.
|
|
@@ -545,18 +560,19 @@ class Matrix:
|
|
|
545
560
|
:type size: int
|
|
546
561
|
:param axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object
|
|
547
562
|
(optional when size is 2).
|
|
548
|
-
:type axis: typing.Union[
|
|
549
|
-
:rtype: 'Matrix'
|
|
563
|
+
:type axis: typing.Union[str, typing.Sequence[float], Vector]
|
|
550
564
|
:return: A new rotation matrix.
|
|
565
|
+
:rtype: Matrix
|
|
551
566
|
"""
|
|
552
567
|
...
|
|
553
568
|
|
|
569
|
+
@classmethod
|
|
554
570
|
def Scale(
|
|
555
|
-
|
|
571
|
+
cls,
|
|
556
572
|
factor: float,
|
|
557
573
|
size: int,
|
|
558
|
-
axis: typing.Union[
|
|
559
|
-
) ->
|
|
574
|
+
axis: typing.Union[typing.Sequence[float], Vector],
|
|
575
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
560
576
|
"""Create a matrix representing a scaling.
|
|
561
577
|
|
|
562
578
|
:param factor: The factor of scaling to apply.
|
|
@@ -564,13 +580,14 @@ class Matrix:
|
|
|
564
580
|
:param size: The size of the scale matrix to construct [2, 4].
|
|
565
581
|
:type size: int
|
|
566
582
|
:param axis: Direction to influence scale. (optional).
|
|
567
|
-
:type axis: typing.Union[
|
|
568
|
-
:rtype: 'Matrix'
|
|
583
|
+
:type axis: typing.Union[typing.Sequence[float], Vector]
|
|
569
584
|
:return: A new scale matrix.
|
|
585
|
+
:rtype: Matrix
|
|
570
586
|
"""
|
|
571
587
|
...
|
|
572
588
|
|
|
573
|
-
|
|
589
|
+
@classmethod
|
|
590
|
+
def Shear(cls, plane: str, size: int, factor: float) -> float:
|
|
574
591
|
"""Create a matrix to represent an shear transformation.
|
|
575
592
|
|
|
576
593
|
:param plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],
|
|
@@ -581,20 +598,21 @@ class Matrix:
|
|
|
581
598
|
:param factor: The factor of shear to apply. For a 3 or 4 size matrix
|
|
582
599
|
pass a pair of floats corresponding with the plane axis.
|
|
583
600
|
:type factor: float
|
|
584
|
-
:rtype: 'Matrix'
|
|
585
601
|
:return: A new shear matrix.
|
|
602
|
+
:rtype: Matrix
|
|
586
603
|
"""
|
|
587
604
|
...
|
|
588
605
|
|
|
606
|
+
@classmethod
|
|
589
607
|
def Translation(
|
|
590
|
-
|
|
591
|
-
) ->
|
|
608
|
+
cls, vector: typing.Union[typing.Sequence[float], Vector]
|
|
609
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
592
610
|
"""Create a matrix representing a translation.
|
|
593
611
|
|
|
594
612
|
:param vector: The translation vector.
|
|
595
|
-
:type vector: typing.Union[
|
|
596
|
-
:rtype: 'Matrix'
|
|
613
|
+
:type vector: typing.Union[typing.Sequence[float], Vector]
|
|
597
614
|
:return: An identity matrix with a translation.
|
|
615
|
+
:rtype: Matrix
|
|
598
616
|
"""
|
|
599
617
|
...
|
|
600
618
|
|
|
@@ -602,39 +620,39 @@ class Matrix:
|
|
|
602
620
|
"""Set the matrix to its adjugate.`Adjugate matrix <https://en.wikipedia.org/wiki/Adjugate_matrix>`__ on Wikipedia."""
|
|
603
621
|
...
|
|
604
622
|
|
|
605
|
-
def adjugated(self) ->
|
|
623
|
+
def adjugated(self) -> Matrix:
|
|
606
624
|
"""Return an adjugated copy of the matrix.
|
|
607
625
|
|
|
608
|
-
:rtype: 'Matrix'
|
|
609
626
|
:return: the adjugated matrix.
|
|
627
|
+
:rtype: Matrix
|
|
610
628
|
"""
|
|
611
629
|
...
|
|
612
630
|
|
|
613
|
-
def copy(self) ->
|
|
631
|
+
def copy(self) -> Matrix:
|
|
614
632
|
"""Returns a copy of this matrix.
|
|
615
633
|
|
|
616
|
-
:rtype: 'Matrix'
|
|
617
634
|
:return: an instance of itself
|
|
635
|
+
:rtype: Matrix
|
|
618
636
|
"""
|
|
619
637
|
...
|
|
620
638
|
|
|
621
|
-
def decompose(self) ->
|
|
639
|
+
def decompose(self) -> Matrix:
|
|
622
640
|
"""Return the translation, rotation, and scale components of this matrix.
|
|
623
641
|
|
|
624
|
-
:rtype: 'Quaternion'
|
|
625
642
|
:return: tuple of translation, rotation, and scale
|
|
643
|
+
:rtype: Quaternion
|
|
626
644
|
"""
|
|
627
645
|
...
|
|
628
646
|
|
|
629
|
-
def determinant(self) ->
|
|
647
|
+
def determinant(self) -> Quaternion:
|
|
630
648
|
"""Return the determinant of a matrix.`Determinant <https://en.wikipedia.org/wiki/Determinant>`__ on Wikipedia.
|
|
631
649
|
|
|
632
|
-
:rtype: float
|
|
633
650
|
:return: Return the determinant of a matrix.
|
|
651
|
+
:rtype: float
|
|
634
652
|
"""
|
|
635
653
|
...
|
|
636
654
|
|
|
637
|
-
def freeze(self):
|
|
655
|
+
def freeze(self) -> float:
|
|
638
656
|
"""Make this object immutable.After this the object can be hashed, used in dictionaries & sets.
|
|
639
657
|
|
|
640
658
|
:return: An instance of this object.
|
|
@@ -645,12 +663,12 @@ class Matrix:
|
|
|
645
663
|
"""Set the matrix to the identity matrix.`Identity matrix <https://en.wikipedia.org/wiki/Identity_matrix>`__ on Wikipedia."""
|
|
646
664
|
...
|
|
647
665
|
|
|
648
|
-
def invert(self, fallback: typing.Union[
|
|
666
|
+
def invert(self, fallback: typing.Union[typing.Sequence[float], Matrix] = None):
|
|
649
667
|
"""Set the matrix to its inverse.`Inverse matrix <https://en.wikipedia.org/wiki/Inverse_matrix>`__ on Wikipedia.
|
|
650
668
|
|
|
651
669
|
:param fallback: Set the matrix to this value when the inverse cannot be calculated
|
|
652
670
|
(instead of raising a `ValueError` exception).
|
|
653
|
-
:type fallback: typing.Union[
|
|
671
|
+
:type fallback: typing.Union[typing.Sequence[float], Matrix]
|
|
654
672
|
"""
|
|
655
673
|
...
|
|
656
674
|
|
|
@@ -662,38 +680,38 @@ class Matrix:
|
|
|
662
680
|
"""
|
|
663
681
|
...
|
|
664
682
|
|
|
665
|
-
def inverted(self, fallback: typing.Any = None) ->
|
|
683
|
+
def inverted(self, fallback: typing.Any = None) -> typing.Any:
|
|
666
684
|
"""Return an inverted copy of the matrix.
|
|
667
685
|
|
|
668
686
|
:param fallback: return this when the inverse can't be calculated
|
|
669
687
|
(instead of raising a `ValueError`).
|
|
670
688
|
:type fallback: typing.Any
|
|
671
|
-
:rtype: 'Matrix'
|
|
672
689
|
:return: the inverted matrix or fallback when given.
|
|
690
|
+
:rtype: Matrix
|
|
673
691
|
"""
|
|
674
692
|
...
|
|
675
693
|
|
|
676
|
-
def inverted_safe(self) ->
|
|
694
|
+
def inverted_safe(self) -> Matrix:
|
|
677
695
|
"""Return an inverted copy of the matrix, will never error.
|
|
678
696
|
If degenerated (e.g. zero scale on an axis), add some epsilon to its diagonal, to get an invertible one.
|
|
679
697
|
If tweaked matrix is still degenerated, return the identity matrix instead.
|
|
680
698
|
|
|
681
|
-
:rtype: 'Matrix'
|
|
682
699
|
:return: the inverted matrix.
|
|
700
|
+
:rtype: Matrix
|
|
683
701
|
"""
|
|
684
702
|
...
|
|
685
703
|
|
|
686
704
|
def lerp(
|
|
687
|
-
self, other: typing.Union[
|
|
688
|
-
) ->
|
|
705
|
+
self, other: typing.Union[typing.Sequence[float], Matrix], factor: float
|
|
706
|
+
) -> float:
|
|
689
707
|
"""Returns the interpolation of two matrices. Uses polar decomposition, see "Matrix Animation and Polar Decomposition", Shoemake and Duff, 1992.
|
|
690
708
|
|
|
691
709
|
:param other: value to interpolate with.
|
|
692
|
-
:type other: typing.Union[
|
|
710
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
693
711
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
694
712
|
:type factor: float
|
|
695
|
-
:rtype: 'Matrix'
|
|
696
713
|
:return: The interpolated matrix.
|
|
714
|
+
:rtype: Matrix
|
|
697
715
|
"""
|
|
698
716
|
...
|
|
699
717
|
|
|
@@ -701,11 +719,11 @@ class Matrix:
|
|
|
701
719
|
"""Normalize each of the matrix columns."""
|
|
702
720
|
...
|
|
703
721
|
|
|
704
|
-
def normalized(self) ->
|
|
722
|
+
def normalized(self) -> Matrix:
|
|
705
723
|
"""Return a column normalized matrix
|
|
706
724
|
|
|
707
|
-
:rtype: 'Matrix'
|
|
708
725
|
:return: a column normalized matrix
|
|
726
|
+
:rtype: Matrix
|
|
709
727
|
"""
|
|
710
728
|
...
|
|
711
729
|
|
|
@@ -716,48 +734,57 @@ class Matrix:
|
|
|
716
734
|
def rotate(
|
|
717
735
|
self,
|
|
718
736
|
other: typing.Union[
|
|
719
|
-
"Euler",
|
|
720
|
-
"Matrix",
|
|
721
|
-
"Quaternion",
|
|
722
737
|
typing.Sequence[float],
|
|
738
|
+
Euler,
|
|
723
739
|
typing.Sequence[float],
|
|
740
|
+
Quaternion,
|
|
724
741
|
typing.Sequence[float],
|
|
742
|
+
Matrix,
|
|
725
743
|
],
|
|
726
744
|
):
|
|
727
745
|
"""Rotates the matrix by another mathutils value.
|
|
728
746
|
|
|
729
747
|
:param other: rotation component of mathutils value
|
|
730
|
-
:type other: typing.Union[
|
|
748
|
+
:type other: typing.Union[typing.Sequence[float], Euler, typing.Sequence[float], Quaternion, typing.Sequence[float], Matrix]
|
|
731
749
|
"""
|
|
732
750
|
...
|
|
733
751
|
|
|
734
|
-
def to_2x2(
|
|
752
|
+
def to_2x2(
|
|
753
|
+
self,
|
|
754
|
+
) -> typing.Union[
|
|
755
|
+
typing.Sequence[float],
|
|
756
|
+
Euler,
|
|
757
|
+
typing.Sequence[float],
|
|
758
|
+
Quaternion,
|
|
759
|
+
typing.Sequence[float],
|
|
760
|
+
Matrix,
|
|
761
|
+
]:
|
|
735
762
|
"""Return a 2x2 copy of this matrix.
|
|
736
763
|
|
|
737
|
-
:rtype: 'Matrix'
|
|
738
764
|
:return: a new matrix.
|
|
765
|
+
:rtype: Matrix
|
|
739
766
|
"""
|
|
740
767
|
...
|
|
741
768
|
|
|
742
|
-
def to_3x3(self) ->
|
|
769
|
+
def to_3x3(self) -> Matrix:
|
|
743
770
|
"""Return a 3x3 copy of this matrix.
|
|
744
771
|
|
|
745
|
-
:rtype: 'Matrix'
|
|
746
772
|
:return: a new matrix.
|
|
773
|
+
:rtype: Matrix
|
|
747
774
|
"""
|
|
748
775
|
...
|
|
749
776
|
|
|
750
|
-
def to_4x4(self) ->
|
|
777
|
+
def to_4x4(self) -> Matrix:
|
|
751
778
|
"""Return a 4x4 copy of this matrix.
|
|
752
779
|
|
|
753
|
-
:rtype: 'Matrix'
|
|
754
780
|
:return: a new matrix.
|
|
781
|
+
:rtype: Matrix
|
|
755
782
|
"""
|
|
756
783
|
...
|
|
757
784
|
|
|
758
785
|
def to_euler(
|
|
759
|
-
self, order: str, euler_compat: typing.Union[
|
|
760
|
-
) ->
|
|
786
|
+
self, order: str, euler_compat: typing.Union[typing.Sequence[float], Euler]
|
|
787
|
+
) -> typing.Union[typing.Sequence[float], Euler]:
|
|
761
788
|
"""Return an Euler representation of the rotation matrix
|
|
762
789
|
(3x3 or 4x4 matrix only).
|
|
763
790
|
|
|
@@ -767,33 +794,33 @@ class Matrix:
|
|
|
767
794
|
:param euler_compat: Optional euler argument the new euler will be made
|
|
768
795
|
compatible with (no axis flipping between them).
|
|
769
796
|
Useful for converting a series of matrices to animation curves.
|
|
770
|
-
:type euler_compat: typing.Union[
|
|
771
|
-
:rtype: 'Euler'
|
|
797
|
+
:type euler_compat: typing.Union[typing.Sequence[float], Euler]
|
|
772
798
|
:return: Euler representation of the matrix.
|
|
799
|
+
:rtype: Euler
|
|
773
800
|
"""
|
|
774
801
|
...
|
|
775
802
|
|
|
776
|
-
def to_quaternion(self) ->
|
|
803
|
+
def to_quaternion(self) -> Euler:
|
|
777
804
|
"""Return a quaternion representation of the rotation matrix.
|
|
778
805
|
|
|
779
|
-
:rtype: 'Quaternion'
|
|
780
806
|
:return: Quaternion representation of the rotation matrix.
|
|
807
|
+
:rtype: Quaternion
|
|
781
808
|
"""
|
|
782
809
|
...
|
|
783
810
|
|
|
784
|
-
def to_scale(self) ->
|
|
811
|
+
def to_scale(self) -> Quaternion:
|
|
785
812
|
"""Return the scale part of a 3x3 or 4x4 matrix.
|
|
786
813
|
|
|
787
|
-
:rtype: 'Vector'
|
|
788
814
|
:return: Return the scale of a matrix.
|
|
815
|
+
:rtype: Vector
|
|
789
816
|
"""
|
|
790
817
|
...
|
|
791
818
|
|
|
792
|
-
def to_translation(self) ->
|
|
819
|
+
def to_translation(self) -> Vector:
|
|
793
820
|
"""Return the translation part of a 4 row matrix.
|
|
794
821
|
|
|
795
|
-
:rtype: 'Vector'
|
|
796
822
|
:return: Return the translation of a matrix.
|
|
823
|
+
:rtype: Vector
|
|
797
824
|
"""
|
|
798
825
|
...
|
|
799
826
|
|
|
@@ -801,11 +828,11 @@ class Matrix:
|
|
|
801
828
|
"""Set the matrix to its transpose.`Transpose <https://en.wikipedia.org/wiki/Transpose>`__ on Wikipedia."""
|
|
802
829
|
...
|
|
803
830
|
|
|
804
|
-
def transposed(self) ->
|
|
831
|
+
def transposed(self) -> Vector:
|
|
805
832
|
"""Return a new, transposed matrix.
|
|
806
833
|
|
|
807
|
-
:rtype: 'Matrix'
|
|
808
834
|
:return: a transposed matrix
|
|
835
|
+
:rtype: Matrix
|
|
809
836
|
"""
|
|
810
837
|
...
|
|
811
838
|
|
|
@@ -821,133 +848,145 @@ class Matrix:
|
|
|
821
848
|
(0.0, 0.0, 1.0, 0.0),
|
|
822
849
|
(0.0, 0.0, 0.0, 1.0),
|
|
823
850
|
),
|
|
824
|
-
)
|
|
851
|
+
):
|
|
825
852
|
"""
|
|
826
853
|
|
|
827
|
-
:
|
|
854
|
+
:param rows:
|
|
828
855
|
"""
|
|
829
856
|
...
|
|
830
857
|
|
|
831
|
-
def __getitem__(self, key: int) ->
|
|
858
|
+
def __getitem__(self, key: int) -> int:
|
|
832
859
|
"""
|
|
833
860
|
|
|
834
861
|
:param key:
|
|
835
862
|
:type key: int
|
|
836
|
-
:
|
|
863
|
+
:return:
|
|
864
|
+
:rtype: Vector
|
|
837
865
|
"""
|
|
838
866
|
...
|
|
839
867
|
|
|
840
|
-
def __len__(self) ->
|
|
868
|
+
def __len__(self) -> Vector:
|
|
841
869
|
"""
|
|
842
870
|
|
|
871
|
+
:return:
|
|
843
872
|
:rtype: int
|
|
844
873
|
"""
|
|
845
874
|
...
|
|
846
875
|
|
|
847
876
|
def __add__(
|
|
848
|
-
self, other: typing.Union[
|
|
849
|
-
) ->
|
|
877
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
878
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
850
879
|
"""
|
|
851
880
|
|
|
852
881
|
:param other:
|
|
853
|
-
:type other: typing.Union[
|
|
854
|
-
:
|
|
882
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
883
|
+
:return:
|
|
884
|
+
:rtype: Matrix
|
|
855
885
|
"""
|
|
856
886
|
...
|
|
857
887
|
|
|
858
888
|
def __sub__(
|
|
859
|
-
self, other: typing.Union[
|
|
860
|
-
) ->
|
|
889
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
890
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
861
891
|
"""
|
|
862
892
|
|
|
863
893
|
:param other:
|
|
864
|
-
:type other: typing.Union[
|
|
865
|
-
:
|
|
894
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
895
|
+
:return:
|
|
896
|
+
:rtype: Matrix
|
|
866
897
|
"""
|
|
867
898
|
...
|
|
868
899
|
|
|
869
|
-
def __mul__(self, other: typing.Union[
|
|
900
|
+
def __mul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
870
901
|
"""
|
|
871
902
|
|
|
872
903
|
:param other:
|
|
873
|
-
:type other: typing.Union[
|
|
874
|
-
:
|
|
904
|
+
:type other: typing.Union[int, float]
|
|
905
|
+
:return:
|
|
906
|
+
:rtype: Matrix
|
|
875
907
|
"""
|
|
876
908
|
...
|
|
877
909
|
|
|
878
910
|
def __matmul__(
|
|
879
911
|
self,
|
|
880
912
|
other: typing.Union[
|
|
881
|
-
|
|
913
|
+
typing.Sequence[float], Matrix, typing.Sequence[float], Vector
|
|
882
914
|
],
|
|
883
|
-
) -> typing.Union[
|
|
915
|
+
) -> typing.Union[typing.Sequence[float], Matrix, typing.Sequence[float], Vector]:
|
|
884
916
|
"""
|
|
885
917
|
|
|
886
918
|
:param other:
|
|
887
|
-
:type other: typing.Union[
|
|
888
|
-
:
|
|
919
|
+
:type other: typing.Union[typing.Sequence[float], Matrix, typing.Sequence[float], Vector]
|
|
920
|
+
:return:
|
|
921
|
+
:rtype: typing.Union[Matrix, Vector]
|
|
889
922
|
"""
|
|
890
923
|
...
|
|
891
924
|
|
|
892
925
|
def __radd__(
|
|
893
|
-
self, other: typing.Union[
|
|
894
|
-
) ->
|
|
926
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
927
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
895
928
|
"""
|
|
896
929
|
|
|
897
930
|
:param other:
|
|
898
|
-
:type other: typing.Union[
|
|
899
|
-
:
|
|
931
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
932
|
+
:return:
|
|
933
|
+
:rtype: Matrix
|
|
900
934
|
"""
|
|
901
935
|
...
|
|
902
936
|
|
|
903
937
|
def __rsub__(
|
|
904
|
-
self, other: typing.Union[
|
|
905
|
-
) ->
|
|
938
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
939
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
906
940
|
"""
|
|
907
941
|
|
|
908
942
|
:param other:
|
|
909
|
-
:type other: typing.Union[
|
|
910
|
-
:
|
|
943
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
944
|
+
:return:
|
|
945
|
+
:rtype: Matrix
|
|
911
946
|
"""
|
|
912
947
|
...
|
|
913
948
|
|
|
914
|
-
def __rmul__(self, other: typing.Union[
|
|
949
|
+
def __rmul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
915
950
|
"""
|
|
916
951
|
|
|
917
952
|
:param other:
|
|
918
|
-
:type other: typing.Union[
|
|
919
|
-
:
|
|
953
|
+
:type other: typing.Union[int, float]
|
|
954
|
+
:return:
|
|
955
|
+
:rtype: Matrix
|
|
920
956
|
"""
|
|
921
957
|
...
|
|
922
958
|
|
|
923
959
|
def __rmatmul__(
|
|
924
|
-
self, other: typing.Union[
|
|
925
|
-
) ->
|
|
960
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
961
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
926
962
|
"""
|
|
927
963
|
|
|
928
964
|
:param other:
|
|
929
|
-
:type other: typing.Union[
|
|
930
|
-
:
|
|
965
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
966
|
+
:return:
|
|
967
|
+
:rtype: Matrix
|
|
931
968
|
"""
|
|
932
969
|
...
|
|
933
970
|
|
|
934
|
-
def __imul__(self, other: typing.Union[
|
|
971
|
+
def __imul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
935
972
|
"""
|
|
936
973
|
|
|
937
974
|
:param other:
|
|
938
|
-
:type other: typing.Union[
|
|
939
|
-
:
|
|
975
|
+
:type other: typing.Union[int, float]
|
|
976
|
+
:return:
|
|
977
|
+
:rtype: Matrix
|
|
940
978
|
"""
|
|
941
979
|
...
|
|
942
980
|
|
|
943
981
|
def __imatmul__(
|
|
944
|
-
self, other: typing.Union[
|
|
945
|
-
) ->
|
|
982
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
983
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
946
984
|
"""
|
|
947
985
|
|
|
948
986
|
:param other:
|
|
949
|
-
:type other: typing.Union[
|
|
950
|
-
:
|
|
987
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
988
|
+
:return:
|
|
989
|
+
:rtype: Matrix
|
|
951
990
|
"""
|
|
952
991
|
...
|
|
953
992
|
|
|
@@ -960,10 +999,10 @@ class Quaternion:
|
|
|
960
999
|
:type: float
|
|
961
1000
|
"""
|
|
962
1001
|
|
|
963
|
-
axis: typing.Union[
|
|
1002
|
+
axis: typing.Union[typing.Sequence[float], Vector]
|
|
964
1003
|
""" Quaternion axis as a vector.
|
|
965
1004
|
|
|
966
|
-
:type: typing.Union[
|
|
1005
|
+
:type: typing.Union[typing.Sequence[float], Vector]
|
|
967
1006
|
"""
|
|
968
1007
|
|
|
969
1008
|
is_frozen: bool
|
|
@@ -1021,45 +1060,47 @@ class Quaternion:
|
|
|
1021
1060
|
"""Set the quaternion to its conjugate (negate x, y, z)."""
|
|
1022
1061
|
...
|
|
1023
1062
|
|
|
1024
|
-
def conjugated(self) ->
|
|
1063
|
+
def conjugated(self) -> float:
|
|
1025
1064
|
"""Return a new conjugated quaternion.
|
|
1026
1065
|
|
|
1027
|
-
:rtype: 'Quaternion'
|
|
1028
1066
|
:return: a new quaternion.
|
|
1067
|
+
:rtype: Quaternion
|
|
1029
1068
|
"""
|
|
1030
1069
|
...
|
|
1031
1070
|
|
|
1032
|
-
def copy(self) ->
|
|
1071
|
+
def copy(self) -> Quaternion:
|
|
1033
1072
|
"""Returns a copy of this quaternion.
|
|
1034
1073
|
|
|
1035
|
-
:rtype: 'Quaternion'
|
|
1036
1074
|
:return: A copy of the quaternion.
|
|
1075
|
+
:rtype: Quaternion
|
|
1037
1076
|
"""
|
|
1038
1077
|
...
|
|
1039
1078
|
|
|
1040
1079
|
def cross(
|
|
1041
|
-
self, other: typing.Union[
|
|
1042
|
-
) ->
|
|
1080
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1081
|
+
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1043
1082
|
"""Return the cross product of this quaternion and another.
|
|
1044
1083
|
|
|
1045
1084
|
:param other: The other quaternion to perform the cross product with.
|
|
1046
|
-
:type other: typing.Union[
|
|
1047
|
-
:rtype: 'Quaternion'
|
|
1085
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1048
1086
|
:return: The cross product.
|
|
1087
|
+
:rtype: Quaternion
|
|
1049
1088
|
"""
|
|
1050
1089
|
...
|
|
1051
1090
|
|
|
1052
|
-
def dot(
|
|
1091
|
+
def dot(
|
|
1092
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1093
|
+
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1053
1094
|
"""Return the dot product of this quaternion and another.
|
|
1054
1095
|
|
|
1055
1096
|
:param other: The other quaternion to perform the dot product with.
|
|
1056
|
-
:type other: typing.Union[
|
|
1057
|
-
:rtype: float
|
|
1097
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1058
1098
|
:return: The dot product.
|
|
1099
|
+
:rtype: float
|
|
1059
1100
|
"""
|
|
1060
1101
|
...
|
|
1061
1102
|
|
|
1062
|
-
def freeze(self):
|
|
1103
|
+
def freeze(self) -> float:
|
|
1063
1104
|
"""Make this object immutable.After this the object can be hashed, used in dictionaries & sets.
|
|
1064
1105
|
|
|
1065
1106
|
:return: An instance of this object.
|
|
@@ -1074,11 +1115,11 @@ class Quaternion:
|
|
|
1074
1115
|
"""Set the quaternion to its inverse."""
|
|
1075
1116
|
...
|
|
1076
1117
|
|
|
1077
|
-
def inverted(self)
|
|
1118
|
+
def inverted(self):
|
|
1078
1119
|
"""Return a new, inverted quaternion.
|
|
1079
1120
|
|
|
1080
|
-
:rtype: 'Quaternion'
|
|
1081
1121
|
:return: the inverted value.
|
|
1122
|
+
:rtype: Quaternion
|
|
1082
1123
|
"""
|
|
1083
1124
|
...
|
|
1084
1125
|
|
|
@@ -1087,7 +1128,6 @@ class Quaternion:
|
|
|
1087
1128
|
so interpolating between them works as intended.
|
|
1088
1129
|
|
|
1089
1130
|
:param other:
|
|
1090
|
-
:type other:
|
|
1091
1131
|
"""
|
|
1092
1132
|
...
|
|
1093
1133
|
|
|
@@ -1099,69 +1139,69 @@ class Quaternion:
|
|
|
1099
1139
|
"""Normalize the quaternion."""
|
|
1100
1140
|
...
|
|
1101
1141
|
|
|
1102
|
-
def normalized(self)
|
|
1142
|
+
def normalized(self):
|
|
1103
1143
|
"""Return a new normalized quaternion.
|
|
1104
1144
|
|
|
1105
|
-
:rtype: 'Quaternion'
|
|
1106
1145
|
:return: a normalized copy.
|
|
1146
|
+
:rtype: Quaternion
|
|
1107
1147
|
"""
|
|
1108
1148
|
...
|
|
1109
1149
|
|
|
1110
1150
|
def rotate(
|
|
1111
1151
|
self,
|
|
1112
1152
|
other: typing.Union[
|
|
1113
|
-
"Euler",
|
|
1114
|
-
"Matrix",
|
|
1115
|
-
"Quaternion",
|
|
1116
1153
|
typing.Sequence[float],
|
|
1154
|
+
Euler,
|
|
1117
1155
|
typing.Sequence[float],
|
|
1156
|
+
Quaternion,
|
|
1118
1157
|
typing.Sequence[float],
|
|
1158
|
+
Matrix,
|
|
1119
1159
|
],
|
|
1120
1160
|
):
|
|
1121
1161
|
"""Rotates the quaternion by another mathutils value.
|
|
1122
1162
|
|
|
1123
1163
|
:param other: rotation component of mathutils value
|
|
1124
|
-
:type other: typing.Union[
|
|
1164
|
+
:type other: typing.Union[typing.Sequence[float], Euler, typing.Sequence[float], Quaternion, typing.Sequence[float], Matrix]
|
|
1125
1165
|
"""
|
|
1126
1166
|
...
|
|
1127
1167
|
|
|
1128
1168
|
def rotation_difference(
|
|
1129
|
-
self, other: typing.Union[
|
|
1130
|
-
) ->
|
|
1169
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1170
|
+
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1131
1171
|
"""Returns a quaternion representing the rotational difference.
|
|
1132
1172
|
|
|
1133
1173
|
:param other: second quaternion.
|
|
1134
|
-
:type other: typing.Union[
|
|
1135
|
-
:rtype: 'Quaternion'
|
|
1174
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1136
1175
|
:return: the rotational difference between the two quat rotations.
|
|
1176
|
+
:rtype: Quaternion
|
|
1137
1177
|
"""
|
|
1138
1178
|
...
|
|
1139
1179
|
|
|
1140
1180
|
def slerp(
|
|
1141
|
-
self, other: typing.Union[
|
|
1142
|
-
) ->
|
|
1181
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion], factor: float
|
|
1182
|
+
) -> float:
|
|
1143
1183
|
"""Returns the interpolation of two quaternions.
|
|
1144
1184
|
|
|
1145
1185
|
:param other: value to interpolate with.
|
|
1146
|
-
:type other: typing.Union[
|
|
1186
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1147
1187
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
1148
1188
|
:type factor: float
|
|
1149
|
-
:rtype: 'Quaternion'
|
|
1150
1189
|
:return: The interpolated rotation.
|
|
1190
|
+
:rtype: Quaternion
|
|
1151
1191
|
"""
|
|
1152
1192
|
...
|
|
1153
1193
|
|
|
1154
|
-
def to_axis_angle(self) ->
|
|
1194
|
+
def to_axis_angle(self) -> Quaternion:
|
|
1155
1195
|
"""Return the axis, angle representation of the quaternion.
|
|
1156
1196
|
|
|
1157
|
-
:rtype: typing.Tuple['Vector', 'float']
|
|
1158
1197
|
:return: axis, angle.
|
|
1198
|
+
:rtype: typing.Tuple[Vector, float]
|
|
1159
1199
|
"""
|
|
1160
1200
|
...
|
|
1161
1201
|
|
|
1162
1202
|
def to_euler(
|
|
1163
|
-
self, order: str, euler_compat: typing.Union[
|
|
1164
|
-
) ->
|
|
1203
|
+
self, order: str, euler_compat: typing.Union[typing.Sequence[float], Euler]
|
|
1204
|
+
) -> typing.Union[typing.Sequence[float], Euler]:
|
|
1165
1205
|
"""Return Euler representation of the quaternion.
|
|
1166
1206
|
|
|
1167
1207
|
:param order: Optional rotation order argument in
|
|
@@ -1170,59 +1210,59 @@ class Quaternion:
|
|
|
1170
1210
|
:param euler_compat: Optional euler argument the new euler will be made
|
|
1171
1211
|
compatible with (no axis flipping between them).
|
|
1172
1212
|
Useful for converting a series of matrices to animation curves.
|
|
1173
|
-
:type euler_compat: typing.Union[
|
|
1174
|
-
:rtype: 'Euler'
|
|
1213
|
+
:type euler_compat: typing.Union[typing.Sequence[float], Euler]
|
|
1175
1214
|
:return: Euler representation of the quaternion.
|
|
1215
|
+
:rtype: Euler
|
|
1176
1216
|
"""
|
|
1177
1217
|
...
|
|
1178
1218
|
|
|
1179
|
-
def to_exponential_map(self) ->
|
|
1219
|
+
def to_exponential_map(self) -> Euler:
|
|
1180
1220
|
"""Return the exponential map representation of the quaternion.This representation consist of the rotation axis multiplied by the rotation angle.
|
|
1181
1221
|
Such a representation is useful for interpolation between multiple orientations.To convert back to a quaternion, pass it to the `Quaternion` constructor.
|
|
1182
1222
|
|
|
1183
|
-
:rtype: 'Vector'
|
|
1184
1223
|
:return: exponential map.
|
|
1185
1224
|
"""
|
|
1186
1225
|
...
|
|
1187
1226
|
|
|
1188
|
-
def to_matrix(self)
|
|
1227
|
+
def to_matrix(self):
|
|
1189
1228
|
"""Return a matrix representation of the quaternion.
|
|
1190
1229
|
|
|
1191
|
-
:rtype: 'Matrix'
|
|
1192
1230
|
:return: A 3x3 rotation matrix representation of the quaternion.
|
|
1231
|
+
:rtype: Matrix
|
|
1193
1232
|
"""
|
|
1194
1233
|
...
|
|
1195
1234
|
|
|
1196
|
-
def to_swing_twist(self, axis)
|
|
1235
|
+
def to_swing_twist(self, axis):
|
|
1197
1236
|
"""Split the rotation into a swing quaternion with the specified
|
|
1198
1237
|
axis fixed at zero, and the remaining twist rotation angle.
|
|
1199
1238
|
|
|
1200
1239
|
:param axis: twist axis as a string in ['X', 'Y', 'Z']
|
|
1201
|
-
:type axis:
|
|
1202
|
-
:rtype: typing.Tuple['Quaternion', 'float']
|
|
1203
1240
|
:return: swing, twist angle.
|
|
1241
|
+
:rtype: typing.Tuple[Quaternion, float]
|
|
1204
1242
|
"""
|
|
1205
1243
|
...
|
|
1206
1244
|
|
|
1207
|
-
def __init__(self, seq=(1.0, 0.0, 0.0, 0.0))
|
|
1245
|
+
def __init__(self, seq=(1.0, 0.0, 0.0, 0.0)):
|
|
1208
1246
|
"""
|
|
1209
1247
|
|
|
1210
|
-
:
|
|
1248
|
+
:param seq:
|
|
1211
1249
|
"""
|
|
1212
1250
|
...
|
|
1213
1251
|
|
|
1214
|
-
def __len__(self)
|
|
1252
|
+
def __len__(self):
|
|
1215
1253
|
"""
|
|
1216
1254
|
|
|
1255
|
+
:return:
|
|
1217
1256
|
:rtype: int
|
|
1218
1257
|
"""
|
|
1219
1258
|
...
|
|
1220
1259
|
|
|
1221
|
-
def __getitem__(self, key: int) ->
|
|
1260
|
+
def __getitem__(self, key: int) -> int:
|
|
1222
1261
|
"""
|
|
1223
1262
|
|
|
1224
1263
|
:param key:
|
|
1225
1264
|
:type key: int
|
|
1265
|
+
:return:
|
|
1226
1266
|
:rtype: float
|
|
1227
1267
|
"""
|
|
1228
1268
|
...
|
|
@@ -1234,120 +1274,133 @@ class Quaternion:
|
|
|
1234
1274
|
:type key: int
|
|
1235
1275
|
:param value:
|
|
1236
1276
|
:type value: float
|
|
1277
|
+
:return:
|
|
1237
1278
|
:rtype: float
|
|
1238
1279
|
"""
|
|
1239
1280
|
...
|
|
1240
1281
|
|
|
1241
1282
|
def __add__(
|
|
1242
|
-
self, other: typing.Union[
|
|
1243
|
-
) ->
|
|
1283
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1284
|
+
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1244
1285
|
"""
|
|
1245
1286
|
|
|
1246
1287
|
:param other:
|
|
1247
|
-
:type other: typing.Union[
|
|
1248
|
-
:
|
|
1288
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1289
|
+
:return:
|
|
1290
|
+
:rtype: Quaternion
|
|
1249
1291
|
"""
|
|
1250
1292
|
...
|
|
1251
1293
|
|
|
1252
1294
|
def __sub__(
|
|
1253
|
-
self, other: typing.Union[
|
|
1254
|
-
) ->
|
|
1295
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1296
|
+
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1255
1297
|
"""
|
|
1256
1298
|
|
|
1257
1299
|
:param other:
|
|
1258
|
-
:type other: typing.Union[
|
|
1259
|
-
:
|
|
1300
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1301
|
+
:return:
|
|
1302
|
+
:rtype: Quaternion
|
|
1260
1303
|
"""
|
|
1261
1304
|
...
|
|
1262
1305
|
|
|
1263
1306
|
def __mul__(
|
|
1264
|
-
self, other: typing.Union[
|
|
1265
|
-
) ->
|
|
1307
|
+
self, other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1308
|
+
) -> typing.Union[int, float, typing.Sequence[float], Quaternion]:
|
|
1266
1309
|
"""
|
|
1267
1310
|
|
|
1268
1311
|
:param other:
|
|
1269
|
-
:type other: typing.Union[
|
|
1270
|
-
:
|
|
1312
|
+
:type other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1313
|
+
:return:
|
|
1314
|
+
:rtype: Quaternion
|
|
1271
1315
|
"""
|
|
1272
1316
|
...
|
|
1273
1317
|
|
|
1274
1318
|
def __matmul__(
|
|
1275
1319
|
self,
|
|
1276
1320
|
other: typing.Union[
|
|
1277
|
-
|
|
1321
|
+
typing.Sequence[float], Vector, typing.Sequence[float], Quaternion
|
|
1278
1322
|
],
|
|
1279
|
-
) -> typing.Union[
|
|
1323
|
+
) -> typing.Union[
|
|
1324
|
+
typing.Sequence[float], Vector, typing.Sequence[float], Quaternion
|
|
1325
|
+
]:
|
|
1280
1326
|
"""
|
|
1281
1327
|
|
|
1282
1328
|
:param other:
|
|
1283
|
-
:type other: typing.Union[
|
|
1284
|
-
:
|
|
1329
|
+
:type other: typing.Union[typing.Sequence[float], Vector, typing.Sequence[float], Quaternion]
|
|
1330
|
+
:return:
|
|
1331
|
+
:rtype: typing.Union[Vector, Quaternion]
|
|
1285
1332
|
"""
|
|
1286
1333
|
...
|
|
1287
1334
|
|
|
1288
1335
|
def __radd__(
|
|
1289
|
-
self, other: typing.Union[
|
|
1290
|
-
) ->
|
|
1336
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1337
|
+
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1291
1338
|
"""
|
|
1292
1339
|
|
|
1293
1340
|
:param other:
|
|
1294
|
-
:type other: typing.Union[
|
|
1295
|
-
:
|
|
1341
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1342
|
+
:return:
|
|
1343
|
+
:rtype: Quaternion
|
|
1296
1344
|
"""
|
|
1297
1345
|
...
|
|
1298
1346
|
|
|
1299
1347
|
def __rsub__(
|
|
1300
|
-
self, other: typing.Union[
|
|
1301
|
-
) ->
|
|
1348
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1349
|
+
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1302
1350
|
"""
|
|
1303
1351
|
|
|
1304
1352
|
:param other:
|
|
1305
|
-
:type other: typing.Union[
|
|
1306
|
-
:
|
|
1353
|
+
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1354
|
+
:return:
|
|
1355
|
+
:rtype: Quaternion
|
|
1307
1356
|
"""
|
|
1308
1357
|
...
|
|
1309
1358
|
|
|
1310
1359
|
def __rmul__(
|
|
1311
|
-
self, other: typing.Union[
|
|
1312
|
-
) ->
|
|
1360
|
+
self, other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1361
|
+
) -> typing.Union[int, float, typing.Sequence[float], Quaternion]:
|
|
1313
1362
|
"""
|
|
1314
1363
|
|
|
1315
1364
|
:param other:
|
|
1316
|
-
:type other: typing.Union[
|
|
1317
|
-
:
|
|
1365
|
+
:type other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1366
|
+
:return:
|
|
1367
|
+
:rtype: Quaternion
|
|
1318
1368
|
"""
|
|
1319
1369
|
...
|
|
1320
1370
|
|
|
1321
1371
|
def __rmatmul__(
|
|
1322
|
-
self, other: typing.Union[
|
|
1323
|
-
) ->
|
|
1372
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
1373
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
1324
1374
|
"""
|
|
1325
1375
|
|
|
1326
1376
|
:param other:
|
|
1327
|
-
:type other: typing.Union[
|
|
1328
|
-
:
|
|
1377
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
1378
|
+
:return:
|
|
1379
|
+
:rtype: Vector
|
|
1329
1380
|
"""
|
|
1330
1381
|
...
|
|
1331
1382
|
|
|
1332
1383
|
def __imul__(
|
|
1333
|
-
self, other: typing.Union[
|
|
1334
|
-
) ->
|
|
1384
|
+
self, other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1385
|
+
) -> typing.Union[int, float, typing.Sequence[float], Quaternion]:
|
|
1335
1386
|
"""
|
|
1336
1387
|
|
|
1337
1388
|
:param other:
|
|
1338
|
-
:type other: typing.Union[
|
|
1339
|
-
:
|
|
1389
|
+
:type other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1390
|
+
:return:
|
|
1391
|
+
:rtype: Quaternion
|
|
1340
1392
|
"""
|
|
1341
1393
|
...
|
|
1342
1394
|
|
|
1343
1395
|
def __imatmul__(
|
|
1344
|
-
self, other: typing.Union[
|
|
1345
|
-
) ->
|
|
1396
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
1397
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
1346
1398
|
"""
|
|
1347
1399
|
|
|
1348
1400
|
:param other:
|
|
1349
|
-
:type other: typing.Union[
|
|
1350
|
-
:
|
|
1401
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
1402
|
+
:return:
|
|
1403
|
+
:rtype: Vector
|
|
1351
1404
|
"""
|
|
1352
1405
|
...
|
|
1353
1406
|
|
|
@@ -2425,7 +2478,8 @@ class Vector:
|
|
|
2425
2478
|
zzzz: typing.Any
|
|
2426
2479
|
""" Undocumented, consider contributing."""
|
|
2427
2480
|
|
|
2428
|
-
|
|
2481
|
+
@classmethod
|
|
2482
|
+
def Fill(cls, size: int, fill: float = 0.0):
|
|
2429
2483
|
"""Create a vector of length size with all values set to fill.
|
|
2430
2484
|
|
|
2431
2485
|
:param size: The length of the vector to be created.
|
|
@@ -2435,7 +2489,8 @@ class Vector:
|
|
|
2435
2489
|
"""
|
|
2436
2490
|
...
|
|
2437
2491
|
|
|
2438
|
-
|
|
2492
|
+
@classmethod
|
|
2493
|
+
def Linspace(cls, start: int, stop: int, size: int):
|
|
2439
2494
|
"""Create a vector of the specified size which is filled with linearly spaced values between start and stop values.
|
|
2440
2495
|
|
|
2441
2496
|
:param start: The start of the range used to fill the vector.
|
|
@@ -2447,7 +2502,8 @@ class Vector:
|
|
|
2447
2502
|
"""
|
|
2448
2503
|
...
|
|
2449
2504
|
|
|
2450
|
-
|
|
2505
|
+
@classmethod
|
|
2506
|
+
def Range(cls, start: int, stop: int, step: int = 1):
|
|
2451
2507
|
"""Create a filled with a range of values.
|
|
2452
2508
|
|
|
2453
2509
|
:param start: The start of the range used to fill the vector.
|
|
@@ -2459,11 +2515,11 @@ class Vector:
|
|
|
2459
2515
|
"""
|
|
2460
2516
|
...
|
|
2461
2517
|
|
|
2462
|
-
|
|
2518
|
+
@classmethod
|
|
2519
|
+
def Repeat(cls, vector, size: int):
|
|
2463
2520
|
"""Create a vector by repeating the values in vector until the required size is reached.
|
|
2464
2521
|
|
|
2465
2522
|
:param vector:
|
|
2466
|
-
:type vector:
|
|
2467
2523
|
:param size: The size of the vector to be created.
|
|
2468
2524
|
:type size: int
|
|
2469
2525
|
"""
|
|
@@ -2471,67 +2527,69 @@ class Vector:
|
|
|
2471
2527
|
|
|
2472
2528
|
def angle(
|
|
2473
2529
|
self,
|
|
2474
|
-
other: typing.Union[
|
|
2530
|
+
other: typing.Union[typing.Sequence[float], Vector],
|
|
2475
2531
|
fallback: typing.Any = None,
|
|
2476
|
-
) ->
|
|
2532
|
+
) -> typing.Any:
|
|
2477
2533
|
"""Return the angle between two vectors.
|
|
2478
2534
|
|
|
2479
2535
|
:param other: another vector to compare the angle with
|
|
2480
|
-
:type other: typing.Union[
|
|
2536
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2481
2537
|
:param fallback: return this when the angle can't be calculated (zero length vector),
|
|
2482
2538
|
(instead of raising a `ValueError`).
|
|
2483
2539
|
:type fallback: typing.Any
|
|
2484
|
-
:rtype: float
|
|
2485
2540
|
:return: angle in radians or fallback when given
|
|
2541
|
+
:rtype: float
|
|
2486
2542
|
"""
|
|
2487
2543
|
...
|
|
2488
2544
|
|
|
2489
2545
|
def angle_signed(
|
|
2490
|
-
self,
|
|
2491
|
-
|
|
2492
|
-
fallback: typing.Any,
|
|
2493
|
-
) -> float:
|
|
2546
|
+
self, other: typing.Union[typing.Sequence[float], Vector], fallback: typing.Any
|
|
2547
|
+
) -> typing.Any:
|
|
2494
2548
|
"""Return the signed angle between two 2D vectors (clockwise is positive).
|
|
2495
2549
|
|
|
2496
2550
|
:param other: another vector to compare the angle with
|
|
2497
|
-
:type other: typing.Union[
|
|
2551
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2498
2552
|
:param fallback: return this when the angle can't be calculated (zero length vector),
|
|
2499
2553
|
(instead of raising a `ValueError`).
|
|
2500
2554
|
:type fallback: typing.Any
|
|
2501
|
-
:rtype: float
|
|
2502
2555
|
:return: angle in radians or fallback when given
|
|
2556
|
+
:rtype: float
|
|
2503
2557
|
"""
|
|
2504
2558
|
...
|
|
2505
2559
|
|
|
2506
|
-
def copy(self) ->
|
|
2560
|
+
def copy(self) -> float:
|
|
2507
2561
|
"""Returns a copy of this vector.
|
|
2508
2562
|
|
|
2509
|
-
:rtype: 'Vector'
|
|
2510
2563
|
:return: A copy of the vector.
|
|
2564
|
+
:rtype: Vector
|
|
2511
2565
|
"""
|
|
2512
2566
|
...
|
|
2513
2567
|
|
|
2514
|
-
def cross(
|
|
2568
|
+
def cross(
|
|
2569
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2570
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2515
2571
|
"""Return the cross product of this vector and another.
|
|
2516
2572
|
|
|
2517
2573
|
:param other: The other vector to perform the cross product with.
|
|
2518
|
-
:type other: typing.Union[
|
|
2519
|
-
:rtype: 'Vector'
|
|
2574
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2520
2575
|
:return: The cross product.
|
|
2576
|
+
:rtype: Vector
|
|
2521
2577
|
"""
|
|
2522
2578
|
...
|
|
2523
2579
|
|
|
2524
|
-
def dot(
|
|
2580
|
+
def dot(
|
|
2581
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2582
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2525
2583
|
"""Return the dot product of this vector and another.
|
|
2526
2584
|
|
|
2527
2585
|
:param other: The other vector to perform the dot product with.
|
|
2528
|
-
:type other: typing.Union[
|
|
2529
|
-
:rtype: float
|
|
2586
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2530
2587
|
:return: The dot product.
|
|
2588
|
+
:rtype: float
|
|
2531
2589
|
"""
|
|
2532
2590
|
...
|
|
2533
2591
|
|
|
2534
|
-
def freeze(self):
|
|
2592
|
+
def freeze(self) -> float:
|
|
2535
2593
|
"""Make this object immutable.After this the object can be hashed, used in dictionaries & sets.
|
|
2536
2594
|
|
|
2537
2595
|
:return: An instance of this object.
|
|
@@ -2539,16 +2597,16 @@ class Vector:
|
|
|
2539
2597
|
...
|
|
2540
2598
|
|
|
2541
2599
|
def lerp(
|
|
2542
|
-
self, other: typing.Union[
|
|
2543
|
-
) ->
|
|
2600
|
+
self, other: typing.Union[typing.Sequence[float], Vector], factor: float
|
|
2601
|
+
) -> float:
|
|
2544
2602
|
"""Returns the interpolation of two vectors.
|
|
2545
2603
|
|
|
2546
2604
|
:param other: value to interpolate with.
|
|
2547
|
-
:type other: typing.Union[
|
|
2605
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2548
2606
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
2549
2607
|
:type factor: float
|
|
2550
|
-
:rtype: 'Vector'
|
|
2551
2608
|
:return: The interpolated vector.
|
|
2609
|
+
:rtype: Vector
|
|
2552
2610
|
"""
|
|
2553
2611
|
...
|
|
2554
2612
|
|
|
@@ -2560,43 +2618,43 @@ class Vector:
|
|
|
2560
2618
|
"""Normalize the vector, making the length of the vector always 1.0."""
|
|
2561
2619
|
...
|
|
2562
2620
|
|
|
2563
|
-
def normalized(self) ->
|
|
2621
|
+
def normalized(self) -> Vector:
|
|
2564
2622
|
"""Return a new, normalized vector.
|
|
2565
2623
|
|
|
2566
|
-
:rtype: 'Vector'
|
|
2567
2624
|
:return: a normalized copy of the vector
|
|
2625
|
+
:rtype: Vector
|
|
2568
2626
|
"""
|
|
2569
2627
|
...
|
|
2570
2628
|
|
|
2571
|
-
def orthogonal(self) ->
|
|
2629
|
+
def orthogonal(self) -> Vector:
|
|
2572
2630
|
"""Return a perpendicular vector.
|
|
2573
2631
|
|
|
2574
|
-
:rtype: 'Vector'
|
|
2575
2632
|
:return: a new vector 90 degrees from this vector.
|
|
2633
|
+
:rtype: Vector
|
|
2576
2634
|
"""
|
|
2577
2635
|
...
|
|
2578
2636
|
|
|
2579
2637
|
def project(
|
|
2580
|
-
self, other: typing.Union[
|
|
2581
|
-
) ->
|
|
2638
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2639
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2582
2640
|
"""Return the projection of this vector onto the other.
|
|
2583
2641
|
|
|
2584
2642
|
:param other: second vector.
|
|
2585
|
-
:type other: typing.Union[
|
|
2586
|
-
:rtype: 'Vector'
|
|
2643
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2587
2644
|
:return: the parallel projection vector
|
|
2645
|
+
:rtype: Vector
|
|
2588
2646
|
"""
|
|
2589
2647
|
...
|
|
2590
2648
|
|
|
2591
2649
|
def reflect(
|
|
2592
|
-
self, mirror: typing.Union[
|
|
2593
|
-
) ->
|
|
2650
|
+
self, mirror: typing.Union[typing.Sequence[float], Vector]
|
|
2651
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2594
2652
|
"""Return the reflection vector from the mirror argument.
|
|
2595
2653
|
|
|
2596
2654
|
:param mirror: This vector could be a normal from the reflecting surface.
|
|
2597
|
-
:type mirror: typing.Union[
|
|
2598
|
-
:rtype: 'Vector'
|
|
2655
|
+
:type mirror: typing.Union[typing.Sequence[float], Vector]
|
|
2599
2656
|
:return: The reflected vector matching the size of this vector.
|
|
2657
|
+
:rtype: Vector
|
|
2600
2658
|
"""
|
|
2601
2659
|
...
|
|
2602
2660
|
|
|
@@ -2604,7 +2662,6 @@ class Vector:
|
|
|
2604
2662
|
"""Resize the vector to have size number of elements.
|
|
2605
2663
|
|
|
2606
2664
|
:param size:
|
|
2607
|
-
:type size:
|
|
2608
2665
|
"""
|
|
2609
2666
|
...
|
|
2610
2667
|
|
|
@@ -2620,110 +2677,109 @@ class Vector:
|
|
|
2620
2677
|
"""Resize the vector to 4D (x, y, z, w)."""
|
|
2621
2678
|
...
|
|
2622
2679
|
|
|
2623
|
-
def resized(self, size=3)
|
|
2680
|
+
def resized(self, size=3):
|
|
2624
2681
|
"""Return a resized copy of the vector with size number of elements.
|
|
2625
2682
|
|
|
2626
2683
|
:param size:
|
|
2627
|
-
:type size:
|
|
2628
|
-
:rtype: 'Vector'
|
|
2629
2684
|
:return: a new vector
|
|
2685
|
+
:rtype: Vector
|
|
2630
2686
|
"""
|
|
2631
2687
|
...
|
|
2632
2688
|
|
|
2633
2689
|
def rotate(
|
|
2634
2690
|
self,
|
|
2635
2691
|
other: typing.Union[
|
|
2636
|
-
"Euler",
|
|
2637
|
-
"Matrix",
|
|
2638
|
-
"Quaternion",
|
|
2639
2692
|
typing.Sequence[float],
|
|
2693
|
+
Euler,
|
|
2640
2694
|
typing.Sequence[float],
|
|
2695
|
+
Quaternion,
|
|
2641
2696
|
typing.Sequence[float],
|
|
2697
|
+
Matrix,
|
|
2642
2698
|
],
|
|
2643
2699
|
):
|
|
2644
2700
|
"""Rotate the vector by a rotation value.
|
|
2645
2701
|
|
|
2646
2702
|
:param other: rotation component of mathutils value
|
|
2647
|
-
:type other: typing.Union[
|
|
2703
|
+
:type other: typing.Union[typing.Sequence[float], Euler, typing.Sequence[float], Quaternion, typing.Sequence[float], Matrix]
|
|
2648
2704
|
"""
|
|
2649
2705
|
...
|
|
2650
2706
|
|
|
2651
2707
|
def rotation_difference(
|
|
2652
|
-
self, other: typing.Union[
|
|
2653
|
-
) ->
|
|
2708
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2709
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2654
2710
|
"""Returns a quaternion representing the rotational difference between this
|
|
2655
2711
|
vector and another.
|
|
2656
2712
|
|
|
2657
2713
|
:param other: second vector.
|
|
2658
|
-
:type other: typing.Union[
|
|
2659
|
-
:rtype: 'Quaternion'
|
|
2714
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2660
2715
|
:return: the rotational difference between the two vectors.
|
|
2716
|
+
:rtype: Quaternion
|
|
2661
2717
|
"""
|
|
2662
2718
|
...
|
|
2663
2719
|
|
|
2664
2720
|
def slerp(
|
|
2665
2721
|
self,
|
|
2666
|
-
other: typing.Union[
|
|
2722
|
+
other: typing.Union[typing.Sequence[float], Vector],
|
|
2667
2723
|
factor: float,
|
|
2668
2724
|
fallback: typing.Any = None,
|
|
2669
|
-
) ->
|
|
2725
|
+
) -> typing.Any:
|
|
2670
2726
|
"""Returns the interpolation of two non-zero vectors (spherical coordinates).
|
|
2671
2727
|
|
|
2672
2728
|
:param other: value to interpolate with.
|
|
2673
|
-
:type other: typing.Union[
|
|
2729
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2674
2730
|
:param factor: The interpolation value typically in [0.0, 1.0].
|
|
2675
2731
|
:type factor: float
|
|
2676
2732
|
:param fallback: return this when the vector can't be calculated (zero length vector or direct opposites),
|
|
2677
2733
|
(instead of raising a `ValueError`).
|
|
2678
2734
|
:type fallback: typing.Any
|
|
2679
|
-
:rtype: 'Vector'
|
|
2680
2735
|
:return: The interpolated vector.
|
|
2736
|
+
:rtype: Vector
|
|
2681
2737
|
"""
|
|
2682
2738
|
...
|
|
2683
2739
|
|
|
2684
|
-
def to_2d(self) ->
|
|
2740
|
+
def to_2d(self) -> Vector:
|
|
2685
2741
|
"""Return a 2d copy of the vector.
|
|
2686
2742
|
|
|
2687
|
-
:rtype: 'Vector'
|
|
2688
2743
|
:return: a new vector
|
|
2744
|
+
:rtype: Vector
|
|
2689
2745
|
"""
|
|
2690
2746
|
...
|
|
2691
2747
|
|
|
2692
|
-
def to_3d(self) ->
|
|
2748
|
+
def to_3d(self) -> Vector:
|
|
2693
2749
|
"""Return a 3d copy of the vector.
|
|
2694
2750
|
|
|
2695
|
-
:rtype: 'Vector'
|
|
2696
2751
|
:return: a new vector
|
|
2752
|
+
:rtype: Vector
|
|
2697
2753
|
"""
|
|
2698
2754
|
...
|
|
2699
2755
|
|
|
2700
|
-
def to_4d(self) ->
|
|
2756
|
+
def to_4d(self) -> Vector:
|
|
2701
2757
|
"""Return a 4d copy of the vector.
|
|
2702
2758
|
|
|
2703
|
-
:rtype: 'Vector'
|
|
2704
2759
|
:return: a new vector
|
|
2760
|
+
:rtype: Vector
|
|
2705
2761
|
"""
|
|
2706
2762
|
...
|
|
2707
2763
|
|
|
2708
|
-
def to_track_quat(self, track: str, up: str) ->
|
|
2764
|
+
def to_track_quat(self, track: str, up: str) -> str:
|
|
2709
2765
|
"""Return a quaternion rotation from the vector and the track and up axis.
|
|
2710
2766
|
|
|
2711
2767
|
:param track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].
|
|
2712
2768
|
:type track: str
|
|
2713
2769
|
:param up: Up axis in ['X', 'Y', 'Z'].
|
|
2714
2770
|
:type up: str
|
|
2715
|
-
:rtype: 'Quaternion'
|
|
2716
2771
|
:return: rotation from the vector and the track and up axis.
|
|
2772
|
+
:rtype: Quaternion
|
|
2717
2773
|
"""
|
|
2718
2774
|
...
|
|
2719
2775
|
|
|
2720
|
-
def to_tuple(self, precision: int = -1) ->
|
|
2776
|
+
def to_tuple(self, precision: int = -1) -> int:
|
|
2721
2777
|
"""Return this vector as a tuple with.
|
|
2722
2778
|
|
|
2723
2779
|
:param precision: The number to round the value to in [-1, 21].
|
|
2724
2780
|
:type precision: int
|
|
2725
|
-
:rtype: typing.Tuple
|
|
2726
2781
|
:return: the values of the vector rounded by precision
|
|
2782
|
+
:rtype: typing.Tuple
|
|
2727
2783
|
"""
|
|
2728
2784
|
...
|
|
2729
2785
|
|
|
@@ -2731,25 +2787,27 @@ class Vector:
|
|
|
2731
2787
|
"""Set all values to zero."""
|
|
2732
2788
|
...
|
|
2733
2789
|
|
|
2734
|
-
def __init__(self, seq=(0.0, 0.0, 0.0))
|
|
2790
|
+
def __init__(self, seq=(0.0, 0.0, 0.0)):
|
|
2735
2791
|
"""
|
|
2736
2792
|
|
|
2737
|
-
:
|
|
2793
|
+
:param seq:
|
|
2738
2794
|
"""
|
|
2739
2795
|
...
|
|
2740
2796
|
|
|
2741
|
-
def __len__(self)
|
|
2797
|
+
def __len__(self):
|
|
2742
2798
|
"""
|
|
2743
2799
|
|
|
2800
|
+
:return:
|
|
2744
2801
|
:rtype: int
|
|
2745
2802
|
"""
|
|
2746
2803
|
...
|
|
2747
2804
|
|
|
2748
|
-
def __getitem__(self, key: int) ->
|
|
2805
|
+
def __getitem__(self, key: int) -> int:
|
|
2749
2806
|
"""
|
|
2750
2807
|
|
|
2751
2808
|
:param key:
|
|
2752
2809
|
:type key: int
|
|
2810
|
+
:return:
|
|
2753
2811
|
:rtype: float
|
|
2754
2812
|
"""
|
|
2755
2813
|
...
|
|
@@ -2761,166 +2819,183 @@ class Vector:
|
|
|
2761
2819
|
:type key: int
|
|
2762
2820
|
:param value:
|
|
2763
2821
|
:type value: float
|
|
2822
|
+
:return:
|
|
2764
2823
|
:rtype: float
|
|
2765
2824
|
"""
|
|
2766
2825
|
...
|
|
2767
2826
|
|
|
2768
|
-
def __neg__(self) ->
|
|
2827
|
+
def __neg__(self) -> float:
|
|
2769
2828
|
"""
|
|
2770
2829
|
|
|
2771
|
-
:
|
|
2830
|
+
:return:
|
|
2831
|
+
:rtype: Vector
|
|
2772
2832
|
"""
|
|
2773
2833
|
...
|
|
2774
2834
|
|
|
2775
2835
|
def __add__(
|
|
2776
|
-
self, other: typing.Union[
|
|
2777
|
-
) ->
|
|
2836
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2837
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2778
2838
|
"""
|
|
2779
2839
|
|
|
2780
2840
|
:param other:
|
|
2781
|
-
:type other: typing.Union[
|
|
2782
|
-
:
|
|
2841
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2842
|
+
:return:
|
|
2843
|
+
:rtype: Vector
|
|
2783
2844
|
"""
|
|
2784
2845
|
...
|
|
2785
2846
|
|
|
2786
2847
|
def __sub__(
|
|
2787
|
-
self, other: typing.Union[
|
|
2788
|
-
) ->
|
|
2848
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2849
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2789
2850
|
"""
|
|
2790
2851
|
|
|
2791
2852
|
:param other:
|
|
2792
|
-
:type other: typing.Union[
|
|
2793
|
-
:
|
|
2853
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2854
|
+
:return:
|
|
2855
|
+
:rtype: Vector
|
|
2794
2856
|
"""
|
|
2795
2857
|
...
|
|
2796
2858
|
|
|
2797
|
-
def __mul__(self, other: typing.Union[
|
|
2859
|
+
def __mul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
2798
2860
|
"""
|
|
2799
2861
|
|
|
2800
2862
|
:param other:
|
|
2801
|
-
:type other: typing.Union[
|
|
2802
|
-
:
|
|
2863
|
+
:type other: typing.Union[int, float]
|
|
2864
|
+
:return:
|
|
2865
|
+
:rtype: Vector
|
|
2803
2866
|
"""
|
|
2804
2867
|
...
|
|
2805
2868
|
|
|
2806
|
-
def __truediv__(self, other: typing.Union[
|
|
2869
|
+
def __truediv__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
2807
2870
|
"""
|
|
2808
2871
|
|
|
2809
2872
|
:param other:
|
|
2810
|
-
:type other: typing.Union[
|
|
2811
|
-
:
|
|
2873
|
+
:type other: typing.Union[int, float]
|
|
2874
|
+
:return:
|
|
2875
|
+
:rtype: Vector
|
|
2812
2876
|
"""
|
|
2813
2877
|
...
|
|
2814
2878
|
|
|
2815
2879
|
def __matmul__(
|
|
2816
|
-
self, other: typing.Union[
|
|
2817
|
-
) ->
|
|
2880
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
2881
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
2818
2882
|
"""
|
|
2819
2883
|
|
|
2820
2884
|
:param other:
|
|
2821
|
-
:type other: typing.Union[
|
|
2822
|
-
:
|
|
2885
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
2886
|
+
:return:
|
|
2887
|
+
:rtype: Vector
|
|
2823
2888
|
"""
|
|
2824
2889
|
...
|
|
2825
2890
|
|
|
2826
2891
|
def __radd__(
|
|
2827
|
-
self, other: typing.Union[
|
|
2828
|
-
) ->
|
|
2892
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2893
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2829
2894
|
"""
|
|
2830
2895
|
|
|
2831
2896
|
:param other:
|
|
2832
|
-
:type other: typing.Union[
|
|
2833
|
-
:
|
|
2897
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2898
|
+
:return:
|
|
2899
|
+
:rtype: Vector
|
|
2834
2900
|
"""
|
|
2835
2901
|
...
|
|
2836
2902
|
|
|
2837
2903
|
def __rsub__(
|
|
2838
|
-
self, other: typing.Union[
|
|
2839
|
-
) ->
|
|
2904
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2905
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2840
2906
|
"""
|
|
2841
2907
|
|
|
2842
2908
|
:param other:
|
|
2843
|
-
:type other: typing.Union[
|
|
2844
|
-
:
|
|
2909
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2910
|
+
:return:
|
|
2911
|
+
:rtype: Vector
|
|
2845
2912
|
"""
|
|
2846
2913
|
...
|
|
2847
2914
|
|
|
2848
|
-
def __rmul__(self, other: typing.Union[
|
|
2915
|
+
def __rmul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
2849
2916
|
"""
|
|
2850
2917
|
|
|
2851
2918
|
:param other:
|
|
2852
|
-
:type other: typing.Union[
|
|
2853
|
-
:
|
|
2919
|
+
:type other: typing.Union[int, float]
|
|
2920
|
+
:return:
|
|
2921
|
+
:rtype: Vector
|
|
2854
2922
|
"""
|
|
2855
2923
|
...
|
|
2856
2924
|
|
|
2857
|
-
def __rtruediv__(self, other: typing.Union[
|
|
2925
|
+
def __rtruediv__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
2858
2926
|
"""
|
|
2859
2927
|
|
|
2860
2928
|
:param other:
|
|
2861
|
-
:type other: typing.Union[
|
|
2862
|
-
:
|
|
2929
|
+
:type other: typing.Union[int, float]
|
|
2930
|
+
:return:
|
|
2931
|
+
:rtype: Vector
|
|
2863
2932
|
"""
|
|
2864
2933
|
...
|
|
2865
2934
|
|
|
2866
2935
|
def __rmatmul__(
|
|
2867
|
-
self, other: typing.Union[
|
|
2868
|
-
) ->
|
|
2936
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
2937
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
2869
2938
|
"""
|
|
2870
2939
|
|
|
2871
2940
|
:param other:
|
|
2872
|
-
:type other: typing.Union[
|
|
2873
|
-
:
|
|
2941
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
2942
|
+
:return:
|
|
2943
|
+
:rtype: Vector
|
|
2874
2944
|
"""
|
|
2875
2945
|
...
|
|
2876
2946
|
|
|
2877
2947
|
def __iadd__(
|
|
2878
|
-
self, other: typing.Union[
|
|
2879
|
-
) ->
|
|
2948
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2949
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2880
2950
|
"""
|
|
2881
2951
|
|
|
2882
2952
|
:param other:
|
|
2883
|
-
:type other: typing.Union[
|
|
2884
|
-
:
|
|
2953
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2954
|
+
:return:
|
|
2955
|
+
:rtype: Vector
|
|
2885
2956
|
"""
|
|
2886
2957
|
...
|
|
2887
2958
|
|
|
2888
2959
|
def __isub__(
|
|
2889
|
-
self, other: typing.Union[
|
|
2890
|
-
) ->
|
|
2960
|
+
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2961
|
+
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2891
2962
|
"""
|
|
2892
2963
|
|
|
2893
2964
|
:param other:
|
|
2894
|
-
:type other: typing.Union[
|
|
2895
|
-
:
|
|
2965
|
+
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2966
|
+
:return:
|
|
2967
|
+
:rtype: Vector
|
|
2896
2968
|
"""
|
|
2897
2969
|
...
|
|
2898
2970
|
|
|
2899
|
-
def __imul__(self, other: typing.Union[
|
|
2971
|
+
def __imul__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
2900
2972
|
"""
|
|
2901
2973
|
|
|
2902
2974
|
:param other:
|
|
2903
|
-
:type other: typing.Union[
|
|
2904
|
-
:
|
|
2975
|
+
:type other: typing.Union[int, float]
|
|
2976
|
+
:return:
|
|
2977
|
+
:rtype: Vector
|
|
2905
2978
|
"""
|
|
2906
2979
|
...
|
|
2907
2980
|
|
|
2908
|
-
def __itruediv__(self, other: typing.Union[
|
|
2981
|
+
def __itruediv__(self, other: typing.Union[int, float]) -> typing.Union[int, float]:
|
|
2909
2982
|
"""
|
|
2910
2983
|
|
|
2911
2984
|
:param other:
|
|
2912
|
-
:type other: typing.Union[
|
|
2913
|
-
:
|
|
2985
|
+
:type other: typing.Union[int, float]
|
|
2986
|
+
:return:
|
|
2987
|
+
:rtype: Vector
|
|
2914
2988
|
"""
|
|
2915
2989
|
...
|
|
2916
2990
|
|
|
2917
2991
|
def __imatmul__(
|
|
2918
|
-
self, other: typing.Union[
|
|
2919
|
-
) ->
|
|
2992
|
+
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
2993
|
+
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
2920
2994
|
"""
|
|
2921
2995
|
|
|
2922
2996
|
:param other:
|
|
2923
|
-
:type other: typing.Union[
|
|
2924
|
-
:
|
|
2997
|
+
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
2998
|
+
:return:
|
|
2999
|
+
:rtype: Vector
|
|
2925
3000
|
"""
|
|
2926
3001
|
...
|