Age | Commit message (Collapse) | Author |
|
Without this, the ImBuf type wasn't part of documentation.
|
|
This reverts commit d3a96e5022e121426c8926d0507effe4e9b4005f.
|
|
|
|
There are fewer python callbacks than `ARegionType`s.
This also broke GTests's `bf_blenderloader_tests`.
|
|
When closing the blender, while the callbacks are removed, the
reference count of the object used as `customdata` is not decremented.
This commit adds two functions that correctly release the
python `draw_callbacks` before releasing all `draw_callbacks`.
Differential Revision: https://developer.blender.org/D10478
|
|
|
|
Even though this might change, rigify, animation-nodes & translation
extraction depend on being able to extract this information.
|
|
Currently the GPU module for python has different ways to handle enums.
- Organizing items in `PyC_StringEnumItems` arrays and parsing them with `PyC_ParseStringEnum`.
- Using dedicated functions for each type of enum (`bpygpu_ParsePrimType`, `pygpu_ParseVertCompType` and `pygpu_ParseVertFetchMode`).
Although apparently more efficient (especially `pygpu_ParseVertCompType`
which transforms strings into integers for simple comparison), these
dedicated functions duplicate functionality, increase the complexity of
the code and consequently make it less readable.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10456
|
|
Reference counting error in dc61a63e3f1bb3773677fb009fd787af7bd5c727
|
|
Regression from cafd6b519c5f5c4b67d0dfe3d453cd4223b38716.
D10494 by @ysano with edits.
|
|
Support Python 3.10a5 or 3.9x with support explicitly enabled.
- Enable Python's postponed annotations for Blender's RNA classes
types registered on startup.
- Using postponed annotations has implications for how they are defined,
since they must evaluate in the modules name-space instead of the
classes name-space. See changes to annotations in `release/scripts`.
- Use `from __future__ import annotations` at the top of the module
to ensure the script will run with Python 3.10.
- Old logic is kept since it could be used if PEP-649 is supported.
Resolves T83626
Ref D10474
|
|
While not needed for Blender, Animation Nodes uses this information,
expose this information for scripts to access that need it.
|
|
This is needed to support Python 3.10's Postponed annotation evaluation.
It also simplifies type checking.
|
|
|
|
|
|
C/Python defined types were accessible but not exposed in dir(bpy.types)
|
|
This is needed to support `typing.get_type_hints`,
which expects each classes module to have a module '__dict__'.
|
|
|
|
This was added to assist upgrading scripts to Blender 2.8x,
now 2.9x is released there is no need to keep this block.
|
|
|
|
This matches nearly all other argument ordering in Blender,
including Python mathutils API.
|
|
|
|
|
|
From the the opengl wiki:
> Buffer objects are associated with a program's uniform block similarly to the way that texture objects are associated with sampler uniforms.
|
|
|
|
This commit extends the gpu python API with:
```
gpu.types.Buffer #"__init__", "to_list"
gpu.types.GPUTexture #"__init__", "clear", "read", "format"
gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__", "__exit__" with "GPUFrameBufferStackContext")
gpu.types.GPUUniformBuf #"__init__", "update"
gpu.state #"blend_set", "blend_get", "depth_test_set", "depth_test_get", "depth_mask_set", "depth_mask_get", "viewport_set", "viewport_get", "line_width_set", "line_width_get", "point_size_set", "color_mask_set", "face_culling_set", "front_facing_set", "program_point_size_set"
```
Add these methods to existing objects:
```
gpu.types.GPUShader #"uniform_sample", "uniform_buffer"
```
Maniphest Tasks: T80481
Differential Revision: https://developer.blender.org/D8826
|
|
`py_` prefix can be confused with the Python's own API's.
|
|
Replace deprecated _PyUnicode_AsString{AndSize} usage.
T83626 still needs to be resolved before 3.10 is usable.
|
|
Use Python 3.8's API for setting the initial configuration.
This replaces a mix of our logic and direct calls to the Python API
and has no user visible changes.
Using the Python API makes the logic easier to follow and provides
utilities such as `PyConfig_SetBytesArgv`
that wasn't available in previous releases.
Note that this uses Python's utf8/wchar_t conversions,
which used to cause problems (see T31506).
Since `Py_UTF8Mode` was set, the systems locale isn't used for decoding,
allowing us to use Python's utility functions that call
`Py_DecodeLocale` internally.
Ref D10382
|
|
|
|
This removes Python version checks needed to build with 3.8+ and 3.7x.
Ref D10381
|
|
It was not following the own documentation at the top code that mentions
that for local API the prefix is "bpygpu_".
|
|
|
|
Caused by rB5b34d11b55e0.
Above commit restored the view matrices in ED_view3d_draw_offscreen
_before_ they can be stored in the ImBuff (see ED_view3d_draw_offscreen
/ texture_paint_image_from_view_exec).
Now make restoring the view matrices optional and dont do this in case
of reprojection, so the used matrices can still be saved in the ImBuff
later.
Reviewed By: campbellbarton
Maniphest Tasks: T85395
Differential Revision: https://developer.blender.org/D10331
|
|
Approximately 91 spelling corrections, almost all in comments.
Differential Revision: https://developer.blender.org/D10288
Reviewed by Harley Acheson
|
|
|
|
|
|
Use the more common abbreviation for `implementation`.
|
|
|
|
Differential Revision: https://developer.blender.org/D10237
|
|
Removed the `--debug-gpu-shaders` argument in bc94036a76b6 but forgot to amend
these changes.
|
|
Removes two unused --debug-gpu command line flags (unused as in, does nothing):
* `--debug-gpumem`: Unused since c08d84748804, the info is now available in
the status-bar if enabled in the Preferences. Initially added in
fec317de8d57.
* `--debug-gpu-shaders`: Unused since 216d78687d2b, double checked with
Clément, he says it's not that useful nowadays. Initially added in
fec317de8d57.
Addresses T83954 and T83953.
Differential Revision: https://developer.blender.org/D10244
Reviewed by: Clément Foucault
|
|
|
|
|
|
System encoding issues have been a paint-point for us with Python 3,
since Blender always uses UTF-8 which might not be the case for the OS.
While the Py_SetStandardStreamEncoding was already set to utf-8,
the file-system could still have an incompatible encoding.
See PEP-540 for details.
|
|
|
|
Off-screen drawing doesn't work once the 'bgl' workaround is enabled.
Disable this for off-screen drawing.
|
|
Comment blocks not conforming to convention.
|
|
The deform parameter of the Bmesh from_object method is deprecated,
always assumed to be True, and will be removed in version 3.0.
That is because the cases where it is False don't work correctly and are
subject to memory leaks. One of the symptoms of the incorrect behavior
is the application of constructive modifiers twice if the input object
is an evaluated one, as demonstrated in D10053.
Reviewed By: Brecht
Differential Revision: https://developer.blender.org/D10086
|
|
The Bmesh from_object method applies modifiers twice when the input
deform is enabled and the input depsgraph is a render one.
The evaluated object already have modifiers applied, and
mesh_create_eval_final() applies modifiers again. To fix this, the
BKE_mesh_new_from_object() function is used instead.
Reviewed By: Brecht
Differential Revision: https://developer.blender.org/D10053
|