Commit graph

133 commits

Author SHA1 Message Date
Sybren A. Stüvel
2ac1e4c040 Fix blender_theme_as_c.py after rename of ListBase::first
Fix `blender_theme_as_c.py` for the rename of `ListBase::first` to
`first_`.

The script actively parses `dna_rename_defs.h` before accessing the
file's DNA, which means it needs updating after the rename.

Pull Request: https://projects.blender.org/blender/blender/pulls/163948
2026-09-15 11:19:09 +02:00
Campbell Barton
4b807d9158 AUTHORS: update canonical authors 2026-07-08 16:27:13 +10:00
Campbell Barton
9302c22e9d AUTHORS: de-duplicate and remove llm-assistant Co-author 2026-07-02 16:43:11 +10:00
Damien Picard
299dc53688 AUTHORS: Sort individuals and add 60 new authors
Notice while doing this that
"blender <blender@MacBook-Pro-von-Thomas.local>" from dab88d61eb is
apparently Thomas Dinges, so add this address to the list of canonical
authors.

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
6c279ff773 Authors Script: Improve author name collation
This commit improves author name collation the same way we did
previously for the credit generation script: by normalizing the
strings using the decomposed unicode variant, and by folding their
case so that non-title case names aren't at the end of the list.

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
38362416ec Cleanup: Remove duplicate exclusion condition from authors_git_gen
Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
8179e24b78 Credits Script: Report duplicate emails
Also add duplicate identities found using this report to the canonical
authors list.

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
682da2d0e5 Credits Script: Report duplicate authors
Also add duplicate identities found using this report to the canonical
authors list.

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
5dddefc8d6 Credits Script: Ignore rubbish at the end of co-author lines
Co-author lines are parsed in commit messages to add to the credits.
When the line does not end with the author's email, it will create a
duplicated entry. This is easy to fix if the email is enclosed in <>,
just discard what follows the address.

Example of this in commit e10a50f890

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
1543338543 Credits Script: Use padding for month and day in date
Credits are generated with a footer that reads
"Generated by 'credits_git_gen.py' 2026/6/22".
It is better to pad the month and day so that they appear as
"2026/06/02".

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
b718fce723 Credits Script: Fold case for organizations
Use `str.casefold` as sorting key for organizations, which arguably
reads more naturally when an organization has a uppercase name.

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
5c45585ae0 Credits Script: Improve author name collation by folding their case
Some author names are written in lower case, which by default places
them after title case ones.

This commit uses `str.casefold()` to ignore case during sorting.

Ref !160527
2026-07-02 12:14:59 +10:00
Damien Picard
9ddb532e51 Credits Script: Improve author name collation by decomposing them
Some authors have names containing non-English letters. Using the
default sort, those names are written at the end of the list.

This commit uses `unicodedata.normalize('NFD', ...)` during sorting.
This outputs the decomposed unicode variant of a string, such that
diacritized letters are found after their undiacritized version
instead of at the very bottom.

This does not solve collation for names written in a non-latin
alphabet, which would probably require external libraries.

Ref !160527
2026-07-02 12:14:59 +10:00
Campbell Barton
31ead990e9 Cleanup: use non hyphenated term "docstring"
This term isn't typically hyphenated in technical text,
add to the dictionary and remove hyphenation.

Ref !158846
2026-05-22 05:06:07 +00:00
Campbell Barton
1991a1363b Cleanup: spelling in comments (make check_spelling_*)
Ref !158792
2026-05-20 11:33:08 +10:00
Sybren A. Stüvel
98360c3e98 Refactor: rename .../assets/remote_library_listing to remote_library
Rename `scripts/modules/_bpy_internal/assets/remote_library_listing/`
to `.../remote_library/`. The Python module started out as code for
the remote listing, but now has all the asset-related code (so also
downloading the assets themselves).

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/158651
2026-05-15 16:30:51 +02:00
Sybren A. Stüvel
c06b5c1dbd Python: Add docstrings to OpenAPI-generated dataclasses
Take the 'description' fields from the OpenAPI schema definition file,
and use those to generate docstrings for the dataclasses.

This adds another dependency to the generator's virtualenv:
docformatter. The generator already runs autopep8 via Blender's `make
format` command, but that doesn't rewrap long docstrings. That's what
docformatter now does.

No functional changes, just added developer comfort.

Pull Request: https://projects.blender.org/blender/blender/pulls/158598
2026-05-14 16:19:10 +02:00
Brecht Van Lommel
8e64d47a09 Merge branch 'blender-v5.1-release' 2026-03-03 16:23:19 +01:00
Brecht Van Lommel
a7adafb8fa Fix #155106: blender_theme_as_c.py uses wrong header includes
Problem introduced in 9550baa99a.
2026-03-03 16:13:25 +01:00
Sybren A. Stüvel
ce34c5de34 Assets: Python code for generating and downloading assets & listings
Part of the remote asset libraries project, see:
https://projects.blender.org/blender/blender/issues/134495

No user visible changes expected.

This commit contains all the Python code necessary integration with
Blender's asset system (so for downloading asset listings, previews, and
the assets themselves), and for the `blender -c asset_listing` CLI
command.

The OpenAPI datamodel generator no longer includes the OpenAPI schema in
the generated code. That was intended to be used by a validation
library, but as it turns out, that couldn't handle the recursive
definitions we need. Now the code just relies on the validation from the
cattrs library, which is good enough for our purpose.

Available CLI commands:

blender -c asset_listing generate:
  Generates the asset listing for all assets in the current directory &
  subdirectories.

blender -c asset_listing download <URL>:
  This is more of a test command, to download the asset listing. The URL
  should point to the root of the asset library, so basically a
  HTTP-exposed version of the same directory in which the `generate`
  command above was given.

  The files are downloaded to `./_asset_download_location`. That way the
  current directory isn't spammed with multiple files.

Downloading includes a time-based 'stamp' for cache-busting, when
requesting the top-level JSON file of a remote asset library's listing.
This stamp is the number of seconds since some point in time, divided by
60, to make it change once per minute. This means that a caching service
like CloudFlare can cache the response, and only forward the query to
our HTTP server once every minute.

Co-authored-by: Julian Eisel <julian@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/153284
2026-02-13 16:32:51 +01:00
Campbell Barton
332680f1a9 AUTHORS: add 54 new authors 2026-02-12 21:41:15 +11:00
Sybren A. Stüvel
374b742b3c Python: upgrade OpenAPI datamodel-code-generator to 0.53.0
datamodel-code-generator version 0.42.1 fixed a bug[1] for which the
Remote Asset Libraries project had to implement a workaround. Version
0.53.0 introduces some backward-incompatible changes[2], and so it's
best to upgrade to that version before seriously using this generator.

[1]: https://github.com/koxudaxi/datamodel-code-generator/issues/836
[2]: https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.53.0

Before running `ninja generate-datamodels` (replace `ninja` with your
build tool of choice), make sure you delete the virtualenv
(`generate_datamodels_venv/` in your build directory). It will be
recreated with the new dependency version by the next run of `ninja
generate-datamodels`.

Pull Request: https://projects.blender.org/blender/blender/pulls/153427
2026-01-26 16:46:47 +01:00
Campbell Barton
d1c9ef117d Cleanup: spelling in comments, strings & vars (make check_spelling_*) 2025-11-29 22:12:24 +11:00
Campbell Barton
13091b2b48 AUTHORS: de-duplicate & update (1 new author) 2025-11-11 15:50:03 +11:00
Campbell Barton
f58e2a9a79 Tools: add --all-authors argument to authors_git_gen.py
Some duplicate names were excluded from authors/credits list.
Support including all authors so they can be de-duplicated.
2025-11-11 15:43:12 +11:00
Campbell Barton
12f5fae69b Tools: update canonical authors for credits generator
Previous updates only accounted for AUTHORS which doesn't
overlap with credits which includes different directories.
2025-11-07 12:18:22 +00:00
Campbell Barton
8747105632 AUTHORS: add 41 authors, deduplicate 4 2025-11-07 06:15:42 +00:00
Damien Picard
2c9fd6752e Tools: Make git credits stable when sorted by commits
Only sorting by the number of commits was unstable
when authors had the same number of commits.

Make the output stable by including the name in the sort "key".

Ref !149460
2025-11-07 03:21:36 +00:00
Damien Picard
3b83d75c4e Tools: Escape author HTML in git credits
Authors in credits_git_gen.py includes email addresses if the
`--use-email` flag is passed which include characters that need
to be escaped.

Ref !149459
2025-11-07 03:21:35 +00:00
Campbell Barton
60475f3c3b Cleanup: minor changes to credits generator
- Resolve linter warnings.
- Remove unnecessary str.format.
- Return the exit code from main() instead of nested functions.
2025-11-05 23:15:34 +00:00
Dalai Felinto
c625ca80c0 Credits: Use AUTHORS to generate the corporate credits and simplify
This uses the orgs section of AUTHORS to generate the corporate part of
the html credits.

This also simplifies and simply list the orgs without the specific
contribution. This reduces the maintaince burden of keeping this list
up-to-date (which was always very arbritrary.

---

Example, it goes from:
```
Adidas – Principled BSDF shader in Cycles
AMD – Cycles HIP GPU rendering, CPU optimizations, Hydra integration
Apple – Metal GPU backends, USD integration
AutoCRC – Improvements to fluid particles, vertex color baking
BioSkill GmbH – H3D compatibility for X3D Exporter, OBJ Nurbs Import/Export
Facebook – Cycles subsurface scattering improvements
Intel – Cycles oneAPI GPU rendering, CPU optimizations
NVIDIA – Cycles OptiX GPU rendering, USD integration
Sony Interactive Entertainment – Deployment improvements
Unity Technologies – FBX Exporter
```

To:
```
Adidas
AMD
Apple
AutoCRC
BioSkill GmbH
Facebook
Intel
NVIDIA
Sony Interactive Entertainment
Unity Technologies
```

It also adds more orgs which were listed on AUTHORS (Qualcomm, Blender Foundation, ...).

Pull Request: https://projects.blender.org/blender/blender/pulls/149424
2025-11-05 23:11:40 +01:00
Campbell Barton
1216651ca9 PyAPI: make internal modules explicitly "private"
Rename modules in `./scripts/modules/` to use an underscore prefix to
make it clear they aren't intended to be part of public API's. This
also means there is no implication that these modules should be stable,
allowing us to change them based on Blender's internal usage.

The following modules have been marked as private:

- `animsys_refactor`
- `bl_console_utils`
- `bl_i18n_utils`
- `bl_previews_utils`
- `bl_rna_utils`
- `bl_text_utils`
- `bl_ui_utils`
- `bpy_restrict_state`
- `console_python`
- `console_shell`
- `graphviz_export`
- `keyingsets_utils`
- `rna_info`
- `rna_manual_reference`
- `rna_xml`

Note that we could further re-arrange these modules
(under `_bpy_internal` in some cases), this change is mainly to mark
them as private, further changes can be handed on a case-by-case basis.

Ref !147773
2025-10-13 09:35:09 +00:00
Thomas Dinges
1a666b5722 Authors: de-duplicate 2025-09-12 12:37:45 +02:00
Damien Picard
5998795aa6 UI: Replace contractions with long-form text
Avoid using contractions for can't, aren't, doesn't, and shouldn't.
Following the writing style guide in the Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/143852
2025-08-05 11:16:22 +02:00
Sybren A. Stüvel
3ca28acbb3 Introduce Python code generator for OpenAPI spec to dataclasses
Add a [Python code generator][1] that takes an OpenAPI definition and
outputs the corresponding data model as [dataclasses][2]

This is intended to be used in the Remote Asset Library project, to
create, download, parse, and validate information of a remote asset
library.

[1]: https://koxudaxi.github.io/datamodel-code-generator/
[2]: https://docs.python.org/3/library/dataclasses.html

## Running the Generator

The generator is a Python script, which creates its own Python
virtualenv, installs the dependencies it needs, and then runs the
generator within that virtualenv.

The script is intended to run via the `generate_datamodels` CMake
target. For example, `ninja generate_datamodels` in the build
directory.

## Details

The virtualenv is created in Blender's build directory, and is not
cleaned up after running. This means that subsequent runs will just
use it directly, instead of reinstalling dependencies on every run.

## Generated Code & Interaction with Build System

It is my intention that the code generation _only_ happens when the
OpenAPI specification changes. This means that the generated code will
be committed to Git like any hand-written code. Building Blender will
therefore _not_ require the code generator to run. Only people working
on the area that uses the generated code will have to deal with this.

Pull Request: https://projects.blender.org/blender/blender/pulls/139495
2025-08-01 16:33:56 +02:00
Campbell Barton
e5947bdf63 Cleanup: spelling (make check_spelling_*)
Also exclude some files that have too many false positives.
2025-07-20 14:59:19 +10:00
Campbell Barton
bc0ab8c6d9 Merge branch 'blender-v4.5-release' 2025-07-10 12:51:37 +10:00
Campbell Barton
9d7e4890c8 Merge branch 'blender-v4.5-release' 2025-07-10 12:51:32 +10:00
Campbell Barton
2f2331d067 Tools: warn about duplicate authors in the author list generator 2025-07-10 12:49:08 +10:00
Campbell Barton
f72f5a2297 AUTHORS: de-duplicate 2025-07-10 12:48:33 +10:00
Campbell Barton
0a2d3d9d85 Merge branch 'blender-v4.5-release' 2025-07-09 11:23:56 +10:00
Campbell Barton
85ad73809f AUTHORS: add 45 new authors 2025-07-09 01:22:00 +00:00
Campbell Barton
37fe1b9b8d Merge branch 'blender-v4.5-release' 2025-06-19 10:34:11 +10:00
Campbell Barton
41bf2f598f Cleanup: spelling in comments (make check_spelling_*) 2025-06-19 00:10:18 +00:00
Bastien Montagne
18635b604c Fix missing update for blender_theme_as_c script after BE removal.
Follow-up to blender/blender@bc80ef136e.
2025-06-12 15:09:23 +02:00
Aras Pranckevicius
5ad6d42c83 IO: Remove Collada import/export
Removes Collada import/export (has been deprecated since 4.2).

Pull Request: https://projects.blender.org/blender/blender/pulls/139337
2025-06-06 08:38:57 +02: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
Campbell Barton
4237e6134c Docs: note what git_data_canonical_authors.py is used for. 2025-04-24 01:30:11 +00:00
Campbell Barton
9567ac1272 Cleanup: quiet python linter warnings 2025-04-16 11:08:40 +10:00
Campbell Barton
a65569f367 Merge branch 'blender-v4.4-release' 2025-03-12 21:55:59 +11:00