Commit Graph

1567 Commits

Author SHA1 Message Date
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 0e3b594edb.
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
Bastien Montagne
b8febd87e1 Fix #121712: outdated mapping between UI translations and Doc languages.
Both lists got heavily out of sync over the years.

Some day would be nice to have this managed in a single place.
2024-05-14 16:53:00 +02:00
Campbell Barton
2c47937a96 Extensions: add Preferences.extensions
Accessing extensions options in preferences.filepaths didn't make so
much sense.
2024-05-15 00:52:23 +10:00
Clément Foucault
ea5e1fef2a EEVEE-Next: Sunlight Extraction
Sun extraction convert part of light comming from the world to a
sun light which increases the quality of the rendering. The goal
of this feature is to workaround the limitation of the storage
techniques used for environment lighting inside EEVEE.

This first implementation works by clamping the world lighting and
summing the excess lighting and (and its incomming directions) to
deduce the sun position.
All the lighting is then transfered into this light power. The sun
angle is computed based on the directionnality of the excess lighting,
the more divergent the excess lighting is, the bigger the angle.

This has a few benefits:
- It's stable and behave well under animation. This is because we
average a lot of data.
- It's fast as it can be done inside the remap shader in one pass.
- It requires only one parameter, the clamp threshold.

However, it has some issue:
- It modifies the lighting as we change the incomming direction for
excess lighting away from the chosen sun direction. This could be fixed
by masking only lighting around the chosen sun direction (requires 2
passes, slower).
- Given that this only average the direction, it behaves poorly if there
two opposite bright light sources (it puts the sun in the middle). This
could be fixed by extracting more suns, but that becomes more complex
and requires even more passes.
- It looks bad if the summed lighting is not supposed to be a perfect
disk in specular reflections or if the sources are too divergent as the
disk is too big and the approximation fails short. This could be
mitigated by adding an upper bound to the sun radius. For now we
workaround this issue by exposing the sun angle parameter in the UI.

A more precise algorithm can be implemented in the future to avoid
having to deal with these limitations. A possibility is to use
importance sampling to randomize sun position. But that would be only
for final render.

Pull Request: https://projects.blender.org/blender/blender/pulls/121455
2024-05-14 16:36:12 +02:00
Sergey Sharybin
727a90a0f1 Compositor: Make GPU compositor an official feature
Effectively, make GPU compositor available without need to enable
an experimental feature set.

The compositor device is now exposed in the Performance panel of
Render Buttons. It is also still available in the compositor's
N-panel, together with some other options which are more about how
editing works, and not exactly related to render performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/121398
2024-05-14 15:49:20 +02:00
Falk David
5d7e785fdd GPv3: Brush radius unit option
This implements and exposes the `View`/`Scene` brush radius option.

* `View`: Brush units are in pixels. Zooming in and out in the viewport will make the brush stay the same size relative to the view, but grow/shrink relative to the scene.
* `Scene`: Brush units are in meters. Zooming in and out in the viewport will make the brush grow/shrink relative to the view, but stay the same size relative to the scene.

The default radius unit is `Scene`, which is what GPv2 did.

The "2D Animation Template" was updated to disable using the radius in the unified paint settings. This means that using the template by default will use the brush radius, which also mimics the behavior of GPv2.

The user can change the radius brush unit from the `Advanced` panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/120257
2024-05-14 15:20:31 +02:00
Falk David
890105b5ef GPv3: Add empty "Weights" menu in weight paint mode
This menu is just added as a stub for now.
2024-05-14 14:40:40 +02:00
Falk David
16af82a10f Fix: GPv3: Warning in space_view3d.py
The weight paint mode in grease pencil doesn't
have a selection menu. Make sure to not try and
add it.
2024-05-14 14:40:40 +02:00
Falk David
a5a49e8b06 Fix: GPv3: View3D header
There was some duplicated logic in the UI code
for the view 3d header.

This deduplicates the logic and moves the code
to the right place.
2024-05-14 14:40:40 +02:00
Campbell Barton
cdee8627b2 Extensions: rename repository "remote_path" to "remote_url"
Existing repository preferences will be reset to defaults.
2024-05-14 20:59:03 +10:00
Clément Foucault
e72c47751d EEVEE-Next: UI Shadow Resolution Limit
Improve naming and tooltips. Also fix a bug in the UI script.
2024-05-13 18:39:47 +02:00
Brecht Van Lommel
9bc8e438ef Cleanup: make format 2024-05-13 16:54:52 +02:00
Nika Kutsniashvili
4dbca26b5c UI: Reorganize 'Select' menus in 3D Viewport
Reorganizes the "Select" menus in all 3D Viewport modes to create more
consistency and sort/group operators according to logic laid out in #121337

More details and images in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/121521
2024-05-13 16:29:17 +02:00
Falk David
4f2f97d498 Formatting 2024-05-13 16:28:19 +02:00
Nika Kutsniashvili
ede675705e UI: Reorganize 'Select' menus in editors
Reorganizes (and in some cases add missing operators to) all 'Select'
menus in all editors except 3D Viewport (done in a separate patch).

The goal of this change is to make menus as consistent as possible, and
to group & sort items according to a certain logic, which should be easy to
remember and users can always expect certain items to be always at same
place in every editor.

More details and images in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/121337
2024-05-13 16:27:23 +02:00
Sybren A. Stüvel
d94a56bdad Anim: merge Animation data-block into bAction
The new/experimental, layered `Animation` data-block is merged with the
existing `bAction` data-block.

The `Animation` data-block is considerably newer than `bAction`, so the
supporting code that was written for it is also more modern. When moving
that code into `bAction`, I chose to keep the modernity where possible,
and thus some of the old code has been updated as well. Things like
preferring references over pointers.

The `Animation` data-block is now gone from DNA, the main database, etc.
As this was still an experimental feature, there is no versioning code
to convert any of that to Actions.

The DNA struct `bAction` now has a C++ wrapper `animrig::Action`, that
can be obtained via `some_action->wrap()`.

`animrig::Action` has functions `is_empty()`, `is_action_legacy()`, and
`is_action_layered()`. They **all** return `true` when the Action is
empty, as in that case none of the data that makes an action either
'legacy' or 'layered' is there.

The 'animation filtering' code (for showing things in the dope sheet,
graph editor, etc) that I wrote for `Animation` is intentionally kept
around. These types now target 'layered actions' and the
already-existing ones 'legacy actions'. A future PR may merge these two
together, but given how much work it was to add something new there, I'd
rather wait until the dust has settled on this commit.

There are plenty of variables (and some comments) named `anim` or
`animation` that now are of type `animrig::Action`. I haven't renamed
them all, to keep the noise level low in this commit (it's already big
enough). This can be done in a followup, non-functional PR.

Related task: #121355

Pull Request: https://projects.blender.org/blender/blender/pulls/121357
2024-05-13 15:58:04 +02:00
Clément Foucault
c7bc3334ad EEVEE-Next: Shadow: Add Maximum Resolution Option
This adds a light parameter to avoid near camera pixels
allocating too much shadow resolution.

This is more intuitive than the scale shadow setting and
allows reducing the precision without changing the look
of distant shadows.

For sun lights, the property sets the minimum pixel
size the shadow can contains. This allows to
remove a lot tilemap close up.

For local lights, there is another additional property
to set the maximum resolution in shadow space (like
EEVEE-Legacy) instead of in world space (like sun
lights). This allows making older files lighter and
allow a more conservative approach to resolution.

This add versionning code to handle EEVEE-Legacy files
that had fixed resolution per light type.

The resolution setting is always in world space distance
as the maximum shadow resolution distribution might change
in the future or be dependent on other parameters
(like beam angle). This ensure that there is no
dependency on these parameters, but make the
setting use very small units. But this is more of
a UI problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/121701
2024-05-13 14:34:11 +02:00
Lukas Tönne
bacfec10bb Cleanup: GPv3: Rename _defs_paint_grease_pencil for consistency
Rename the `_defs_paint_grease_pencil` toolsystem definition to
`_defs_grease_pencil_paint` for consistency with other definitions,
like `_defs_grease_pencil_sculpt`.
2024-05-13 14:11:59 +02:00
Pablo Vazquez
6e42c3d920 UI: Sequencer Overlays layout improvements
Follow the layout closer to the 3D Viewport overlays.

* Wider, to fit two-column layout and translations.
* Move general settings on top.
* Move strips-related overlays into their own subpanel.
* Move `Thumbnails` higher up so it's more easily reachable.
* Rename `F-Curves` to `Animation Curves`.
* Remove redundant labels.
* Gray out "Waveform Style" when set to Off.

Pull Request: https://projects.blender.org/blender/blender/pulls/121591
2024-05-13 12:25:35 +02:00
Falk David
7f8d4df410 UI: Add eyedropper button to camera focus distance
Blender already had the ability to sample the depth with an eyedropper
and fill the focus distance (see `"ui.eyedropper_depth"`). But this feature
was fairly hidden. You had to hover over the `focal_distance` property
in the camera data panel and then press `E` (then sample a distance
in the 3D viewport).

This patch adds a `prop_data_path` property to the `ui.eyedropper_depth`
operator to allow specifying the property that should be filled with the
depth value.

The idea for this is taken from `wm.radial_control`, which also uses this
approach to write to a property. This allows us to add the eyedropper
as a button.

Pull Request: https://projects.blender.org/blender/blender/pulls/121486
2024-05-13 11:01:57 +02:00