Commit Graph

1222 Commits

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