Commit Graph

1281 Commits

Author SHA1 Message Date
Jure Triglav 319ff28b7b Initial exposure of compute dispatch and image store in Python API
Motivation: When discussing with @Jeroen-Bakker and @aras_p about how to
approach sorting when rendering Gaussian splats in Blender, we realised that
compute shaders could help there (and have many other use cases), and that also
due to Blender 4.0 being on OpenGL >= 4.3, we can now rely on compute shaders
existing.

This PR is an initial pass for that functionality. It comes with a Python example, which
runs a compute shader and saves the output to a texture, which is then rendered in the
viewport.

There is no exposed support for storage buffers yet, but I expect I'll be able to work on
them soon if this is accepted.

The newly added parts are:
1. `gpu.compute.dispatch()`
2. a way set the compute source to `GPUShaderCreateInfo`: `shader_info.compute_source()`
3. a way to set the image store for `GPUShaderCreateInfo`: `shader_info.image()`
4. a way to set the `local_group_size` for `GPUShaderCreateInfo`: `shader_info.local_group_size(x,y,z)`
5. a way to get `max_work_group_size` from capabilities: `gpu.capabilities.max_work_group_size_get(index)`
6. a way to get `max_work_group_count` from capabilities: `gpu.capabilities.max_work_group_count_get(index)`

Pull Request: https://projects.blender.org/blender/blender/pulls/114238
2023-11-23 14:23:26 +01:00
HurricanePootis 70e2c0bcd4 Fix #115056: man page generation fails with Python error
Need to convert byte to string.

Pull Request: https://projects.blender.org/blender/blender/pulls/115127
2023-11-22 20:00:58 +01:00
Omar Emara 37da2ac881 Merge branch 'blender-v4.0-release' 2023-11-01 10:33:27 +02:00
Campbell Barton 960e2c73de Docs: improve bpy.app.driver_namespace, add stub example
The description first described functionality that doesn't work properly.
Prefer text that is to the point with what works well, elaborating on
error prone & partially working solutions afterwards.

Also include a stub example for script authors who prefer to develop &
maintain their scripts outside of Blender.
2023-11-01 14:06:46 +11:00
Campbell Barton acc06592fe Merge branch 'blender-v4.0-release' 2023-10-31 21:49:35 +11:00
Campbell Barton 592345631a Docs: improve wording for bpy.app.driver_namespace 2023-10-31 21:48:30 +11:00
Campbell Barton f60d1b3537 Merge branch 'blender-v4.0-release' 2023-10-31 21:36:37 +11:00
Campbell Barton ea86a77bc5 Docs: add notes on populating bpy.app.driver_namespace
Address issues raised by #114155.

Also fix sphinx documentation generation using incorrect identifiers
when looking up references from PyStruct types
(was looking for `bpy.app.bpy.app.driver_namespace.py`).
2023-10-31 21:34:32 +11:00
Brecht Van Lommel 39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb.

After this commits from main were pushed to blender-v4.0-release. These are
being reverted.

Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
2023-10-30 21:40:35 +01:00
Campbell Barton 64d5938662 Merge branch 'blender-v4.0-release' 2023-10-24 14:13:43 +11:00
Campbell Barton 0ff1414f04 Docs: update bpy documentation, referencing PIP which is now supported
Resolve #114076.
2023-10-24 14:10:34 +11:00
Thomas Dinges 673ad635f5 Release cycle: Bcon1 for Blender 4.1 2023-09-27 12:49:46 +02:00
Bogdan Nagirniak c0a0de617c Hydra: export Blender shader nodes as MaterialX node graph
This adds initial support for rendering Cycles and EEVEE shaders in Hydra
render engines that support MaterialX. Not all nodes are currently
supported, see the detailed compatibility list in #112864.

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl Pidhirskyi <vpidhirskyi@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/111765
2023-09-26 18:52:41 +02:00
Julian Eisel aaefb0249c Fix documentation build (validation?) error
Necessary after 974d70918b and ca58f97cda.
2023-09-19 17:14:31 +02:00
Campbell Barton 7eb0b6cce9 Docs: remove references to "tessface" 2023-09-13 13:31:34 +10:00
Campbell Barton 09f61f6881 Cleanup: enforce documented convention for RNA enum naming
This was noted in code comments and checked in Python documentation
generation but not at build time.

Since these enums are identifiers that end up included in various places
enforce the `rna_enum_*_items` convention which was noted as
the convention but not followed strictly.

Partially reverts [0], avoids having to deal with multiple prefix types.

[0]: 3ea7117ed1
2023-08-25 13:35:58 +10:00
Campbell Barton 3de8900ed6 Cleanup: spelling in comments 2023-08-25 09:40:42 +10:00
Campbell Barton a13823057c Cleanup: format 2023-08-24 11:37:29 +10:00
demeterdzadik@gmail.com fa09ffc585 Document 110239: How callbacks work on Operator properties
After writing add-ons for like the past 8 years, I didn't realize that the first parameter of update callbacks of operator properties, conventionally named `self` is not actually what a Python coder would expect from a variable named `self`. I tried to document that here.

This is in response to [what I thought was a bug](https://projects.blender.org/blender/blender/issues/110239).

Pull Request: https://projects.blender.org/blender/blender/pulls/110242
2023-08-23 18:59:58 +02:00
Aaron Carlisle 3a99e8898c PyAPI Docs: Update Sphinx and theme
Updates sphinx and the them to the latest versions

This commit also removes 'babel' from the list of requirements, babel is only important for internationalization.
2023-08-16 17:50:37 -04:00
Aaron Carlisle 3ea7117ed1 PyAPI Docs: Fix generation after recent node RNA changes
This commit allows both `rna_enum_` and `rna_node_`to be used for enum prefixes

This also fixes one enum by adding `rna_` to the prefix.

Together these changes fix the API documentation generation.
2023-08-16 17:37:41 -04:00
Campbell Barton 92c4756d02 Fix replacement of "Blender Foundation" in recent header change
The recent change to header copyrights [0] unintentionally changed
"Blender Foundation" to "Blender Authors" for the WIN32 file path
which blender is installed into.

Revert lines changed that aren't related to copyright text.

[0]: e955c94ed3
2023-08-16 21:21:55 +10:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Jacques Lucke cc4d5c432c RNA: move headers to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/111022
2023-08-10 22:40:27 +02:00
Campbell Barton faaac97239 Cleanup: format 2023-08-09 10:46:10 +10:00
Michael Kowalski ecb3262bf0 USD export: prototype invoking Python chasers
This commit allows invoking user-defined Python 'hook' functions to extend
the USD export functionality.

Added support for registering subclasses of a new bpy.types.USDHook
type which may implement the hooks as member functions.  Supported
hook functions are on_export() and on_material_export().  Also added
definitions and Python registration for USDSceneExportContext and
USDMaterialExportContext structs that encapsulate arguments
to these functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/108823
2023-08-07 23:02:47 +02:00
Brecht Van Lommel 3549e1fd40 Fix mistake in bpy.types.HydraRenderEngine API example 2023-08-07 15:09:51 +02:00
Bogdan Nagirniak 04bb5f9995 Render: support USD Hydra render delegates
Hydra is a rendering architecture part of USD, designed to abstract the
host application from the renderer. A renderer implementing a Hydra
render delegate can run in any host application supporting Hydra, which
now includes Blender.

For external renderers this means less code to be written, and improved
performance due to a using a C++ API instead of a Python API.

Add-ons need to subclass bpy.types.HydraRenderEngine. See the example in
the Python API docs for details.

An add-on for Hydra Storm will be included as well. This is USD's
rasterizing renderer, used in other applications like usdview. For users
it can provide a preview of USD file export, and for developers it
serves a reference.

There are still limitations and missing features, especially around
materials. The remaining to do items are tracked in #110765.

This feature was contributed by AMD.

Ref #110765

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl-Pidhirskyi <vpidhirskyi@gmail.com>
Co-authored-by: Brian Savery <brian.savery@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/104712
2023-08-04 17:01:09 +02:00
Campbell Barton f7be60eff0 Cleanup: format 2023-08-04 08:46:18 +10:00
Alexander Gavrilov 36c6bcca1a Python API: expose the math mapping vertex positions to B-Bone segments.
Recently a user expressed interest in exporting baked animation
with B-Bone segments. Currently the python API already exposes
segment matrices via a PoseBone method, but there is no access
to the mapping of vertices to the segments.

Although currently the math is simple and easy to re-implement,
forcing Python add-ons to do that would cause a maintenance issue
if the mapping is ever changed later (it's quite dumb, ignoring
the rest pose curve, and there definitely is room for improvement).

This patch extracts the relevant math into a BKE function, and
exposes it in the python API as a new PoseBone method.

Pull Request: https://projects.blender.org/blender/blender/pulls/105419
2023-08-03 14:44:39 +02:00
Sergey Sharybin 73d22c4c4f Fix: API doc generation for bmesh opdefines
A continuation of the previous change. It was not enough to
simply point the script to the new file, the actual parsing
needed to be updated as well.

This is a minimalistic change which converts the file to the
old C-style format, just to restore the working state of the
CI/CD.

It is a bit fragile, and surely a more future-proof solution
is possible to work on.

Pull Request: https://projects.blender.org/blender/blender/pulls/110536
2023-07-27 15:58:29 +02:00
Sergey Sharybin 6b9da41221 Fix doc builder using C version of bmesh_opdefines
The file bmesh_opdefines.c was recently converted to bmesh_opdefines.cc,
but the manual builder was not updated accordingly.

Also, update some comments in the code which were still mentioning the C
version of this file.

Pull Request: https://projects.blender.org/blender/blender/pulls/110532
2023-07-27 14:49:00 +02:00
Campbell Barton 1c104b16dd Cleanup: use set.discard instead of a __contains__ check before remove() 2023-07-02 19:54:27 +10:00
Sergey Sharybin fa5a8b3769 Fix documentation building since recent changes in GPv3
The #109197 introduced the following error to the documentation
builders:

  Error: context key 'grease_pencil' not found in context_type_map; update ../doc/python_api/sphinx_doc_gen.py

To reproduce the issue locally the following command could be
used:

```
./bin/Blender.app/Contents/MacOS/Blender \
    --background \
    --factory-startup \
    -noaudio \
    --python ../../blender/doc/python_api/sphinx_doc_gen.py -- \
    --output ./sphinx/build_doc_api \
    --api-changelog-generate \
    --api-dump-index-path \
    ./sphinx/api_dump_index.json
```

Note that even after this fix the command from above would still
fail locally because the script expect information from previous
Blender version to be in the index. It is possible to bypass by
manually editing api_dump_index.json and adding 3.6 key.

Pull Request: https://projects.blender.org/blender/blender/pulls/109365
2023-06-26 11:34:54 +02:00
Campbell Barton 65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Campbell Barton 61d99d450e manpage: use bpy.app.help_text() for manual text extraction
Call Blender directly to generate the man-page,
instead of relying on the systems Python which called Blender twice and
processed it's output.
2023-05-27 17:55:57 +10:00
Campbell Barton 823685db76 Cleanup: consistent doxygen comment blocks
Also remove doxygen block for comments in a functions body.
2023-05-27 15:10:58 +10:00
Josh Maros 6ba0346797 Python API: add bpy.context.property, for property under the mouse cursor
This can be useful for example to add custom operators to the property
context menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/107280
2023-05-26 21:33:26 +02:00
Campbell Barton 60d97fb5fa Fix man-page generation when ASAN_OPTIONS included strict_init_order
The install target would fail when ASAN_OPTIONS was set for the
environment that launched the build.

Resolve by explicitly overriding these settings.
2023-05-24 21:54:54 +10:00
Campbell Barton 495e4f2d0e PyAPI: remove deprecated 2D_/3D_ prefix (update docs) 2023-05-23 16:24:08 +10:00
Campbell Barton 9a8fd2f1dd PyAPI: remove deprecated 2D_/3D_ prefix for built-in shader names
Names passed to gpu.shader.from_builtin()
no longer skip the 2D_/3D_ prefix.
2023-05-23 15:51:54 +10:00
Campbell Barton ac263a9bce PyAPI: remove context override argument from bpy.ops
Remove deprecated context override argument to operator execution and
poll() method in favor of context.temp_override().
2023-05-23 14:34:09 +10:00
Campbell Barton 9357f7b606 PyAPI: remove deprecated blf.size() dpi argument
Scripts can be updated by scaling the font size, e.g.

blf.size(id, size, dpi) -> blf.size(id, size * (dpi / 72.0))
2023-05-23 12:02:10 +10:00
Thomas Dinges 7be3a0a727 Release cycle: Bcon1 for Blender 4.0, alpha. 2023-05-17 12:39:01 +02:00
Campbell Barton 557344b64c Cleanup: correct UTF8 code-commets, remove imbdds reference 2023-05-13 17:34:25 +10:00
Campbell Barton 09a2b5c70f Docs: note that renaming data-blocks sorted them which impacts iteration
Address issue raised in #107027.
2023-04-21 20:36:29 +10:00
Campbell Barton c4c1cc7cd3 Cleanup: double quotes for non-enum strings
Also use back-ticks for code-references in comments.
2023-04-18 10:51:32 +10:00
Aaron Carlisle d727f64ad2 PyAPI DocS: Fix source code link markup
FIxes https://projects.blender.org/blender/blender/issues/106212#
2023-04-05 22:27:51 -04:00
Aaron Carlisle 809a336a3d Merge branch 'blender-v3.5-release' 2023-03-07 20:06:05 -05:00
Aaron Carlisle d6d2e98e5e PyAPI Docs: Fix Broken link to source files
With the move to Gitea the URI for line numbers changed from `$1234` to `#L1234`.

The change also removes a superfluous space character from the generated RST syntax.
2023-03-07 20:03:07 -05:00
Campbell Barton e1ab9e352c Cleanup: autopep8 2023-03-01 22:12:18 +11:00
Sergey Sharybin ecb88eff7e Merge branch 'blender-v3.5-release' 2023-02-21 16:41:47 +01:00
Sergey Sharybin 03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00
Julian Eisel c437a8aea8 Revert release branch only commit after merge
This is a revert of a revert, because the initial revert is only
supposed to be in the release branch.

This reverts commit 3eed00dc54.
2023-02-20 11:51:16 +01:00
Julian Eisel 3eed00dc54 Revert "GPencil: Include UV information in simplify->sample modifier."
This reverts commit 19222627c6.

Something went wrong here, seems like this commit merged the main branch
into the release branch, which should never be done.
2023-02-20 11:20:07 +01:00
YimingWu 19222627c6 GPencil: Include UV information in simplify->sample modifier.
Simplify modifier sample mode didn't transfer UV parameters, now fixed.

Pull Request #104942
2023-02-19 11:45:22 +01:00
Dalai Felinto 4ec9aff2af Revert "Fix #104850: Create Geometry Nodes operators fails if not in English"
This reverts commit 68181c2560.

I merged 3.6 into 3.5 by mistake. Basically I had a PR against main,
 then changed it in the last minute to be against 3.5 via the
 web-interface unaware that I shouldn't do it without updating the
 patch.

 Original Pull Request: #104889
2023-02-17 18:45:42 +01:00
Dalai Felinto 68181c2560 Fix #104850: Create Geometry Nodes operators fails if not in English
Note that the node group has its sockets names
translated, while the built-in nodes don't.

So we need to use data_ for the built-in nodes names,
and the sockets of the created node groups.

Pull Request #104889
2023-02-17 18:39:17 +01:00
Campbell Barton d851c91856 PyDocs: update links in generated API docs for GITEA migration
- Correct broken link for undocumented modules.
  Point to the contributing page, it seems #51062 was lost with the
  GITEA task migration.
- Correct Blender Version link to the SHA1.
2023-02-14 12:41:51 +11:00
Campbell Barton 91346755ce Cleanup: use '#' prefix for issues instead of 'T'
Match the convention from Gitea instead of Phabricator's T for tasks.
2023-02-12 14:56:05 +11:00
Sergey Sharybin bd6b0bac88 Update references to the new projects platform and main branch 2023-02-07 14:18:19 +01:00
Campbell Barton db8b5a2316 PyDoc: remove deprecated dpi argument from BLF example 2023-02-07 15:12:05 +11:00
Campbell Barton 92734d868b PyDoc: resolve bpy.types & bpy.ops expanding sub-modules inline
The bpy.types page was unreasonably long (over 17k lines).
Resolve by setting the `maxdepth` for this and the `bpy.ops` page too.

This problem showed up in v3.4 release and may be caused by changes
to Sphinx's default behavior as there doesn't seem to be any change
that would cause this in the generated docs.
2023-01-20 14:04:34 +11:00
Damien Picard 30c90f0ad0 Cleanup: Replace "UV's" with "UVs"
An apostrophe should not be used because it is not a mark of plural,
even for initialisms. This involves mostly comments, but a few UI
messages are affected as well.

Differential Revision: https://developer.blender.org/D16749
2023-01-10 14:50:13 -05:00
Alexander Gavrilov 7be5ca63ae Python API Docs: explain the CANCELLED return code of operators.
The effect of CANCELLED on the undo stack is quite obscure, and
mistakenly using it after doing some changes causes confusing
behavior. It's better to describe it explicitly in the docs.
2022-12-26 14:47:38 +02:00
Campbell Barton 530b232309 Cleanup: use more descriptive name for function in BMesh doc generation
Avoid the term "print" as the function doesn't print.
2022-12-15 12:02:57 +11:00
Campbell Barton a5d391919c Cleanup: format 2022-12-08 13:46:26 +11:00
Michal Srb be5afe9987 PyAPI Docs: Add default values for bmesh API
This diff improves the docs for bmesh by adding the default values to all methods. This is motivated by this issue https://github.com/nutti/fake-bpy-module/issues/118 in fake-bpy-module which generates a typed API for authoring Blender scripts and addons from the docs.

After this diff gets merged, the Blender docs get updated, and `fake-bpy-module` gets regenerated, the type signatures in `fake-bpy-module` will match the reality of Blender's API.

Here's a diff for the docs using the modified script:
https://gist.github.com/xixixao/1c83153adbcefbe0859f9cc9ba757d46

I "hardcoded" the defaults based on the types of the arguments, after some testing and consulting the Blender .c source for these APIs.

Here's a test script that verifies that the arguments with defaults added in this diff are indeed not required by Blender 3.3: https://gist.github.com/xixixao/adc4e5a076e80a63735bd60c7c9e7a0d

I made the minimum changes required to get this doc generation script fixed, but let me know if I should restructure this script more.

I also amended the comments of three args, 2 to align them with Python (NULL -> None) and one to mark it as optional (CurveProfile).

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D16400
2022-12-07 15:48:41 -06:00
Bastien Montagne 429771fed5 Add 'work around' to accessing data from volatile iterators in py API.
Re T102550.
2022-11-30 17:04:37 +01:00
Alexander Gavrilov d961119563 Python API Docs: document when fields use mathutils types.
When accessing certain structure fields from Python, they return
mathutils types instead of generic arrays (this is based on subtype).

This exposes this information in the Python API documentation.

Differential Revision: https://developer.blender.org/D16626
2022-11-28 00:33:41 +02:00
Aaron Carlisle ecda9483f1 Merge branch 'blender-v3.4-release' 2022-11-03 23:41:11 -04:00
Aaron Carlisle eb8155ebcd PyDoc: Make rst files more readable
This commit reduces the amount of white space generated and keeps parameter documentation of a single line.

This makes the resulting rst files easier to read in the case of debugging.

This was useful while looking into T97464
2022-11-03 23:36:12 -04:00
Thomas Dinges ba8754cf11 Blender 3.5 Alpha: Start of new release cycle. 2022-11-03 10:11:13 +01:00
Aaron Carlisle 5ba045af7b PyDocs: Upgrade Theme to 1.1.0
Updates to kbd and breadcrumbs along with some fixes to API docs that should'nt affect us.
2022-11-02 22:37:39 -04:00
Aaron Carlisle ea94d5723f PyDocs: Upgrade Sphinx to 5.3.0
Trivial changes, should not affect us in anyway.
2022-11-02 22:35:42 -04:00
Aaron Carlisle 9cd99684b0 Py Docs: Update to sphinx 5.2.3
Notable change is the improvements made to search.
2022-10-10 23:17:23 -04:00
Campbell Barton 0f6d5c9a9d Docs: minor improvements to info_advanced_blender_as_bpy wording 2022-09-23 15:04:02 +10:00
Germano Cavalcante 2ce8b01c59 PyGPU: call 'GPU_shader_bind' in 'GPUShader.uniform_' methods
This simplifies python code.

When we call a method like shader.uniform_float("color", (1,1,1,1)),
we expect the shader's uniform to be updated regardless of whether the
shader is bound or not.

And `batch.draw()` already calls `GPU_shader_bind` inside.

Differential Revision: https://developer.blender.org/D15929
2022-09-19 09:40:20 -03:00
Aaron Carlisle 72253f427d Docs: Update sphinx 2022-09-15 22:30:47 -04:00
Campbell Barton 27e17fed28 PyDoc: hide overly long titles from the side-bar
The side-bar included both title and description for documentation
pages including quickstart, tips & tricks .. etc.

Titles often wrapped and took up a lot of vertical space in the side-bar.

Now these pages are linked on the main page, with the side-bar
used for top-level Python modules.
2022-09-15 14:34:23 +10:00
Campbell Barton 39c341bf4a Cleanup: remove redundant braces from assert & raise
autopep8 v1.7 added a space after assert & raise,
remove the braces as they aren't needed.
2022-09-14 16:18:59 +10:00
Campbell Barton 260b75a952 PyDoc: add an "Advanced" section to document WITH_PYTHON_MODULE
Document the use cases, usage and limitations
of using Blender as a Python module.
2022-09-14 15:17:51 +10:00
Julian Eisel 00d2bda241 Py Docs: Document delayed setting of UI data
Blender may not apply certain UI data changes immediately when done via BPY.
This is a rather typical gotcha, better to have it documented.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D15614
2022-09-01 15:03:51 +02:00
Germano Cavalcante cb771dbe76 PyDoc: update the shader creation examples with gpu module
The old way of creating shaders is being replaced by using
`GPUShaderCreateInfo` for more portability.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14634
2022-09-01 08:31:56 -03:00
Luca Rood 9a65dca37c Merge branch 'blender-v3.3-release' 2022-08-18 15:26:30 +02:00
Luca Rood 8a799b00f8 Fix T100423: Addon's custom context menu entries get overridden by other addons
This introduces a new `UI_MT_button_context_menu` class which is
registered at startup. Addons can append/prepend draw functions to this
class, in order to add their custom context menu entries.

The new class replaces the old `WM_MT_button_context` class, thus
requiring a small change in addons using this feature. This is done
because addons were previously required to register the class
themselves, which caused addons to override each other's context menu
entries.

Now the class registration is handled by Blender, and addons need only
append their draw functions. The new class name ensures that addons
using the old method don't override menu entries made using the new
class.

Menu entries added with the legacy `WM_MT_button_context` class are
still drawn for backwards compatibility, but this class must not be used
going forward, as any addon using it still runs the risk of having its
menu entries overridden, and support for the legacy class is subject to
removal in a future version.

Reviewed By: campbellbarton

Maniphest Tasks: T100423

Differential Revision: https://developer.blender.org/D15702
2022-08-18 14:46:30 +02:00
Bastien Montagne 6c6e59e846 Merge branch 'blender-v3.3-release' 2022-08-12 16:23:28 +02:00
Bastien Montagne fd57f520ac Py API doc: Add warning that py-defined property accessor callbacks may be called in threaded context.
At least Depsgraph evaluation and liboverride diffing do process IDs in
parallel, so python code in py-defined properties should not access any
data outside of their owner ID.

Ref. T100203.
2022-08-12 16:23:12 +02:00
Thomas Dinges 9015952c9c Blender 3.4 Alpha: Start of new release cycle. 2022-07-27 16:53:19 +02:00
Campbell Barton 37ad72ab23 Fix T99966: Python API docs fail to generate
The recent addition of "active_action" [0] required updating in the
API docs type information.

[0]: cd21022b78
2022-07-26 12:51:01 +10:00
Campbell Barton 3c016fbfd0 Fix error indenting new-lines in generated RST API docs
New-lines in RNA type descriptions caused invalid RST indentation.

This resolve the error noted by @nutti in D15481.
2022-07-18 20:00:21 +10:00
Campbell Barton 68d037190f Cleanup: format 2022-06-29 10:19:02 +10:00
Bastien Montagne 614aa9d8ec Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.
Optionally use `sphinx_changelog_gen.py` to dump current version of the
API in a JSON file, and use closest previous one listed in given index
file to create a changelog RST page for Sphinx.

Part of {T97663}.
2022-06-28 16:53:12 +02:00
Bastien Montagne f9f73473d6 Py API Doc: refactor changelog generation script.
Main change is to make it use JSON format for its dump files, instead of
some Python code.

It also introduces an index for those API dump files, mapping a blender
version to the relevant file path.

This is then used to automatically the most recent (version-number wise)
previous API dump to compare against current one, when generating the
change log RST file.

Part of {T97663}.
2022-06-28 16:52:46 +02:00
Bastien Montagne 0ea173165b Revert "TEST COMMIT: API doc generation changes."
This reverts commit d86af60429.
2022-06-17 18:21:28 +02:00
Bastien Montagne d86af60429 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 50adc860a652508570dbc7102ef288049a9ffed4
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit 88fc683e78f866f1b3cda379c3b90e1f2916ce00
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 17:07:37 +02:00
Bastien Montagne 3c0162295f Revert "TEST COMMIT: API doc generation changes."
This reverts commit 52b93c423d.
2022-06-17 17:03:32 +02:00
Bastien Montagne 52b93c423d TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 9442d8ef0f255d3c18b610b42aff71229904aaee
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit f7fb537078641d2e2de015c08554f5281ce9debd
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 16:39:36 +02:00
Bastien Montagne b8f489c65b Revert "TEST COMMIT: API doc generation changes."
This reverts commit 510f3fe9a9.
2022-06-17 16:30:42 +02:00
Bastien Montagne 510f3fe9a9 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 088497c870630d9b0d405aaa5fd796c77b380731
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit 91801f47ad03f4739e97ae4b4edee09687e2cb85
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 10:46:06 +02:00