Commit Graph

1586 Commits

Author SHA1 Message Date
Campbell Barton
57c023d580 Preference: add option allow internet access
Add a preference to "Work Offline" system preference as well as command
line options `--offline-mode` & `--online-mode`
(which overrides the preference).
This option is displayed in the initial setup screen too.

This is currently respected by:

- Check for updates on startup
- Disables running an update when enabling extensions.

When Blender is launched with `--offline-mode` the option cannot be
enabled in the preferences. This is intended for environments
where internet access is intentionally disallowed.

Background: with Blender supporting access to online-repositories
as well as 3rd party extensions themselves potentially accessing the
internet. This setting provides a way for users to disable online
functionality.

This prevents error messages when online access fails in environments
without internet access as well as the ability for users who prefer
Blender doesn't access the internet to have one place to turn this off.

While it does not enforce limitations on add-ons, 3rd party scripts
are expected to respect this setting using `bpy.app.internet_offline`.

The details for this will be handled along with other policies scripts
are expected to follow.

Ref !121994
2024-05-23 13:50:06 +10:00
Sergey Sharybin
90b9f90ca7 Cleanup: Code style 2024-05-22 19:14:37 +02:00
Richard Antalik
8c53a18c48 Cleanup: Refactor VSE selection tools keymap
Split single keymap definition into timeline and preview as well as LCS
and RCS definitions.

This improves readability of keymap code.

Tweak and Box Select tools will now use "Sequencer Timeline Tool",
or "Sequencer Preview Tool" entries instead of "Sequencer Tool", so
custom keymaps or scripts have to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/121846
2024-05-22 18:46:53 +02:00
Campbell Barton
08df46d7cd Extensions: support token access for remote repositories
This introduce a new "secret" per-repository property of type password
as described by #121856.

A token or secret may be used by some non blender.org repositories.

This only shows for remote repositories and is shown in the
"Add Remote Repository" popup.

This commit doesn't implement sending to token to the server which will
be implemented separately.

Ref !121886

Co-authored-by: Dalai Felinto <dalai@blender.org>
2024-05-22 20:40:28 +10:00
Campbell Barton
774f59dd07 Cleanup: remove unnecessary check left in last commit
Should have been removed in 236c0f61b1e1686f1b053a290c8b8a526f94721f.
2024-05-22 20:22:47 +10:00
Campbell Barton
236c0f61b1 Cleanup: avoid duplicate attribute access in scripts 2024-05-22 20:20:47 +10:00
Campbell Barton
268b2fcc0d Cleanup: follow core-scripts conventions for world.py operators
- Replace f-string with str.format
- Comment type annotations.
- Use double-quote for non-enum strings.
- Use single instead of double-underscores for private functions.
2024-05-22 20:08:02 +10:00
Campbell Barton
97c70883d0 UI: un-indent tooltip text for WORLD_OT_convert_volume_to_mesh 2024-05-22 20:06:21 +10:00
Campbell Barton
57986ad2f9 License headers: add SPDX header 2024-05-22 19:55:33 +10:00
Campbell Barton
54cf0f7f4c Extensions: add support for "build" paths in the manifest
Add an optional `[build]` table, only used for the "build" sub-command.

Supported entries.

- `paths = [..]` list of strings.
  Explicitly list all paths to include.
  Python "wheels" and the manifest are automatically included.

- `paths_exclude_pattern = [..]` list of strings.
  A `.gitignore` compatible list of patterns.

By default "paths_exclude_pattern" is set to:
[".*", "__pycache__"] when the `[build]` table entry isn't found.

Only one of these options is supported at once since it makes to sense
to exclude paths when they're manually listed.
2024-05-22 15:02:12 +10:00
Campbell Barton
124f003fcb Cleanup: correct comments for package building
Also remove an unnecessary exclusion.
2024-05-22 12:35:17 +10:00
Bastien Montagne
82f9501a4a Collada: Mark the I/O operators as legacy in the UI.
Ref. https://devtalk.blender.org/t/moving-collada-i-o-to-legacy-status/34621
2024-05-21 17:02:00 +02:00
Christoph Lendenfeld
3a40d2813f Anim: Pose Library - Allow blending flipped from the context menu
This adds the `Blend Pose Flipped` option to the
context menu of the pose library.
The operator already accepted a flipped property,
it was just missing a dedicated menu entry for that.

In order for this to work, the modal operator had to be modified.
Instead of setting the flipped state, pressing `Ctrl` now acts as a toggle.
That means that if the operator has been started in flipped mode,
pressing and holding `Ctrl` will unflip it.

This has been a point of discussion in the A&R module meeting
https://devtalk.blender.org/t/2024-05-14-animation-rigging-module-meeting/34614#ux-quirks-in-the-pose-library-shelf-5

Pull Request: https://projects.blender.org/blender/blender/pulls/121857
2024-05-21 11:08:22 +02:00
Colin Basnett
2fe92c63d3 Geometry Nodes: Add Active Element tool node
This pull request adds an "Active Element" node that exposes the active
vertex, edge, or face index to the geometry node tool context. The
presence of an active element is available as a boolean.

This node enables the creation of "active-to-selected" style operators.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121333
2024-05-20 21:01:30 +02:00
Campbell Barton
e0b043d076 Cleanup: minor changes to the splash "Quick Setup"
No functional changes.

- Remove unnecessary variable declarations.
- Declare wm & prefs at the function beginning
  to prevent noisy patches in case they're used elsewhere in the future.
- Correct invalid comment.
2024-05-20 12:51:20 +10:00
Campbell Barton
096eed9d7f Cleanup: spelling in comments 2024-05-20 10:23:54 +10:00
Clément Foucault
e0b3dee35a EEVEE-Next: Jittered Soft Shadows
Jittered Soft Shadows support.
Improves soft shadow quality at the cost of re-rendering shadow maps every sample.
Disabled by default in the viewport unless enabled in the Scene settings.

| Tracing-only | Jitter-only | Jitter+Over-blur |
| --- | --- | --- |
| ![imagen](/attachments/e5ca6120-0666-4e86-b6e0-3d7512587b86) | ![imagen](/attachments/a72631aa-14f8-4e10-a748-848fc4bd4ab2) | ![imagen](/attachments/07c5de65-61d2-48e7-b78c-9c3cbdcaf844) |

Tracing-only is the method used by default in EEVEE-Next.
Jitter-only is the method used by EEVEE-Legacy Soft Shadows.
Jitter+Over-blur combines both.

Co-authored by Miguel Pozo @pragma37 (initial patch #119753)

Pull Request: https://projects.blender.org/blender/blender/pulls/121836
2024-05-18 17:21:47 +02:00
Julien Duroure
20d8f48500 glTF exporter: Allow custom attribute UVMap to be on point domain
Fixes the root cause of #121204
2024-05-18 08:54:35 +02:00
Campbell Barton
e0b47f78e8 Extensions: show permissions, validate permission values 2024-05-18 16:52:21 +10:00
Julien Duroure
876bfdcbdf glTF exporter: Fix #121878 crash when exporting without animation 2024-05-18 08:50:21 +02:00
Julien Duroure
733bd00432 glTF exporter: fix typo in Vertex Color Alpha management 2024-05-18 07:00:58 +02:00
Campbell Barton
dc7cfb7905 Extensions: improve colors for the "list" subcommand
The dark-grey tagline on black was difficult to read.
2024-05-17 14:53:17 +10:00
Campbell Barton
c598e8c8a7 Fix #121876: index.json error in console, accumulation of @ files
Fix missing check for the existence of index.json before removal.
Also write errors to the stderr instead of the stdout.
2024-05-17 13:56:52 +10:00
Campbell Barton
bf7267638a Fix #121892: string formatting errors in the clip editor & sequencer
Regression in 0e3b594edb910ccb811bd5ac1998868d9ec72ea1.
2024-05-17 13:24:34 +10:00
Campbell Barton
2391407116 Cleanup: resolve mypy type warnings 2024-05-17 12:15:03 +10:00
Campbell Barton
676ac9cfb1 Cleanup: de-duplicate error handling when downloading extension data 2024-05-17 12:01:25 +10:00
Campbell Barton
489b6aed18 Extensions: always show errors when checking for updates fails 2024-05-17 12:01:07 +10:00
Campbell Barton
05617ed07d Extensions: clarify defaults in extension command line help text
Also don't use `.` for the output-filepath because it's not a directory.
2024-05-17 10:32:20 +10:00
Campbell Barton
64c4c939a9 Fix "missing scripts" being unavailable in the extensions UI
Add-ons which were enabled but not found warn on startup
and were shown under "Missing scripts", where they can be ignored
(the user can choose to restore the paths) or disabled them to suppress
the warnings in future.

This is now available again, with a minor refactor.
2024-05-16 22:55:20 +10:00
Brecht Van Lommel
a926f5b67d Refactor: Replace ID_IS_LINKED by !ID_IS_EDITABLE
Add new ID_IS_EDITABLE macro that checks if the ID can be edited in the
user interface. Replace usage of ID_IS_LINKED where it is used with this
meaning.

Also add a corresponding ID.is_editable property for Python.

This prepares for the ability to edit some linked datablocks for brush
assets.

Pull Request: https://projects.blender.org/blender/blender/pulls/121838
2024-05-16 14:53:09 +02:00
Brecht Van Lommel
430c58bbb2 Fix: Inconsistent use of Add-On in label instead of Add-on 2024-05-16 14:05:29 +02:00
Julien Duroure
b583b6ec39 glTF I/O: Use nodes for alpha clipping
Replace the use of Blend Mode on EEVEE (legacy), not existing on EEVEE-Next
2024-05-16 13:14:41 +02:00
Campbell Barton
3003953e14 Extensions: rename the internal name for repository JSON
Use the name "index.json" instead of "bl_ext_repo.json".

This makes more sense as the name is automatically added to the end
of file:// URL's a little like index.html for web-sites.
2024-05-16 20:44:59 +10:00
Campbell Barton
1e852879c5 Cleanup: remove extensions readme
Some of this is outdated.
Documentation for extensions is now part of developers docs.
2024-05-16 20:43:40 +10:00
Campbell Barton
d91e6f7b14 Extensions: use the modal update when enabling the repository
This allows the user to cancel the update by pressing escape.
2024-05-16 17:01:44 +10:00
Campbell Barton
af996db23a Extensions: use the wait cursor for modal actions
Actions such as update/install now use the wait cursor.
2024-05-16 17:01:44 +10:00
Campbell Barton
30f4a5e051 Fix error checking for updates on startup
Manually deleting the extensions directory caused checking for
updates on startup to fail.

It attempted to create a directory without the parent existing
which raised an error.
2024-05-16 17:01:44 +10:00
Campbell Barton
8ff15f1c70 Cleanup: restore error, exclude extensions tests from bl_load_py_modules
Also remove outdated exclusions.
2024-05-16 16:02:25 +10:00
Campbell Barton
6e6ce17e34 Addons: include addons_core/modules in sys.path when found
Renaming "addons" to "addons_core" should have included this change.
2024-05-16 15:18:42 +10:00
Campbell Barton
744819cf9b Addons: only ever check "addons_core" for bundled add-ons
Avoid checking every scripts directory for add-ons core,
as creating this directory would cause "addons" to be ignored.
2024-05-16 15:06:10 +10:00
Campbell Barton
672d203e67 Extensions: support file URI's for the remote URL
Previously regular paths were supported however supporting both
URL's and file paths isn't very common & complicated internal logic.

Also fixed an error where the server-generate sub-command created the
"archive_url" from the file-name without URL encoding.
2024-05-16 13:41:39 +10:00
Campbell Barton
dd1769088b Fix error dropping a local extension onto Blender 2024-05-16 12:11:46 +10:00
Campbell Barton
ecec9de4e6 Cleanup: remove internal argument to override the support level
This was only ever used for addons_contrib which has been removed.
2024-05-16 09:03:16 +10:00
Dalai Felinto
eab9e05773 Extensions: Update repository listing after enabling Blender repository
Without this the experience was:
* Launch Blender
* Go to Preferences > Extensions
* Click on Enable Repository

Nothing happens...

* Restart Blender
* Go to Preferences > Extensions

You would see an error: Repository ... must sync with the remote
repository.

In theory users had to click on "Check for Updates" for this to go away.
This commit does it automatically for them.
2024-05-15 20:22:43 +02:00
Dalai Felinto
88e76a0667 Remove warning from VR and UI Translate add-ons 2024-05-15 19:39:56 +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
13a3603578 Move addons from the addons repo to "addons_core"
Ref: !121825
2024-05-15 19:26:29 +02:00
Chao Li
4b59c1bcbf GPv3: Merge by distance Operator
The algorithm to merge points based on distance thresholdhas been
implemented in 8b7d5f8587. This patch moves the function to
`blender::ed::greasepencil` namespace and use it to implement
merge by distance operator.

There are two parameters for the operator:
`threshold`: Distance threshold used for merging.
`use_unselected`: Use whole stroke or only selected points

Resolves: #113917
Pull Request: https://projects.blender.org/blender/blender/pulls/120385
2024-05-15 16:25:41 +02:00
Lukas Tönne
7a3cd753ba GPv3: Fill tool to generate strokes in empty areas
Implementation of the GPv2 Fill tool in Grease Pencil 3.

This tool creates new strokes where the user clicks, by rendering
strokes into an image and then performing flood-fill and boundary
search operations.

This is a minimal first part, several features of the GPv2 tool are
still missing (gap filling methods, smoothing, dilate/erode).

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120693
2024-05-15 13:36:06 +02:00
Sean Kim
1cf0d7ca6a Sculpt: Add customizable increment for line tool snapping
Sculpt: Add customizable increment for line tool snapping

This PR exposes the snap increments introduced in #118760 to the base
`WM_gesture_straightline` operators and exposes the increment menu to
allow users to change this value in both Sculpt and Weight Paint mode.

## Details
The full list of operators this affects:
* IMAGE_OT_sample_line
* PAINT_OT_weight_gradient
* MESH_OT_bisect
* PAINT_OT_mask_line_gesture
* SCULPT_OT_trim_line_gesture
* SCULPT_OT_project_line_gesture
* PAINT_OT_hide_show_line_gesture

## Compatibility
Previously, the hardcoded value for this snap increment was 15 degrees,
by using the toolsetting value, this changes the default to 5 degrees.

Pull Request: https://projects.blender.org/blender/blender/pulls/121547
2024-05-14 19:00:58 +02:00