fake-bpy-module 20250612__py3-none-any.whl → 20260118__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.
- {bl_console_utils → _bl_console_utils}/autocomplete/complete_calltip/__init__.pyi +0 -13
- {bl_console_utils → _bl_console_utils}/autocomplete/complete_import/__init__.pyi +0 -5
- {bl_console_utils → _bl_console_utils}/autocomplete/complete_namespace/__init__.pyi +0 -11
- {bl_console_utils → _bl_console_utils}/autocomplete/intellisense/__init__.pyi +0 -10
- {bl_i18n_utils → _bl_i18n_utils}/__init__.pyi +1 -0
- {bl_i18n_utils → _bl_i18n_utils}/bl_extract_messages/__init__.pyi +1 -0
- {bl_i18n_utils → _bl_i18n_utils}/settings/__init__.pyi +3 -1
- {bl_i18n_utils → _bl_i18n_utils}/utils/__init__.pyi +4 -4
- _bl_i18n_utils/utils_spell_check/__init__.pyi +22 -0
- {bl_ui_utils → _bl_ui_utils}/__init__.pyi +1 -0
- _blendfile_header/__init__.pyi +48 -0
- _bpy_internal/__init__.pyi +4 -1
- _bpy_internal/assets/__init__.pyi +5 -0
- _bpy_internal/assets/remote_library_listing/__init__.pyi +5 -0
- _bpy_internal/assets/remote_library_listing/blender_asset_library_openapi/__init__.pyi +13 -0
- _bpy_internal/disk_file_hash_service/__init__.pyi +19 -0
- _bpy_internal/disk_file_hash_service/backend_sqlite/__init__.pyi +48 -0
- _bpy_internal/disk_file_hash_service/hash_service/__init__.pyi +64 -0
- _bpy_internal/disk_file_hash_service/types/__init__.pyi +53 -0
- _bpy_internal/extensions/wheel_manager/__init__.pyi +1 -1
- _bpy_internal/filesystem/__init__.pyi +5 -0
- _bpy_internal/filesystem/locking/__init__.pyi +28 -0
- _bpy_internal/grease_pencil/stroke/__init__.pyi +2 -2
- _bpy_internal/platform/__init__.pyi +5 -0
- _bpy_types/__init__.pyi +1592 -0
- {keyingsets_utils → _keyingsets_utils}/__init__.pyi +2 -0
- {rna_info → _rna_info}/__init__.pyi +4 -2
- addon_utils/__init__.pyi +0 -13
- aud/__init__.pyi +122 -145
- bl_app_templates_system/Storyboarding/__init__.pyi +11 -0
- bl_app_templates_system/__init__.pyi +5 -0
- bl_app_templates_system/py.typed +0 -0
- bl_math/__init__.pyi +3 -13
- bl_operators/__init__.pyi +1 -0
- bl_operators/add_mesh_torus/__init__.pyi +2 -3
- bl_operators/anim/__init__.pyi +62 -38
- bl_operators/assets/__init__.pyi +4 -9
- bl_operators/bone_selection_sets/__init__.pyi +15 -42
- bl_operators/clip/__init__.pyi +12 -31
- bl_operators/connect_to_output/__init__.pyi +2 -3
- bl_operators/console/__init__.pyi +6 -15
- bl_operators/constraint/__init__.pyi +6 -13
- bl_operators/copy_global_transform/__init__.pyi +261 -0
- bl_operators/file/__init__.pyi +6 -11
- bl_operators/freestyle/__init__.pyi +5 -12
- bl_operators/geometry_nodes/__init__.pyi +5 -12
- bl_operators/grease_pencil/__init__.pyi +2 -3
- bl_operators/image/__init__.pyi +6 -15
- bl_operators/image_as_planes/__init__.pyi +3 -10
- bl_operators/mesh/__init__.pyi +3 -49
- bl_operators/node/__init__.pyi +294 -73
- bl_operators/object/__init__.pyi +17 -53
- bl_operators/object_align/__init__.pyi +2 -3
- bl_operators/object_quick_effects/__init__.pyi +5 -12
- bl_operators/object_randomize_transform/__init__.pyi +2 -3
- bl_operators/presets/__init__.pyi +27 -76
- bl_operators/rigidbody/__init__.pyi +4 -9
- bl_operators/screen_play_rendered_anim/__init__.pyi +2 -3
- bl_operators/sequencer/__init__.pyi +12 -27
- bl_operators/spreadsheet/__init__.pyi +2 -3
- bl_operators/userpref/__init__.pyi +26 -75
- bl_operators/uvcalc_follow_active/__init__.pyi +3 -4
- bl_operators/uvcalc_lightmap/__init__.pyi +3 -4
- bl_operators/uvcalc_transform/__init__.pyi +26 -16
- bl_operators/vertexpaint_dirt/__init__.pyi +2 -3
- bl_operators/view3d/__init__.pyi +9 -24
- bl_operators/wm/__init__.pyi +48 -139
- bl_operators/world/__init__.pyi +3 -4
- bl_ui/__init__.pyi +7 -7
- bl_ui/anim/__init__.pyi +2 -3
- bl_ui/asset_shelf/__init__.pyi +2 -3
- bl_ui/generic_ui_list/__init__.pyi +4 -19
- bl_ui/node_add_menu/__init__.pyi +263 -7
- bl_ui/node_add_menu_compositor/__init__.pyi +96 -79
- bl_ui/node_add_menu_geometry/__init__.pyi +309 -270
- bl_ui/node_add_menu_shader/__init__.pyi +49 -49
- bl_ui/node_add_menu_texture/__init__.pyi +17 -62
- bl_ui/properties_collection/__init__.pyi +9 -22
- bl_ui/properties_constraint/__init__.pyi +129 -282
- bl_ui/properties_data_armature/__init__.pyi +22 -57
- bl_ui/properties_data_bone/__init__.pyi +12 -31
- bl_ui/properties_data_camera/__init__.pyi +18 -47
- bl_ui/properties_data_curve/__init__.pyi +18 -47
- bl_ui/properties_data_curves/__init__.pyi +11 -26
- bl_ui/properties_data_empty/__init__.pyi +3 -6
- bl_ui/properties_data_grease_pencil/__init__.pyi +23 -62
- bl_ui/properties_data_lattice/__init__.pyi +7 -14
- bl_ui/properties_data_light/__init__.pyi +13 -32
- bl_ui/properties_data_lightprobe/__init__.pyi +16 -43
- bl_ui/properties_data_mesh/__init__.pyi +47 -62
- bl_ui/properties_data_metaball/__init__.pyi +9 -20
- bl_ui/properties_data_modifier/__init__.pyi +22 -28
- bl_ui/properties_data_pointcloud/__init__.pyi +8 -19
- bl_ui/properties_data_shaderfx/__init__.pyi +2 -3
- bl_ui/properties_data_speaker/__init__.pyi +9 -20
- bl_ui/properties_data_volume/__init__.pyi +12 -29
- bl_ui/properties_freestyle/__init__.pyi +27 -76
- bl_ui/properties_grease_pencil_common/__init__.pyi +10 -168
- bl_ui/properties_mask_common/__init__.pyi +8 -21
- bl_ui/properties_material/__init__.pyi +26 -86
- bl_ui/properties_material_gpencil/__init__.pyi +36 -57
- bl_ui/properties_object/__init__.pyi +59 -65
- bl_ui/properties_output/__init__.pyi +21 -60
- bl_ui/properties_paint_common/__init__.pyi +30 -22
- bl_ui/properties_particle/__init__.pyi +58 -161
- bl_ui/properties_physics_cloth/__init__.pyi +15 -42
- bl_ui/properties_physics_common/__init__.pyi +2 -3
- bl_ui/properties_physics_dynamicpaint/__init__.pyi +23 -66
- bl_ui/properties_physics_field/__init__.pyi +11 -30
- bl_ui/properties_physics_fluid/__init__.pyi +29 -84
- bl_ui/properties_physics_geometry_nodes/__init__.pyi +2 -3
- bl_ui/properties_physics_rigidbody/__init__.pyi +9 -24
- bl_ui/properties_physics_rigidbody_constraint/__init__.pyi +14 -39
- bl_ui/properties_physics_softbody/__init__.pyi +16 -45
- bl_ui/properties_render/__init__.pyi +139 -197
- bl_ui/properties_scene/__init__.pyi +46 -50
- bl_ui/properties_strip/__init__.pyi +744 -0
- bl_ui/properties_strip_modifier/__init__.pyi +45 -0
- bl_ui/properties_texture/__init__.pyi +30 -83
- bl_ui/properties_view_layer/__init__.pyi +84 -39
- bl_ui/properties_workspace/__init__.pyi +6 -13
- bl_ui/properties_world/__init__.pyi +14 -35
- bl_ui/space_clip/__init__.pyi +150 -231
- bl_ui/space_console/__init__.pyi +7 -18
- bl_ui/space_dopesheet/__init__.pyi +143 -100
- bl_ui/space_filebrowser/__init__.pyi +33 -90
- bl_ui/space_graph/__init__.pyi +48 -85
- bl_ui/space_image/__init__.pyi +111 -229
- bl_ui/space_info/__init__.pyi +7 -18
- bl_ui/space_nla/__init__.pyi +44 -73
- bl_ui/space_node/__init__.pyi +161 -123
- bl_ui/space_outliner/__init__.pyi +16 -45
- bl_ui/space_properties/__init__.pyi +34 -10
- bl_ui/space_sequencer/__init__.pyi +164 -901
- bl_ui/space_spreadsheet/__init__.pyi +4 -9
- bl_ui/space_statusbar/__init__.pyi +2 -3
- bl_ui/space_text/__init__.pyi +17 -48
- bl_ui/space_time/__init__.pyi +25 -71
- bl_ui/space_toolsystem_common/__init__.pyi +2 -2
- bl_ui/space_toolsystem_toolbar/__init__.pyi +30 -7
- bl_ui/space_topbar/__init__.pyi +35 -79
- bl_ui/space_userpref/__init__.pyi +185 -321
- bl_ui/space_view3d/__init__.pyi +337 -817
- bl_ui/space_view3d_sidebar/__init__.pyi +127 -0
- bl_ui/space_view3d_toolbar/__init__.pyi +110 -880
- bl_ui/utils/__init__.pyi +0 -17
- blend_render_info/__init__.pyi +1 -0
- blf/__init__.pyi +8 -54
- bmesh/__init__.pyi +2 -9
- bmesh/geometry/__init__.pyi +1 -4
- bmesh/ops/__init__.pyi +125 -508
- bmesh/types/__init__.pyi +318 -664
- bmesh/utils/__init__.pyi +17 -43
- bpy/__init__.pyi +1 -1
- bpy/app/__init__.pyi +93 -88
- bpy/app/handlers/__init__.pyi +19 -19
- bpy/app/icons/__init__.pyi +0 -6
- bpy/app/timers/__init__.pyi +2 -7
- bpy/app/translations/__init__.pyi +8 -23
- bpy/msgbus/__init__.pyi +4 -6
- bpy/ops/action/__init__.pyi +68 -199
- bpy/ops/anim/__init__.pyi +142 -299
- bpy/ops/armature/__init__.pyi +78 -209
- bpy/ops/asset/__init__.pyi +46 -108
- bpy/ops/boid/__init__.pyi +28 -45
- bpy/ops/brush/__init__.pyi +13 -108
- bpy/ops/buttons/__init__.pyi +16 -75
- bpy/ops/cachefile/__init__.pyi +8 -65
- bpy/ops/camera/__init__.pyi +0 -11
- bpy/ops/clip/__init__.pyi +173 -471
- bpy/ops/cloth/__init__.pyi +0 -5
- bpy/ops/collection/__init__.pyi +23 -36
- bpy/ops/console/__init__.pyi +40 -98
- bpy/ops/constraint/__init__.pyi +14 -85
- bpy/ops/curve/__init__.pyi +94 -277
- bpy/ops/curves/__init__.pyi +119 -166
- bpy/ops/cycles/__init__.pyi +4 -15
- bpy/ops/dpaint/__init__.pyi +14 -24
- bpy/ops/ed/__init__.pyi +44 -92
- bpy/ops/export_anim/__init__.pyi +2 -10
- bpy/ops/export_scene/__init__.pyi +16 -170
- bpy/ops/extensions/__init__.pyi +60 -165
- bpy/ops/file/__init__.pyi +110 -246
- bpy/ops/fluid/__init__.pyi +52 -83
- bpy/ops/font/__init__.pyi +40 -144
- bpy/ops/geometry/__init__.pyi +12 -127
- bpy/ops/gizmogroup/__init__.pyi +4 -13
- bpy/ops/gpencil/__init__.pyi +22 -54
- bpy/ops/graph/__init__.pyi +92 -343
- bpy/ops/grease_pencil/__init__.pyi +218 -550
- bpy/ops/image/__init__.pyi +85 -435
- bpy/ops/import_anim/__init__.pyi +3 -17
- bpy/ops/import_curve/__init__.pyi +2 -5
- bpy/ops/import_scene/__init__.pyi +15 -49
- bpy/ops/info/__init__.pyi +16 -39
- bpy/ops/lattice/__init__.pyi +12 -36
- bpy/ops/marker/__init__.pyi +12 -51
- bpy/ops/mask/__init__.pyi +68 -193
- bpy/ops/material/__init__.pyi +18 -18
- bpy/ops/mball/__init__.pyi +4 -31
- bpy/ops/mesh/__init__.pyi +140 -967
- bpy/ops/nla/__init__.pyi +87 -206
- bpy/ops/node/__init__.pyi +714 -744
- bpy/ops/object/__init__.pyi +461 -1341
- bpy/ops/outliner/__init__.pyi +192 -376
- bpy/ops/paint/__init__.pyi +94 -319
- bpy/ops/paintcurve/__init__.pyi +20 -40
- bpy/ops/palette/__init__.pyi +14 -30
- bpy/ops/particle/__init__.pyi +86 -184
- bpy/ops/pointcloud/__init__.pyi +12 -38
- bpy/ops/pose/__init__.pyi +108 -261
- bpy/ops/poselib/__init__.pyi +32 -67
- bpy/ops/preferences/__init__.pyi +37 -187
- bpy/ops/ptcache/__init__.pyi +22 -36
- bpy/ops/render/__init__.pyi +20 -72
- bpy/ops/rigidbody/__init__.pyi +25 -63
- bpy/ops/scene/__init__.pyi +122 -181
- bpy/ops/screen/__init__.pyi +93 -221
- bpy/ops/script/__init__.pyi +4 -13
- bpy/ops/sculpt/__init__.pyi +69 -324
- bpy/ops/sculpt_curves/__init__.pyi +10 -23
- bpy/ops/sequencer/__init__.pyi +410 -730
- bpy/ops/sound/__init__.pyi +16 -114
- bpy/ops/spreadsheet/__init__.pyi +20 -37
- bpy/ops/surface/__init__.pyi +0 -48
- bpy/ops/text/__init__.pyi +112 -250
- bpy/ops/text_editor/__init__.pyi +0 -5
- bpy/ops/texture/__init__.pyi +14 -21
- bpy/ops/transform/__init__.pyi +18 -386
- bpy/ops/ui/__init__.pyi +117 -188
- bpy/ops/uilist/__init__.pyi +0 -13
- bpy/ops/uv/__init__.pyi +238 -305
- bpy/ops/view2d/__init__.pyi +16 -76
- bpy/ops/view3d/__init__.pyi +153 -377
- bpy/ops/wm/__init__.pyi +277 -1397
- bpy/ops/workspace/__init__.pyi +32 -39
- bpy/ops/world/__init__.pyi +10 -12
- bpy/path/__init__.pyi +1 -35
- bpy/props/__init__.pyi +347 -218
- bpy/stub_internal/rna_enums/__init__.pyi +142 -108
- bpy/types/__init__.pyi +77367 -101305
- bpy/utils/__init__.pyi +11 -82
- bpy/utils/previews/__init__.pyi +2 -11
- bpy/utils/units/__init__.pyi +5 -15
- bpy_extras/anim_utils/__init__.pyi +24 -16
- bpy_extras/bmesh_utils/__init__.pyi +0 -1
- bpy_extras/id_map_utils/__init__.pyi +14 -6
- bpy_extras/image_utils/__init__.pyi +2 -11
- bpy_extras/io_utils/__init__.pyi +8 -27
- bpy_extras/keyconfig_utils/__init__.pyi +1 -1
- bpy_extras/mesh_utils/__init__.pyi +0 -12
- bpy_extras/node_shader_utils/__init__.pyi +1 -9
- bpy_extras/object_utils/__init__.pyi +1 -15
- bpy_extras/view3d_utils/__init__.pyi +0 -18
- bpy_extras/wm_utils/progress_report/__init__.pyi +1 -1
- {fake_bpy_module-20250612.dist-info → fake_bpy_module-20260118.dist-info}/METADATA +4 -1
- fake_bpy_module-20260118.dist-info/RECORD +385 -0
- {fake_bpy_module-20250612.dist-info → fake_bpy_module-20260118.dist-info}/top_level.txt +17 -16
- freestyle/chainingiterators/__init__.pyi +5 -27
- freestyle/functions/__init__.pyi +0 -139
- freestyle/predicates/__init__.pyi +2 -53
- freestyle/shaders/__init__.pyi +15 -81
- freestyle/types/__init__.pyi +159 -799
- freestyle/utils/ContextFunctions/__init__.pyi +0 -23
- freestyle/utils/__init__.pyi +5 -11
- gpu/capabilities/__init__.pyi +0 -21
- gpu/matrix/__init__.pyi +1 -10
- gpu/platform/__init__.pyi +2 -7
- gpu/shader/__init__.pyi +26 -9
- gpu/state/__init__.pyi +60 -39
- gpu/texture/__init__.pyi +3 -5
- gpu/types/__init__.pyi +116 -184
- gpu_extras/batch/__init__.pyi +1 -5
- gpu_extras/presets/__init__.pyi +6 -8
- idprop/types/__init__.pyi +6 -6
- imbuf/__init__.pyi +3 -10
- imbuf/types/__init__.pyi +7 -21
- keyingsets_builtins/__init__.pyi +24 -67
- mathutils/__init__.pyi +241 -2207
- mathutils/bvhtree/__init__.pyi +18 -26
- mathutils/geometry/__init__.pyi +82 -132
- mathutils/interpolate/__init__.pyi +6 -5
- mathutils/kdtree/__init__.pyi +1 -11
- mathutils/noise/__init__.pyi +61 -106
- rna_prop_ui/__init__.pyi +1 -1
- bgl/__init__.pyi +0 -4256
- bpy_types/__init__.pyi +0 -30
- fake_bpy_module-20250612.dist-info/RECORD +0 -367
- {animsys_refactor → _animsys_refactor}/__init__.pyi +0 -0
- {animsys_refactor → _animsys_refactor}/py.typed +0 -0
- {bl_console_utils → _bl_console_utils}/__init__.pyi +0 -0
- {bl_console_utils → _bl_console_utils}/autocomplete/__init__.pyi +0 -0
- {bgl → _bl_console_utils}/py.typed +0 -0
- {bl_i18n_utils → _bl_i18n_utils}/merge_po/__init__.pyi +0 -0
- {bl_console_utils → _bl_i18n_utils}/py.typed +0 -0
- {bl_i18n_utils → _bl_i18n_utils}/utils_cli/__init__.pyi +0 -0
- {bl_i18n_utils → _bl_i18n_utils}/utils_languages_menu/__init__.pyi +0 -0
- {bl_i18n_utils → _bl_i18n_utils}/utils_rtl/__init__.pyi +0 -0
- {bl_previews_utils → _bl_previews_utils}/__init__.pyi +0 -0
- {bl_previews_utils → _bl_previews_utils}/bl_previews_render/__init__.pyi +0 -0
- {bl_i18n_utils → _bl_previews_utils}/py.typed +0 -0
- {bl_rna_utils → _bl_rna_utils}/__init__.pyi +0 -0
- {bl_rna_utils → _bl_rna_utils}/data_path/__init__.pyi +0 -0
- {bl_previews_utils → _bl_rna_utils}/py.typed +0 -0
- {bl_text_utils → _bl_text_utils}/__init__.pyi +0 -0
- {bl_text_utils → _bl_text_utils}/external_editor/__init__.pyi +0 -0
- {bl_rna_utils → _bl_text_utils}/py.typed +0 -0
- {bl_ui_utils → _bl_ui_utils}/layout/__init__.pyi +0 -0
- {bl_text_utils → _bl_ui_utils}/py.typed +0 -0
- {bl_ui_utils → _blendfile_header}/py.typed +0 -0
- /_bpy_internal/{freedesktop → platform/freedesktop}/__init__.pyi +0 -0
- {bpy_restrict_state → _bpy_restrict_state}/__init__.pyi +0 -0
- {bpy_restrict_state → _bpy_restrict_state}/py.typed +0 -0
- {bpy_types → _bpy_types}/py.typed +0 -0
- {console_python → _console_python}/__init__.pyi +0 -0
- {console_python → _console_python}/py.typed +0 -0
- {console_shell → _console_shell}/__init__.pyi +0 -0
- {console_shell → _console_shell}/py.typed +0 -0
- {graphviz_export → _graphviz_export}/__init__.pyi +0 -0
- {graphviz_export → _graphviz_export}/py.typed +0 -0
- {keyingsets_utils → _keyingsets_utils}/py.typed +0 -0
- {rna_info → _rna_info}/py.typed +0 -0
- {rna_xml → _rna_xml}/__init__.pyi +0 -0
- {rna_xml → _rna_xml}/py.typed +0 -0
- {fake_bpy_module-20250612.dist-info → fake_bpy_module-20260118.dist-info}/WHEEL +0 -0
gpu/types/__init__.pyi
CHANGED
|
@@ -14,7 +14,7 @@ class Buffer:
|
|
|
14
14
|
class GPUBatch:
|
|
15
15
|
"""Reusable container for drawable geometry."""
|
|
16
16
|
|
|
17
|
-
def draw(self, shader=None) -> None:
|
|
17
|
+
def draw(self, shader: GPUShader | None = None) -> None:
|
|
18
18
|
"""Run the drawing shader with the parameters assigned to the batch.
|
|
19
19
|
|
|
20
20
|
:param shader: Shader that performs the drawing operations.
|
|
@@ -29,13 +29,10 @@ class GPUBatch:
|
|
|
29
29
|
number being drawn.
|
|
30
30
|
|
|
31
31
|
:param program: Program that performs the drawing operations.
|
|
32
|
-
:type program: GPUShader
|
|
33
32
|
:param instance_start: Number of the first instance to draw.
|
|
34
|
-
:type instance_start: int
|
|
35
33
|
:param instance_count: Number of instances to draw. When not provided or set to 0
|
|
36
34
|
the number of instances will be determined by the number of rows in the first
|
|
37
35
|
vertex buffer.
|
|
38
|
-
:type instance_count: int
|
|
39
36
|
"""
|
|
40
37
|
|
|
41
38
|
def draw_range(
|
|
@@ -44,14 +41,11 @@ class GPUBatch:
|
|
|
44
41
|
"""Run the drawing program with the parameters assigned to the batch. Only draw the elem_count elements of the index buffer starting at elem_start.
|
|
45
42
|
|
|
46
43
|
:param program: Program that performs the drawing operations.
|
|
47
|
-
:type program: GPUShader
|
|
48
44
|
:param elem_start: First index to draw. When not provided or set to 0 drawing
|
|
49
45
|
will start from the first element of the index buffer.
|
|
50
|
-
:type elem_start: int
|
|
51
46
|
:param elem_count: Number of elements of the index buffer to draw. When not
|
|
52
47
|
provided or set to 0 all elements from elem_start to the end of the
|
|
53
48
|
index buffer will be drawn.
|
|
54
|
-
:type elem_count: int
|
|
55
49
|
"""
|
|
56
50
|
|
|
57
51
|
def program_set(self, program: GPUShader) -> None:
|
|
@@ -61,7 +55,6 @@ class GPUBatch:
|
|
|
61
55
|
set the shader when calling `gpu.types.GPUBatch.draw`.
|
|
62
56
|
|
|
63
57
|
:param program: The program/shader the batch will use in future draw calls.
|
|
64
|
-
:type program: GPUShader
|
|
65
58
|
"""
|
|
66
59
|
|
|
67
60
|
def vertbuf_add(self, buf: GPUVertBuf) -> None:
|
|
@@ -73,23 +66,23 @@ class GPUBatch:
|
|
|
73
66
|
Current a batch can have at most GPU_BATCH_VBO_MAX_LEN vertex buffers.
|
|
74
67
|
|
|
75
68
|
:param buf: The vertex buffer that will be added to the batch.
|
|
76
|
-
:type buf: GPUVertBuf
|
|
77
69
|
"""
|
|
78
70
|
|
|
79
71
|
class GPUFrameBuffer:
|
|
80
72
|
"""This object gives access to framebuffer functionalities.
|
|
81
|
-
When a
|
|
73
|
+
When a layer is specified in a argument, a single layer of a 3D or array texture is attached to the frame-buffer.
|
|
82
74
|
For cube map textures, layer is translated into a cube map face.
|
|
83
75
|
"""
|
|
84
76
|
|
|
85
77
|
is_bound: typing.Any
|
|
86
|
-
""" Checks if this is the active
|
|
78
|
+
""" Checks if this is the active frame-buffer in the context."""
|
|
87
79
|
|
|
88
80
|
def bind(self) -> None:
|
|
89
81
|
"""Context manager to ensure balanced bind calls, even in the case of an error."""
|
|
90
82
|
|
|
91
83
|
def clear(
|
|
92
84
|
self,
|
|
85
|
+
*,
|
|
93
86
|
color: collections.abc.Sequence[float] | None = None,
|
|
94
87
|
depth: float | None = None,
|
|
95
88
|
stencil: int | None = None,
|
|
@@ -98,11 +91,8 @@ class GPUFrameBuffer:
|
|
|
98
91
|
Common values: color=(0.0, 0.0, 0.0, 1.0), depth=1.0, stencil=0.
|
|
99
92
|
|
|
100
93
|
:param color: Sequence of 3 or 4 floats representing (r, g, b, a).
|
|
101
|
-
:type color: collections.abc.Sequence[float] | None
|
|
102
94
|
:param depth: depth value.
|
|
103
|
-
:type depth: float | None
|
|
104
95
|
:param stencil: stencil value.
|
|
105
|
-
:type stencil: int | None
|
|
106
96
|
"""
|
|
107
97
|
|
|
108
98
|
def read_color(
|
|
@@ -114,41 +104,35 @@ class GPUFrameBuffer:
|
|
|
114
104
|
channels: int,
|
|
115
105
|
slot: int,
|
|
116
106
|
format: str,
|
|
117
|
-
|
|
107
|
+
*,
|
|
108
|
+
data: Buffer | None = None,
|
|
118
109
|
) -> Buffer:
|
|
119
110
|
"""Read a block of pixels from the frame buffer.
|
|
120
111
|
|
|
121
112
|
:param x: Lower left corner of a rectangular block of pixels.
|
|
122
|
-
:type x: int
|
|
123
113
|
:param y:
|
|
124
114
|
:param xsize: Dimensions of the pixel rectangle.
|
|
125
115
|
:param ysize:
|
|
126
116
|
:param channels: Number of components to read.
|
|
127
|
-
:type channels: int
|
|
128
117
|
:param slot: The framebuffer slot to read data from.
|
|
129
|
-
:type slot: int
|
|
130
118
|
:param format: The format that describes the content of a single channel.
|
|
131
|
-
Possible values are FLOAT, INT, UINT, UBYTE, UINT_24_8
|
|
132
|
-
|
|
119
|
+
Possible values are FLOAT, INT, UINT, UBYTE, UINT_24_8 & 10_11_11_REV.
|
|
120
|
+
UINT_24_8 is deprecated, use FLOAT instead.
|
|
133
121
|
:param data: Optional Buffer object to fill with the pixels values.
|
|
134
|
-
:type data: Buffer
|
|
135
122
|
:return: The Buffer with the read pixels.
|
|
136
|
-
:rtype: Buffer
|
|
137
123
|
"""
|
|
138
124
|
|
|
139
|
-
def read_depth(
|
|
125
|
+
def read_depth(
|
|
126
|
+
self, x: int, y, xsize: int, ysize, *, data: Buffer | None = None
|
|
127
|
+
) -> Buffer:
|
|
140
128
|
"""Read a pixel depth block from the frame buffer.
|
|
141
129
|
|
|
142
130
|
:param x: Lower left corner of a rectangular block of pixels.
|
|
143
|
-
:type x: int
|
|
144
131
|
:param y:
|
|
145
132
|
:param xsize: Dimensions of the pixel rectangle.
|
|
146
|
-
:type xsize: int
|
|
147
133
|
:param ysize:
|
|
148
134
|
:param data: Optional Buffer object to fill with the pixels values.
|
|
149
|
-
:type data: Buffer
|
|
150
135
|
:return: The Buffer with the read pixels.
|
|
151
|
-
:rtype: Buffer
|
|
152
136
|
"""
|
|
153
137
|
|
|
154
138
|
def viewport_get(self) -> None:
|
|
@@ -159,10 +143,8 @@ class GPUFrameBuffer:
|
|
|
159
143
|
Note: The viewport state is not saved upon framebuffer rebind.
|
|
160
144
|
|
|
161
145
|
:param x: lower left corner of the viewport_set rectangle, in pixels.
|
|
162
|
-
:type x: int
|
|
163
146
|
:param y:
|
|
164
147
|
:param xsize: width and height of the viewport_set.
|
|
165
|
-
:type xsize: int
|
|
166
148
|
:param ysize:
|
|
167
149
|
"""
|
|
168
150
|
|
|
@@ -172,29 +154,14 @@ class GPUIndexBuf:
|
|
|
172
154
|
class GPUOffScreen:
|
|
173
155
|
"""This object gives access to off screen buffers."""
|
|
174
156
|
|
|
175
|
-
color_texture: int
|
|
176
|
-
""" OpenGL bindcode for the color texture.
|
|
177
|
-
|
|
178
|
-
:type: int
|
|
179
|
-
"""
|
|
180
|
-
|
|
181
157
|
height: int
|
|
182
|
-
""" Height of the texture.
|
|
183
|
-
|
|
184
|
-
:type: int
|
|
185
|
-
"""
|
|
158
|
+
""" Height of the texture."""
|
|
186
159
|
|
|
187
160
|
texture_color: GPUTexture
|
|
188
|
-
""" The color texture attached.
|
|
189
|
-
|
|
190
|
-
:type: GPUTexture
|
|
191
|
-
"""
|
|
161
|
+
""" The color texture attached."""
|
|
192
162
|
|
|
193
163
|
width: int
|
|
194
|
-
""" Width of the texture.
|
|
195
|
-
|
|
196
|
-
:type: int
|
|
197
|
-
"""
|
|
164
|
+
""" Width of the texture."""
|
|
198
165
|
|
|
199
166
|
def bind(self) -> None:
|
|
200
167
|
"""Context manager to ensure balanced bind calls, even in the case of an error."""
|
|
@@ -209,27 +176,20 @@ class GPUOffScreen:
|
|
|
209
176
|
| mathutils.Matrix,
|
|
210
177
|
projection_matrix: collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
211
178
|
| mathutils.Matrix,
|
|
179
|
+
*,
|
|
212
180
|
do_color_management: bool = False,
|
|
213
181
|
draw_background: bool = True,
|
|
214
182
|
) -> None:
|
|
215
183
|
"""Draw the 3d viewport in the offscreen object.
|
|
216
184
|
|
|
217
185
|
:param scene: Scene to draw.
|
|
218
|
-
:type scene: bpy.types.Scene
|
|
219
186
|
:param view_layer: View layer to draw.
|
|
220
|
-
:type view_layer: bpy.types.ViewLayer
|
|
221
187
|
:param view3d: 3D View to get the drawing settings from.
|
|
222
|
-
:type view3d: bpy.types.SpaceView3D
|
|
223
188
|
:param region: Region of the 3D View (required as temporary draw target).
|
|
224
|
-
:type region: bpy.types.Region
|
|
225
189
|
:param view_matrix: View Matrix (e.g. camera.matrix_world.inverted()).
|
|
226
|
-
:type view_matrix: collections.abc.Sequence[collections.abc.Sequence[float]] | mathutils.Matrix
|
|
227
190
|
:param projection_matrix: Projection Matrix (e.g. camera.calc_matrix_camera(...)).
|
|
228
|
-
:type projection_matrix: collections.abc.Sequence[collections.abc.Sequence[float]] | mathutils.Matrix
|
|
229
191
|
:param do_color_management: Color manage the output.
|
|
230
|
-
:type do_color_management: bool
|
|
231
192
|
:param draw_background: Draw background.
|
|
232
|
-
:type draw_background: bool
|
|
233
193
|
"""
|
|
234
194
|
|
|
235
195
|
def free(self) -> None:
|
|
@@ -238,51 +198,31 @@ class GPUOffScreen:
|
|
|
238
198
|
|
|
239
199
|
"""
|
|
240
200
|
|
|
241
|
-
def unbind(self, restore: bool = True) -> None:
|
|
201
|
+
def unbind(self, *, restore: bool = True) -> None:
|
|
242
202
|
"""Unbind the offscreen object.
|
|
243
203
|
|
|
244
204
|
:param restore: Restore the OpenGL state, can only be used when the state has been saved before.
|
|
245
|
-
:type restore: bool
|
|
246
205
|
"""
|
|
247
206
|
|
|
248
207
|
class GPUShader:
|
|
249
|
-
"""GPUShader combines multiple GLSL shaders into a program used for drawing.
|
|
250
|
-
It must contain at least a vertex and fragment shaders.The GLSL #version directive is automatically included at the top of shaders,
|
|
251
|
-
and set to 330. Some preprocessor directives are automatically added according to
|
|
252
|
-
the Operating System or availability: GPU_ATI, GPU_NVIDIA and GPU_INTEL.The following extensions are enabled by default if supported by the GPU:
|
|
253
|
-
GL_ARB_texture_gather, GL_ARB_texture_cube_map_array
|
|
254
|
-
and GL_ARB_shader_draw_parameters.For drawing user interface elements and gizmos, use
|
|
255
|
-
fragOutput = blender_srgb_to_framebuffer_space(fragOutput)
|
|
256
|
-
to transform the output sRGB colors to the frame-buffer color-space.
|
|
257
|
-
"""
|
|
258
|
-
|
|
259
208
|
name: str
|
|
260
|
-
""" The name of the shader object for debugging purposes (read-only).
|
|
261
|
-
|
|
262
|
-
:type: str
|
|
263
|
-
"""
|
|
209
|
+
""" The name of the shader object for debugging purposes (read-only)."""
|
|
264
210
|
|
|
265
211
|
program: int
|
|
266
212
|
""" The name of the program object for use by the OpenGL API (read-only).
|
|
267
|
-
This is deprecated and will always return -1.
|
|
268
|
-
|
|
269
|
-
:type: int
|
|
270
|
-
"""
|
|
213
|
+
This is deprecated and will always return -1."""
|
|
271
214
|
|
|
272
215
|
def attr_from_name(self, name: str) -> int:
|
|
273
216
|
"""Get attribute location by name.
|
|
274
217
|
|
|
275
218
|
:param name: The name of the attribute variable whose location is to be queried.
|
|
276
|
-
:type name: str
|
|
277
219
|
:return: The location of an attribute variable.
|
|
278
|
-
:rtype: int
|
|
279
220
|
"""
|
|
280
221
|
|
|
281
222
|
def attrs_info_get(self) -> tuple[tuple[str, str | None], ...]:
|
|
282
223
|
"""Information about the attributes used in the Shader.
|
|
283
224
|
|
|
284
225
|
:return: tuples containing information about the attributes in order (name, type)
|
|
285
|
-
:rtype: tuple[tuple[str, str | None], ...]
|
|
286
226
|
"""
|
|
287
227
|
|
|
288
228
|
def bind(self) -> None:
|
|
@@ -292,23 +232,19 @@ This is deprecated and will always return -1.
|
|
|
292
232
|
"""Build a new format based on the attributes of the shader.
|
|
293
233
|
|
|
294
234
|
:return: vertex attribute format for the shader
|
|
295
|
-
:rtype: GPUVertFormat
|
|
296
235
|
"""
|
|
297
236
|
|
|
298
237
|
def image(self, name: str, texture: GPUTexture) -> None:
|
|
299
238
|
"""Specify the value of an image variable for the current GPUShader.
|
|
300
239
|
|
|
301
240
|
:param name: Name of the image variable to which the texture is to be bound.
|
|
302
|
-
:type name: str
|
|
303
241
|
:param texture: Texture to attach.
|
|
304
|
-
:type texture: GPUTexture
|
|
305
242
|
"""
|
|
306
243
|
|
|
307
|
-
def uniform_block(self, name: str, ubo) -> None:
|
|
308
|
-
"""Specify the value of
|
|
244
|
+
def uniform_block(self, name: str, ubo: GPUUniformBuf) -> None:
|
|
245
|
+
"""Specify the value of a uniform buffer object variable for the current GPUShader.
|
|
309
246
|
|
|
310
|
-
:param name:
|
|
311
|
-
:type name: str
|
|
247
|
+
:param name: Name of the uniform variable whose UBO is to be specified.
|
|
312
248
|
:param ubo: Uniform Buffer to attach.
|
|
313
249
|
"""
|
|
314
250
|
|
|
@@ -316,9 +252,7 @@ This is deprecated and will always return -1.
|
|
|
316
252
|
"""Get uniform block location by name.
|
|
317
253
|
|
|
318
254
|
:param name: Name of the uniform block variable whose location is to be queried.
|
|
319
|
-
:type name: str
|
|
320
255
|
:return: The location of the uniform block variable.
|
|
321
|
-
:rtype: int
|
|
322
256
|
"""
|
|
323
257
|
|
|
324
258
|
def uniform_bool(
|
|
@@ -327,9 +261,7 @@ This is deprecated and will always return -1.
|
|
|
327
261
|
"""Specify the value of a uniform variable for the current program object.
|
|
328
262
|
|
|
329
263
|
:param name: Name of the uniform variable whose value is to be changed.
|
|
330
|
-
:type name: str
|
|
331
264
|
:param value: Value that will be used to update the specified uniform variable.
|
|
332
|
-
:type value: bool | collections.abc.Sequence[bool]
|
|
333
265
|
"""
|
|
334
266
|
|
|
335
267
|
def uniform_float(
|
|
@@ -338,36 +270,28 @@ This is deprecated and will always return -1.
|
|
|
338
270
|
"""Specify the value of a uniform variable for the current program object.
|
|
339
271
|
|
|
340
272
|
:param name: Name of the uniform variable whose value is to be changed.
|
|
341
|
-
:type name: str
|
|
342
273
|
:param value: Value that will be used to update the specified uniform variable.
|
|
343
|
-
:type value: collections.abc.Sequence[float] | float
|
|
344
274
|
"""
|
|
345
275
|
|
|
346
276
|
def uniform_from_name(self, name: str) -> int:
|
|
347
277
|
"""Get uniform location by name.
|
|
348
278
|
|
|
349
279
|
:param name: Name of the uniform variable whose location is to be queried.
|
|
350
|
-
:type name: str
|
|
351
280
|
:return: Location of the uniform variable.
|
|
352
|
-
:rtype: int
|
|
353
281
|
"""
|
|
354
282
|
|
|
355
|
-
def uniform_int(self, name: str, seq: collections.abc.Sequence[int]) -> None:
|
|
283
|
+
def uniform_int(self, name: str, seq: collections.abc.Sequence[int] | int) -> None:
|
|
356
284
|
"""Specify the value of a uniform variable for the current program object.
|
|
357
285
|
|
|
358
|
-
:param name:
|
|
359
|
-
:type name: str
|
|
286
|
+
:param name: Name of the uniform variable whose value is to be changed.
|
|
360
287
|
:param seq: Value that will be used to update the specified uniform variable.
|
|
361
|
-
:type seq: collections.abc.Sequence[int]
|
|
362
288
|
"""
|
|
363
289
|
|
|
364
290
|
def uniform_sampler(self, name: str, texture: GPUTexture) -> None:
|
|
365
291
|
"""Specify the value of a texture uniform variable for the current GPUShader.
|
|
366
292
|
|
|
367
|
-
:param name:
|
|
368
|
-
:type name: str
|
|
293
|
+
:param name: Name of the uniform variable whose texture is to be specified.
|
|
369
294
|
:param texture: Texture to attach.
|
|
370
|
-
:type texture: GPUTexture
|
|
371
295
|
"""
|
|
372
296
|
|
|
373
297
|
def uniform_vector_float(
|
|
@@ -380,9 +304,7 @@ This is deprecated and will always return -1.
|
|
|
380
304
|
"""Set the buffer to fill the uniform.
|
|
381
305
|
|
|
382
306
|
:param location: Location of the uniform variable to be modified.
|
|
383
|
-
:type location: int
|
|
384
307
|
:param buffer: The data that should be set. Can support the buffer protocol.
|
|
385
|
-
:type buffer: collections.abc.Sequence[float]
|
|
386
308
|
:param length: Size of the uniform data type:
|
|
387
309
|
|
|
388
310
|
1: float
|
|
@@ -396,18 +318,18 @@ This is deprecated and will always return -1.
|
|
|
396
318
|
9: mat3
|
|
397
319
|
|
|
398
320
|
16: mat4
|
|
399
|
-
:type length: int
|
|
400
321
|
:param count: Specifies the number of elements, vector or matrices that are to be modified.
|
|
401
|
-
:type count: int
|
|
402
322
|
"""
|
|
403
323
|
|
|
404
|
-
def uniform_vector_int(
|
|
405
|
-
|
|
324
|
+
def uniform_vector_int(
|
|
325
|
+
self, location: int, buffer, length: int, count: int
|
|
326
|
+
) -> None:
|
|
327
|
+
"""Set the buffer to fill the uniform.
|
|
406
328
|
|
|
407
|
-
:param location:
|
|
408
|
-
:param buffer:
|
|
409
|
-
:param length:
|
|
410
|
-
:param count:
|
|
329
|
+
:param location: Location of the uniform variable to be modified.
|
|
330
|
+
:param buffer: Buffer object with format matching the uniform.
|
|
331
|
+
:param length: Size of the uniform data type.
|
|
332
|
+
:param count: Specifies the number of elements that are to be modified.
|
|
411
333
|
"""
|
|
412
334
|
|
|
413
335
|
class GPUShaderCreateInfo:
|
|
@@ -417,17 +339,16 @@ class GPUShaderCreateInfo:
|
|
|
417
339
|
"""compute shader source code written in GLSL.Example:`GLSL Cross Compilation <https://developer.blender.org/docs/features/gpu/glsl_cross_compilation/>`__
|
|
418
340
|
|
|
419
341
|
:param source: The compute shader source code.
|
|
420
|
-
:type source: str
|
|
421
342
|
"""
|
|
422
343
|
|
|
423
|
-
def define(self, name, value) -> None:
|
|
344
|
+
def define(self, name: str, value: str) -> None:
|
|
424
345
|
"""Add a preprocessing define directive. In GLSL it would be something like:
|
|
425
346
|
|
|
426
|
-
:param name:
|
|
427
|
-
:param value:
|
|
347
|
+
:param name: Token name.
|
|
348
|
+
:param value: Text that replaces token occurrences.
|
|
428
349
|
"""
|
|
429
350
|
|
|
430
|
-
def depth_write(self, value) -> None:
|
|
351
|
+
def depth_write(self, value: str) -> None:
|
|
431
352
|
"""Specify a depth write behavior when modifying gl_FragDepth.There is a common optimization for GPUs that relies on an early depth
|
|
432
353
|
test to be run before the fragment shader so that the shader evaluation
|
|
433
354
|
can be skipped if the fragment ends up being discarded because it is occluded.This optimization does not affect the final rendering, and is typically
|
|
@@ -436,7 +357,7 @@ class GPUShaderCreateInfo:
|
|
|
436
357
|
could still be performed while allowing the early depth test to operate.This function alters the behavior of the optimization to allow those operations
|
|
437
358
|
to be performed.
|
|
438
359
|
|
|
439
|
-
:param value: Depth write value. It can be
|
|
360
|
+
:param value: Depth write value. It can be UNCHANGED (default), ANY, GREATER or LESS.
|
|
440
361
|
:UNCHANGED: disables depth write in a fragment shader and execution of thefragments can be optimized away.
|
|
441
362
|
:ANY: enables depth write in a fragment shader for any fragments
|
|
442
363
|
:GREATER: enables depth write in a fragment shader for depth values thatare greater than the depth value in the output buffer.
|
|
@@ -444,12 +365,11 @@ class GPUShaderCreateInfo:
|
|
|
444
365
|
"""
|
|
445
366
|
|
|
446
367
|
def fragment_out(
|
|
447
|
-
self, slot: int, type: str, name: str, blend: str = "NONE"
|
|
368
|
+
self, slot: int, type: str, name: str, *, blend: str = "NONE"
|
|
448
369
|
) -> None:
|
|
449
370
|
"""Specify a fragment output corresponding to a framebuffer target slot.
|
|
450
371
|
|
|
451
372
|
:param slot: The attribute index.
|
|
452
|
-
:type slot: int
|
|
453
373
|
:param type: One of these types:
|
|
454
374
|
|
|
455
375
|
FLOAT
|
|
@@ -481,27 +401,28 @@ class GPUShaderCreateInfo:
|
|
|
481
401
|
IVEC4
|
|
482
402
|
|
|
483
403
|
BOOL
|
|
484
|
-
:type type: str
|
|
485
404
|
:param name: Name of the attribute.
|
|
486
|
-
:
|
|
487
|
-
:param blend: Dual Source Blending Index. It can be 'NONE', 'SRC_0' or 'SRC_1'.
|
|
488
|
-
:type blend: str
|
|
405
|
+
:param blend: Dual Source Blending Index. It can be NONE, SRC_0 or SRC_1.
|
|
489
406
|
"""
|
|
490
407
|
|
|
491
408
|
def fragment_source(self, source: str) -> None:
|
|
492
409
|
"""Fragment shader source code written in GLSL.Example:`GLSL Cross Compilation <https://developer.blender.org/docs/features/gpu/glsl_cross_compilation/>`__
|
|
493
410
|
|
|
494
411
|
:param source: The fragment shader source code.
|
|
495
|
-
:type source: str
|
|
496
412
|
"""
|
|
497
413
|
|
|
498
414
|
def image(
|
|
499
|
-
self,
|
|
415
|
+
self,
|
|
416
|
+
slot: int,
|
|
417
|
+
format: str,
|
|
418
|
+
type: str,
|
|
419
|
+
name: str,
|
|
420
|
+
*,
|
|
421
|
+
qualifiers: set[str] = {"NO_RESTRICT"},
|
|
500
422
|
) -> None:
|
|
501
423
|
"""Specify an image resource used for arbitrary load and store operations.
|
|
502
424
|
|
|
503
425
|
:param slot: The image resource index.
|
|
504
|
-
:type slot: int
|
|
505
426
|
:param format: The GPUTexture format that is passed to the shader. Possible values are:
|
|
506
427
|
|
|
507
428
|
RGBA8UI
|
|
@@ -568,7 +489,7 @@ class GPUShaderCreateInfo:
|
|
|
568
489
|
|
|
569
490
|
DEPTH32F_STENCIL8
|
|
570
491
|
|
|
571
|
-
DEPTH24_STENCIL8
|
|
492
|
+
DEPTH24_STENCIL8 (deprecated, use DEPTH32F_STENCIL8)
|
|
572
493
|
|
|
573
494
|
SRGB8_A8
|
|
574
495
|
|
|
@@ -588,10 +509,9 @@ class GPUShaderCreateInfo:
|
|
|
588
509
|
|
|
589
510
|
DEPTH_COMPONENT32F
|
|
590
511
|
|
|
591
|
-
DEPTH_COMPONENT24
|
|
512
|
+
DEPTH_COMPONENT24 (deprecated, use DEPTH_COMPONENT32F)
|
|
592
513
|
|
|
593
514
|
DEPTH_COMPONENT16
|
|
594
|
-
:type format: str
|
|
595
515
|
:param type: The data type describing how the image is to be read in the shader. Possible values are:
|
|
596
516
|
|
|
597
517
|
FLOAT_BUFFER
|
|
@@ -657,24 +577,19 @@ class GPUShaderCreateInfo:
|
|
|
657
577
|
DEPTH_CUBE
|
|
658
578
|
|
|
659
579
|
DEPTH_CUBE_ARRAY
|
|
660
|
-
:type type: str
|
|
661
580
|
:param name: The image resource name.
|
|
662
|
-
:type name: str
|
|
663
581
|
:param qualifiers: Set containing values that describe how the image resource is to be read or written. Possible values are:
|
|
664
582
|
- NO_RESTRICT
|
|
665
583
|
- READ
|
|
666
584
|
- WRITE
|
|
667
585
|
"""
|
|
668
586
|
|
|
669
|
-
def local_group_size(self, x: int, y: int =
|
|
587
|
+
def local_group_size(self, x: int, y: int = 1, z: int = 1) -> None:
|
|
670
588
|
"""Specify the local group size for compute shaders.
|
|
671
589
|
|
|
672
590
|
:param x: The local group size in the x dimension.
|
|
673
|
-
:
|
|
674
|
-
:param
|
|
675
|
-
:type y: int
|
|
676
|
-
:param z: The local group size in the z dimension. Optional. Defaults to -1.
|
|
677
|
-
:type z: int
|
|
591
|
+
:param y: The local group size in the y dimension. Optional. Defaults to 1.
|
|
592
|
+
:param z: The local group size in the z dimension. Optional. Defaults to 1.
|
|
678
593
|
"""
|
|
679
594
|
|
|
680
595
|
def push_constant(self, type: str, name: str, size: int = 0) -> None:
|
|
@@ -711,18 +626,14 @@ class GPUShaderCreateInfo:
|
|
|
711
626
|
IVEC4
|
|
712
627
|
|
|
713
628
|
BOOL
|
|
714
|
-
:type type: str
|
|
715
629
|
:param name: Name of the constant.
|
|
716
|
-
:type name: str
|
|
717
630
|
:param size: If not zero, indicates that the constant is an array with the specified size.
|
|
718
|
-
:type size: int
|
|
719
631
|
"""
|
|
720
632
|
|
|
721
633
|
def sampler(self, slot: int, type: str, name: str) -> None:
|
|
722
634
|
"""Specify an image texture sampler.
|
|
723
635
|
|
|
724
636
|
:param slot: The image texture sampler index.
|
|
725
|
-
:type slot: int
|
|
726
637
|
:param type: The data type describing the format of each sampler unit. Possible values are:
|
|
727
638
|
|
|
728
639
|
FLOAT_BUFFER
|
|
@@ -788,33 +699,27 @@ class GPUShaderCreateInfo:
|
|
|
788
699
|
DEPTH_CUBE
|
|
789
700
|
|
|
790
701
|
DEPTH_CUBE_ARRAY
|
|
791
|
-
:type type: str
|
|
792
702
|
:param name: The image texture sampler name.
|
|
793
|
-
:type name: str
|
|
794
703
|
"""
|
|
795
704
|
|
|
796
|
-
def typedef_source(self, source) -> None:
|
|
705
|
+
def typedef_source(self, source: str) -> None:
|
|
797
706
|
"""Source code included before resource declaration. Useful for defining structs used by Uniform Buffers.Example:
|
|
798
707
|
|
|
799
|
-
:param source:
|
|
708
|
+
:param source: The source code defining types.
|
|
800
709
|
"""
|
|
801
710
|
|
|
802
711
|
def uniform_buf(self, slot: int, type_name: str, name: str) -> None:
|
|
803
712
|
"""Specify a uniform variable whose type can be one of those declared in `gpu.types.GPUShaderCreateInfo.typedef_source`.
|
|
804
713
|
|
|
805
714
|
:param slot: The uniform variable index.
|
|
806
|
-
:type slot: int
|
|
807
715
|
:param type_name: Name of the data type. It can be a struct type defined in the source passed through the `gpu.types.GPUShaderCreateInfo.typedef_source`.
|
|
808
|
-
:type type_name: str
|
|
809
716
|
:param name: The uniform variable name.
|
|
810
|
-
:type name: str
|
|
811
717
|
"""
|
|
812
718
|
|
|
813
719
|
def vertex_in(self, slot: int, type: str, name: str) -> None:
|
|
814
720
|
"""Add a vertex shader input attribute.
|
|
815
721
|
|
|
816
722
|
:param slot: The attribute index.
|
|
817
|
-
:type slot: int
|
|
818
723
|
:param type: One of these types:
|
|
819
724
|
|
|
820
725
|
FLOAT
|
|
@@ -846,33 +751,26 @@ class GPUShaderCreateInfo:
|
|
|
846
751
|
IVEC4
|
|
847
752
|
|
|
848
753
|
BOOL
|
|
849
|
-
:type type: str
|
|
850
754
|
:param name: name of the attribute.
|
|
851
|
-
:type name: str
|
|
852
755
|
"""
|
|
853
756
|
|
|
854
757
|
def vertex_out(self, interface: GPUStageInterfaceInfo) -> None:
|
|
855
758
|
"""Add a vertex shader output interface block.
|
|
856
759
|
|
|
857
760
|
:param interface: Object describing the block.
|
|
858
|
-
:type interface: GPUStageInterfaceInfo
|
|
859
761
|
"""
|
|
860
762
|
|
|
861
763
|
def vertex_source(self, source: str) -> None:
|
|
862
764
|
"""Vertex shader source code written in GLSL.Example:`GLSL Cross Compilation <https://developer.blender.org/docs/features/gpu/glsl_cross_compilation/>`__
|
|
863
765
|
|
|
864
766
|
:param source: The vertex shader source code.
|
|
865
|
-
:type source: str
|
|
866
767
|
"""
|
|
867
768
|
|
|
868
769
|
class GPUStageInterfaceInfo:
|
|
869
770
|
"""List of varyings between shader stages."""
|
|
870
771
|
|
|
871
772
|
name: str
|
|
872
|
-
""" Name of the interface block.
|
|
873
|
-
|
|
874
|
-
:type: str
|
|
875
|
-
"""
|
|
773
|
+
""" Name of the interface block."""
|
|
876
774
|
|
|
877
775
|
def flat(self, type: str, name: str) -> None:
|
|
878
776
|
"""Add an attribute with qualifier of type flat to the interface block.
|
|
@@ -908,9 +806,7 @@ class GPUStageInterfaceInfo:
|
|
|
908
806
|
IVEC4
|
|
909
807
|
|
|
910
808
|
BOOL
|
|
911
|
-
:type type: str
|
|
912
809
|
:param name: name of the attribute.
|
|
913
|
-
:type name: str
|
|
914
810
|
"""
|
|
915
811
|
|
|
916
812
|
def no_perspective(self, type: str, name: str) -> None:
|
|
@@ -947,9 +843,7 @@ class GPUStageInterfaceInfo:
|
|
|
947
843
|
IVEC4
|
|
948
844
|
|
|
949
845
|
BOOL
|
|
950
|
-
:type type: str
|
|
951
846
|
:param name: name of the attribute.
|
|
952
|
-
:type name: str
|
|
953
847
|
"""
|
|
954
848
|
|
|
955
849
|
def smooth(self, type: str, name: str) -> None:
|
|
@@ -986,31 +880,26 @@ class GPUStageInterfaceInfo:
|
|
|
986
880
|
IVEC4
|
|
987
881
|
|
|
988
882
|
BOOL
|
|
989
|
-
:type type: str
|
|
990
883
|
:param name: name of the attribute.
|
|
991
|
-
:type name: str
|
|
992
884
|
"""
|
|
993
885
|
|
|
994
886
|
class GPUTexture:
|
|
995
|
-
"""This object gives access to
|
|
887
|
+
"""This object gives access to GPU textures."""
|
|
996
888
|
|
|
997
889
|
format: str
|
|
998
|
-
""" Format of the texture.
|
|
999
|
-
|
|
1000
|
-
:type: str
|
|
1001
|
-
"""
|
|
890
|
+
""" Format of the texture."""
|
|
1002
891
|
|
|
1003
892
|
height: int
|
|
1004
|
-
""" Height of the texture.
|
|
1005
|
-
|
|
1006
|
-
:type: int
|
|
1007
|
-
"""
|
|
893
|
+
""" Height of the texture."""
|
|
1008
894
|
|
|
1009
895
|
width: int
|
|
1010
|
-
""" Width of the texture.
|
|
896
|
+
""" Width of the texture."""
|
|
1011
897
|
|
|
1012
|
-
:
|
|
1013
|
-
|
|
898
|
+
def anisotropic_filter(self, use_anisotropic: bool) -> None:
|
|
899
|
+
"""Set anisotropic filter usage. This only has effect if mipmapping is enabled.
|
|
900
|
+
|
|
901
|
+
:param use_anisotropic: If set to true, the texture will use anisotropic filtering.
|
|
902
|
+
"""
|
|
1014
903
|
|
|
1015
904
|
def clear(
|
|
1016
905
|
self,
|
|
@@ -1020,10 +909,59 @@ class GPUTexture:
|
|
|
1020
909
|
"""Fill texture with specific value.
|
|
1021
910
|
|
|
1022
911
|
:param format: The format that describes the content of a single item.
|
|
1023
|
-
Possible values are FLOAT, INT, UINT, UBYTE, UINT_24_8
|
|
1024
|
-
|
|
912
|
+
Possible values are FLOAT, INT, UINT, UBYTE, UINT_24_8 & 10_11_11_REV.
|
|
913
|
+
UINT_24_8 is deprecated, use FLOAT instead.
|
|
1025
914
|
:param value: Sequence each representing the value to fill. Sizes 1..4 are supported.
|
|
1026
|
-
|
|
915
|
+
"""
|
|
916
|
+
|
|
917
|
+
def extend_mode(
|
|
918
|
+
self,
|
|
919
|
+
extend_mode: typing.Literal[
|
|
920
|
+
"EXTEND", "REPEAT", "MIRRORED_REPEAT", "CLAMP_TO_BORDER"
|
|
921
|
+
] = "EXTEND",
|
|
922
|
+
/,
|
|
923
|
+
) -> None:
|
|
924
|
+
"""Set texture sampling method for coordinates outside of the [0..1] uv range along
|
|
925
|
+
both the x and y axis.
|
|
926
|
+
|
|
927
|
+
:param extend_mode: the specified extent mode.
|
|
928
|
+
"""
|
|
929
|
+
|
|
930
|
+
def extend_mode_x(
|
|
931
|
+
self,
|
|
932
|
+
extend_mode: typing.Literal[
|
|
933
|
+
"EXTEND", "REPEAT", "MIRRORED_REPEAT", "CLAMP_TO_BORDER"
|
|
934
|
+
] = "EXTEND",
|
|
935
|
+
/,
|
|
936
|
+
) -> None:
|
|
937
|
+
"""Set texture sampling method for coordinates outside of the [0..1] uv range along the x axis.
|
|
938
|
+
|
|
939
|
+
:param extend_mode: the specified extent mode.
|
|
940
|
+
"""
|
|
941
|
+
|
|
942
|
+
def extend_mode_y(
|
|
943
|
+
self,
|
|
944
|
+
extend_mode: typing.Literal[
|
|
945
|
+
"EXTEND", "REPEAT", "MIRRORED_REPEAT", "CLAMP_TO_BORDER"
|
|
946
|
+
] = "EXTEND",
|
|
947
|
+
/,
|
|
948
|
+
) -> None:
|
|
949
|
+
"""Set texture sampling method for coordinates outside of the [0..1] uv range along the y axis.
|
|
950
|
+
|
|
951
|
+
:param extend_mode: the specified extent mode.
|
|
952
|
+
"""
|
|
953
|
+
|
|
954
|
+
def filter_mode(self, use_filter: bool) -> None:
|
|
955
|
+
"""Set texture filter usage.
|
|
956
|
+
|
|
957
|
+
:param use_filter: If set to true, the texture will use linear interpolation between neighboring texels.
|
|
958
|
+
"""
|
|
959
|
+
|
|
960
|
+
def mipmap_mode(self, use_mipmap: bool = True, use_filter: bool = True) -> None:
|
|
961
|
+
"""Set texture filter and mip-map usage.
|
|
962
|
+
|
|
963
|
+
:param use_mipmap: If set to true, the texture will use mip-mapping as anti-aliasing method.
|
|
964
|
+
:param use_filter: If set to true, the texture will use linear interpolation between neighboring texels.
|
|
1027
965
|
"""
|
|
1028
966
|
|
|
1029
967
|
def read(self) -> None:
|
|
@@ -1053,9 +991,7 @@ class GPUVertBuf:
|
|
|
1053
991
|
"""Insert data into the buffer for a single attribute.
|
|
1054
992
|
|
|
1055
993
|
:param id: Either the name or the id of the attribute.
|
|
1056
|
-
:type id: int | str
|
|
1057
994
|
:param data: Buffer or sequence of data that should be stored in the buffer
|
|
1058
|
-
:type data: Buffer | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[collections.abc.Sequence[int]] | collections.abc.Sequence[float] | collections.abc.Sequence[int]
|
|
1059
995
|
"""
|
|
1060
996
|
|
|
1061
997
|
class GPUVertFormat:
|
|
@@ -1065,17 +1001,13 @@ class GPUVertFormat:
|
|
|
1065
1001
|
"""Add a new attribute to the format.
|
|
1066
1002
|
|
|
1067
1003
|
:param id: Name the attribute. Often position, normal, ...
|
|
1068
|
-
:type id: str
|
|
1069
1004
|
:param comp_type: The data type that will be used store the value in memory.
|
|
1070
|
-
Possible values are I8, U8, I16, U16, I32, U32, F32
|
|
1071
|
-
:type comp_type: str
|
|
1005
|
+
Possible values are I8, U8, I16, U16, I32, U32, F32 & I10.
|
|
1072
1006
|
:param len: How many individual values the attribute consists of
|
|
1073
1007
|
(e.g. 2 for uv coordinates).
|
|
1074
|
-
:type len: int
|
|
1075
1008
|
:param fetch_mode: How values from memory will be converted when used in the shader.
|
|
1076
1009
|
This is mainly useful for memory optimizations when you want to store values with
|
|
1077
1010
|
reduced precision. E.g. you can store a float in only 1 byte but it will be
|
|
1078
1011
|
converted to a normal 4 byte float when used.
|
|
1079
1012
|
Possible values are FLOAT, INT or INT_TO_FLOAT_UNIT.
|
|
1080
|
-
:type fetch_mode: str
|
|
1081
1013
|
"""
|