Commit Graph

1281 Commits

Author SHA1 Message Date
Aaron Carlisle 8d12c58f2c Docs: Use reference links when possible when linking to other API 2024-03-29 22:54:12 -04:00
Aaron Carlisle 7b4fa19fca Docs: Python: Add copy button to code blocks
Uses the sphinx-copybutton to add a copy icon to code block to quickly copy content to the clipboard.

Pull Request: #119948
2024-03-29 20:39:35 -04:00
Hans Goudey e6808cd558 Cleanup: Make format 2024-03-28 20:55:23 -04:00
Jesse Yurkovich af7a34dee7 ImportHelper: Common methods for FileHandler drag and drop support
Provide common implementations for two operations that all Python
FileHandlers will typically use.

- `poll_file_object_drop` To be used inside the FileHandler `poll_drop`
   callback
- `invoke_popup` To be used inside the Operator `invoke` callback

The above code closely mirrors what is currently done inside the
existing Blender c++ FileHandlers.

Pull Request: https://projects.blender.org/blender/blender/pulls/119774
2024-03-29 01:22:51 +01:00
Campbell Barton 976b2d47b4 Unbreak building PyDocs from error in recent refactor
Building docs with buildinfo was failing
2024-03-27 16:26:31 +11: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 7cb8c57728 Docs: Python: Update Sphinx to 7.2.6
This matches what we use for the manual.
Also updates corresponding dependencies.
2024-03-27 00:02:31 -04:00
Campbell Barton 2709888f2d Cleanup: de-duplicate date assignment
Use the same format when there is no build-info available.
2024-03-27 15:01:30 +11:00
Campbell Barton 81a636dcf4 Cleanup: remove unused import, consistent quote style 2024-03-27 14:54:00 +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
Julian Eisel d470b65f6d Merge branch 'blender-v4.1-release' 2024-03-22 12:28:46 +01:00
Julian Eisel 303014bfac Fix #108078: Crash when inverting results in pose library sidebar
a958ae36e8 introduced support for UI lists to reference items that would
never be shown, regardless of filter settings. This was to skip assets
in the asset view template that were not of the requested type. UI list
sorting code wasn't updated to account for such items that should be
entirely ignored.

Pull Request: https://projects.blender.org/blender/blender/pulls/109157
2024-03-22 12:25:39 +01:00
Aaron Carlisle 02578117cd Merge branch 'blender-v4.1-release' 2024-03-21 23:48:14 -04:00
Aaron Carlisle 476e16a999 Docs: Python API: Fixes for mobile browsers
- Collapse field list on mobile browsers
- Allow horizontal lists to collapse when they do not have enough space
- Break long code reference links
2024-03-21 23:37:44 -04:00
Aaron Carlisle 0b29a63e38 Merge branch 'blender-v4.1-release' 2024-03-20 16:58:20 -04:00
Aaron Carlisle 91aa2a3d84 Docs: Python API: Fix builds on buildbot
Because sphinx-basic-ng does not have an official release on BYPI, pip could not satisfy the dependency.
2024-03-20 16:57:10 -04:00
Aaron Carlisle 1f3582bf95 Merge branch 'blender-v4.1-release' 2024-03-20 16:17:11 -04:00
Aaron Carlisle 429fea4abf Docs: Python API: Update the version switch to match the user manual
Not quite a 1:1 match, some customizations have to be made for the API URL differences and the face that there are no translations.

This also enables the version switch publicly now that this change fixes a few bugs.
2024-03-20 16:10:04 -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
Aaron Carlisle 49cd05020c Docs: Python API: Update the version switch to match the user manual
Not quite a 1:1 match, some customizations have to be made for the API URL differences and the face that there are no translations.

This also enables the version switch publicly now that this change fixes a few bugs.
2024-03-19 20:51:49 -04:00
Brecht Van Lommel 7a395e2e7f Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was f57e4c5b98.

After this one more fix was committed, this one is preserved as well:
67bd678887.
2024-03-18 15:04:12 +01:00
nutti dad9248897 Fix: Invalid RST bpy.utils.register_cli_command formatting
Titles can't be used because this text is indented.

Ref: !119320
2024-03-15 13:31:01 +11:00
Campbell Barton f347706ecd Cleanup: add "unreachable" message to "assert False" statements
Clarify that these blocks are unreachable so the intention is clear
if they're ever encountered.
2024-03-15 13:20:11 +11:00
Campbell Barton 9372e0dfe0 CLI: support defining custom commands via C++ & Python API
Add support for add-ons to define commands using the new argument
`-c` or `--command`.

Commands behave as follows:

- Passing in a command enables background mode without the need to pass
  in `--background`.
- All arguments following the command are passed to the command
  (without the need to use the `--` argument).
- Add-ons can define their own commands via
  `bpy.utils.register_cli_command` (see examples in API docs).
- Passing in `--command help` lists all available commands.

Ref !119115
2024-03-08 11:10:13 +11:00
Aaron Carlisle 427dbaed14 Merge branch 'blender-v4.1-release' 2024-02-19 22:12:19 -05:00
Aaron Carlisle db9a067934 Docs: Updates to python docs to reflect the user manual
These were renamed in the manual. This updates to using the full RNA path for these properties.
2024-02-19 22:11:40 -05:00
Brecht Van Lommel 0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Jesse Yurkovich 551b846bcd Merge branch 'blender-v4.1-release' 2024-02-15 16:55:12 -08:00
Jesse Yurkovich 9e8bbc1129 Fix: USD hooks leak
If hooks are not unregistered Blender will report a leak on exit.

Store the hooks as unique_ptrs to remove manual memory management and
encapsulate the previous global list inside a function. These changes
ensure that everything is cleaned up on termination.

Also makes a small change to the hook documentation for a missing
`import` statement.

Pull Request: https://projects.blender.org/blender/blender/pulls/118294
2024-02-16 01:53:33 +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
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