fake-bpy-module 20240713__py3-none-any.whl → 20240715__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.
- bgl/__init__.pyi +0 -558
- bpy/path/__init__.pyi +0 -182
- bpy/types/__init__.pyi +37 -1
- bpy/utils/__init__.pyi +0 -215
- bpy/utils/previews/__init__.pyi +9 -80
- bpy_extras/anim_utils/__init__.pyi +0 -55
- bpy_extras/asset_utils/__init__.pyi +1 -14
- bpy_extras/id_map_utils/__init__.pyi +0 -10
- bpy_extras/image_utils/__init__.pyi +0 -49
- bpy_extras/io_utils/__init__.pyi +0 -131
- bpy_extras/keyconfig_utils/__init__.pyi +0 -11
- bpy_extras/mesh_utils/__init__.pyi +0 -88
- bpy_extras/node_utils/__init__.pyi +0 -1
- bpy_extras/object_utils/__init__.pyi +0 -96
- bpy_extras/view3d_utils/__init__.pyi +0 -94
- {fake_bpy_module-20240713.dist-info → fake_bpy_module-20240715.dist-info}/METADATA +1 -1
- {fake_bpy_module-20240713.dist-info → fake_bpy_module-20240715.dist-info}/RECORD +20 -20
- freestyle/utils/__init__.pyi +1 -1
- {fake_bpy_module-20240713.dist-info → fake_bpy_module-20240715.dist-info}/WHEEL +0 -0
- {fake_bpy_module-20240713.dist-info → fake_bpy_module-20240715.dist-info}/top_level.txt +0 -0
|
@@ -91,40 +91,6 @@ def bake_action(
|
|
|
91
91
|
|
|
92
92
|
...
|
|
93
93
|
|
|
94
|
-
def bake_action(
|
|
95
|
-
obj: bpy.types.Object, *, action: bpy.types.Action | None, frames, bake_options
|
|
96
|
-
) -> bpy.types.Action:
|
|
97
|
-
"""
|
|
98
|
-
|
|
99
|
-
:param obj: Object to bake.
|
|
100
|
-
:type obj: bpy.types.Object
|
|
101
|
-
:param action: An action to bake the data into, or None for a new action
|
|
102
|
-
to be created.
|
|
103
|
-
:type action: bpy.types.Action | None
|
|
104
|
-
:param frames: Frames to bake.
|
|
105
|
-
:return: an action or None
|
|
106
|
-
:rtype: bpy.types.Action
|
|
107
|
-
"""
|
|
108
|
-
|
|
109
|
-
...
|
|
110
|
-
|
|
111
|
-
def bake_action_iter(
|
|
112
|
-
obj: bpy.types.Object, *, action: bpy.types.Action | None, bake_options
|
|
113
|
-
) -> bpy.types.Action:
|
|
114
|
-
"""An coroutine that bakes action for a single object.
|
|
115
|
-
|
|
116
|
-
:param obj: Object to bake.
|
|
117
|
-
:type obj: bpy.types.Object
|
|
118
|
-
:param action: An action to bake the data into, or None for a new action
|
|
119
|
-
to be created.
|
|
120
|
-
:type action: bpy.types.Action | None
|
|
121
|
-
:param bake_options: Boolean options of what to include into the action bake.
|
|
122
|
-
:return: an action or None
|
|
123
|
-
:rtype: bpy.types.Action
|
|
124
|
-
"""
|
|
125
|
-
|
|
126
|
-
...
|
|
127
|
-
|
|
128
94
|
def bake_action_iter(
|
|
129
95
|
obj: bpy.types.Object, *, action: bpy.types.Action | None, bake_options
|
|
130
96
|
) -> bpy.types.Action:
|
|
@@ -154,27 +120,6 @@ def bake_action_objects(
|
|
|
154
120
|
|
|
155
121
|
...
|
|
156
122
|
|
|
157
|
-
def bake_action_objects(
|
|
158
|
-
object_action_pairs, *, frames, bake_options
|
|
159
|
-
) -> list[bpy.types.Action]:
|
|
160
|
-
"""A version of `bake_action_objects_iter` that takes frames and returns the output.
|
|
161
|
-
|
|
162
|
-
:param frames: Frames to bake.
|
|
163
|
-
:return: A sequence of Action or None types (aligned with object_action_pairs)
|
|
164
|
-
:rtype: list[bpy.types.Action]
|
|
165
|
-
"""
|
|
166
|
-
|
|
167
|
-
...
|
|
168
|
-
|
|
169
|
-
def bake_action_objects_iter(object_action_pairs, bake_options):
|
|
170
|
-
"""An coroutine that bakes actions for multiple objects.
|
|
171
|
-
|
|
172
|
-
:param object_action_pairs: Sequence of object action tuples,
|
|
173
|
-
action is the destination for the baked data. When None a new action will be created.
|
|
174
|
-
"""
|
|
175
|
-
|
|
176
|
-
...
|
|
177
|
-
|
|
178
123
|
def bake_action_objects_iter(object_action_pairs, bake_options):
|
|
179
124
|
"""An coroutine that bakes actions for multiple objects.
|
|
180
125
|
|
|
@@ -38,17 +38,4 @@ class AssetMetaDataPanel:
|
|
|
38
38
|
"""
|
|
39
39
|
...
|
|
40
40
|
|
|
41
|
-
class SpaceAssetInfo:
|
|
42
|
-
def is_asset_browser(self, space_data):
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
|
-
:param space_data:
|
|
46
|
-
"""
|
|
47
|
-
...
|
|
48
|
-
|
|
49
|
-
def is_asset_browser_poll(self, context):
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
:param context:
|
|
53
|
-
"""
|
|
54
|
-
...
|
|
41
|
+
class SpaceAssetInfo: ...
|
|
@@ -10,16 +10,6 @@ def get_all_referenced_ids(id, ref_map):
|
|
|
10
10
|
|
|
11
11
|
...
|
|
12
12
|
|
|
13
|
-
def get_all_referenced_ids(id, ref_map):
|
|
14
|
-
"""Return a set of IDs directly or indirectly referenced by id."""
|
|
15
|
-
|
|
16
|
-
...
|
|
17
|
-
|
|
18
|
-
def get_id_reference_map():
|
|
19
|
-
"""Return a dictionary of direct datablock references for every datablock in the blend file."""
|
|
20
|
-
|
|
21
|
-
...
|
|
22
|
-
|
|
23
13
|
def get_id_reference_map():
|
|
24
14
|
"""Return a dictionary of direct datablock references for every datablock in the blend file."""
|
|
25
15
|
|
|
@@ -54,52 +54,3 @@ def load_image(
|
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
56
|
...
|
|
57
|
-
|
|
58
|
-
def load_image(
|
|
59
|
-
imagepath,
|
|
60
|
-
dirname: str = "",
|
|
61
|
-
place_holder: bool = False,
|
|
62
|
-
recursive: bool = False,
|
|
63
|
-
ncase_cmp: bool = True,
|
|
64
|
-
convert_callback: typing.Any = None,
|
|
65
|
-
verbose=False,
|
|
66
|
-
relpath: str = None,
|
|
67
|
-
check_existing: bool = False,
|
|
68
|
-
force_reload: bool = False,
|
|
69
|
-
) -> bpy.types.Image:
|
|
70
|
-
"""Return an image from the file path with options to search multiple paths
|
|
71
|
-
and return a placeholder if its not found.
|
|
72
|
-
|
|
73
|
-
:param dirname: is the directory where the image may be located - any file at
|
|
74
|
-
the end will be ignored.
|
|
75
|
-
:type dirname: str
|
|
76
|
-
:param place_holder: if True a new place holder image will be created.
|
|
77
|
-
this is useful so later you can relink the image to its original data.
|
|
78
|
-
:type place_holder: bool
|
|
79
|
-
:param recursive: If True, directories will be recursively searched.
|
|
80
|
-
Be careful with this if you have files in your root directory because
|
|
81
|
-
it may take a long time.
|
|
82
|
-
:type recursive: bool
|
|
83
|
-
:param ncase_cmp: on non windows systems, find the correct case for the file.
|
|
84
|
-
:type ncase_cmp: bool
|
|
85
|
-
:param convert_callback: a function that takes an existing path and returns
|
|
86
|
-
a new one. Use this when loading image formats blender may not support,
|
|
87
|
-
the CONVERT_CALLBACK can take the path for a GIF (for example),
|
|
88
|
-
convert it to a PNG and return the PNG's path.
|
|
89
|
-
For formats blender can read, simply return the path that is given.
|
|
90
|
-
:type convert_callback: typing.Any
|
|
91
|
-
:param relpath: If not None, make the file relative to this path.
|
|
92
|
-
:type relpath: str
|
|
93
|
-
:param check_existing: If true,
|
|
94
|
-
returns already loaded image datablock if possible
|
|
95
|
-
(based on file path).
|
|
96
|
-
:type check_existing: bool
|
|
97
|
-
:param force_reload: If true,
|
|
98
|
-
force reloading of image (only useful when check_existing
|
|
99
|
-
is also enabled).
|
|
100
|
-
:type force_reload: bool
|
|
101
|
-
:return: an image or None
|
|
102
|
-
:rtype: bpy.types.Image
|
|
103
|
-
"""
|
|
104
|
-
|
|
105
|
-
...
|
bpy_extras/io_utils/__init__.pyi
CHANGED
|
@@ -7,8 +7,6 @@ GenericType1 = typing.TypeVar("GenericType1")
|
|
|
7
7
|
GenericType2 = typing.TypeVar("GenericType2")
|
|
8
8
|
|
|
9
9
|
class ExportHelper:
|
|
10
|
-
check_extension: typing.Any
|
|
11
|
-
|
|
12
10
|
def check(self, _context):
|
|
13
11
|
"""
|
|
14
12
|
|
|
@@ -56,32 +54,6 @@ def axis_conversion(from_forward="Y", from_up="Z", to_forward="Y", to_up="Z"):
|
|
|
56
54
|
|
|
57
55
|
...
|
|
58
56
|
|
|
59
|
-
def axis_conversion(from_forward="Y", from_up="Z", to_forward="Y", to_up="Z"):
|
|
60
|
-
"""Each argument us an axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z']
|
|
61
|
-
where the first 2 are a source and the second 2 are the target.
|
|
62
|
-
|
|
63
|
-
"""
|
|
64
|
-
|
|
65
|
-
...
|
|
66
|
-
|
|
67
|
-
def axis_conversion_ensure(
|
|
68
|
-
operator: bpy.types.Operator, forward_attr: str, up_attr: str
|
|
69
|
-
) -> bool:
|
|
70
|
-
"""Function to ensure an operator has valid axis conversion settings, intended
|
|
71
|
-
to be used from `bpy.types.Operator.check`.
|
|
72
|
-
|
|
73
|
-
:param operator: the operator to access axis attributes from.
|
|
74
|
-
:type operator: bpy.types.Operator
|
|
75
|
-
:param forward_attr: attribute storing the forward axis
|
|
76
|
-
:type forward_attr: str
|
|
77
|
-
:param up_attr: attribute storing the up axis
|
|
78
|
-
:type up_attr: str
|
|
79
|
-
:return: True if the value was modified.
|
|
80
|
-
:rtype: bool
|
|
81
|
-
"""
|
|
82
|
-
|
|
83
|
-
...
|
|
84
|
-
|
|
85
57
|
def axis_conversion_ensure(
|
|
86
58
|
operator: bpy.types.Operator, forward_attr: str, up_attr: str
|
|
87
59
|
) -> bool:
|
|
@@ -116,30 +88,6 @@ def create_derived_objects(
|
|
|
116
88
|
|
|
117
89
|
...
|
|
118
90
|
|
|
119
|
-
def create_derived_objects(
|
|
120
|
-
depsgraph: bpy.types.Depsgraph, objects: list[bpy.types.Object]
|
|
121
|
-
) -> dict:
|
|
122
|
-
"""This function takes a sequence of objects, returning their instances.
|
|
123
|
-
|
|
124
|
-
:param depsgraph: The evaluated depsgraph.
|
|
125
|
-
:type depsgraph: bpy.types.Depsgraph
|
|
126
|
-
:param objects: A sequencer of objects.
|
|
127
|
-
:type objects: list[bpy.types.Object]
|
|
128
|
-
:return: A dictionary where each key is an object from objects,
|
|
129
|
-
values are lists of (`bpy.types.Object`, `mathutils.Matrix`) tuples representing instances.
|
|
130
|
-
:rtype: dict
|
|
131
|
-
"""
|
|
132
|
-
|
|
133
|
-
...
|
|
134
|
-
|
|
135
|
-
def orientation_helper(axis_forward="Y", axis_up="Z"):
|
|
136
|
-
"""A decorator for import/export classes, generating properties needed by the axis conversion system and IO helpers,
|
|
137
|
-
with specified default values (axes).
|
|
138
|
-
|
|
139
|
-
"""
|
|
140
|
-
|
|
141
|
-
...
|
|
142
|
-
|
|
143
91
|
def orientation_helper(axis_forward="Y", axis_up="Z"):
|
|
144
92
|
"""A decorator for import/export classes, generating properties needed by the axis conversion system and IO helpers,
|
|
145
93
|
with specified default values (axes).
|
|
@@ -185,43 +133,6 @@ def path_reference(
|
|
|
185
133
|
|
|
186
134
|
...
|
|
187
135
|
|
|
188
|
-
def path_reference(
|
|
189
|
-
filepath: str,
|
|
190
|
-
base_src: str,
|
|
191
|
-
base_dst: str,
|
|
192
|
-
mode: str = "AUTO",
|
|
193
|
-
copy_subdir: str = "",
|
|
194
|
-
copy_set: set = None,
|
|
195
|
-
library: bpy.types.Library | None = None,
|
|
196
|
-
) -> str:
|
|
197
|
-
"""Return a filepath relative to a destination directory, for use with
|
|
198
|
-
exporters.
|
|
199
|
-
|
|
200
|
-
:param filepath: the file path to return,
|
|
201
|
-
supporting blenders relative '//' prefix.
|
|
202
|
-
:type filepath: str
|
|
203
|
-
:param base_src: the directory the filepath is relative too
|
|
204
|
-
(normally the blend file).
|
|
205
|
-
:type base_src: str
|
|
206
|
-
:param base_dst: the directory the filepath will be referenced from
|
|
207
|
-
(normally the export path).
|
|
208
|
-
:type base_dst: str
|
|
209
|
-
:param mode: the method used get the path in
|
|
210
|
-
['AUTO', 'ABSOLUTE', 'RELATIVE', 'MATCH', 'STRIP', 'COPY']
|
|
211
|
-
:type mode: str
|
|
212
|
-
:param copy_subdir: the subdirectory of base_dst to use when mode='COPY'.
|
|
213
|
-
:type copy_subdir: str
|
|
214
|
-
:param copy_set: collect from/to pairs when mode='COPY',
|
|
215
|
-
pass to path_reference_copy when exporting is done.
|
|
216
|
-
:type copy_set: set
|
|
217
|
-
:param library: The library this path is relative to.
|
|
218
|
-
:type library: bpy.types.Library | None
|
|
219
|
-
:return: the new filepath.
|
|
220
|
-
:rtype: str
|
|
221
|
-
"""
|
|
222
|
-
|
|
223
|
-
...
|
|
224
|
-
|
|
225
136
|
def path_reference_copy(copy_set: set, report: typing.Any = print):
|
|
226
137
|
"""Execute copying files of path_reference
|
|
227
138
|
|
|
@@ -233,17 +144,6 @@ def path_reference_copy(copy_set: set, report: typing.Any = print):
|
|
|
233
144
|
|
|
234
145
|
...
|
|
235
146
|
|
|
236
|
-
def path_reference_copy(copy_set: set, report: typing.Any = None):
|
|
237
|
-
"""Execute copying files of path_reference
|
|
238
|
-
|
|
239
|
-
:param copy_set: set of (from, to) pairs to copy.
|
|
240
|
-
:type copy_set: set
|
|
241
|
-
:param report: function used for reporting warnings, takes a string argument.
|
|
242
|
-
:type report: typing.Any
|
|
243
|
-
"""
|
|
244
|
-
|
|
245
|
-
...
|
|
246
|
-
|
|
247
147
|
def poll_file_object_drop(context):
|
|
248
148
|
"""A default implementation for FileHandler poll_drop methods. Allows for both the 3D Viewport and
|
|
249
149
|
the Outliner (in ViewLayer display mode) to be targets for file drag and drop.
|
|
@@ -281,36 +181,5 @@ def unique_name(
|
|
|
281
181
|
|
|
282
182
|
...
|
|
283
183
|
|
|
284
|
-
def unique_name(
|
|
285
|
-
key,
|
|
286
|
-
name: str,
|
|
287
|
-
name_dict: dict,
|
|
288
|
-
name_max=-1,
|
|
289
|
-
clean_func: typing.Any = None,
|
|
290
|
-
sep: str = ".",
|
|
291
|
-
):
|
|
292
|
-
"""Helper function for storing unique names which may have special characters
|
|
293
|
-
stripped and restricted to a maximum length.
|
|
294
|
-
|
|
295
|
-
:param key: unique item this name belongs to, name_dict[key] will be reused
|
|
296
|
-
when available.
|
|
297
|
-
This can be the object, mesh, material, etc instance itself.
|
|
298
|
-
:param name: The name used to create a unique value in name_dict.
|
|
299
|
-
:type name: str
|
|
300
|
-
:param name_dict: This is used to cache namespace to ensure no collisions
|
|
301
|
-
occur, this should be an empty dict initially and only modified by this
|
|
302
|
-
function.
|
|
303
|
-
:type name_dict: dict
|
|
304
|
-
:param clean_func: Function to call on name before creating a unique value.
|
|
305
|
-
:type clean_func: typing.Any
|
|
306
|
-
:param sep: Separator to use when between the name and a number when a
|
|
307
|
-
duplicate name is found.
|
|
308
|
-
:type sep: str
|
|
309
|
-
"""
|
|
310
|
-
|
|
311
|
-
...
|
|
312
|
-
|
|
313
184
|
def unpack_face_list(list_of_tuples): ...
|
|
314
|
-
def unpack_face_list(list_of_tuples): ...
|
|
315
|
-
def unpack_list(list_of_tuples): ...
|
|
316
185
|
def unpack_list(list_of_tuples): ...
|
|
@@ -5,11 +5,6 @@ import typing_extensions
|
|
|
5
5
|
GenericType1 = typing.TypeVar("GenericType1")
|
|
6
6
|
GenericType2 = typing.TypeVar("GenericType2")
|
|
7
7
|
|
|
8
|
-
def addon_keymap_register(keymap_data):
|
|
9
|
-
"""Register a set of keymaps for addons using a list of keymaps.See 'blender_defaults.py' for examples of the format this takes."""
|
|
10
|
-
|
|
11
|
-
...
|
|
12
|
-
|
|
13
8
|
def addon_keymap_register(keymap_data):
|
|
14
9
|
"""Register a set of keymaps for addons using a list of keymaps.See 'blender_defaults.py' for examples of the format this takes."""
|
|
15
10
|
|
|
@@ -20,10 +15,4 @@ def addon_keymap_unregister(keymap_data):
|
|
|
20
15
|
|
|
21
16
|
...
|
|
22
17
|
|
|
23
|
-
def addon_keymap_unregister(keymap_data):
|
|
24
|
-
"""Unregister a set of keymaps for addons."""
|
|
25
|
-
|
|
26
|
-
...
|
|
27
|
-
|
|
28
|
-
def keyconfig_test(kc): ...
|
|
29
18
|
def keyconfig_test(kc): ...
|
|
@@ -15,25 +15,6 @@ def edge_face_count(mesh) -> list:
|
|
|
15
15
|
|
|
16
16
|
...
|
|
17
17
|
|
|
18
|
-
def edge_face_count(mesh) -> list:
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
:return: list face users for each item in mesh.edges.
|
|
22
|
-
:rtype: list
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
...
|
|
26
|
-
|
|
27
|
-
def edge_face_count_dict(mesh) -> dict:
|
|
28
|
-
"""
|
|
29
|
-
|
|
30
|
-
:return: dict of edge keys with their value set to the number of
|
|
31
|
-
faces using each edge.
|
|
32
|
-
:rtype: dict
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
...
|
|
36
|
-
|
|
37
18
|
def edge_face_count_dict(mesh) -> dict:
|
|
38
19
|
"""
|
|
39
20
|
|
|
@@ -52,26 +33,6 @@ def edge_loops_from_edges(mesh, edges=None):
|
|
|
52
33
|
|
|
53
34
|
...
|
|
54
35
|
|
|
55
|
-
def edge_loops_from_edges(mesh, edges=None):
|
|
56
|
-
"""Edge loops defined by edgesTakes me.edges or a list of edges and returns the edge loopsreturn a list of vertex indices.
|
|
57
|
-
[ [1, 6, 7, 2], ...]closed loops have matching start and end values.
|
|
58
|
-
|
|
59
|
-
"""
|
|
60
|
-
|
|
61
|
-
...
|
|
62
|
-
|
|
63
|
-
def mesh_linked_triangles(mesh: bpy.types.Mesh) -> list:
|
|
64
|
-
"""Splits the mesh into connected triangles, use this for separating cubes from
|
|
65
|
-
other mesh elements within 1 mesh datablock.
|
|
66
|
-
|
|
67
|
-
:param mesh: the mesh used to group with.
|
|
68
|
-
:type mesh: bpy.types.Mesh
|
|
69
|
-
:return: lists of lists containing triangles.
|
|
70
|
-
:rtype: list
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
...
|
|
74
|
-
|
|
75
36
|
def mesh_linked_triangles(mesh: bpy.types.Mesh) -> list:
|
|
76
37
|
"""Splits the mesh into connected triangles, use this for separating cubes from
|
|
77
38
|
other mesh elements within 1 mesh datablock.
|
|
@@ -95,41 +56,6 @@ def mesh_linked_uv_islands(mesh: bpy.types.Mesh) -> list:
|
|
|
95
56
|
|
|
96
57
|
...
|
|
97
58
|
|
|
98
|
-
def mesh_linked_uv_islands(mesh: bpy.types.Mesh) -> list:
|
|
99
|
-
"""Returns lists of polygon indices connected by UV islands.
|
|
100
|
-
|
|
101
|
-
:param mesh: the mesh used to group with.
|
|
102
|
-
:type mesh: bpy.types.Mesh
|
|
103
|
-
:return: list of lists containing polygon indices
|
|
104
|
-
:rtype: list
|
|
105
|
-
"""
|
|
106
|
-
|
|
107
|
-
...
|
|
108
|
-
|
|
109
|
-
def ngon_tessellate(
|
|
110
|
-
from_data: bpy.types.Mesh | list,
|
|
111
|
-
indices: list,
|
|
112
|
-
fix_loops: bool = True,
|
|
113
|
-
debug_print=True,
|
|
114
|
-
):
|
|
115
|
-
"""Takes a poly-line of indices (ngon) and returns a list of face
|
|
116
|
-
index lists. Designed to be used for importers that need indices for an
|
|
117
|
-
ngon to create from existing verts.
|
|
118
|
-
|
|
119
|
-
:param from_data: either a mesh, or a list/tuple of vectors.
|
|
120
|
-
:type from_data: bpy.types.Mesh | list
|
|
121
|
-
:param indices: a list of indices to use this list
|
|
122
|
-
is the ordered closed poly-line
|
|
123
|
-
to fill, and can be a subset of the data given.
|
|
124
|
-
:type indices: list
|
|
125
|
-
:param fix_loops: If this is enabled poly-lines
|
|
126
|
-
that use loops to make multiple
|
|
127
|
-
poly-lines are dealt with correctly.
|
|
128
|
-
:type fix_loops: bool
|
|
129
|
-
"""
|
|
130
|
-
|
|
131
|
-
...
|
|
132
|
-
|
|
133
59
|
def ngon_tessellate(
|
|
134
60
|
from_data: bpy.types.Mesh | list,
|
|
135
61
|
indices: list,
|
|
@@ -167,17 +93,3 @@ def triangle_random_points(
|
|
|
167
93
|
"""
|
|
168
94
|
|
|
169
95
|
...
|
|
170
|
-
|
|
171
|
-
def triangle_random_points(
|
|
172
|
-
num_points, loop_triangles: bpy.types.MeshLoopTriangle | collections.abc.Sequence
|
|
173
|
-
) -> list:
|
|
174
|
-
"""Generates a list of random points over mesh loop triangles.
|
|
175
|
-
|
|
176
|
-
:param num_points: the number of random points to generate on each triangle.
|
|
177
|
-
:param loop_triangles: list of the triangles to generate points on.
|
|
178
|
-
:type loop_triangles: bpy.types.MeshLoopTriangle | collections.abc.Sequence
|
|
179
|
-
:return: list of random points over all triangles.
|
|
180
|
-
:rtype: list
|
|
181
|
-
"""
|
|
182
|
-
|
|
183
|
-
...
|
|
@@ -15,28 +15,6 @@ class AddObjectHelper:
|
|
|
15
15
|
"""
|
|
16
16
|
...
|
|
17
17
|
|
|
18
|
-
def poll(self, context):
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
:param context:
|
|
22
|
-
"""
|
|
23
|
-
...
|
|
24
|
-
|
|
25
|
-
def add_object_align_init(
|
|
26
|
-
context: bpy.types.Context, operator: bpy.types.Operator
|
|
27
|
-
) -> mathutils.Matrix:
|
|
28
|
-
"""Return a matrix using the operator settings and view context.
|
|
29
|
-
|
|
30
|
-
:param context: The context to use.
|
|
31
|
-
:type context: bpy.types.Context
|
|
32
|
-
:param operator: The operator, checked for location and rotation properties.
|
|
33
|
-
:type operator: bpy.types.Operator
|
|
34
|
-
:return: the matrix from the context and settings.
|
|
35
|
-
:rtype: mathutils.Matrix
|
|
36
|
-
"""
|
|
37
|
-
|
|
38
|
-
...
|
|
39
|
-
|
|
40
18
|
def add_object_align_init(
|
|
41
19
|
context: bpy.types.Context, operator: bpy.types.Operator
|
|
42
20
|
) -> mathutils.Matrix:
|
|
@@ -60,19 +38,6 @@ def object_add_grid_scale(context):
|
|
|
60
38
|
|
|
61
39
|
...
|
|
62
40
|
|
|
63
|
-
def object_add_grid_scale(context):
|
|
64
|
-
"""Return scale which should be applied on object
|
|
65
|
-
data to align it to grid scale
|
|
66
|
-
|
|
67
|
-
"""
|
|
68
|
-
|
|
69
|
-
...
|
|
70
|
-
|
|
71
|
-
def object_add_grid_scale_apply_operator(operator, context):
|
|
72
|
-
"""Scale an operators distance values by the grid size."""
|
|
73
|
-
|
|
74
|
-
...
|
|
75
|
-
|
|
76
41
|
def object_add_grid_scale_apply_operator(operator, context):
|
|
77
42
|
"""Scale an operators distance values by the grid size."""
|
|
78
43
|
|
|
@@ -100,42 +65,6 @@ def object_data_add(
|
|
|
100
65
|
|
|
101
66
|
...
|
|
102
67
|
|
|
103
|
-
def object_data_add(
|
|
104
|
-
context: bpy.types.Context,
|
|
105
|
-
obdata,
|
|
106
|
-
operator: bpy.types.Operator = None,
|
|
107
|
-
name: str | None = None,
|
|
108
|
-
) -> bpy.types.Object:
|
|
109
|
-
"""Add an object using the view context and preference to initialize the
|
|
110
|
-
location, rotation and layer.
|
|
111
|
-
|
|
112
|
-
:param context: The context to use.
|
|
113
|
-
:type context: bpy.types.Context
|
|
114
|
-
:param obdata: the data used for the new object.
|
|
115
|
-
:param operator: The operator, checked for location and rotation properties.
|
|
116
|
-
:type operator: bpy.types.Operator
|
|
117
|
-
:param name: Optional name
|
|
118
|
-
:type name: str | None
|
|
119
|
-
:return: the newly created object in the scene.
|
|
120
|
-
:rtype: bpy.types.Object
|
|
121
|
-
"""
|
|
122
|
-
|
|
123
|
-
...
|
|
124
|
-
|
|
125
|
-
def object_report_if_active_shape_key_is_locked(
|
|
126
|
-
obj: bpy.types.Object, operator: bpy.types.Operator
|
|
127
|
-
):
|
|
128
|
-
"""Checks if the active shape key of the specified object is locked, and reports an error if so.If the object has no shape keys, there is nothing to lock, and the function returns False.
|
|
129
|
-
|
|
130
|
-
:param obj: Object to check.
|
|
131
|
-
:type obj: bpy.types.Object
|
|
132
|
-
:param operator: Currently running operator to report the error through. Use None to suppress emitting the message.
|
|
133
|
-
:type operator: bpy.types.Operator
|
|
134
|
-
:return: True if the shape key was locked.
|
|
135
|
-
"""
|
|
136
|
-
|
|
137
|
-
...
|
|
138
|
-
|
|
139
68
|
def object_report_if_active_shape_key_is_locked(
|
|
140
69
|
obj: bpy.types.Object, operator: bpy.types.Operator
|
|
141
70
|
):
|
|
@@ -174,28 +103,3 @@ def world_to_camera_view(
|
|
|
174
103
|
"""
|
|
175
104
|
|
|
176
105
|
...
|
|
177
|
-
|
|
178
|
-
def world_to_camera_view(
|
|
179
|
-
scene: bpy.types.Scene,
|
|
180
|
-
obj: bpy.types.Object,
|
|
181
|
-
coord: collections.abc.Sequence[float] | mathutils.Vector,
|
|
182
|
-
) -> mathutils.Vector:
|
|
183
|
-
"""Returns the camera space coords for a 3d point.
|
|
184
|
-
(also known as: normalized device coordinates - NDC).Where (0, 0) is the bottom left and (1, 1)
|
|
185
|
-
is the top right of the camera frame.
|
|
186
|
-
values outside 0-1 are also supported.
|
|
187
|
-
A negative 'z' value means the point is behind the camera.Takes shift-x/y, lens angle and sensor size into account
|
|
188
|
-
as well as perspective/ortho projections.
|
|
189
|
-
|
|
190
|
-
:param scene: Scene to use for frame size.
|
|
191
|
-
:type scene: bpy.types.Scene
|
|
192
|
-
:param obj: Camera object.
|
|
193
|
-
:type obj: bpy.types.Object
|
|
194
|
-
:param coord: World space location.
|
|
195
|
-
:type coord: collections.abc.Sequence[float] | mathutils.Vector
|
|
196
|
-
:return: a vector where X and Y map to the view plane and
|
|
197
|
-
Z is the depth on the view axis.
|
|
198
|
-
:rtype: mathutils.Vector
|
|
199
|
-
"""
|
|
200
|
-
|
|
201
|
-
...
|
|
@@ -30,54 +30,6 @@ def location_3d_to_region_2d(
|
|
|
30
30
|
|
|
31
31
|
...
|
|
32
32
|
|
|
33
|
-
def location_3d_to_region_2d(
|
|
34
|
-
region: bpy.types.Region,
|
|
35
|
-
rv3d: bpy.types.RegionView3D,
|
|
36
|
-
coord: collections.abc.Sequence[float] | mathutils.Vector,
|
|
37
|
-
*,
|
|
38
|
-
default=None,
|
|
39
|
-
) -> mathutils.Vector:
|
|
40
|
-
"""Return the region relative 2d location of a 3d position.
|
|
41
|
-
|
|
42
|
-
:param region: region of the 3D viewport, typically bpy.context.region.
|
|
43
|
-
:type region: bpy.types.Region
|
|
44
|
-
:param rv3d: 3D region data, typically bpy.context.space_data.region_3d.
|
|
45
|
-
:type rv3d: bpy.types.RegionView3D
|
|
46
|
-
:param coord: 3d world-space location.
|
|
47
|
-
:type coord: collections.abc.Sequence[float] | mathutils.Vector
|
|
48
|
-
:param default: Return this value if coord
|
|
49
|
-
is behind the origin of a perspective view.
|
|
50
|
-
:return: 2d location
|
|
51
|
-
:rtype: mathutils.Vector
|
|
52
|
-
"""
|
|
53
|
-
|
|
54
|
-
...
|
|
55
|
-
|
|
56
|
-
def region_2d_to_location_3d(
|
|
57
|
-
region: bpy.types.Region,
|
|
58
|
-
rv3d: bpy.types.RegionView3D,
|
|
59
|
-
coord: collections.abc.Sequence[float] | mathutils.Vector,
|
|
60
|
-
depth_location: collections.abc.Sequence[float] | mathutils.Vector,
|
|
61
|
-
) -> mathutils.Vector:
|
|
62
|
-
"""Return a 3d location from the region relative 2d coords, aligned with
|
|
63
|
-
depth_location.
|
|
64
|
-
|
|
65
|
-
:param region: region of the 3D viewport, typically bpy.context.region.
|
|
66
|
-
:type region: bpy.types.Region
|
|
67
|
-
:param rv3d: 3D region data, typically bpy.context.space_data.region_3d.
|
|
68
|
-
:type rv3d: bpy.types.RegionView3D
|
|
69
|
-
:param coord: 2d coordinates relative to the region;
|
|
70
|
-
(event.mouse_region_x, event.mouse_region_y) for example.
|
|
71
|
-
:type coord: collections.abc.Sequence[float] | mathutils.Vector
|
|
72
|
-
:param depth_location: the returned vectors depth is aligned with this since
|
|
73
|
-
there is no defined depth with a 2d region input.
|
|
74
|
-
:type depth_location: collections.abc.Sequence[float] | mathutils.Vector
|
|
75
|
-
:return: normalized 3d vector.
|
|
76
|
-
:rtype: mathutils.Vector
|
|
77
|
-
"""
|
|
78
|
-
|
|
79
|
-
...
|
|
80
|
-
|
|
81
33
|
def region_2d_to_location_3d(
|
|
82
34
|
region: bpy.types.Region,
|
|
83
35
|
rv3d: bpy.types.RegionView3D,
|
|
@@ -128,52 +80,6 @@ def region_2d_to_origin_3d(
|
|
|
128
80
|
|
|
129
81
|
...
|
|
130
82
|
|
|
131
|
-
def region_2d_to_origin_3d(
|
|
132
|
-
region: bpy.types.Region,
|
|
133
|
-
rv3d: bpy.types.RegionView3D,
|
|
134
|
-
coord: collections.abc.Sequence[float] | mathutils.Vector,
|
|
135
|
-
*,
|
|
136
|
-
clamp: float | None = None,
|
|
137
|
-
) -> mathutils.Vector:
|
|
138
|
-
"""Return the 3d view origin from the region relative 2d coords.
|
|
139
|
-
|
|
140
|
-
:param region: region of the 3D viewport, typically bpy.context.region.
|
|
141
|
-
:type region: bpy.types.Region
|
|
142
|
-
:param rv3d: 3D region data, typically bpy.context.space_data.region_3d.
|
|
143
|
-
:type rv3d: bpy.types.RegionView3D
|
|
144
|
-
:param coord: 2d coordinates relative to the region;
|
|
145
|
-
(event.mouse_region_x, event.mouse_region_y) for example.
|
|
146
|
-
:type coord: collections.abc.Sequence[float] | mathutils.Vector
|
|
147
|
-
:param clamp: Clamp the maximum far-clip value used.
|
|
148
|
-
(negative value will move the offset away from the view_location)
|
|
149
|
-
:type clamp: float | None
|
|
150
|
-
:return: The origin of the viewpoint in 3d space.
|
|
151
|
-
:rtype: mathutils.Vector
|
|
152
|
-
"""
|
|
153
|
-
|
|
154
|
-
...
|
|
155
|
-
|
|
156
|
-
def region_2d_to_vector_3d(
|
|
157
|
-
region: bpy.types.Region,
|
|
158
|
-
rv3d: bpy.types.RegionView3D,
|
|
159
|
-
coord: collections.abc.Sequence[float] | mathutils.Vector,
|
|
160
|
-
) -> mathutils.Vector:
|
|
161
|
-
"""Return a direction vector from the viewport at the specific 2d region
|
|
162
|
-
coordinate.
|
|
163
|
-
|
|
164
|
-
:param region: region of the 3D viewport, typically bpy.context.region.
|
|
165
|
-
:type region: bpy.types.Region
|
|
166
|
-
:param rv3d: 3D region data, typically bpy.context.space_data.region_3d.
|
|
167
|
-
:type rv3d: bpy.types.RegionView3D
|
|
168
|
-
:param coord: 2d coordinates relative to the region:
|
|
169
|
-
(event.mouse_region_x, event.mouse_region_y) for example.
|
|
170
|
-
:type coord: collections.abc.Sequence[float] | mathutils.Vector
|
|
171
|
-
:return: normalized 3d vector.
|
|
172
|
-
:rtype: mathutils.Vector
|
|
173
|
-
"""
|
|
174
|
-
|
|
175
|
-
...
|
|
176
|
-
|
|
177
83
|
def region_2d_to_vector_3d(
|
|
178
84
|
region: bpy.types.Region,
|
|
179
85
|
rv3d: bpy.types.RegionView3D,
|