Commit Graph

408 Commits

Author SHA1 Message Date
Campbell Barton
08cf60c66e PyDoc: generate a list of types that support custom properties
Methods for `bpy_struct` such as `get()` & `items()` noted that only
some types support custom-properties.

Since these docs were written many more types support custom properties.
Replace the inline list with a link to a generated list since there are
now too many to include inline.

Resolves #141450.
2025-08-07 14:37:38 +10:00
Campbell Barton
3de916ca25 RNA: support for marking properties as deprecated
Deprecation meta-data support for RNA properties.

- Properties may have a deprecated note and version.
- Warnings shown when these are accessed from Python.
- A note is included in the generated documentation.

Support for marking functions as deprecated can be added in the future.

Ref !139487
2025-07-29 22:09:59 +10:00
Campbell Barton
895189dd19 PyDocs: always quote enum values in docs
While this was an intentional change in [0],
it seemed like an error to removing quoting (based on #141853).

Restore the quotes while keeping the string literals.

[0]: 0fb80f698a
2025-07-27 19:36:13 +10:00
Campbell Barton
f7fb02dcf9 Cleanup: use dash for bullet points in generated docs
Follow the user manual style guide.
2025-07-27 16:56:21 +10:00
Campbell Barton
084ded1c07 Merge branch 'blender-v4.5-release' 2025-06-30 17:21:10 +10:00
Campbell Barton
0fb80f698a PyDoc: use string literals for enum values
Use literals since their literal values need to be used in code.
2025-06-30 17:12:04 +10:00
Brecht Van Lommel
789db82dfd Merge branch 'blender-v4.5-release' 2025-06-17 20:09:12 +02:00
Brecht Van Lommel
984ae99624 Fix: Python API doc build fails after previous pointcloud fix
This is now always in context, not just for experimental features.

Ref #140516
2025-06-17 20:06:51 +02:00
Clément Foucault
decd88f67e Python: Remove deprecated BGL API
The API was in a deprecation state for many years now.
This API was not compatible with Metal nor Vulkan.

This also remove `Image.bindcode`.

Pull Request: https://projects.blender.org/blender/blender/pulls/140370
2025-06-16 12:50:50 +02:00
John Kiril Swenson
a37c5e7d6c Fix: API doc build error after adding asset to context
Introduced by 3f9c943243.
2025-06-12 15:36:42 -05:00
Campbell Barton
db22e6cb8b PyDocs: quiet context member warning without experimental features 2025-06-06 10:48:25 +10:00
Bastien Montagne
aca960500e Fix PyAPI doc generation: add back a 'context' entry removed by mistake.
Reverts part of 6fbef14f4b.
2025-06-05 13:42:06 +02:00
Campbell Barton
6fbef14f4b PyDoc: quiet wanings/prints when building docs 2025-06-05 05:31:51 +00:00
Hans Goudey
91803e130f Cleanup: Grammar: Fix uses of "for e.g."
e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.

Pull Request: https://projects.blender.org/blender/blender/pulls/139596
2025-05-29 21:21:18 +02:00
Sybren A. Stüvel
58d0b0e4b4 Py Docs: Gotcha chapter on threading
Update the Python API documentation about crashes with multi-threaded
code.

- Move the "threading gotcha" into a file of its own. That way it's
  immediately clear from looking at the Gotcha table of contents that
  threading is not supported.
- Simplify the example code, so that it doesn't access `bpy`.
  Apparently the problem is much wider than just multi-threaded access
  to `bpy`, and involves _all_ Python threads, regardless of what they
  do / access.
- Add some more explanation and move some text from the bottom to the
  top, so that the first-read part (when reading top to bottom) has
  most of the information.

Pull Request: https://projects.blender.org/blender/blender/pulls/139279
2025-05-22 16:23:23 +02:00
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
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
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
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
6ef7dae8ef Cleanup: spelling in comments (make check_spelling_*) 2025-03-13 13:41:17 +11: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
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
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
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
Bastien Montagne
d5c50fc366 API docs: Split 'Gotchas' page, add some info about python instances and subclasses.
This PR:
* Splits the `Gotchas` page into several sub-sections. This was getting too big and hard to navigate.
* Adds some information regarding Python instances life-time of objects wrapping Blender internal data.
* Adds some information about usage of constructors and destructors for sub-classes of Blender-defined types.

Pull Request: https://projects.blender.org/blender/blender/pulls/129814
2024-11-10 18:40:14 +01:00
Bastien Montagne
2910f6dce9 Cleanup: API docs generator: Remove references to removed GP(v2) types. 2024-11-10 18:27:10 +01:00
Bastien Montagne
246b43e136 Merge branch 'blender-v4.3-release' 2024-11-10 18:24:49 +01:00
nutti
1c8669f8c9 Fix: sphinx_doc_gen.py syntax error while generating PyDoc
Ref !130085
2024-11-10 23:35:45 +11:00
Campbell Barton
a3773c827d Merge branch 'blender-v4.3-release' 2024-11-09 13:20:38 +11:00
Campbell Barton
f026c3a80f Merge branch 'blender-v4.3-release' 2024-11-09 13:20:36 +11:00
Campbell Barton
63c56a5d67 PyDoc: show keyword-only signifier for all RNA functions 2024-11-09 13:19:26 +11:00
Campbell Barton
56cea4a36b Fix PyDoc: Invalid signature for functions without arguments
Ref: !130031
2024-11-09 13:17:43 +11:00
Campbell Barton
96ac7b7ff3 Merge branch 'blender-v4.3-release' 2024-11-06 10:51:53 +11:00
Campbell Barton
6ccbafc5dc Cleanup: spelling in comments 2024-11-06 10:49:51 +11:00
Campbell Barton
d40a0fc5c3 Merge branch 'blender-v4.3-release' 2024-11-03 22:04:51 +11:00
Campbell Barton
470173bbc4 PyDoc: use keyword only specifier for bpy.props & bpy.ops 2024-11-03 21:50:33 +11:00
Campbell Barton
1a1e75c253 Cleanup: replace implicit BaseException with Exception
Exception is more appropriate as a general exception in these cases.
2024-10-08 09:41:51 +11:00
Lukas Tönne
a57206dd59 GPv3: Remove unused legacy editor functions for GPv2
Removes all unused functions in ED_gpencil_legacy.hh

Pull Request: https://projects.blender.org/blender/blender/pulls/128597
2024-10-07 18:21:28 +02:00
nutti
3ecfa5659e PyDocs: distinguish between tuple and union data types
Ref: !124879
2024-07-18 15:39:04 +10:00
Campbell Barton
8465ca92d2 Cleanup: quiet some pylint warnings for doc-generation
Also add punctuation.
2024-07-17 16:43:13 +10:00
nutti
b23567f86e Fix Context.active_bone type for API docs
Support multiple types for a single context memeber.

Ref !124406
2024-07-17 16:29:42 +10:00
Campbell Barton
949dfbfaa8 Cleanup: Python script formatting
- Double quotes for strings.
- Trailing commas when wrapped lines.
2024-06-06 11:26:28 +10:00