fake-bpy-module 20241103__py3-none-any.whl → 20241111__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 +28 -13
- bl_console_utils/autocomplete/complete_calltip/__init__.pyi +1 -2
- bl_console_utils/autocomplete/complete_import/__init__.pyi +3 -6
- bl_console_utils/autocomplete/complete_namespace/__init__.pyi +1 -2
- bl_console_utils/autocomplete/intellisense/__init__.pyi +2 -6
- bl_operators/image_as_planes/__init__.pyi +12 -39
- bl_operators/uvcalc_transform/__init__.pyi +4 -42
- bl_operators/wm/__init__.pyi +8 -0
- bl_ui/generic_ui_list/__init__.pyi +2 -1
- bl_ui/properties_grease_pencil_common/__init__.pyi +0 -7
- bl_ui/space_userpref/__init__.pyi +2 -2
- blf/__init__.pyi +3 -5
- bmesh/types/__init__.pyi +22 -33
- bmesh/utils/__init__.pyi +6 -16
- bpy/app/icons/__init__.pyi +5 -11
- bpy/app/translations/__init__.pyi +7 -14
- bpy/msgbus/__init__.pyi +7 -8
- bpy/ops/curves/__init__.pyi +16 -0
- bpy/ops/nla/__init__.pyi +1 -1
- bpy/ops/sequencer/__init__.pyi +3 -0
- bpy/path/__init__.pyi +6 -16
- bpy/props/__init__.pyi +122 -135
- bpy/types/__init__.pyi +365 -604
- bpy/utils/__init__.pyi +30 -29
- bpy/utils/previews/__init__.pyi +1 -2
- bpy/utils/units/__init__.pyi +1 -2
- bpy_extras/anim_utils/__init__.pyi +5 -12
- bpy_extras/bmesh_utils/__init__.pyi +1 -2
- bpy_extras/image_utils/__init__.pyi +2 -5
- bpy_extras/io_utils/__init__.pyi +8 -14
- bpy_extras/mesh_utils/__init__.pyi +14 -29
- bpy_extras/object_utils/__init__.pyi +1 -1
- bpy_extras/view3d_utils/__init__.pyi +3 -10
- {fake_bpy_module-20241103.dist-info → fake_bpy_module-20241111.dist-info}/METADATA +1 -1
- {fake_bpy_module-20241103.dist-info → fake_bpy_module-20241111.dist-info}/RECORD +56 -56
- freestyle/chainingiterators/__init__.pyi +2 -7
- freestyle/functions/__init__.pyi +4 -16
- freestyle/types/__init__.pyi +29 -63
- freestyle/utils/ContextFunctions/__init__.pyi +2 -2
- freestyle/utils/__init__.pyi +1 -2
- gpu/__init__.pyi +19 -5
- gpu/matrix/__init__.pyi +2 -2
- gpu/state/__init__.pyi +16 -8
- gpu/types/__init__.pyi +14 -29
- gpu_extras/batch/__init__.pyi +9 -9
- gpu_extras/presets/__init__.pyi +4 -11
- idprop/types/__init__.pyi +1 -2
- imbuf/__init__.pyi +2 -4
- mathutils/__init__.pyi +30 -95
- mathutils/bvhtree/__init__.pyi +13 -17
- mathutils/geometry/__init__.pyi +26 -45
- mathutils/interpolate/__init__.pyi +2 -2
- mathutils/kdtree/__init__.pyi +13 -28
- rna_info/__init__.pyi +1 -2
- {fake_bpy_module-20241103.dist-info → fake_bpy_module-20241111.dist-info}/WHEEL +0 -0
- {fake_bpy_module-20241103.dist-info → fake_bpy_module-20241111.dist-info}/top_level.txt +0 -0
bpy/utils/__init__.pyi
CHANGED
|
@@ -13,6 +13,8 @@ bpy.utils.units.rst
|
|
|
13
13
|
import typing
|
|
14
14
|
import collections.abc
|
|
15
15
|
import typing_extensions
|
|
16
|
+
import bpy.types
|
|
17
|
+
|
|
16
18
|
from . import previews as previews
|
|
17
19
|
from . import units as units
|
|
18
20
|
|
|
@@ -21,12 +23,10 @@ def app_template_paths(*, path: str | None = None):
|
|
|
21
23
|
|
|
22
24
|
:param path: Optional subdir.
|
|
23
25
|
:type path: str | None
|
|
24
|
-
:return:
|
|
26
|
+
:return: App template paths.
|
|
25
27
|
"""
|
|
26
28
|
|
|
27
|
-
def blend_paths(
|
|
28
|
-
absolute: bool = False, packed: bool = False, local: bool = False
|
|
29
|
-
) -> list[str]:
|
|
29
|
+
def blend_paths(absolute: bool = False, packed: bool = False, local: bool = False):
|
|
30
30
|
"""Returns a list of paths to external files referenced by the loaded .blend file.
|
|
31
31
|
|
|
32
32
|
:param absolute: When true the paths returned are made absolute.
|
|
@@ -36,7 +36,6 @@ def blend_paths(
|
|
|
36
36
|
:param local: When true skip linked library paths.
|
|
37
37
|
:type local: bool
|
|
38
38
|
:return: path list.
|
|
39
|
-
:rtype: list[str]
|
|
40
39
|
"""
|
|
41
40
|
|
|
42
41
|
def escape_identifier(string: str) -> str:
|
|
@@ -126,7 +125,7 @@ def load_scripts_extensions(*, reload_scripts: bool = False):
|
|
|
126
125
|
:type reload_scripts: bool
|
|
127
126
|
"""
|
|
128
127
|
|
|
129
|
-
def make_rna_paths(struct_name: str, prop_name: str, enum_name: str):
|
|
128
|
+
def make_rna_paths(struct_name: str, prop_name: str, enum_name: str) -> str:
|
|
130
129
|
"""Create RNA "paths" from given names.
|
|
131
130
|
|
|
132
131
|
:param struct_name: Name of a RNA struct (like e.g. "Scene").
|
|
@@ -138,6 +137,7 @@ def make_rna_paths(struct_name: str, prop_name: str, enum_name: str):
|
|
|
138
137
|
:return: A triple of three "RNA paths"
|
|
139
138
|
(most_complete_path, "struct.prop", "struct.prop:'enum'").
|
|
140
139
|
If no enum_name is given, the third element will always be void.
|
|
140
|
+
:rtype: str
|
|
141
141
|
"""
|
|
142
142
|
|
|
143
143
|
def manual_language_code(default="en") -> str:
|
|
@@ -149,32 +149,29 @@ def manual_language_code(default="en") -> str:
|
|
|
149
149
|
"""
|
|
150
150
|
|
|
151
151
|
def manual_map(): ...
|
|
152
|
-
def modules_from_path(path: str, loaded_modules
|
|
152
|
+
def modules_from_path(path: str, loaded_modules):
|
|
153
153
|
"""Load all modules in a path and return them as a list.
|
|
154
154
|
|
|
155
155
|
:param path: this path is scanned for scripts and packages.
|
|
156
156
|
:type path: str
|
|
157
157
|
:param loaded_modules: already loaded module names, files matching these
|
|
158
158
|
names will be ignored.
|
|
159
|
-
:type loaded_modules: set
|
|
160
159
|
:return: all loaded modules.
|
|
161
|
-
:rtype: list
|
|
162
160
|
"""
|
|
163
161
|
|
|
164
162
|
def preset_find(name, preset_path, *, display_name=False, ext=".py"): ...
|
|
165
|
-
def preset_paths(subdir: str)
|
|
163
|
+
def preset_paths(subdir: str):
|
|
166
164
|
"""Returns a list of paths for a specific preset.
|
|
167
165
|
|
|
168
166
|
:param subdir: preset subdirectory (must not be an absolute path).
|
|
169
167
|
:type subdir: str
|
|
170
|
-
:return:
|
|
171
|
-
:rtype: list
|
|
168
|
+
:return: Script paths.
|
|
172
169
|
"""
|
|
173
170
|
|
|
174
171
|
def refresh_script_paths():
|
|
175
172
|
"""Run this after creating new script paths to update sys.path"""
|
|
176
173
|
|
|
177
|
-
def register_class(cls):
|
|
174
|
+
def register_class(cls: typing.Any):
|
|
178
175
|
"""Register a subclass of a Blender type class.
|
|
179
176
|
|
|
180
177
|
:param cls: Blender type class in:
|
|
@@ -183,6 +180,7 @@ def register_class(cls):
|
|
|
183
180
|
`bpy.types.Operator`, `bpy.types.KeyingSetInfo`,
|
|
184
181
|
`bpy.types.RenderEngine`, `bpy.types.AssetShelf`,
|
|
185
182
|
`bpy.types.FileHandler`
|
|
183
|
+
:type cls: typing.Any
|
|
186
184
|
"""
|
|
187
185
|
|
|
188
186
|
def register_classes_factory(classes):
|
|
@@ -224,7 +222,9 @@ def register_preset_path(path: str) -> bool:
|
|
|
224
222
|
:rtype: bool
|
|
225
223
|
"""
|
|
226
224
|
|
|
227
|
-
def register_submodule_factory(
|
|
225
|
+
def register_submodule_factory(
|
|
226
|
+
module_name: str, submodule_names
|
|
227
|
+
) -> collections.abc.Callable:
|
|
228
228
|
"""Utility function to create register and unregister functions
|
|
229
229
|
which simply load submodules,
|
|
230
230
|
calling their register & unregister functions.
|
|
@@ -232,16 +232,21 @@ def register_submodule_factory(module_name: str, submodule_names: list[str]):
|
|
|
232
232
|
:param module_name: The module name, typically __name__.
|
|
233
233
|
:type module_name: str
|
|
234
234
|
:param submodule_names: List of submodule names to load and unload.
|
|
235
|
-
:type submodule_names: list[str]
|
|
236
235
|
:return: register and unregister functions.
|
|
236
|
+
:rtype: collections.abc.Callable
|
|
237
237
|
"""
|
|
238
238
|
|
|
239
239
|
def register_tool(
|
|
240
|
-
tool_cls
|
|
240
|
+
tool_cls: bpy.types.WorkSpaceTool,
|
|
241
|
+
*,
|
|
242
|
+
after=None,
|
|
243
|
+
separator: bool = False,
|
|
244
|
+
group: bool = False,
|
|
241
245
|
):
|
|
242
246
|
"""Register a tool in the toolbar.
|
|
243
247
|
|
|
244
248
|
:param tool_cls: A tool subclass.
|
|
249
|
+
:type tool_cls: bpy.types.WorkSpaceTool
|
|
245
250
|
:param after: Optional identifiers this tool will be added after.
|
|
246
251
|
:param separator: When true, add a separator before this tool.
|
|
247
252
|
:type separator: bool
|
|
@@ -274,7 +279,7 @@ def script_paths(
|
|
|
274
279
|
check_all: bool = False,
|
|
275
280
|
use_user: bool = True,
|
|
276
281
|
use_system_environment: bool = True,
|
|
277
|
-
)
|
|
282
|
+
):
|
|
278
283
|
"""Returns a list of valid script paths.
|
|
279
284
|
|
|
280
285
|
:param subdir: Optional subdir.
|
|
@@ -288,7 +293,6 @@ def script_paths(
|
|
|
288
293
|
:param use_system_environment: Include BLENDER_SYSTEM_SCRIPTS variable path
|
|
289
294
|
:type use_system_environment: bool
|
|
290
295
|
:return: script paths.
|
|
291
|
-
:rtype: list
|
|
292
296
|
"""
|
|
293
297
|
|
|
294
298
|
def script_paths_pref():
|
|
@@ -297,46 +301,42 @@ def script_paths_pref():
|
|
|
297
301
|
def script_paths_system_environment():
|
|
298
302
|
"""Returns a list of system script directories from environment variables."""
|
|
299
303
|
|
|
300
|
-
def smpte_from_frame(frame
|
|
304
|
+
def smpte_from_frame(frame, *, fps=None, fps_base=None) -> str:
|
|
301
305
|
"""Returns an SMPTE formatted string from the frame:
|
|
302
306
|
HH:MM:SS:FF.If fps and fps_base are not given the current scene is used.
|
|
303
307
|
|
|
304
308
|
:param frame: frame number.
|
|
305
|
-
:type frame: int
|
|
306
309
|
:return: the frame string.
|
|
307
310
|
:rtype: str
|
|
308
311
|
"""
|
|
309
312
|
|
|
310
|
-
def smpte_from_seconds(time
|
|
313
|
+
def smpte_from_seconds(time, *, fps=None, fps_base=None) -> str:
|
|
311
314
|
"""Returns an SMPTE formatted string from the time:
|
|
312
315
|
HH:MM:SS:FF.If fps and fps_base are not given the current scene is used.
|
|
313
316
|
|
|
314
317
|
:param time: time in seconds.
|
|
315
|
-
:type time: float
|
|
316
318
|
:return: the frame string.
|
|
317
319
|
:rtype: str
|
|
318
320
|
"""
|
|
319
321
|
|
|
320
|
-
def time_from_frame(frame
|
|
322
|
+
def time_from_frame(frame, *, fps=None, fps_base=None):
|
|
321
323
|
"""Returns the time from a frame number .If fps and fps_base are not given the current scene is used.
|
|
322
324
|
|
|
323
325
|
:param frame: number.
|
|
324
|
-
:type frame: int
|
|
325
326
|
:return: the time in seconds.
|
|
326
327
|
"""
|
|
327
328
|
|
|
328
|
-
def time_to_frame(time, *, fps=None, fps_base=None)
|
|
329
|
+
def time_to_frame(time, *, fps=None, fps_base=None):
|
|
329
330
|
"""Returns a float frame number from a time given in seconds or
|
|
330
331
|
as a datetime.timedelta object.If fps and fps_base are not given the current scene is used.
|
|
331
332
|
|
|
332
333
|
:param time: time in seconds.
|
|
333
|
-
:return:
|
|
334
|
-
:rtype: float
|
|
334
|
+
:return: The frame.
|
|
335
335
|
"""
|
|
336
336
|
|
|
337
337
|
def unescape_identifier(string: str) -> str:
|
|
338
338
|
"""Simple string un-escape function used for animation paths.
|
|
339
|
-
This performs the reverse of escape_identifier
|
|
339
|
+
This performs the reverse of `escape_identifier`.
|
|
340
340
|
|
|
341
341
|
:param string: text
|
|
342
342
|
:type string: str
|
|
@@ -344,12 +344,13 @@ def unescape_identifier(string: str) -> str:
|
|
|
344
344
|
:rtype: str
|
|
345
345
|
"""
|
|
346
346
|
|
|
347
|
-
def unregister_class(cls):
|
|
347
|
+
def unregister_class(cls: typing.Any):
|
|
348
348
|
"""Unload the Python class from blender.
|
|
349
349
|
|
|
350
350
|
:param cls: Blender type class,
|
|
351
351
|
see `bpy.utils.register_class` for classes which can
|
|
352
352
|
be registered.
|
|
353
|
+
:type cls: typing.Any
|
|
353
354
|
"""
|
|
354
355
|
|
|
355
356
|
def unregister_cli_command(handle):
|
bpy/utils/previews/__init__.pyi
CHANGED
|
@@ -32,7 +32,7 @@ class ImagePreviewCollection:
|
|
|
32
32
|
def load(
|
|
33
33
|
self,
|
|
34
34
|
name: str | None,
|
|
35
|
-
filepath
|
|
35
|
+
filepath,
|
|
36
36
|
filetype: str | None,
|
|
37
37
|
force_reload: bool | None = False,
|
|
38
38
|
) -> bpy.types.ImagePreview:
|
|
@@ -41,7 +41,6 @@ class ImagePreviewCollection:
|
|
|
41
41
|
:param name: The name (unique id) identifying the preview.
|
|
42
42
|
:type name: str | None
|
|
43
43
|
:param filepath: The file path to generate the preview from.
|
|
44
|
-
:type filepath: bytes | str | None
|
|
45
44
|
:param filetype: The type of file, needed to generate the preview in ['IMAGE', 'MOVIE', 'BLEND', 'FONT'].
|
|
46
45
|
:type filetype: str | None
|
|
47
46
|
:param force_reload: If True, force running thumbnail manager even if preview already exists in cache.
|
bpy/utils/units/__init__.pyi
CHANGED
|
@@ -38,7 +38,7 @@ def to_value(
|
|
|
38
38
|
unit_system: str | None,
|
|
39
39
|
unit_category: str | None,
|
|
40
40
|
str_input: str | None,
|
|
41
|
-
str_ref_unit
|
|
41
|
+
str_ref_unit=None,
|
|
42
42
|
) -> float:
|
|
43
43
|
"""Convert a given input string into a float value.
|
|
44
44
|
|
|
@@ -50,7 +50,6 @@ def to_value(
|
|
|
50
50
|
:param str_input: The string to convert to a float value.
|
|
51
51
|
:type str_input: str | None
|
|
52
52
|
:param str_ref_unit: A reference string from which to extract a default unit, if none is found in str_input.
|
|
53
|
-
:type str_ref_unit: str | None
|
|
54
53
|
:return: The converted/interpreted value.
|
|
55
54
|
:rtype: float
|
|
56
55
|
"""
|
|
@@ -63,24 +63,21 @@ class KeyframesCo:
|
|
|
63
63
|
:type action_group_name: str
|
|
64
64
|
"""
|
|
65
65
|
|
|
66
|
-
def bake_action(
|
|
67
|
-
obj: bpy.types.Object, *, action: bpy.types.Action | None, frames, bake_options
|
|
68
|
-
) -> bpy.types.Action:
|
|
66
|
+
def bake_action(obj: bpy.types.Object, *, action, frames: int, bake_options):
|
|
69
67
|
"""
|
|
70
68
|
|
|
71
69
|
:param obj: Object to bake.
|
|
72
70
|
:type obj: bpy.types.Object
|
|
73
71
|
:param action: An action to bake the data into, or None for a new action
|
|
74
72
|
to be created.
|
|
75
|
-
:type action: bpy.types.Action | None
|
|
76
73
|
:param frames: Frames to bake.
|
|
74
|
+
:type frames: int
|
|
77
75
|
:param bake_options: Options for baking.
|
|
78
|
-
:return:
|
|
79
|
-
:rtype: bpy.types.Action
|
|
76
|
+
:return: Action or None.
|
|
80
77
|
"""
|
|
81
78
|
|
|
82
79
|
def bake_action_iter(
|
|
83
|
-
obj: bpy.types.Object, *, action
|
|
80
|
+
obj: bpy.types.Object, *, action, bake_options
|
|
84
81
|
) -> bpy.types.Action:
|
|
85
82
|
"""An coroutine that bakes action for a single object.
|
|
86
83
|
|
|
@@ -88,21 +85,17 @@ def bake_action_iter(
|
|
|
88
85
|
:type obj: bpy.types.Object
|
|
89
86
|
:param action: An action to bake the data into, or None for a new action
|
|
90
87
|
to be created.
|
|
91
|
-
:type action: bpy.types.Action | None
|
|
92
88
|
:param bake_options: Boolean options of what to include into the action bake.
|
|
93
89
|
:return: an action or None
|
|
94
90
|
:rtype: bpy.types.Action
|
|
95
91
|
"""
|
|
96
92
|
|
|
97
|
-
def bake_action_objects(
|
|
98
|
-
object_action_pairs, *, frames, bake_options
|
|
99
|
-
) -> list[bpy.types.Action]:
|
|
93
|
+
def bake_action_objects(object_action_pairs, *, frames, bake_options):
|
|
100
94
|
"""A version of `bake_action_objects_iter` that takes frames and returns the output.
|
|
101
95
|
|
|
102
96
|
:param frames: Frames to bake.
|
|
103
97
|
:param bake_options: Options for baking.
|
|
104
98
|
:return: A sequence of Action or None types (aligned with object_action_pairs)
|
|
105
|
-
:rtype: list[bpy.types.Action]
|
|
106
99
|
"""
|
|
107
100
|
|
|
108
101
|
def bake_action_objects_iter(object_action_pairs, bake_options):
|
|
@@ -2,13 +2,12 @@ import typing
|
|
|
2
2
|
import collections.abc
|
|
3
3
|
import typing_extensions
|
|
4
4
|
|
|
5
|
-
def bmesh_linked_uv_islands(bm, uv_layer)
|
|
5
|
+
def bmesh_linked_uv_islands(bm, uv_layer):
|
|
6
6
|
"""Returns lists of faces connected by UV islands.For meshes use `bpy.types.Mesh.mesh_linked_uv_islands` instead.
|
|
7
7
|
|
|
8
8
|
:param bm: the bmesh used to group with.
|
|
9
9
|
:param uv_layer: the UV layer to source UVs from.
|
|
10
10
|
:return: list of lists containing polygon indices
|
|
11
|
-
:rtype: list
|
|
12
11
|
"""
|
|
13
12
|
|
|
14
13
|
def match_uv(face, vert, uv, uv_layer): ...
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import typing
|
|
2
2
|
import collections.abc
|
|
3
3
|
import typing_extensions
|
|
4
|
-
import bpy.types
|
|
5
4
|
|
|
6
5
|
def load_image(
|
|
7
6
|
imagepath,
|
|
@@ -11,10 +10,10 @@ def load_image(
|
|
|
11
10
|
ncase_cmp: bool = True,
|
|
12
11
|
convert_callback: typing.Any | None = None,
|
|
13
12
|
verbose=False,
|
|
14
|
-
relpath
|
|
13
|
+
relpath=None,
|
|
15
14
|
check_existing: bool = False,
|
|
16
15
|
force_reload: bool = False,
|
|
17
|
-
)
|
|
16
|
+
):
|
|
18
17
|
"""Return an image from the file path with options to search multiple paths
|
|
19
18
|
and return a placeholder if its not found.
|
|
20
19
|
|
|
@@ -37,7 +36,6 @@ def load_image(
|
|
|
37
36
|
For formats blender can read, simply return the path that is given.
|
|
38
37
|
:type convert_callback: typing.Any | None
|
|
39
38
|
:param relpath: If not None, make the file relative to this path.
|
|
40
|
-
:type relpath: str | None
|
|
41
39
|
:param check_existing: If true,
|
|
42
40
|
returns already loaded image datablock if possible
|
|
43
41
|
(based on file path).
|
|
@@ -47,5 +45,4 @@ def load_image(
|
|
|
47
45
|
is also enabled).
|
|
48
46
|
:type force_reload: bool
|
|
49
47
|
:return: an image or None
|
|
50
|
-
:rtype: bpy.types.Image
|
|
51
48
|
"""
|
bpy_extras/io_utils/__init__.pyi
CHANGED
|
@@ -60,18 +60,14 @@ def axis_conversion_ensure(
|
|
|
60
60
|
:rtype: bool
|
|
61
61
|
"""
|
|
62
62
|
|
|
63
|
-
def create_derived_objects(
|
|
64
|
-
depsgraph: bpy.types.Depsgraph, objects: list[bpy.types.Object]
|
|
65
|
-
) -> dict:
|
|
63
|
+
def create_derived_objects(depsgraph: bpy.types.Depsgraph, objects):
|
|
66
64
|
"""This function takes a sequence of objects, returning their instances.
|
|
67
65
|
|
|
68
66
|
:param depsgraph: The evaluated depsgraph.
|
|
69
67
|
:type depsgraph: bpy.types.Depsgraph
|
|
70
68
|
:param objects: A sequencer of objects.
|
|
71
|
-
:type objects: list[bpy.types.Object]
|
|
72
69
|
:return: A dictionary where each key is an object from objects,
|
|
73
|
-
values are lists of (
|
|
74
|
-
:rtype: dict
|
|
70
|
+
values are lists of (object, matrix) tuples representing instances.
|
|
75
71
|
"""
|
|
76
72
|
|
|
77
73
|
def orientation_helper(axis_forward="Y", axis_up="Z"):
|
|
@@ -86,8 +82,8 @@ def path_reference(
|
|
|
86
82
|
base_dst: str,
|
|
87
83
|
mode: str = "AUTO",
|
|
88
84
|
copy_subdir: str = "",
|
|
89
|
-
copy_set
|
|
90
|
-
library
|
|
85
|
+
copy_set=None,
|
|
86
|
+
library=None,
|
|
91
87
|
) -> str:
|
|
92
88
|
"""Return a filepath relative to a destination directory, for use with
|
|
93
89
|
exporters.
|
|
@@ -108,20 +104,17 @@ def path_reference(
|
|
|
108
104
|
:type copy_subdir: str
|
|
109
105
|
:param copy_set: collect from/to pairs when mode='COPY',
|
|
110
106
|
pass to path_reference_copy when exporting is done.
|
|
111
|
-
:type copy_set: set | None
|
|
112
107
|
:param library: The library this path is relative to.
|
|
113
|
-
:type library: bpy.types.Library | None
|
|
114
108
|
:return: the new filepath.
|
|
115
109
|
:rtype: str
|
|
116
110
|
"""
|
|
117
111
|
|
|
118
|
-
def path_reference_copy(copy_set
|
|
112
|
+
def path_reference_copy(copy_set, report: collections.abc.Callable = print):
|
|
119
113
|
"""Execute copying files of path_reference
|
|
120
114
|
|
|
121
115
|
:param copy_set: set of (from, to) pairs to copy.
|
|
122
|
-
:type copy_set: set
|
|
123
116
|
:param report: function used for reporting warnings, takes a string argument.
|
|
124
|
-
:type report:
|
|
117
|
+
:type report: collections.abc.Callable
|
|
125
118
|
"""
|
|
126
119
|
|
|
127
120
|
def poll_file_object_drop(context):
|
|
@@ -141,9 +134,10 @@ def unique_name(
|
|
|
141
134
|
"""Helper function for storing unique names which may have special characters
|
|
142
135
|
stripped and restricted to a maximum length.
|
|
143
136
|
|
|
144
|
-
:param key:
|
|
137
|
+
:param key: Unique item this name belongs to, name_dict[key] will be reused
|
|
145
138
|
when available.
|
|
146
139
|
This can be the object, mesh, material, etc instance itself.
|
|
140
|
+
Any hashable object associated with the name.
|
|
147
141
|
:param name: The name used to create a unique value in name_dict.
|
|
148
142
|
:type name: str
|
|
149
143
|
:param name_dict: This is used to cache namespace to ensure no collisions
|
|
@@ -3,19 +3,16 @@ import collections.abc
|
|
|
3
3
|
import typing_extensions
|
|
4
4
|
import bpy.types
|
|
5
5
|
|
|
6
|
-
def edge_face_count(mesh)
|
|
6
|
+
def edge_face_count(mesh):
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
:return: list face users for each item in mesh.edges.
|
|
10
|
-
:rtype: list
|
|
11
10
|
"""
|
|
12
11
|
|
|
13
|
-
def edge_face_count_dict(mesh)
|
|
12
|
+
def edge_face_count_dict(mesh):
|
|
14
13
|
"""
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
faces using each edge.
|
|
18
|
-
:rtype: dict
|
|
15
|
+
:return: Dictionary of edge keys with their value set to the number of faces using each edge.
|
|
19
16
|
"""
|
|
20
17
|
|
|
21
18
|
def edge_loops_from_edges(mesh, edges=None):
|
|
@@ -24,55 +21,43 @@ def edge_loops_from_edges(mesh, edges=None):
|
|
|
24
21
|
|
|
25
22
|
"""
|
|
26
23
|
|
|
27
|
-
def mesh_linked_triangles(mesh: bpy.types.Mesh)
|
|
24
|
+
def mesh_linked_triangles(mesh: bpy.types.Mesh):
|
|
28
25
|
"""Splits the mesh into connected triangles, use this for separating cubes from
|
|
29
|
-
other mesh elements within 1 mesh
|
|
26
|
+
other mesh elements within 1 mesh data-block.
|
|
30
27
|
|
|
31
28
|
:param mesh: the mesh used to group with.
|
|
32
29
|
:type mesh: bpy.types.Mesh
|
|
33
|
-
:return:
|
|
34
|
-
:rtype: list
|
|
30
|
+
:return: Lists of lists containing triangles.
|
|
35
31
|
"""
|
|
36
32
|
|
|
37
|
-
def mesh_linked_uv_islands(mesh: bpy.types.Mesh)
|
|
33
|
+
def mesh_linked_uv_islands(mesh: bpy.types.Mesh):
|
|
38
34
|
"""Returns lists of polygon indices connected by UV islands.
|
|
39
35
|
|
|
40
36
|
:param mesh: the mesh used to group with.
|
|
41
37
|
:type mesh: bpy.types.Mesh
|
|
42
38
|
:return: list of lists containing polygon indices
|
|
43
|
-
:rtype: list
|
|
44
39
|
"""
|
|
45
40
|
|
|
46
|
-
def ngon_tessellate(
|
|
47
|
-
from_data: bpy.types.Mesh | list,
|
|
48
|
-
indices: list,
|
|
49
|
-
fix_loops: bool = True,
|
|
50
|
-
debug_print=True,
|
|
51
|
-
):
|
|
41
|
+
def ngon_tessellate(from_data, indices, fix_loops: bool = True, debug_print=True):
|
|
52
42
|
"""Takes a poly-line of indices (ngon) and returns a list of face
|
|
53
43
|
index lists. Designed to be used for importers that need indices for an
|
|
54
44
|
ngon to create from existing verts.
|
|
55
45
|
|
|
56
|
-
:param from_data:
|
|
57
|
-
:type from_data: bpy.types.Mesh | list
|
|
46
|
+
:param from_data: Either a mesh, or a list/tuple of 3D vectors.
|
|
58
47
|
:param indices: a list of indices to use this list
|
|
59
48
|
is the ordered closed poly-line
|
|
60
49
|
to fill, and can be a subset of the data given.
|
|
61
|
-
:type indices: list
|
|
62
50
|
:param fix_loops: If this is enabled poly-lines
|
|
63
51
|
that use loops to make multiple
|
|
64
52
|
poly-lines are dealt with correctly.
|
|
65
53
|
:type fix_loops: bool
|
|
66
54
|
"""
|
|
67
55
|
|
|
68
|
-
def triangle_random_points(
|
|
69
|
-
num_points, loop_triangles: bpy.types.MeshLoopTriangle | collections.abc.Sequence
|
|
70
|
-
) -> list:
|
|
56
|
+
def triangle_random_points(num_points: int, loop_triangles):
|
|
71
57
|
"""Generates a list of random points over mesh loop triangles.
|
|
72
58
|
|
|
73
|
-
:param num_points:
|
|
74
|
-
:
|
|
75
|
-
:
|
|
76
|
-
:return:
|
|
77
|
-
:rtype: list
|
|
59
|
+
:param num_points: The number of random points to generate on each triangle.
|
|
60
|
+
:type num_points: int
|
|
61
|
+
:param loop_triangles: Sequence of the triangles to generate points on.
|
|
62
|
+
:return: List of random points over all triangles.
|
|
78
63
|
"""
|
|
@@ -44,7 +44,7 @@ def object_data_add(
|
|
|
44
44
|
|
|
45
45
|
:param context: The context to use.
|
|
46
46
|
:type context: bpy.types.Context | None
|
|
47
|
-
:param obdata:
|
|
47
|
+
:param obdata: Valid object data to used for the new object or None.
|
|
48
48
|
:param operator: The operator, checked for location and rotation properties.
|
|
49
49
|
:type operator: bpy.types.Operator | None
|
|
50
50
|
:param name: Optional name
|
|
@@ -10,7 +10,7 @@ def location_3d_to_region_2d(
|
|
|
10
10
|
coord: collections.abc.Sequence[float] | mathutils.Vector,
|
|
11
11
|
*,
|
|
12
12
|
default=None,
|
|
13
|
-
)
|
|
13
|
+
):
|
|
14
14
|
"""Return the region relative 2d location of a 3d position.
|
|
15
15
|
|
|
16
16
|
:param region: region of the 3D viewport, typically bpy.context.region.
|
|
@@ -22,7 +22,6 @@ def location_3d_to_region_2d(
|
|
|
22
22
|
:param default: Return this value if coord
|
|
23
23
|
is behind the origin of a perspective view.
|
|
24
24
|
:return: 2d location
|
|
25
|
-
:rtype: mathutils.Vector
|
|
26
25
|
"""
|
|
27
26
|
|
|
28
27
|
def region_2d_to_location_3d(
|
|
@@ -49,11 +48,7 @@ def region_2d_to_location_3d(
|
|
|
49
48
|
"""
|
|
50
49
|
|
|
51
50
|
def region_2d_to_origin_3d(
|
|
52
|
-
region: bpy.types.Region,
|
|
53
|
-
rv3d: bpy.types.RegionView3D,
|
|
54
|
-
coord: collections.abc.Sequence[float] | mathutils.Vector,
|
|
55
|
-
*,
|
|
56
|
-
clamp: float | None = None,
|
|
51
|
+
region: bpy.types.Region, rv3d: bpy.types.RegionView3D, coord, *, clamp=None
|
|
57
52
|
) -> mathutils.Vector:
|
|
58
53
|
"""Return the 3d view origin from the region relative 2d coords.
|
|
59
54
|
|
|
@@ -61,12 +56,10 @@ def region_2d_to_origin_3d(
|
|
|
61
56
|
:type region: bpy.types.Region
|
|
62
57
|
:param rv3d: 3D region data, typically bpy.context.space_data.region_3d.
|
|
63
58
|
:type rv3d: bpy.types.RegionView3D
|
|
64
|
-
:param coord:
|
|
59
|
+
:param coord: 2D coordinates relative to the region;
|
|
65
60
|
(event.mouse_region_x, event.mouse_region_y) for example.
|
|
66
|
-
:type coord: collections.abc.Sequence[float] | mathutils.Vector
|
|
67
61
|
:param clamp: Clamp the maximum far-clip value used.
|
|
68
62
|
(negative value will move the offset away from the view_location)
|
|
69
|
-
:type clamp: float | None
|
|
70
63
|
:return: The origin of the viewpoint in 3d space.
|
|
71
64
|
:rtype: mathutils.Vector
|
|
72
65
|
"""
|