Commit graph

423 commits

Author SHA1 Message Date
Alaska
c654ff9c15 Fix: Missing 's' in the name 'Developer Extras' in API documentation
Fixes #161701

Pull Request: https://projects.blender.org/blender/blender/pulls/161711

---------

Co-authored-by: Aaron Carlisle <8493+blendify@noreply.localhost>
2026-09-28 01:03:44 +02:00
Bastien Montagne
c8a6c96db2 Core: Harden IDProps against too-high embedding depth.
IDProperties can be embedded into one-another with no theoritical depth
limit, however the code currently uses recursive patterns to process
them, which means beyond a certain depth it will run out of stack memory
and crash.

While we cannot really prevent creating such insanely high data depth,
this commit adds several safe-guards (readfile, writefile, foreach_id,
and freeing processes), skipping further processing beyond a certain
recursion depth (currently set at 1024, which should be both well
within safety margins of any modern OS, and more than enough for any
practical use-case).

Issue initially reported by Ray Molenkemp (@lazydodo), thanks.

This commit also contains a small refactor for the IDProperty freeing
code (and IDP array resize internal logic), essentially removing public
API to free IDProperties' content - all of its usages was immediately
after calling MEM_delete on the same root properties, so can as well
call directly IDP_FreeProperty.

Finally, it fixes a potential bug related to arrays of groups freeing,
where the 'do_id_user' option was not properly propagated through the
array resize logic. Probably not an issue in practice though (not sure
if arrays of groups are used anywhere currently?).

Pull Request: https://projects.blender.org/blender/blender/pulls/160274
2026-06-18 12:07:48 +02:00
Campbell Barton
197d87c31c Docs: update to reference extensions instead of "bl_info"
Resolves #156648.
2026-05-19 07:49:29 +00:00
Campbell Barton
85e847f882 Cleanup: long line & trailing space in recent commit to API docs 2026-05-13 12:24:11 +10:00
Vansh Gaur
43517ac7fa Docs: fix grammar and punctuation in Python API docs
Signed-off-by: Vansh <gaurvansh133@gmail.com>

Fix a few small grammar, punctuation, and wording issues in the Python API docs.

Touches:

* `doc/python_api/rst/info_overview.rst`
* `doc/python_api/rst/info_quickstart.rst`
* `doc/python_api/rst/info_best_practice.rst`

Docs only, no functional changes.

Co-authored-by: Aaron Carlisle <blendify@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/158437
2026-05-13 02:50:34 +02:00
quackarooni
a0dafebac9 UI: subdirectory support for Menu.menu_path, use for text templates
Create submenus for common template types in the text editor as the menu
was getting too long.

Common categories such as Gizmo, UI & Operators are now in their own
directories, displayed as submenus.

Menu.menu_path now supports expanding sub-menus recursively.

Ref !154643
2026-03-05 11:04:52 +11:00
Campbell Barton
76976a676a PyDoc: correct operator links, use :func: instead of :mod: 2026-02-16 18:20:55 +11:00
Campbell Barton
57d607f680 PyDoc: corrections in manually maintained RST docs
Correct grammar and typos across documentation.

Update outdated API references:
- Group -> Collection.
- __cmp__ -> __eq__, verts -> vertices.
- threading code examples.
2026-02-16 03:42:15 +00:00
Campbell Barton
458640840a PyDoc: fix RST cross-references in Python API docs
Fix cross-reference roles, incorrect use of :class:.
correct broken cross-reference targets.
2026-02-16 03:42:14 +00:00
Campbell Barton
87f425ff37 Cleanup: remove unused imports, argument shadowing, long lines in RST
Also resolve various pylint warnings.
2026-02-13 19:42:07 +11:00
Campbell Barton
0640836baa PyDoc: number all examples to avoid conflicts when type checking
Examples were supported with/without number suffix,
this caused problems using mypy for type checking because it attempted
to resolve imports such as `mathutils` to the example file.

Having only some examples numbered already complicated documentation
for conventions with examples - simplify extraction and number all.
2026-02-12 00:51:02 +00:00
Nick Alberelli
f7a3348637 PyDoc: add a Python API documentation contribution guide
Add a contribution guide for Blender's Python API documentation,
similar to the User Manual contribution guide.

Some parts of this process weren't so clear,
especially the example auto-discovery.

Cover:
- Setting up the build environment.
- Modifying API documentation.
- Adding example code snippets.
- File naming conventions and auto-discovery.
- Best practices and style guidelines.

PR !151750

Co-authored-by: Campbell Barton <campbell@blender.org>
2026-01-31 20:06:52 +11:00
Campbell Barton
845ca44a30 PyDoc: clarify threading example regarding Blender API usage
Address issue raised in #153398.
2026-01-28 09:29:48 +00:00
Nick Alberelli
0d9ea9d11c PyAPI: add Context.temp_override documentation & examples
Add a new section to the `Context` page that includes an explanation
on how to invoke "on demand" logging for context member access.

Design task: #144746
Logging added in: !144810

Ref !146862
2025-10-08 16:08:09 +11:00
luz paz
656c3f65ad Cleanup: fix typos in doc subdirectory
Fix several documentation related typos.
Found via `codespell -S "*.desktop,*.diff,./intern,./extern,./locale,./AUTHORS,./source/blender/blenlib/tests/BLI_string_utf8_test.cc,./doc/license/bf-members.txt" -L accessort,abd,aci,alo,ans,ba,bording,childrens,clen,constructin,datas,dependees,domin,eary,ege,eiter,elemt,eles,endianess,enew,espace,finded,fiter,fpt,groupd,hist,implementating,indext,ine,infront,inout,inouts,inpt,ist,lene,listenter,lod,maks,masia,mata,mis,mke,nam,nd,ned,opose,ot,outlow,parm,parms,passt,pinter,pixelx,poin,pres,ptd,re-usable,re-use,re-used,re-uses,re-using,ridiculus,schem,soler,strack,suh,te,tesselate,tham,ue,vai,varius,wew`

Pull Request: https://projects.blender.org/blender/blender/pulls/145824
2025-09-06 08:03:16 +02:00
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
Bastien Montagne
e28a714245 Merge branch 'blender-v4.5-release' 2025-06-16 16:31:38 +02:00
Alberto-Luaces
e7191f8390 Python API: update animation example in quickstart docs for slots
Update the Animation example in the Python API: Quickstart documentation
to use slotted Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/140334
2025-06-16 15:59:48 +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
Steve-Paws
d8e88572dd Fix: PyDocs: Syntax error in PointerProperty assignment
syntax error on `info_overview` PyAPI docs page for
property assignment

Pull Request: https://projects.blender.org/blender/blender/pulls/140090
2025-06-10 08:09:06 +02:00
Hans Goudey
77b14f2dcb Cleanup: Grammar: Fallback vs. fall back
The former is a noun or adjective, the latter is a verb.
2025-06-02 17:13:56 -04: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
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
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
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
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
Brecht Van Lommel
f301952b6a Fix: Missing super().__del__() in Cycles and Hydra render engine
According to the Python API release notes, this is required now along
with super().__init__() which was already done.

Also fixes mistake in example in API docs.

Pull Request: https://projects.blender.org/blender/blender/pulls/132476
2024-12-31 15:18:25 +01:00
Campbell Barton
45dfec6c55 Cleanup: trailing space 2024-11-26 12:41:29 +11:00
Bastien Montagne
fcc1c89923 API Doc: improvements/fixes regarding new requirements for __init__/__del__ 2024-11-19 15:37:04 +01:00
Bastien Montagne
b1d044bfb8 Merge branch 'blender-v4.3-release' 2024-11-11 16:17:04 +01:00
Bastien Montagne
69a7948575 Doc: Py API: Add more info about UNDO operator option.
Essentially, any operator modifying Blender data should enable this
`UNDO` option, else bad things (corruption, crashes...) are likely to
happen.

* Added a new Operator example to explain this topic.
* Updated some existing Operator examples that were not correct anymore.
* Added a new small section in the gotchas page linking to it.
* Added also short reminder about this in the `UNDO` 'tooltip'
  description itself.

Related to #77557.
2024-11-11 16:13:37 +01:00
Bastien Montagne
c18ec7e2ad Fix wrong link in Py API docs after recent refactor. 2024-11-10 18:48:56 +01: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
Pratik Borhade
1395a958d7 Fix #122788: Typo in python api docs 2024-06-06 12:49:29 +05:30
Germano Cavalcante
ce354c4693 Fix #120484: Typo in Blender Python API docs 2024-04-10 14:28:22 -03: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
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
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
Campbell Barton
0ff1414f04 Docs: update bpy documentation, referencing PIP which is now supported
Resolve #114076.
2023-10-24 14:10:34 +11:00
Campbell Barton
7eb0b6cce9 Docs: remove references to "tessface" 2023-09-13 13:31:34 +10:00
Campbell Barton
09a2b5c70f Docs: note that renaming data-blocks sorted them which impacts iteration
Address issue raised in #107027.
2023-04-21 20:36:29 +10:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00