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