Commit Graph

1144 Commits

Author SHA1 Message Date
Campbell Barton
fd6ac498b0 Cleanup: spelling in comments, strings (make check_spelling_*)
Also replace some triple-quoted non-doc-string strings with commented
blocks in examples.
2025-05-06 00:18:39 +00:00
Jesse Yurkovich
0a3e4b0fd4 Fix #138365: Define and use 'use_filter_orderby_invert' for UIList example
The property in question was undefined since the first commit[1]

[1] b7e2cd5948

Pull Request: https://projects.blender.org/blender/blender/pulls/138373
2025-05-05 19:40:59 +02:00
Sergey Sharybin
9477fa4eb0 Migrate existing files to Git LFS
The files that were binary and were committed prior to the
Git LFS configuration in the main repository.

override restrictions

Pull Request: https://projects.blender.org/blender/blender/pulls/138452
2025-05-05 17:18:42 +02:00
Campbell Barton
4f04f6f8af Docs: add warning regarding operators that use the file selector 2025-04-25 16:24:24 +10:00
Andrej730
e09d59f9de Fix duplicated dirpath in fileselect_add docs (0314f9318c)
Ref: !137985
2025-04-25 16:04:18 +10:00
Campbell Barton
575600d540 Docs: correct use of FILE_PATH for directories
Also correct own error in recent doc-update regarding the expected
return value for fileselect_add.
2025-04-25 10:27:30 +10:00
Andrej730
e9c0029316 Docs: add the WindowManager.fileselect_add check_existing property
Ref: !137416
2025-04-25 10:20:08 +10:00
Campbell Barton
0314f9318c Docs: move WindowManager.fileselect_add descriptions into an example
- Allow for formatting and expanded descriptions.
- Clarify the expected types of each property.
2025-04-25 10:18:36 +10:00
Campbell Barton
9567ac1272 Cleanup: quiet python linter warnings 2025-04-16 11:08:40 +10:00
Jan-Hendrik-Muller
e1163bf133 Fix Python: broken format string in API docs
This example was currently broken:
https://docs.blender.org/api/current/bpy.props.html#operator-example

Pull Request: https://projects.blender.org/blender/blender/pulls/136937
2025-04-14 11:38:43 +02:00
nutti
07e6f78ac1 PyDoc: Add base class of bpy_prop_collection_idprop
`bpy_prop_collection_idprop` is inherited from `bpy_prop_collection`.
Python API doc does not reflect this specification now.

Ref !136382
2025-04-04 16:07:26 +11:00
Campbell Barton
4996f9eed9 PyDoc: use context manager to avoid resource leak writing log-file 2025-04-04 10:32:13 +11:00
Campbell Barton
57fde0ee77 PyDoc: fix resource leak warning when generating docs
Use the context manager to avoid having to explicitly close files.
2025-04-04 10:15:44 +11:00
Campbell Barton
357e7e1ab2 PyDoc: support disabling online access when building the API docs 2025-04-04 10:14:21 +11:00
Campbell Barton
b2c57fd877 PyDoc: use complete sentences in comments for templates & examples 2025-04-02 23:46:58 +00:00
Philipp Oeser
1750a2bbc8 Fix #136395: Python API Quickstart uses outdated API
Replace with a working example.

Pull Request: https://projects.blender.org/blender/blender/pulls/136882
2025-04-02 12:52:09 +02:00
Jacques Lucke
e1fb4a063b Fix: write bpy.types.GeometrySet example above class in api docs
This is an alternative solution to #136733.
2025-03-31 17:48:00 +02:00
Jacques Lucke
29fddf4710 Python: Geometry: create GeometrySet wrapper for Python
In Geometry Nodes a geometry is represented by a `GeometrySet`. This is a
container that can contain one geometry of each of the supported types (mesh,
curves, volume, grease pencil, pointcloud, instances). It's possible for a
`GeometrySet` to contain e.g. a mesh and a point cloud.

This patch creates a Python  wrapper for the built-in `GeometrySet`. For now,
it's main purpose is to consume the complete evaluated geometry of an object
without having to go through complex hoops via `depsgraph.object_instances`. It
also also allows retrieving instances that have been created with legacy
instancing systems such as dupli-verts or particles.

In the future, the `GeometrySet` API could also be used for more kinds of
geometry processing from Python, similar to how we use `GeometrySet` internally
as generic geometry storage.

Since we can't really have constness guarantees in Python currently, it's
enforced that the `GeometrySet` wrapper always has its own copy of each geometry
type (so e.g. it does not share a `Mesh` data-block pointer with any other place
in Blender). Without the copy, changes to the mesh in the geometry set would
also affect the evaluated geometry that Blender sees. The copy has a small cost,
but typically the overhead should be low, because attributes and other run-time
data can still be shared. This should be entirely thread-safe, assuming that no
code modifies implicitly shared data, which is forbidden. For historic reasons
there are still cases like #132423 where this assumption does not hold in all
cases. Those cases should be fixed. To my knowledge, this patch does not
introduce any new such issues or makes existing issues worse.

Pull Request: https://projects.blender.org/blender/blender/pulls/135318
2025-03-28 22:40:01 +01:00
Campbell Barton
e436b9638e Cleanup: replace references to "C" to C++ or the C-API
Also capitalize Blender, Python & API in docs & code-comments.
2025-03-26 17:23:33 +11:00
Andrej730
ad5494d7ac PyDoc: bpy.types.Operator docs - add note on execution context
Clarify the default behavior when invoke and execute is called.

Ref: !135854
2025-03-26 17:02:40 +11:00
Jonas Holzman
34a7aa3a5e Docs build: Update path of newly renamed gizmo_simple_3d.py Python template 2025-03-21 14:47:01 +01:00
tariqsulley
812aaa957d Fix #136079: Broken source file links in docs pages
Since add-ons are no longer in their own repository,
they don't need to have a separate base URL.

Ref: !136106
2025-03-19 00:38:00 +00:00
Campbell Barton
c3e5a35ecd PyAPI: add blf.bind_imbuf(..) context manager
Add support for using BLF to draw into an ImBuf image buffer.
Once the imbuf context has been set, draw calls for that font_id will draw into the image.

This works by binding an imbuf to BLF which is then used as the target when drawing.
```
with blf.bind_imbuf(font_id, imbuf):
    blf.draw_buffer(font_id, text)
```
See the example in the Python API documentation for reference.

The following BLF API's have been added to support a Python context manager.

- `BLF_buffer_state_push`.
- `BLF_buffer_state_pop`
- `BLF_buffer_state_free`

Ref !135772
2025-03-15 11:00:51 +11:00
Campbell Barton
6ef7dae8ef Cleanup: spelling in comments (make check_spelling_*) 2025-03-13 13:41:17 +11:00
Campbell Barton
5b856ba447 Merge branch 'blender-v4.4-release' 2025-03-06 10:35:59 +11:00
Campbell Barton
b85fc32cae Cleanup: spelling & repeated words in comments
Address warnings from check_spelling.py
2025-03-06 10:33:21 +11:00
Aaron Carlisle
45fee7d851 PyAPI Docs: Increase the width of "On this page" region
This helps prevent long text from wrapping but still looks nice in my opinion.
In the future we might try to hide the base name part of the class but I think this would require a fix in sphinx.
2025-02-26 16:39:00 -05:00
Bastien Montagne
8ad740ae95 API Docs: Add some more precisions about calling __init__ for Blender-derined classes.
Hopefully will avoid confusion like in #134600.
2025-02-17 10:49:04 +01:00
Campbell Barton
c9bbc767db Docs: correct context.temp_override example
Address #134296
2025-02-11 10:51:05 +11:00
Campbell Barton
59732c95d8 Cleanup: strip trailing space for TOML,HTML & XML 2025-02-02 13:58:34 +11:00
Campbell Barton
4cd827870d Cleanup: quiet check_spelling_* targets
Also correct outdated references to `ghash`.
2025-02-02 13:58:34 +11:00
Campbell Barton
9d4b48b107 Cleanup: spelling in build-files & docs 2025-01-31 15:22:50 +11:00
Aaron Carlisle
277c2a9552 PyDocs: Fix broken type section
Fixes blender/blender-manual#105013
2025-01-25 20:44:37 -05:00
Falk David
b9f253564e VSE: Python API: Deprecate sequence properties and replace with new ones
This PR adds new RNA properties that deprecate and replace any `sequence` property.
The old prooperties are still there and fully functional, but the description is changed
to indicate that these will be removed in the future and that the new properties should
be used instead.

| Deprecated property | Replacement property |
| --------------------------------- | ----------------------------------- |
| `context.active_sequence_strip` | `context.active_strip` |
| `context.selected_editable_sequences` | `context.selected_editable_strips` |
| `context.selected_sequences` | `context.selected_strips` |
| `context.sequences` | `context.strips` |
| `SequenceEditor.sequences` | `SequenceEditor.strips` |
| `SequenceEditor.sequences_all` |  `SequenceEditor.strips_all` |
| `MetaStrip.sequences` | `MetaStrip.strips` |

Previously, rna paths for animation data on strips started with `sequence_editor.sequences`.
This PRadds versioning for the rna paths to make sure to use
the new naming scheme. This does mean that in previous versions of blender,
the animations don't show but the data is not lost (even if the file is saved in the older version).

Also do some cleanup of existing python scripts inside the source to use the
new properties.

Part of #132963.

Pull Request: https://projects.blender.org/blender/blender/pulls/133156
2025-01-21 11:30:20 +01:00
Bastien Montagne
992d44131d Second attempt at fixing warning 2025-01-21 10:27:06 +01:00
Bastien Montagne
9fe2ab3f34 Fix warning 2025-01-21 10:04:50 +01:00
Bastien Montagne
0036206b6d API doc: add examples of error messages when constructor is not called. 2025-01-21 09:56:42 +01:00
Campbell Barton
18783c5699 Cleanup: correct RST syntax, spelling & adjust quotes 2025-01-21 16:51:40 +11:00
Bastien Montagne
e8e6705081 Add note about calling Blender-defined constructor in multi-inheritance cases
`super()` is using the MRO to find the first `__init__()` function, if the blender-defined type is not the first inherited type, it may never be called that way.

See #133183
2025-01-20 18:35:18 +01:00
Campbell Barton
7cd621bebc Fix incorrect docs for bpy.types.bpy_prop_collection_idprop
ID Property methods were missing from the API docs,
error in [0] which added docs for this type.

[0]: 10e3e3b4a0

Co-authored-by: nutti <nutti.metro@gmail.com>
2025-01-20 15:49:54 +11:00
Brecht Van Lommel
a6b293daac Python Module: Bundle VFX library python bindings
When calling bpy.utils.expose_bundled_modules(), these modules are
added to sys.path.

This provides a solution/workaround to two problems:
* Using bpy together with packages like usd-core is problematic. Besides
  crashing due to C++ symbol conflicts, it's just impossible to import
  different versions of the same module, or to have distinct environment
  variables for both. (#127132)
* Blender add-ons using these VFX modules do not currently work with
  the bpy module.

This adds about 15MB to the bpy package.

Pull Request: https://projects.blender.org/blender/blender/pulls/133082
2025-01-17 10:13:31 +01:00
Falk David
6b63ec95d0 Fix: Update type name in sphinx_doc_gen.py
The `Sequence` RNA type has been renamed to `Strip`
in 655a17a6ab.
2025-01-14 19:13:13 +01:00
nutti
10e3e3b4a0 PyDoc: add bpy_prop_collection_idprop class document
Ref: !132587
2025-01-06 20:29:29 +11:00
nutti
aa81aed109 PyDoc: add 'rtype' field for multiple return values
Ref: !131482
2025-01-06 20:29:29 +11:00
Campbell Barton
4f1817cc18 Cleanup: declare __all__ for Python scripts
Declare all to make public public API's explicit and
help detect unused code.
2025-01-06 16:45:36 +11:00
Campbell Barton
444f1064c9 Cleanup: remove unused functions, imports 2025-01-04 21:09:41 +11:00
Campbell Barton
6216e8574c Cleanup: declare __all__ for doc-generation & icon updating utils 2025-01-04 20:33:53 +11:00
Aaron Carlisle
1bcc01519a Cleanup: Spelling: "Explicitly" 2025-01-03 22:35:05 -05:00
Bastien Montagne
34908de285 Update BPY API 'creation & destruction' section re __del__().
While in theory it would be good to have calls to super classes'
`__del__()` destructors in subclasses, matching the ones to
`__init__()`, several limitations of current CPython implementation do
not make it a practical requirement.

So remove `__del__` from examples, and add a note summarizing the
current problems with using it (aka `tp_finalize` in C++ code).

Also see !132476 for some discussion about that topic.
2025-01-03 12:16:50 +01:00
Campbell Barton
7481355397 Cleanup: scripts, unused variables & re-declaring built-ins 2025-01-02 15:11:15 +11:00