Commit Graph

1248 Commits

Author SHA1 Message Date
Campbell Barton 2119d271e0 Cleanup: remove "-noaudio" argument in background mode
This is no longer needed as background mode implies -noaudio.
2024-02-14 00:13:38 +11:00
Campbell Barton 2ec7ab066f Merge branch 'blender-v4.1-release' 2024-02-09 16:46:35 +11:00
Campbell Barton ecb0dc0fcb Fix manpage hiding lines beginning with single quotes
Escape single quotes, file formats were not displayed.
2024-02-09 16:45:21 +11:00
Thomas Dinges f77996e344 Release cycle: Start of 4.2, Bcon1 2024-02-07 12:46:54 +01:00
Damien Picard fa77e9142d UI: fix and improve a few messages
- "can not" -> "cannot" in many places (ambiguous, also see
  Writing Style guide).
- "Bezier" -> "Bézier": proper spelling of the eponym.
- Tool keymaps: make "Uv" all caps.
- "FFMPEG" -> "FFmpeg" (official spelling)
- Use MULTIPLICATION SIGN U+00D7 instead of MULTIPLICATION X U+2715.
- "LClick" -> "LMB", "RClick" -> "RMB": this convention is used
  everywhere else.
- "Save rendered the image..." -> "Save the rendered image...": typo.
- "Preserve Current retiming": title case for property.
- Bend status message: punctuation.
- "... class used to define the panel" -> "header": copy-paste error.
- "... class used to define the menu" -> "asset": copy-paste error.
- "Lights user to display objects..." -> "Lights used...": typo.
- "-setaudio require one argument" -> "requires": typo.

Some issues reported by Joan Pujolar and Tamar Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/117856
2024-02-05 17:08:17 +01:00
Michael Kowalski ecbf3385c5 USD: basic support for on_import USD hooks
Added support for defining an on_import() function in
bpy.types.USDHook subclasses.  If on_import() is defined
on a given USD hook, it will be invoked in import_endjob().

The implementation closely follows the existing design of
export hooks.  USDHook.on_import() takes as an argument
an instance of an internally defined USDSceneImportContext
class which provides an accessor to the USD stage.

Also updated the USDHook documentation with an example
on_import() callback implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/117822
2024-02-05 14:26:02 +01:00
Campbell Barton 1fa896bb9a Cleanup: move bl_description to doc-strings
This is already done almost everywhere, prefer doc-strings unless
there is a reason for the tool-tip and Python doc-string to differ.
2024-01-23 13:59:15 +11:00
Thomas Dinges 64fc6d7890 Docs: Replace most wiki links with links to new developer docs
Exceptions:
* Links to personal wiki pages
* Pages that are not in the new developer docs yet (like Human Interface Guidelines)
* tools\check_wiki\check_wiki_file_structure.py needs a refactor
2024-01-18 16:49:38 +01:00
Brecht Van Lommel 303c19f736 Fix: API doc build error after adding missing texture_node to context 2024-01-12 17:11:09 +01:00
Campbell Barton 59dc67974a PyAPI: support returning non ID types when accessing Context.property
Previously accessing properties without an associated ID would return
None, even when the non-ID data was available.

Ref !116981
2024-01-10 23:43:29 +11:00
Guillermo Venegas 5b104fb3fa Cleanup: Silence warnings from 1254fee589
Introduced in 1254fee589

Also remove translation from CLOG statements.

Pull Request: https://projects.blender.org/blender/blender/pulls/116836
2024-01-06 06:53:42 +01:00
Guillermo Venegas 1254fee589 IO: Add support for Drag and Drop to FileHandlers
Added support to Drag and Drop to file handlers, part of #111242.

If file handlers are registered with an import operator they can now be
invoked with drag and drop path data.

Import operators must either declare a `filepath` StringProperty or both
a `directory` StringProperty and a `files` CollectionProperty depending
on if they support single or multiple files respectively.

Multiple FileHandlers could be valid for handling a dropped path. When
this happens a menu is shown so the user can choose which exact handler
to use for the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/116047
2024-01-06 03:51:45 +01:00
Campbell Barton 6e3d1be637 Licenses: add MPL-2.0 (from recent inclusion of NanoVDB.h) 2023-12-12 13:08:16 +11:00
Campbell Barton 1abdf9d624 Cleanup: consistent indentation for HTML templates, wrap long lines 2023-12-08 13:28:45 +11:00
Aaron Carlisle ee57ad334e Docs: Add button to report python API documentation issue
Adds a button similar to the user manual at the bottom of each page.
This is done to give people a place to report issues other than the documentation repository which should be limited to the user manual.

With this change also comes a new issue template with helpful text and a redirect for people looking to submit an issue with Blender.

I would also like to add a Documentation label too but that requires configuring with the Gitea project.

Pull Request: https://projects.blender.org/blender/blender/pulls/115865
2023-12-07 22:06:07 +01:00
Campbell Barton 5486c70aae Fix #115056: man-page fails to build with non-portable install
This effectively reverts [0] which required the installed Blender
along with the `bpy` module to load for the install target to generate
the man-page. It turns out running a full Blender at install time can be
quite involved.

Now the man-page generator runs `blender --help` & `blender --version`,
converting the output into a man-page from a Python script.

Some minor changes have also been made:

- Use PYTHON_EXECUTABLE so the systems Python
  (which may not be compatible) isn't used.
- Remove leading blender version from the description
  which was unintentionally being included.

[0]: 61d99d450e
2023-11-28 16:55:53 +11:00
Jeroen Bakker 9aac9254cc Cleanup: Make format 2023-11-24 07:20:52 +01:00
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