Commit Graph

1204 Commits

Author SHA1 Message Date
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