1068 Commits

Author SHA1 Message Date
Campbell Barton
d40a0fc5c3 Merge branch 'blender-v4.3-release' 2024-11-03 22:04:51 +11:00
Campbell Barton
ba3c53f200 Merge branch 'blender-v4.3-release' 2024-11-03 22:04:48 +11:00
Campbell Barton
d920ef5425 Merge branch 'blender-v4.3-release' 2024-11-03 22:04:44 +11:00
Campbell Barton
e97e2e4b6d Merge branch 'blender-v4.3-release' 2024-11-03 22:04:42 +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
091ee2833b PyDoc: replace references to the deprecated "bgl" with "gpu"
Also correct bullet-points in gpu.state.blend_set.
2024-11-03 21:50:33 +11:00
Campbell Barton
b00550916c PyDoc: correct use of single back-ticks 2024-11-03 21:50:33 +11:00
Campbell Barton
901359abf7 Cleanup: replace doc-strings with comments for internal logic
There is no need to store text in memory for comments on functions
that aren't exposed publicly and are only of used when reading
the code.
2024-11-03 21:50:33 +11:00
Campbell Barton
f17379a5d0 Merge branch 'blender-v4.3-release' 2024-11-03 16:07:40 +11:00
Campbell Barton
3bcfb151c1 PyDoc: use Python's type annotation syntax for doc-strings
Replace plain-text type information with the type syntax used
for Python's type annotations as it's more concise, especially for
callbacks which often didn't include useful type information.

Note that this change only applies to inline doc-strings,
generated doc-strings from RNA need to be updated separately.

Details:

- Many minor corrections were made when "list" was incorrectly used
  instead of "sequence".
- Some type information wasn't defined in the doc-strings and has been
  added.
- Verbose type info would benefit from support for type aliases.
2024-11-03 15:44:35 +11:00
Campbell Barton
b3919319fb Merge branch 'blender-v4.3-release' 2024-11-02 15:44:18 +11:00
Campbell Barton
c056d03f93 Cleanup: move binary operator to line end in Python scripts 2024-11-02 15:43:26 +11:00
Campbell Barton
f1eb98c427 Merge branch 'blender-v4.3-release' 2024-10-28 09:38:05 +11:00
Campbell Barton
59c52ef2cf Cleanup: remove unused import in CLI example 2024-10-28 09:36:28 +11:00
Campbell Barton
f3c2deac3e Cleanup: replace U+00A0 with space
Using ASCII space is sufficient in source.
2024-10-09 16:34:39 +11:00
Campbell Barton
3525b83c6b Cleanup: use specific exception types where appropriate 2024-10-08 09:41:53 +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
Spencer Magnusson
183112ad40 Docs: update AddonPreferences comment on __package__ use in extensions
Ref: !127661
2024-09-16 20:17:27 +10:00
Campbell Barton
97179b10fb Refactor: make "sys_info" an internal module, rename for clarity
- Move sys_info into an internal module to avoid having so many
  top level modules for Blender's internal functionality.
- Rename system_info sub-modules that pre-fill URL's for clarity.
- Move top-level exception handling into the operator.
- Report an error if an unexpected exception occurs.
- Use `Exception` instead of `BaseException` as there is no reason to
  catch the additional exceptions.
- Remove use of sys_info from the command line example,
  replace with in-lined system info.
2024-09-06 11:11:26 +10:00
Campbell Barton
8febf15ea5 Fix missing import in cli command registration example 2024-09-06 10:38:00 +10:00
Campbell Barton
fe6ab4f344 PyDoc: corrections to formatting and resolve warnings
Use RST formatting for doc-strings used in Python API docs
as well as minor corrections, also add links for foreach_get/set.
2024-08-19 10:48:06 +10:00
Hans Goudey
4333277aa8 Cleanup: Formatting 2024-08-15 12:45:05 -04:00
Falk David
d09fb76caa Docs: Python API: Add section about using attributes
This adds a section at the top of the `bpy.type.Attribute` about
how to use the attribute API in python.

Pull Request: https://projects.blender.org/blender/blender/pulls/126367
2024-08-15 17:42:47 +02:00
Campbell Barton
dc74a98b9e Cleanup: remove unused imports 2024-07-23 15:58:21 +10: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
Brecht Van Lommel
9068ea6d45 Merge branch 'blender-v4.2-release' 2024-06-14 15:48:27 +02:00
Brecht Van Lommel
1fec22e350 Fix #104061: RenderEngine Python example does not work in background mode
And add example of how to use bl_use_gpu_context.
2024-06-14 15:47:49 +02:00
Brecht Van Lommel
012a6fc573 Cleanup: make format 2024-06-12 17:43:44 +02:00
Matthew Hinson
a04d0b932f Fix: Broken Dependency Graph Python API example
Fix blender/blender-manual#104712

Pull Request: https://projects.blender.org/blender/blender/pulls/122563
2024-06-12 17:21:52 +02:00
Pratik Borhade
1395a958d7 Fix #122788: Typo in python api docs 2024-06-06 12:49:29 +05:30
Campbell Barton
0f5e816a7d Merge branch 'blender-v4.2-release' 2024-06-06 11:28:06 +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
Pablo Vazquez
561f26e31a Docs: Update favicon
Use a higher resolution PNG version of the icon, matching other
websites related to development.

The previous favicon.ico is from the days of the old Typo3 blender.org

Part of infrastructure/blender-org#57107
2024-06-05 19:21:36 +02: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
98986c6562 Python: replace '%' with str.format for examples & templates
Use modern/preferred string formatting for user facing scripts.
2024-04-12 15:33:40 +10:00
Germano Cavalcante
ce354c4693 Fix #120484: Typo in Blender Python API docs 2024-04-10 14:28:22 -03:00
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