Commit Graph

141 Commits

Author SHA1 Message Date
Brecht Van Lommel
97acee6e68 Cleanup: make format 2024-05-27 12:24:16 +02:00
Brecht Van Lommel
412671a765 Fix: Wrong python tag version in bpy pip package
Did not cause known issues, but better to be right.
2024-05-27 11:58:49 +02:00
Brecht Van Lommel
ef5e04c02e Fix #120181: bpy pip package not installing on macOS
Since macOS 11, the minor version should be zero. Previously 10.x were
major releases.
2024-05-27 11:58:49 +02: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
06adfcaf38 Cleanup: unused imports 2024-04-19 16:09:30 +10:00
Campbell Barton
ae950451ea Cleanup: remove redundant f-string use 2024-04-01 16:51:32 +11:00
Campbell Barton
0eb1317e70 Cleanup: remove unused exception value 2024-03-29 16:18:28 +11:00
Campbell Barton
6a937d646b Cleanup: remove unused variables 2024-03-21 10:11:54 +11:00
Campbell Barton
2e6739967e Cleanup: reduce right-shift in Python scripts
Also place the return type on it's own line as it's easier to identify
when it's in a predictable location instead of the line ending.
2024-02-28 11:02:54 +11:00
Campbell Barton
44e64b8f29 Cleanup: correct type hints for Python scripts 2024-02-28 11:02:53 +11:00
Campbell Barton
4f8db2ee67 Cleanup: use static sets for contains checks, remove f-string use 2024-02-28 11:02:49 +11:00
Sergey Sharybin
05b465f02d Merge branch 'blender-v4.1-release' 2024-02-27 20:02:45 +01:00
Sergey Sharybin
468e4b0e3b Make update: Bring behavior closer to what it used to be
The `make update` will now always update all initialized submodules,
including the library ones.

The `make_update.py --no-libraries` will neither initialize nor update
pre-compiled libraries or tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/118812
2024-02-27 20:02:15 +01:00
Sergey Sharybin
ca63ce835f Merge branch 'blender-v4.1-release' 2024-02-23 17:41:22 +01:00
Sergey Sharybin
9277377f6b Make update: Show Git LFS download progress
Solves the issue of the script potentially sitting for a long time
without having any progress reported. Confusingly, such behavior
depends on Git version.

In older versions (< 2.33) there will be progress reported, but it
then got changed by the commit in Git:

  7a132c628e

The delayed checkout is exactly how Git LFS integrates into the Git
process. Another affecting factor for the behavior is that submodule
configured to use "checkout" update policy is forced to have quite
flag passed to the "git checkout":

  https://github.com/git/git/blob/v2.43.2/builtin/submodule--helper.c#L2258

This is done to avoid the long message at the end of checkout about
the detached state of HEAD, with instructions how to resolve that.

There are two possible solutions: either use "rebase" update policy
for submodules, or skip Git LFS download during the submodule update.

Changing the update policy is possible, but it needs to be done with
a bit of care, and possible revised process for updating/merging
tests data.

This change follows the second idea of delaying LFS download for a
later step, so the process is the following:
- Run `git submodule update`, but tell Git LFS to not resolve the links
  by using GIT_LFS_SKIP_SMUDGE=1 environment variable.
- Run `git lfs pull` for the submodule, to resolve the links.

Doing so bypasses hardcoded silencing in the Git. It also potentially
allows to recover from an aborted download process.

The `git lfs pull` seems to be a nominal step to resolve the LFS links
after the smudging has been skipped. It is also how in earlier Git
versions some Windows limitations were bypassed:

  https://www.mankier.com/7/git-lfs-faq

The submodule update now also receives the "--progress" flag, which
logs the initial Git repository checkout process, which further
improves the feedback.

The byproduct of this change is that an error during precompiled
libraries and tests data update is not considered to be fatal.
It seems to be more fitting with other update steps, and allows
more easily reuse some code.

There is also a cosmetic change: the messages at the end of the
update process now have their own header, allowing more easily
see them in the wall-of-text.

Pull Request: https://projects.blender.org/blender/blender/pulls/118673
2024-02-23 17:40:59 +01:00
Sergey Sharybin
9b2c312ac7 Merge branch 'blender-v4.1-release' 2024-02-23 12:33:11 +01:00
Sergey Sharybin
63613e431e Fix make update pulling libraries when --no-libraries is provided
Likewise, skip tests update when --use-tests is not provided.

It was a bit of ambiguous situation because libraries and tests
are technically submodules. After some feedback it seems that it
is better to ignore submodule for libraries and tests unless
requested explicitly.

Pull Request: https://projects.blender.org/blender/blender/pulls/118631
2024-02-23 12:24:22 +01:00
Falk David
6bc2f6c6d5 Merge branch 'blender-v4.1-release' 2024-02-22 16:44:30 +01:00
Falk David
c7f2a0567e Cleanup: Rename ensure_git_lfs_hooks to ensure_git_lfs
Since the function no longer adds hooks and skips the process deliberatly, the function name doesn't make sense.
Rename to `ensure_git_lfs`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118626
2024-02-22 16:43:33 +01:00
Sergey Sharybin
1e88fd6050 Merge branch 'blender-v4.1-release' 2024-02-22 16:08:14 +01:00
Sergey Sharybin
6e26ee822b Tweak mnake update's LFS installation further
Ensure the filters are installed, but not the hooks.
Should fix the original issue of developers using custom
hooks in the repository.
2024-02-22 16:06:11 +01:00
Sergey Sharybin
dddafe428e Merge branch 'blender-v4.1-release' 2024-02-22 15:52:15 +01:00
Sergey Sharybin
44e121e8c7 Fix URL in previous commit
Need to use pushURL for comparison, not the pull URL.
2024-02-22 15:51:44 +01:00
Sergey Sharybin
3203f534f4 Merge branch 'blender-v4.1-release' 2024-02-22 15:48:57 +01:00
Sergey Sharybin
df0e64f7d8 Fix incorrect pushURL set on the submodules 2024-02-22 15:48:41 +01:00
Sergey Sharybin
2916c8ca96 Merge branch 'blender-v4.1-release' 2024-02-22 15:20:02 +01:00
Sergey Sharybin
520a08a286 Fix make update in systems with manually installed hooks
If LFS hooks are installed manually the automatic installation would
fail.

This change makes it so `lfs` is a valid command of `git`, ensuring
that the package is installed. If the installation fails assume it
is due to tricky local setup, and do not fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/118618
2024-02-22 15:16:01 +01:00
Sergey Sharybin
23c892366b Merge branch 'blender-v4.1-release' 2024-02-22 14:39:05 +01:00
Sergey Sharybin
7b472b83a3 Fix make_update for libraries update
- git lfs install was called a bit too late, after the libraries
  has been checked out, leaving the checkout in a non-resolved
  state.

- Update blender code first, allowing proper submodule hash to
  be pulled.

Pull Request: https://projects.blender.org/blender/blender/pulls/118615
2024-02-22 14:38:37 +01:00
Sergey Sharybin
9cc1962120 Merge branch 'blender-v4.1-release' 2024-02-22 14:01:54 +01:00
Sergey Sharybin
e5e5591c7e Fix wrong architecture detection on Windows
Windows passes architecture of amd64, which needs to be converted
to x64 for the library names.
2024-02-22 14:01:01 +01:00
Sergey Sharybin
396348eea9 Merge branch 'blender-v4.1-release' 2024-02-22 13:51:48 +01:00
Sergey Sharybin
3dc832a904 Switch SVN to Git submodules using Git-LFS
This change makes it so build system and update utilities for Blender builds
are using pre-compiled libraries and other resources attached as Git modules
instead of using checkout of SVN repositories in the parent folder.

The directory layout:
```
  * release/datafiles/
    * assets/        -> blender-assets.git
      * publish/
      * ...
      * README.txt
  * lib/
    * darwin_x64/    -> lib-darwin_x64.git
    * darwin_arm64/  -> lib-darwin_arm64.git
    * linux_x64/     -> lib-linux_x64.git
    * windows_x64/   -> lib-windows_x64.git
  * tests/
    * data/         -> blender-test-data.git
```

The changes about configuring the actual Git sub-modules are not included
into this patch, as those require repository to actually exist before it
can be used.

The assets submodule is enabled by default, and the rest of them are
disabled. This means that if someone runs `git submodule update --init`
they will not get heavy libraries. The platform-specific and tests
related submodules are enabled when using `make update` or `make test`.

All the submodules are tracked: this means that when new commits are
done to the submodule, the blender.git repository is to be updated to
point them to the new hash. This causes some extra manual work, but it
allows to more easily update Blender and its dependencies to known good
state when performing operations like bisect.

Ref #108978

Pull Request: https://projects.blender.org/blender/blender/pulls/117946
2024-02-22 13:50:55 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564ad2.
2024-02-19 15:59:59 +01:00
Brecht Van Lommel
3e0d77c80f Build: macOS support for "make source_archive" 2024-02-11 02:50:23 +01:00
Campbell Barton
5dd91346e1 Cleanup: remove unused imports 2024-01-08 11:40:53 +11:00
Brecht Van Lommel
25cfd64afa Build: remove outdated bf-committers email from bpy package
Mailing lists are no longer active.
2023-11-15 17:40:05 +01: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
Campbell Barton
8f109712ee License headers: use SPDX-FileCopyrightText for build_files/ & tools/ 2023-06-14 23:36:23 +10:00
Campbell Barton
393d4a6e14 Cleanup: duplicate words in comments
Also use doxygen-comments in files where this is already the convention.
2023-05-26 12:40:06 +10:00
Sergey Sharybin
d1254519ad Fix make update for upstream workflow and missing branch in submodule
Fix the issue when upstream workflow is used and the addons fork does
not yet have the release branch. In this case create a local branch
which is based on the upstream/<branch> but does not track anything.

Typically with such workflow the local branches will track origin, but
since the origin does not have the branch yet it is not possible to
track it.

Test plan:
- Use upstream workflow
- Have a fork of addons, which does not have blender-v3.6-release
- Run make update

The error message:
```
Updating scripts/addons ...
git fetch origin
git fetch upstream
git checkout -t origin/blender-v3.6-release
fatal: 'origin/blender-v3.6-release' is not a commit and a branch 'blender-v3.6-release' cannot be created from it
make: *** [update] Error 128
```

Pull Request: https://projects.blender.org/blender/blender/pulls/108197
2023-05-23 17:49:43 +02:00
Sergey Sharybin
a245e294a3 Fix missing assets in the source archive
The assets are required to build proper Blender release, so they can not be
skipped from packing.

The packing ignores the `working` directory as it seems to be big and sounds
that it is not needed for the release.

The assets are bundled under the `release/datafiles/assets` folder in the
blender sources. This is where they will reside after switch to the Git LFS.

Pull Request: https://projects.blender.org/blender/blender/pulls/106536
2023-04-05 09:27:42 +02:00
Sergey Sharybin
b1bf1db656 Fix source_archive ignoring addons
Caused by the changes in the submodules configuration.

Can no longer rely on the `git submodule` command to
show list of external references to be packed.

Needs to be backported to 3.5.1.

Pull Request: https://projects.blender.org/blender/blender/pulls/106502
2023-04-04 09:14:58 +02:00
Sergey Sharybin
74070a1c2c Merge branch 'blender-v3.5-release' 2023-03-17 18:12:20 +01:00
Sergey Sharybin
ddec556ef3 Fix make_update running on a freshly cloned Blender fork
Simple logic: when the repository is not found under the relative
path to the main repository's origin, enforce clone of the upstream
repository instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/105858
2023-03-17 18:07:31 +01:00
Campbell Barton
8859b1cd3c Cleanup: quiet mypy type checking warnings
- make_update.external_script_add_origin_if_needed
  returned None or an empty string. As neither where checked simply
  return None.
- git_get_remote_url had an incorrect annotation.
2023-02-28 15:12:04 +11:00
Sergey Sharybin
40a11c7404 Merge branch 'blender-v3.5-release' 2023-02-27 10:59:30 +01:00
Sergey Sharybin
931b832fb2 Fix make update when local branch exists
Apparently `git checkout -t` is only allowed to happen for new branches.
Added a code which checks whether the branch already exists and it so
uses the `git checkout <branch>`.

Pull Request #105234
2023-02-27 10:58:58 +01:00
Sergey Sharybin
12cc3ccd72 Merge branch 'blender-v3.5-release' 2023-02-24 17:09:29 +01:00