fake-bpy-module 20240421__py3-none-any.whl → 20240423__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.
- bl_operators/add_mesh_torus/__init__.pyi +2 -1
- bl_operators/assets/__init__.pyi +12 -12
- bl_operators/geometry_nodes/__init__.pyi +256 -238
- bl_operators/node/__init__.pyi +262 -260
- bl_operators/object_quick_effects/__init__.pyi +19 -19
- bl_operators/presets/__init__.pyi +371 -368
- bl_operators/wm/__init__.pyi +4 -4
- bl_ui/__init__.pyi +3 -3
- bl_ui/anim/__init__.pyi +1 -1
- bl_ui/asset_shelf/__init__.pyi +1 -1
- bl_ui/generic_ui_list/__init__.pyi +3 -3
- bl_ui/node_add_menu/__init__.pyi +1 -1
- bl_ui/node_add_menu_compositor/__init__.pyi +18 -18
- bl_ui/node_add_menu_geometry/__init__.pyi +50 -48
- bl_ui/node_add_menu_shader/__init__.pyi +10 -10
- bl_ui/node_add_menu_texture/__init__.pyi +9 -9
- bl_ui/properties_collection/__init__.pyi +39 -25
- bl_ui/properties_constraint/__init__.pyi +1257 -1041
- bl_ui/properties_data_armature/__init__.pyi +120 -96
- bl_ui/properties_data_bone/__init__.pyi +36 -29
- bl_ui/properties_data_camera/__init__.pyi +32 -14
- bl_ui/properties_data_curve/__init__.pyi +143 -116
- bl_ui/properties_data_curves/__init__.pyi +30 -25
- bl_ui/properties_data_empty/__init__.pyi +21 -21
- bl_ui/properties_data_gpencil/__init__.pyi +297 -260
- bl_ui/properties_data_grease_pencil/__init__.pyi +228 -205
- bl_ui/properties_data_lattice/__init__.pyi +25 -22
- bl_ui/properties_data_light/__init__.pyi +44 -31
- bl_ui/properties_data_lightprobe/__init__.pyi +54 -32
- bl_ui/properties_data_mesh/__init__.pyi +579 -570
- bl_ui/properties_data_metaball/__init__.pyi +29 -24
- bl_ui/properties_data_modifier/__init__.pyi +55 -43
- bl_ui/properties_data_pointcloud/__init__.pyi +146 -139
- bl_ui/properties_data_shaderfx/__init__.pyi +13 -13
- bl_ui/properties_data_speaker/__init__.pyi +27 -24
- bl_ui/properties_data_volume/__init__.pyi +75 -68
- bl_ui/properties_freestyle/__init__.pyi +407 -284
- bl_ui/properties_grease_pencil_common/__init__.pyi +13 -13
- bl_ui/properties_mask_common/__init__.pyi +7 -7
- bl_ui/properties_material/__init__.pyi +186 -162
- bl_ui/properties_material_gpencil/__init__.pyi +111 -87
- bl_ui/properties_object/__init__.pyi +102 -84
- bl_ui/properties_output/__init__.pyi +255 -228
- bl_ui/properties_paint_common/__init__.pyi +9 -9
- bl_ui/properties_particle/__init__.pyi +341 -254
- bl_ui/properties_physics_cloth/__init__.pyi +54 -33
- bl_ui/properties_physics_common/__init__.pyi +20 -20
- bl_ui/properties_physics_dynamicpaint/__init__.pyi +231 -193
- bl_ui/properties_physics_field/__init__.pyi +52 -36
- bl_ui/properties_physics_fluid/__init__.pyi +119 -96
- bl_ui/properties_physics_geometry_nodes/__init__.pyi +1 -1
- bl_ui/properties_physics_rigidbody/__init__.pyi +36 -20
- bl_ui/properties_physics_rigidbody_constraint/__init__.pyi +51 -25
- bl_ui/properties_physics_softbody/__init__.pyi +62 -34
- bl_ui/properties_render/__init__.pyi +275 -187
- bl_ui/properties_scene/__init__.pyi +173 -154
- bl_ui/properties_texture/__init__.pyi +251 -205
- bl_ui/properties_view_layer/__init__.pyi +126 -93
- bl_ui/properties_workspace/__init__.pyi +82 -76
- bl_ui/properties_world/__init__.pyi +31 -26
- bl_ui/space_clip/__init__.pyi +495 -433
- bl_ui/space_console/__init__.pyi +6 -6
- bl_ui/space_dopesheet/__init__.pyi +209 -174
- bl_ui/space_filebrowser/__init__.pyi +691 -679
- bl_ui/space_graph/__init__.pyi +25 -20
- bl_ui/space_image/__init__.pyi +959 -845
- bl_ui/space_info/__init__.pyi +6 -6
- bl_ui/space_nla/__init__.pyi +26 -17
- bl_ui/space_node/__init__.pyi +49 -36
- bl_ui/space_outliner/__init__.pyi +14 -14
- bl_ui/space_properties/__init__.pyi +3 -3
- bl_ui/space_sequencer/__init__.pyi +510 -444
- bl_ui/space_spreadsheet/__init__.pyi +1 -1
- bl_ui/space_statusbar/__init__.pyi +1 -1
- bl_ui/space_text/__init__.pyi +16 -16
- bl_ui/space_time/__init__.pyi +27 -23
- bl_ui/space_toolsystem_common/__init__.pyi +1 -1
- bl_ui/space_toolsystem_toolbar/__init__.pyi +52 -4
- bl_ui/space_topbar/__init__.pyi +26 -26
- bl_ui/space_userpref/__init__.pyi +795 -658
- bl_ui/space_view3d/__init__.pyi +1460 -1428
- bl_ui/space_view3d_toolbar/__init__.pyi +2968 -2657
- bl_ui/temp_anim_layers/__init__.pyi +1 -1
- bmesh/types/__init__.pyi +13 -6
- bpy/app/__init__.pyi +4 -4
- bpy/app/icons/__init__.pyi +8 -6
- bpy/app/timers/__init__.pyi +10 -8
- bpy/app/translations/__init__.pyi +22 -20
- bpy/msgbus/__init__.pyi +4 -2
- bpy/ops/action/__init__.pyi +319 -316
- bpy/ops/anim/__init__.pyi +428 -428
- bpy/ops/armature/__init__.pyi +359 -358
- bpy/ops/asset/__init__.pyi +146 -146
- bpy/ops/boid/__init__.pyi +50 -50
- bpy/ops/brush/__init__.pyi +72 -72
- bpy/ops/buttons/__init__.pyi +128 -128
- bpy/ops/cachefile/__init__.pyi +124 -124
- bpy/ops/camera/__init__.pyi +22 -22
- bpy/ops/clip/__init__.pyi +773 -768
- bpy/ops/cloth/__init__.pyi +10 -10
- bpy/ops/collection/__init__.pyi +64 -64
- bpy/ops/console/__init__.pyi +150 -150
- bpy/ops/constraint/__init__.pyi +150 -150
- bpy/ops/curve/__init__.pyi +475 -472
- bpy/ops/curves/__init__.pyi +247 -244
- bpy/ops/cycles/__init__.pyi +18 -18
- bpy/ops/dpaint/__init__.pyi +34 -34
- bpy/ops/ed/__init__.pyi +122 -122
- bpy/ops/export_anim/__init__.pyi +18 -18
- bpy/ops/export_mesh/__init__.pyi +26 -26
- bpy/ops/export_scene/__init__.pyi +333 -307
- bpy/ops/file/__init__.pyi +340 -340
- bpy/ops/fluid/__init__.pyi +88 -88
- bpy/ops/font/__init__.pyi +252 -252
- bpy/ops/geometry/__init__.pyi +86 -86
- bpy/ops/gizmogroup/__init__.pyi +22 -22
- bpy/ops/gpencil/__init__.pyi +1459 -1444
- bpy/ops/graph/__init__.pyi +645 -642
- bpy/ops/grease_pencil/__init__.pyi +580 -436
- bpy/ops/image/__init__.pyi +614 -612
- bpy/ops/import_anim/__init__.pyi +26 -26
- bpy/ops/import_curve/__init__.pyi +6 -6
- bpy/ops/import_mesh/__init__.pyi +20 -18
- bpy/ops/import_scene/__init__.pyi +92 -86
- bpy/ops/info/__init__.pyi +60 -60
- bpy/ops/lattice/__init__.pyi +64 -64
- bpy/ops/marker/__init__.pyi +106 -106
- bpy/ops/mask/__init__.pyi +321 -318
- bpy/ops/material/__init__.pyi +18 -18
- bpy/ops/mball/__init__.pyi +71 -70
- bpy/ops/mesh/__init__.pyi +1997 -1990
- bpy/ops/nla/__init__.pyi +331 -330
- bpy/ops/node/__init__.pyi +867 -852
- bpy/ops/object/__init__.pyi +2433 -2430
- bpy/ops/outliner/__init__.pyi +498 -498
- bpy/ops/paint/__init__.pyi +554 -544
- bpy/ops/paintcurve/__init__.pyi +64 -64
- bpy/ops/palette/__init__.pyi +48 -48
- bpy/ops/particle/__init__.pyi +266 -264
- bpy/ops/pose/__init__.pyi +336 -336
- bpy/ops/poselib/__init__.pyi +70 -70
- bpy/ops/preferences/__init__.pyi +338 -336
- bpy/ops/ptcache/__init__.pyi +46 -46
- bpy/ops/render/__init__.pyi +114 -114
- bpy/ops/rigidbody/__init__.pyi +102 -102
- bpy/ops/scene/__init__.pyi +270 -270
- bpy/ops/screen/__init__.pyi +378 -378
- bpy/ops/script/__init__.pyi +18 -18
- bpy/ops/sculpt/__init__.pyi +411 -405
- bpy/ops/sculpt_curves/__init__.pyi +42 -40
- bpy/ops/sequencer/__init__.pyi +1053 -1040
- bpy/ops/sound/__init__.pyi +208 -208
- bpy/ops/spreadsheet/__init__.pyi +30 -30
- bpy/ops/surface/__init__.pyi +108 -108
- bpy/ops/text/__init__.pyi +382 -382
- bpy/ops/text_editor/__init__.pyi +10 -10
- bpy/ops/texture/__init__.pyi +26 -26
- bpy/ops/transform/__init__.pyi +826 -790
- bpy/ops/ui/__init__.pyi +216 -216
- bpy/ops/uilist/__init__.pyi +20 -20
- bpy/ops/uv/__init__.pyi +605 -600
- bpy/ops/view2d/__init__.pyi +156 -156
- bpy/ops/view3d/__init__.pyi +578 -576
- bpy/ops/wm/__init__.pyi +2418 -2376
- bpy/ops/workspace/__init__.pyi +42 -42
- bpy/ops/world/__init__.pyi +6 -6
- bpy/path/__init__.pyi +48 -33
- bpy/props/__init__.pyi +263 -261
- bpy/types/__init__.pyi +105733 -102298
- bpy/utils/__init__.pyi +87 -52
- bpy/utils/previews/__init__.pyi +2 -2
- bpy/utils/units/__init__.pyi +21 -18
- bpy_extras/anim_utils/__init__.pyi +9 -2
- bpy_extras/io_utils/__init__.pyi +2 -1
- bpy_extras/view3d_utils/__init__.pyi +2 -1
- bpy_types/__init__.pyi +236 -236
- {fake_bpy_module-20240421.dist-info → fake_bpy_module-20240423.dist-info}/METADATA +1 -1
- {fake_bpy_module-20240421.dist-info → fake_bpy_module-20240423.dist-info}/RECORD +187 -187
- freestyle/chainingiterators/__init__.pyi +7 -2
- freestyle/types/__init__.pyi +8 -3
- gpu_extras/presets/__init__.pyi +14 -2
- keyingsets_builtins/__init__.pyi +92 -92
- mathutils/__init__.pyi +9 -5
- mathutils/geometry/__init__.pyi +8 -4
- nodeitems_builtins/__init__.pyi +7 -7
- {fake_bpy_module-20240421.dist-info → fake_bpy_module-20240423.dist-info}/WHEEL +0 -0
- {fake_bpy_module-20240421.dist-info → fake_bpy_module-20240423.dist-info}/top_level.txt +0 -0
bpy/ops/workspace/__init__.pyi
CHANGED
|
@@ -4,31 +4,31 @@ import bpy.types
|
|
|
4
4
|
GenericType = typing.TypeVar("GenericType")
|
|
5
5
|
|
|
6
6
|
def add(
|
|
7
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
8
|
-
execution_context: typing.Union[str, int] = None,
|
|
9
|
-
undo: bool = None,
|
|
7
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
8
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
9
|
+
undo: typing.Optional[bool] = None,
|
|
10
10
|
):
|
|
11
11
|
"""Add a new workspace by duplicating the current one or appending one from the user configuration
|
|
12
12
|
|
|
13
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
14
|
-
:type execution_context: typing.Union[str, int]
|
|
15
|
-
:type undo: bool
|
|
13
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
14
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
15
|
+
:type undo: typing.Optional[bool]
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
...
|
|
19
19
|
|
|
20
20
|
def append_activate(
|
|
21
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
22
|
-
execution_context: typing.Union[str, int] = None,
|
|
23
|
-
undo: bool = None,
|
|
21
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
22
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
23
|
+
undo: typing.Optional[bool] = None,
|
|
24
24
|
idname: typing.Union[str, typing.Any] = "",
|
|
25
25
|
filepath: typing.Union[str, typing.Any] = "",
|
|
26
26
|
):
|
|
27
27
|
"""Append a workspace and make it the active one in the current window
|
|
28
28
|
|
|
29
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
30
|
-
:type execution_context: typing.Union[str, int]
|
|
31
|
-
:type undo: bool
|
|
29
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
30
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
31
|
+
:type undo: typing.Optional[bool]
|
|
32
32
|
:param idname: Identifier, Name of the workspace to append and activate
|
|
33
33
|
:type idname: typing.Union[str, typing.Any]
|
|
34
34
|
:param filepath: Filepath, Path to the library
|
|
@@ -38,71 +38,71 @@ def append_activate(
|
|
|
38
38
|
...
|
|
39
39
|
|
|
40
40
|
def delete(
|
|
41
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
42
|
-
execution_context: typing.Union[str, int] = None,
|
|
43
|
-
undo: bool = None,
|
|
41
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
42
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
43
|
+
undo: typing.Optional[bool] = None,
|
|
44
44
|
):
|
|
45
45
|
"""Delete the active workspace
|
|
46
46
|
|
|
47
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
48
|
-
:type execution_context: typing.Union[str, int]
|
|
49
|
-
:type undo: bool
|
|
47
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
48
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
49
|
+
:type undo: typing.Optional[bool]
|
|
50
50
|
"""
|
|
51
51
|
|
|
52
52
|
...
|
|
53
53
|
|
|
54
54
|
def duplicate(
|
|
55
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
56
|
-
execution_context: typing.Union[str, int] = None,
|
|
57
|
-
undo: bool = None,
|
|
55
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
56
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
57
|
+
undo: typing.Optional[bool] = None,
|
|
58
58
|
):
|
|
59
59
|
"""Add a new workspace
|
|
60
60
|
|
|
61
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
62
|
-
:type execution_context: typing.Union[str, int]
|
|
63
|
-
:type undo: bool
|
|
61
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
62
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
63
|
+
:type undo: typing.Optional[bool]
|
|
64
64
|
"""
|
|
65
65
|
|
|
66
66
|
...
|
|
67
67
|
|
|
68
68
|
def reorder_to_back(
|
|
69
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
70
|
-
execution_context: typing.Union[str, int] = None,
|
|
71
|
-
undo: bool = None,
|
|
69
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
70
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
71
|
+
undo: typing.Optional[bool] = None,
|
|
72
72
|
):
|
|
73
73
|
"""Reorder workspace to be last in the list
|
|
74
74
|
|
|
75
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
76
|
-
:type execution_context: typing.Union[str, int]
|
|
77
|
-
:type undo: bool
|
|
75
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
76
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
77
|
+
:type undo: typing.Optional[bool]
|
|
78
78
|
"""
|
|
79
79
|
|
|
80
80
|
...
|
|
81
81
|
|
|
82
82
|
def reorder_to_front(
|
|
83
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
84
|
-
execution_context: typing.Union[str, int] = None,
|
|
85
|
-
undo: bool = None,
|
|
83
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
84
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
85
|
+
undo: typing.Optional[bool] = None,
|
|
86
86
|
):
|
|
87
87
|
"""Reorder workspace to be first in the list
|
|
88
88
|
|
|
89
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
90
|
-
:type execution_context: typing.Union[str, int]
|
|
91
|
-
:type undo: bool
|
|
89
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
90
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
91
|
+
:type undo: typing.Optional[bool]
|
|
92
92
|
"""
|
|
93
93
|
|
|
94
94
|
...
|
|
95
95
|
|
|
96
96
|
def scene_pin_toggle(
|
|
97
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
98
|
-
execution_context: typing.Union[str, int] = None,
|
|
99
|
-
undo: bool = None,
|
|
97
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
98
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
99
|
+
undo: typing.Optional[bool] = None,
|
|
100
100
|
):
|
|
101
101
|
"""Remember the last used scene for the current workspace and switch to it whenever this workspace is activated again
|
|
102
102
|
|
|
103
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
104
|
-
:type execution_context: typing.Union[str, int]
|
|
105
|
-
:type undo: bool
|
|
103
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
104
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
105
|
+
:type undo: typing.Optional[bool]
|
|
106
106
|
"""
|
|
107
107
|
|
|
108
108
|
...
|
bpy/ops/world/__init__.pyi
CHANGED
|
@@ -4,15 +4,15 @@ import bpy.types
|
|
|
4
4
|
GenericType = typing.TypeVar("GenericType")
|
|
5
5
|
|
|
6
6
|
def new(
|
|
7
|
-
override_context: typing.Union[dict, bpy.types.Context] = None,
|
|
8
|
-
execution_context: typing.Union[str, int] = None,
|
|
9
|
-
undo: bool = None,
|
|
7
|
+
override_context: typing.Optional[typing.Union[dict, bpy.types.Context]] = None,
|
|
8
|
+
execution_context: typing.Optional[typing.Union[str, int]] = None,
|
|
9
|
+
undo: typing.Optional[bool] = None,
|
|
10
10
|
):
|
|
11
11
|
"""Create a new world Data-Block
|
|
12
12
|
|
|
13
|
-
:type override_context: typing.Union[dict, bpy.types.Context]
|
|
14
|
-
:type execution_context: typing.Union[str, int]
|
|
15
|
-
:type undo: bool
|
|
13
|
+
:type override_context: typing.Optional[typing.Union[dict, bpy.types.Context]]
|
|
14
|
+
:type execution_context: typing.Optional[typing.Union[str, int]]
|
|
15
|
+
:type undo: typing.Optional[bool]
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
...
|
bpy/path/__init__.pyi
CHANGED
|
@@ -10,17 +10,19 @@ import bpy.types
|
|
|
10
10
|
GenericType = typing.TypeVar("GenericType")
|
|
11
11
|
|
|
12
12
|
def abspath(
|
|
13
|
-
path,
|
|
13
|
+
path,
|
|
14
|
+
start: typing.Optional[typing.Union[str, bytes]] = None,
|
|
15
|
+
library: typing.Optional[bpy.types.Library] = None,
|
|
14
16
|
) -> str:
|
|
15
17
|
"""Returns the absolute path relative to the current blend file
|
|
16
18
|
using the "//" prefix.
|
|
17
19
|
|
|
18
20
|
:param start: Relative to this path,
|
|
19
21
|
when not set the current filename is used.
|
|
20
|
-
:type start: typing.Union[str, bytes]
|
|
22
|
+
:type start: typing.Optional[typing.Union[str, bytes]]
|
|
21
23
|
:param library: The library this path is from. This is only included for
|
|
22
24
|
convenience, when the library is not None its path replaces start.
|
|
23
|
-
:type library: bpy.types.Library
|
|
25
|
+
:type library: typing.Optional[bpy.types.Library]
|
|
24
26
|
:return: The absolute path.
|
|
25
27
|
:rtype: str
|
|
26
28
|
"""
|
|
@@ -46,16 +48,18 @@ def basename(path):
|
|
|
46
48
|
|
|
47
49
|
...
|
|
48
50
|
|
|
49
|
-
def clean_name(
|
|
51
|
+
def clean_name(
|
|
52
|
+
name: typing.Optional[typing.Union[str, bytes]], replace: typing.Optional[str] = "_"
|
|
53
|
+
) -> str:
|
|
50
54
|
"""Returns a name with characters replaced that
|
|
51
55
|
may cause problems under various circumstances,
|
|
52
56
|
such as writing to a file.All characters besides A-Z/a-z, 0-9 are replaced with "_"
|
|
53
57
|
or the replace argument if defined.
|
|
54
58
|
|
|
55
59
|
:param name: The path name.
|
|
56
|
-
:type name: typing.Union[str, bytes]
|
|
60
|
+
:type name: typing.Optional[typing.Union[str, bytes]]
|
|
57
61
|
:param replace: The replacement for non-valid characters.
|
|
58
|
-
:type replace: str
|
|
62
|
+
:type replace: typing.Optional[str]
|
|
59
63
|
:return: The cleaned name.
|
|
60
64
|
:rtype: str
|
|
61
65
|
"""
|
|
@@ -67,16 +71,20 @@ def clean_name(name, replace):
|
|
|
67
71
|
|
|
68
72
|
...
|
|
69
73
|
|
|
70
|
-
def display_name(
|
|
74
|
+
def display_name(
|
|
75
|
+
name: typing.Optional[str],
|
|
76
|
+
has_ext: typing.Optional[bool] = True,
|
|
77
|
+
title_case: typing.Optional[bool] = True,
|
|
78
|
+
) -> str:
|
|
71
79
|
"""Creates a display string from name to be used menus and the user interface.
|
|
72
80
|
Intended for use with filenames and module names.
|
|
73
81
|
|
|
74
82
|
:param name: The name to be used for displaying the user interface.
|
|
75
|
-
:type name: str
|
|
83
|
+
:type name: typing.Optional[str]
|
|
76
84
|
:param has_ext: Remove file extension from name.
|
|
77
|
-
:type has_ext: bool
|
|
85
|
+
:type has_ext: typing.Optional[bool]
|
|
78
86
|
:param title_case: Convert lowercase names to title case.
|
|
79
|
-
:type title_case: bool
|
|
87
|
+
:type title_case: typing.Optional[bool]
|
|
80
88
|
:return: The display string.
|
|
81
89
|
:rtype: str
|
|
82
90
|
"""
|
|
@@ -88,12 +96,12 @@ def display_name(name, has_ext, title_case):
|
|
|
88
96
|
|
|
89
97
|
...
|
|
90
98
|
|
|
91
|
-
def display_name_from_filepath(name: str) -> str:
|
|
99
|
+
def display_name_from_filepath(name: typing.Optional[str]) -> str:
|
|
92
100
|
"""Returns the path stripped of directory and extension,
|
|
93
101
|
ensured to be utf8 compatible.
|
|
94
102
|
|
|
95
103
|
:param name: The file path to convert.
|
|
96
|
-
:type name: str
|
|
104
|
+
:type name: typing.Optional[str]
|
|
97
105
|
:return: The display name.
|
|
98
106
|
:rtype: str
|
|
99
107
|
"""
|
|
@@ -105,12 +113,12 @@ def display_name_from_filepath(name):
|
|
|
105
113
|
|
|
106
114
|
...
|
|
107
115
|
|
|
108
|
-
def display_name_to_filepath(name: str) -> str:
|
|
116
|
+
def display_name_to_filepath(name: typing.Optional[str]) -> str:
|
|
109
117
|
"""Performs the reverse of display_name using literal versions of characters
|
|
110
118
|
which aren't supported in a filepath.
|
|
111
119
|
|
|
112
120
|
:param name: The display name to convert.
|
|
113
|
-
:type name: str
|
|
121
|
+
:type name: typing.Optional[str]
|
|
114
122
|
:return: The file path.
|
|
115
123
|
:rtype: str
|
|
116
124
|
"""
|
|
@@ -122,16 +130,20 @@ def display_name_to_filepath(name):
|
|
|
122
130
|
|
|
123
131
|
...
|
|
124
132
|
|
|
125
|
-
def ensure_ext(
|
|
133
|
+
def ensure_ext(
|
|
134
|
+
filepath: typing.Optional[str],
|
|
135
|
+
ext: typing.Optional[str],
|
|
136
|
+
case_sensitive: typing.Optional[bool] = False,
|
|
137
|
+
) -> str:
|
|
126
138
|
"""Return the path with the extension added if it is not already set.
|
|
127
139
|
|
|
128
140
|
:param filepath: The file path.
|
|
129
|
-
:type filepath: str
|
|
141
|
+
:type filepath: typing.Optional[str]
|
|
130
142
|
:param ext: The extension to check for, can be a compound extension. Should
|
|
131
143
|
start with a dot, such as '.blend' or '.tar.gz'.
|
|
132
|
-
:type ext: str
|
|
144
|
+
:type ext: typing.Optional[str]
|
|
133
145
|
:param case_sensitive: Check for matching case when comparing extensions.
|
|
134
|
-
:type case_sensitive: bool
|
|
146
|
+
:type case_sensitive: typing.Optional[bool]
|
|
135
147
|
:return: The file path with the given extension.
|
|
136
148
|
:rtype: str
|
|
137
149
|
"""
|
|
@@ -143,12 +155,12 @@ def ensure_ext(filepath, ext, case_sensitive):
|
|
|
143
155
|
|
|
144
156
|
...
|
|
145
157
|
|
|
146
|
-
def is_subdir(path: typing.Union[str, bytes], directory) -> bool:
|
|
158
|
+
def is_subdir(path: typing.Optional[typing.Union[str, bytes]], directory) -> bool:
|
|
147
159
|
"""Returns true if path in a subdirectory of directory.
|
|
148
160
|
Both paths must be absolute.
|
|
149
161
|
|
|
150
162
|
:param path: An absolute path.
|
|
151
|
-
:type path: typing.Union[str, bytes]
|
|
163
|
+
:type path: typing.Optional[typing.Union[str, bytes]]
|
|
152
164
|
:return: Whether or not the path is a subdirectory.
|
|
153
165
|
:rtype: bool
|
|
154
166
|
"""
|
|
@@ -161,16 +173,18 @@ def is_subdir(path, directory):
|
|
|
161
173
|
...
|
|
162
174
|
|
|
163
175
|
def module_names(
|
|
164
|
-
path: str,
|
|
176
|
+
path: typing.Optional[str],
|
|
177
|
+
recursive: typing.Optional[bool] = False,
|
|
178
|
+
package: typing.Optional[str] = "",
|
|
165
179
|
) -> typing.List[str]:
|
|
166
180
|
"""Return a list of modules which can be imported from path.
|
|
167
181
|
|
|
168
182
|
:param path: a directory to scan.
|
|
169
|
-
:type path: str
|
|
183
|
+
:type path: typing.Optional[str]
|
|
170
184
|
:param recursive: Also return submodule names for packages.
|
|
171
|
-
:type recursive: bool
|
|
185
|
+
:type recursive: typing.Optional[bool]
|
|
172
186
|
:param package: Optional string, used as the prefix for module names (without the trailing ".").
|
|
173
|
-
:type package: str
|
|
187
|
+
:type package: typing.Optional[str]
|
|
174
188
|
:return: a list of string pairs (module_name, module_file).
|
|
175
189
|
:rtype: typing.List[str]
|
|
176
190
|
"""
|
|
@@ -182,11 +196,11 @@ def module_names(path, recursive, package):
|
|
|
182
196
|
|
|
183
197
|
...
|
|
184
198
|
|
|
185
|
-
def native_pathsep(path: str) -> str:
|
|
199
|
+
def native_pathsep(path: typing.Optional[str]) -> str:
|
|
186
200
|
"""Replace the path separator with the systems native os.sep.
|
|
187
201
|
|
|
188
202
|
:param path: The path to replace.
|
|
189
|
-
:type path: str
|
|
203
|
+
:type path: typing.Optional[str]
|
|
190
204
|
:return: The path with system native separators.
|
|
191
205
|
:rtype: str
|
|
192
206
|
"""
|
|
@@ -198,13 +212,13 @@ def native_pathsep(path):
|
|
|
198
212
|
|
|
199
213
|
...
|
|
200
214
|
|
|
201
|
-
def reduce_dirs(dirs: typing.List[str]) -> typing.List[str]:
|
|
215
|
+
def reduce_dirs(dirs: typing.Optional[typing.List[str]]) -> typing.List[str]:
|
|
202
216
|
"""Given a sequence of directories, remove duplicates and
|
|
203
217
|
any directories nested in one of the other paths.
|
|
204
218
|
(Useful for recursive path searching).
|
|
205
219
|
|
|
206
220
|
:param dirs: Sequence of directory paths.
|
|
207
|
-
:type dirs: typing.List[str]
|
|
221
|
+
:type dirs: typing.Optional[typing.List[str]]
|
|
208
222
|
:return: A unique list of paths.
|
|
209
223
|
:rtype: typing.List[str]
|
|
210
224
|
"""
|
|
@@ -217,15 +231,16 @@ def reduce_dirs(dirs):
|
|
|
217
231
|
...
|
|
218
232
|
|
|
219
233
|
def relpath(
|
|
220
|
-
path: typing.
|
|
234
|
+
path: typing.Optional[typing.Union[str, bytes]],
|
|
235
|
+
start: typing.Optional[typing.Union[str, bytes]] = None,
|
|
221
236
|
) -> str:
|
|
222
237
|
"""Returns the path relative to the current blend file using the "//" prefix.
|
|
223
238
|
|
|
224
239
|
:param path: An absolute path.
|
|
225
|
-
:type path: typing.Union[str, bytes]
|
|
240
|
+
:type path: typing.Optional[typing.Union[str, bytes]]
|
|
226
241
|
:param start: Relative to this path,
|
|
227
242
|
when not set the current filename is used.
|
|
228
|
-
:type start: typing.Union[str, bytes]
|
|
243
|
+
:type start: typing.Optional[typing.Union[str, bytes]]
|
|
229
244
|
:return: The relative path.
|
|
230
245
|
:rtype: str
|
|
231
246
|
"""
|
|
@@ -237,12 +252,12 @@ def relpath(path, start):
|
|
|
237
252
|
|
|
238
253
|
...
|
|
239
254
|
|
|
240
|
-
def resolve_ncase(path: str) -> str:
|
|
255
|
+
def resolve_ncase(path: typing.Optional[str]) -> str:
|
|
241
256
|
"""Resolve a case insensitive path on a case sensitive system,
|
|
242
257
|
returning a string with the path if found else return the original path.
|
|
243
258
|
|
|
244
259
|
:param path: The path name to resolve.
|
|
245
|
-
:type path: str
|
|
260
|
+
:type path: typing.Optional[str]
|
|
246
261
|
:return: The resolved path.
|
|
247
262
|
:rtype: str
|
|
248
263
|
"""
|