381 Commits

Author SHA1 Message Date
Falk David
6b63ec95d0 Fix: Update type name in sphinx_doc_gen.py
The `Sequence` RNA type has been renamed to `Strip`
in 655a17a6abcf0d949d4932bd4f3349d4e0516229.
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
Campbell Barton
a700fdc163 Fix class methods being excluded from the Python API docs
All class methods were excluded which makes sense for methods such
as poll, draw ... etc. however this would also exclude utility methods
that aren't associated with RNA classes.

The following methods for `bpy.types` classes are now included:

- Macro.define
- UI_UL_list.sort_items_by_name
- {Header/Menu/Panel/UIList}.{append/prepend/remove/is_extended}
2024-06-01 16:17:01 +10:00
Campbell Barton
20d506941b Cleanup: comments in sphinx doc generation 2024-06-01 16:08:54 +10:00
Campbell Barton
c4a0bbb1f4 Extensions: Support online extensions and move add-ons outside Blender
The extensions system allows to extend Blender with connectivity to the internet. Right now it means Blender can
discover and install add-ons and themes directly from the internet, and notify users about their updates.

By default this is disabled (opt-in), and users can enable it the first time they try to install an extension or visit
the Prefences > Extensions tab. If this is enabled, Blender will automatically check for updates for
extensions.blender.org upon startup.

When will Blender access the remote repositories:

* Every time you open the Preferences → Extensions: ALL the enabled repositories get checked for the latest info (json)
* Every time you try to install by dragging: ALL the enabled repositories get checked for the latest info (json).
* Every time you start Blender: selected repositories get checked for the latest info (json).

------------------

From the Blender code point of view, this means that most of the add-ons and themes originally bundled with Blender
will now be available from the online platform, instead of bundled with Blender. The exception are add-ons which are
deemed core functionality which just happened to be written as Python add-ons.

Links:
* Original Extenesions Platform Announcement: https://code.blender.org/2022/10/blender-extensions-platform/
* Extensions website: https://extensions.blender.org/
* User Manual: https://docs.blender.org/manual/en/4.2/extensions/index.html#extensions-index
* Technical specifications: https://developer.blender.org/docs/features/extensions/
* Changes on add-ons bundling: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593

------------------

This PR does the following:

* Move extensions out of experimental.
* No longer install `scripts/addons` & `scripts/addons_contrib`.
* Add `scripts/addons_core` to blender's repository.

These add-ons will still be bundled with Blender and will be always enabled in the future, with their preferences
moved to be more closely integrated with the rest of Blender. This will happen during the remaining bcon2 period.
For more details, see #121830

From scripts/addons:

* copy_global_transform.py
* hydra_storm
* io_anim_bvh
* io_curve_svg
* io_mesh_uv_layout
* io_scene_fbx
* io_scene_gltf2
* pose_library
* ui_translate
* viewport_vr_preview

Extra: bl_pkg (scripts/addons_contrib)

Note: The STL (legacy) add-on is going to be moved to the extensions platform. There is already a C++ version on core
which is enabled by default.

All the other add-ons are already available at extensions.blender.org. To use them you need to:

* Go to User Preferences > Extensions
* You will be greated with an "Online Extensions" message, click on "Enable Repository".
* Search the add-on you are looking for (e.g, Import Images as Planes).
* Click on Install

Over time their maintaince will be transferred over to the community so their development can carry on. If you used to
help maintain a bundled add-on please read: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593

Ref: !121825
2024-05-15 19:26:29 +02:00
Campbell Barton
8eb0abcc69 Cleanup: replace %-formatting with str.format in doc/ 2024-04-27 16:06:50 +10:00
Campbell Barton
3b8818cb6e Docs: avoid potential error with templated strings
Use a method of declaring templated strings that properly escapes
characters.

Also use utf-8 encoding for the conf.py.
2024-03-27 15:53:27 +11:00
Aaron Carlisle
32db305899 Docs: Python: Refactor the config file out of 'sphinx_doc_gen.py'
This was done originally because we need access to some information that is avalable from `bpy` however, we only need a few pieces of information.

Instead, I have refactored the code to a traditional `conf.py` file that uses template strings that get substituted when the file is copied to the build folder.

The goal here is to make it simpler to adjust the configuration.

This change also moves the config generation from `rna2sphinx` to the main function.

Pull Request: https://projects.blender.org/blender/blender/pulls/119904
2024-03-27 04:27:40 +01:00
Aaron Carlisle
3b3a6ccecd Docs: Python: Use headings instead of rubrics
This allows these headings to show under "On this page".
2024-03-26 01:48:32 -04:00
Aaron Carlisle
7d29f25ee1 Docs: Python: Fixes for sphinx Idioms
- There is no need to use the low level css add function use `html_css_files` instead.
- There is no need to specify each file for `html_extra_path`, just use the directory.
2024-03-26 01:23:55 -04:00
Aaron Carlisle
f032da82af Merge branch 'blender-v4.1-release' 2024-03-25 12:52:47 -04:00
Aaron Carlisle
5a9b292ac4 Docs: Python API: Enable version switch menu 2024-03-25 12:50:01 -04:00
Aaron Carlisle
1f3582bf95 Merge branch 'blender-v4.1-release' 2024-03-20 16:17:11 -04:00
Aaron Carlisle
12407be18b Docs: Python API: Switch theme to Furo
Since moving from the Wiki we have used the `sphinx_rtd_theme` which has worked well but has become a little dated and has had slow development. This changes to use "Furo" instead.

[Furo](https://github.com/pradyunsg/furo) is a lightweight theme that is responsive and has native dark mode support.

Dark mode is one of the major enhancements but this change also brings:

- Content is slightly larger making text and images easier to view
- Site navigation and page navigation is split into two navigation trees. The site navigation is on the left and page on the right if the page has multiple headings.
- Return to top button
- Content is centered on the screen which helps with wide monitors
- No more breadcrumbs
- Remove google analytics

So far the caveat that I have noticed with this is slower compile times and larger pages, this is due to the better sidebar navigation.

This change also brings a lot of simplifications to customizations that we made to the `sphinx_rtd_theme`. There is still likely room for improvement in the future.

Pull Request: #119684
2024-03-20 16:08:31 -04:00
Brecht Van Lommel
7a395e2e7f Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was f57e4c5b98c075f3dfc61faebbcb43c99a778956.

After this one more fix was committed, this one is preserved as well:
67bd678887d7f8aec9f3b23bbf1aaf29f80d0da4.
2024-03-18 15:04:12 +01:00
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
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
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
Julian Eisel
aaefb0249c Fix documentation build (validation?) error
Necessary after 974d70918b and ca58f97cda.
2023-09-19 17:14:31 +02: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]: 3ea7117ed15f7b9fa82d7aba11eb32f6f502ddd5
2023-08-25 13:35:58 +10: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]: e955c94ed38595cb12fa6cf517b6ba8033017141
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
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
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
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