Age | Commit message (Collapse) | Author |
|
|
|
Support RNA types using the Py/C-API PyGetSetDef defined properties.
Currently `WindowManager.clipboard` is the only instance of this.
|
|
Accessing context members depended on `ctypes` to access symbols
which were hidden for macOS & WIN32.
Add an API call that doesn't require the symbols to be exported.
This allows most symbols to be hidden on Linux, see D14971.
|
|
Report when the PYTHONPATH is expected to be used to help debug Python
initialization issues (see T98131).
|
|
|
|
|
|
Also add missing task-ID reference & remove colon after \note as it
doesn't render properly in doxygen.
|
|
|
|
acceleration, lens length, and power
`TEMPERATURE` type was also missing, not only the new-ish
`TIME_ABSOLUTE` one...
Added a static assert on the size of the `bpyunits_ucategories_items`
array, and a comment on anonymous enum of `B_UNIT_`, in the hope this
won't happen again in the future.
|
|
|
|
python API
Adds an example python script to the documentation for the 3D_IMAGE shader.
The **use-case** is to draw textures with 3D vertex positions, in XR views as well as non-XR views (in a simpler manner).
**Testing**: I've tested that this compiles and works on my Macbook (with the example python script included in this change). I don't have access to a Windows or Linux machine right now, but this change doesn't look platform-specific and no new glsl shaders have been added or edited by this change. I'll try to get access to a Windows machine, but if someone does have one, I'd be really grateful if they could try this change. Thanks!
**Problem addressed**: The existing 2D_IMAGE shader (exposed in the python API) gets near-clipped when drawn in the
XR view, regardless of the near-clip settings. Additionally, the 2D_IMAGE shader only accepts 2D
positions for the image vertices, which means drawing textures in 3D requires providing
2D coordinates and then pushing a transform-rotate-scale matrix to the GPU, even for
non-XR (i.e. WINDOW) views. The 3D_IMAGE shader is simpler: it accepts 3D vertex positions, and doesn't require
any additional work by the scripter.
**Workaround**: The current workaround is to use custom shaders in the python script.
**Non-intrusive change**: No new glsl shaders were added. This change just bundles two existing shaders: the vertex shader used
by the 3D_IMAGE_MODULATE_ALPHA shader, and the fragment shader used by the 2D_IMAGE shader.
Reviewed By: #eevee_viewport, jbakker
Differential Revision: https://developer.blender.org/D14832
|
|
|
|
Related to T95616, the relationship between Image ID and ImBuf 'cached'
buffers can be fairly confusing when using the RNA API.
Reviewed By: campbellbarton, jbakker
Differential Revision: https://developer.blender.org/D14833
|
|
|
|
|
|
The previous docs for `normal_update` methods of `BMVert`, `BMEdge`,
`BMFace`, and `BMesh` were not clear on some behaviors. These
behaviors are listed in D14370. This commit updates the docs to be
clearer.
Reviewed By: Blendify
Differential Revision: https://developer.blender.org/D14370
|
|
|
|
Regression caused by [0] that caused the error message to be
created based on a normalized exception (which hid line numbers).
PyC_ExceptionBuffer{_Simple} & BPy_errors_to_report
no longer clears the exception.
This could have been resolved by changing python_script_error_jump
however that would involve changes to reference counting that are more
risky (noted in code-comment).
[0]: 2d2baeaf04d481f284bc2f098fb6d7ee9268151f
|
|
|
|
|
|
Add missing check as the context override dict may have been copied
since it was assigned, also initialize the context manager with
PyType_Ready, while it didn't cause any errors - it's expected
that all types are initialized.
|
|
|
|
Support methods being used as persistent callbacks.
Resolves T97555.
|
|
|
|
As `GPU_PRIM_LINE_LOOP` is not supported on Vulkan or Metal and
`GPU_PRIM_TRI_FAN` is not supported on Metal, they will be removed in
future releases.
So it is important to inform users that they are obsolete and may not
be supported for a long time.
Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D14679
|
|
The "PROP" in the name reflects its generic status, and removing
"LOOP" makes sense because it is no longer associated with just
mesh face corners. In general the goal is to remove extra semantic
meaning from the custom data types.
|
|
- Increase the stack level so the reported line number references
script authors code (not Blender's wrapper function).
- Include the operator name and poll/call usage in the warning.
|
|
|
|
Support a way to temporarily override the context from Python.
- Added method `Context.temp_override` context manager.
- Special support for windowing variables "window", "area" and "region",
other context members such as "active_object".
- Nesting context overrides is supported.
- Previous windowing members are restored when the context exists unless
they have been removed.
- Overriding context members by passing a dictionary into operators in
`bpy.ops` has been deprecated and warns when used.
This allows the window in a newly loaded file to be used, see: T92464
Reviewed by: mont29
Ref D13126
|
|
These functions can be used with PyArg_ParseTupleAndKeywords
(and related functions) to take typed RNA arguments without
having to extract and type-check them separately.
No functional changes, extracted from D13126.
|
|
Since shader sources are now parsed on demand via `GPUShaderCreateInfo`,
sources are not available to be read via
`GPU_shader_get_builtin_shader_code`.
Currently this results in a crash as the code tries to read `NULL`
pointers.
`GPU_shader_get_builtin_shader_code` was created with the intention of
informing the user how a builtin shader works, thus "replacing"
detailed documentation.
Therefore this function doesn't really have a practical use in an addon.
So, instead of updating the function (which would require several
changes to the gpu module), remove it and improve the documentation.
Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API#Breaking_Changes
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D14678
|
|
Recent addition to the Python API [0] didn't follow this convention.
See [1] for the rationale behind this change.
[0]: 9bc678969aaef5e2343d9362648e9a633d1b6e5e
[1]: 982aea88e0d74020c62c2054a45eeafa56c8ca30
|
|
|
|
`GPU_shader_get_uniform_block` is marked as deprecated and the value
returned does not match what `GPU_uniformbuf_bind` expects.
Also, small typo fix in python error message.
Differential Revision: https://developer.blender.org/D14638
|
|
|
|
Also ensure space around text in C-comment blocks.
|
|
Since uniform buffers are generally structs and not sequences,
`BPyGPU_BufferType` objects are not suitable for filling the buffer.
|
|
Use the `flags` parameter to avoid unnecessary allocations.
|
|
It was being wrongly multiplied by 2.
|
|
|
|
The `clear` method can be called before dealloc, which can
mislead buffer ownership.
|
|
In order to allow GLSL Cross Compilation across platforms, expose in
Python the `GPUShaderCreateInfo` strategy as detailed in
https://wiki.blender.org/wiki/EEVEE_%26_Viewport/GPU_Module/GLSL_Cross_Compilation
The new features can be listed as follows:
```
>>> gpu.types.GPUShaderCreateInfo.
define(
fragment_out(
fragment_source(
push_constant(
sampler(
typedef_source(
uniform_buf(
vertex_in(
vertex_out(
vertex_source(
>>> gpu.types.GPUStageInterfaceInfo.
flat(
name
no_perspective(
smooth(
>>> gpu.shader.create_from_info(
```
Reviewed By: fclem, campbellbarton
Differential Revision: https://developer.blender.org/D14497
|
|
64cd927519748bbd50 didn't update the argument parsing strings,
and updated the docstring of `from_object` incorrectly.
Fixes T97025, T97213
|
|
Alignment with `vec4` is a requirement in C++, so it should be a
requirement in Python as well.
|
|
Buffer creation may crash when passed a PyBuffer with no `shape` defined.
(Which is common for strucs).
|
|
This simply adds access to the vertex crease layer from Python
code. Documentation was modified to remove "Edge" as it is
shared between edges and vertices, similarly to bevel weights.
Differential Revision: https://developer.blender.org/D14605
|
|
- Missing star prefix.
- Unnecessary indentation.
- Blank line after dot-points
(otherwise doxygen merges with the previous dot-point).
- Use back-slash for doxygen commands.
- Correct spelling.
|
|
This is the convention for most parts of Blender Python API.
|
|
With the increased use of multi-character format units and keyword-only
arguments these are increasingly difficult to make sense of.
Split the string onto multiple lines, one per argument.
While verbose it's easier to understand and add new arguments.
|
|
No functional changes.
|