Commit Graph

136147 Commits

Author SHA1 Message Date
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
Sergey Sharybin
3b975dddcc Fix Cycles viewport not properly updating
Only happens under certain circumstances: when a renderable object is
not visible at the graph node build time, but becomes visible due to
some indirect dependency like instancing.

In order to solve this, report all updates via the depsgraph.updates.

Reproduced with 210_0040-lighting.blend from the Gold repository at
revision 2834: open the file, enter rendered viewport, change frame,
and observe that sails do not move with the boat.

Pull Request: https://projects.blender.org/blender/blender/pulls/121833
2024-05-15 18:27:04 +02:00
Harley Acheson
3fbc603137 UI: Mesh Bevel Status Display
While using the mesh Bevel operator, show the changing values on the
area header and keymap entries on the Status Bar using the new system
that shows icons and toggles. Approximately 30% shorter display.

Pull Request: https://projects.blender.org/blender/blender/pulls/121796
2024-05-15 18:12:22 +02:00
Hans Goudey
944be3d619 Refactor: GPv3: Store inverted hardness value
To simplify propagation of the attribute with joined geometry
(0.0 defaults are generally easier to handle with attributes, and
even more performant), store the inverse of the current "hardness"
attribute as "softness" instead. This change involves adding a few
`1.0f - value` operations, though in the future as the renderer is
replaced that mostly should become unnecessary.

Updated version of #118007.

Pull Request: https://projects.blender.org/blender/blender/pulls/121578
2024-05-15 17:51:35 +02:00
Hans Goudey
0a6f89d487 Cleanup: Sculpt: Use const pointers for orig vert data 2024-05-15 11:18:18 -04:00
Harley Acheson
5b249f62d0 Cleanup: Make format
Just formatting changes resulting from running Make Format.
2024-05-15 08:06:21 -07:00
Brecht Van Lommel
ad18fe673e Cleanup: Correct capitalization in comment 2024-05-15 17:04:49 +02:00
Hans Goudey
1cdc76ea41 Cleanup: Sculpt: Remove unused automasking function 2024-05-15 10:53:11 -04:00
Hans Goudey
1c1efb0a14 Cleanup: Sculpt: Move automasking functions to proper file 2024-05-15 10:51:04 -04:00
Hans Goudey
b8e419ba1e Cleanup: Sculpt: Use C++ types for orig vert data 2024-05-15 10:47:54 -04:00
Hans Goudey
b76612998c Cleanup: Sculpt: Use references, std::optional in automasking data 2024-05-15 10:47:46 -04: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
Miguel Pozo
aa37e46152 Draw: Use GPUPass for default material fallback detection
Update #121137 to store the reused GPUPass on its own GPUMaterial,
instead of replacing the GPUMaterial itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/121790
2024-05-15 16:01:05 +02:00
Damien Picard
fb5e7caa70 UI: improve "Compact with Milliseconds" timecode style
The user preference Timecode Style has a "Compact with
Milliseconds" item, but they are not actually milliseconds. For
example at 25 fps, frame 42 will be at 00:01+17, or 00:01.68, which
is just seconds with the decimal part. Actual milliseconds would be
00:01+680ms or something, which would be cumbersome.

This PR rephrases the option to "Compact with Decimals" instead of
"Milliseconds".

Timecodes in animation editors currently show only one decimal
place when this timecode style is selected. This may not be
sufficient precision, so increase the precision to 2 places
instead.

If one animates at 25 fps, each timecode is currently duplicated 2
or 3 times, which makes it hard to distinguish each frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/119768
2024-05-15 15:25:14 +02:00
Philipp Oeser
710d168e30 Fix #121666: Modifying UVs of duplicate affects the original object
Caused by 7eee378eccc8.

Since the implicit sharing commit, uv data was not unshared when
accessed. Fix along the ines of 34b44878449d (same downside of not being
able to tell if the data is just read -- or written to).

Pull Request: https://projects.blender.org/blender/blender/pulls/121786
2024-05-15 15:23:26 +02:00
Pratik Borhade
8e6b276f84 Fix #121660: Auto-keyframe icon Overlapping when Navigation Controls are off
This is due to the wrong offset when "navigation controls" is off. Axis
gizmo is still visible so "else" codeblock is expected to handle the
correct offset value.

Pull Request: https://projects.blender.org/blender/blender/pulls/121775
2024-05-15 14:22:32 +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
Sergey Sharybin
ed2be4c89f Cleanup: Strict compiler warning
The possible values of handle_clicked are checked above, but compiler
is not smart enough to take this into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/121814
2024-05-15 10:16:32 +02:00
Omar Emara
2b622bd3c4 Fix #121682: Hue Correct corrupted for out of bound points
The Hue Correct node curves gets corrupted when the user disabled
clipping and adds points outside of the range. To fix this, we remove
the ability to change the range of the curves and disable clipping,
which doesn't really make sense for the use case of wrapping.

Pull Request: https://projects.blender.org/blender/blender/pulls/121746
2024-05-15 08:24:23 +02:00
Jesse Yurkovich
3b31d73c62 USD: Add common Blender attribute to USD primvar utilities
This factors out the current set of attribute-to-primvar functions
inside the USD mesh reader/writer so we can use them elsewhere.

These new functions will be used for PointCloud attribute reading and
Curve attribute reading and writing in follow up changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/121145
2024-05-15 05:44:26 +02:00
YimingWu
9b2130be56 Fix #120759: Prevent tooltip translation crash
Previously the `disabled_msg` is freed in a wrong code path, this patch
fixes that.

Pull Request: https://projects.blender.org/blender/blender/pulls/121657
2024-05-15 04:36:34 +02:00
Jesse Yurkovich
94b1d21e9e Fix: Use correct datatype for the USD uvmap varname
We were writing out the `inputs:varname` as a `token` instead of
`string` which is incorrect according to the UsdPreviewSurface spec[1].
Apparently it changed with version 2.3[2].

This results in a validation failure in USD 24.05, and maybe 24.03, seen
here:
```
Incorrect type for /root/_materials/Material/UV_Map.inputs:varname. Expected 'string'; got 'token'. (fails 'ShaderPropertyTypeConformanceChecker')
Failed!
```

The fix is a 1-liner but I've changed the surrounding code to use
`std::string` instead of `pxr::TfToken` to reinforce the concept. Our
material reading code is unaffected and was already handling both tokens
and strings.

[1] https://openusd.org/release/spec_usdpreviewsurface.html#primvar-reader
[2] https://openusd.org/release/spec_usdpreviewsurface.html#version-2-3

Pull Request: https://projects.blender.org/blender/blender/pulls/121668
2024-05-15 02:14:35 +02:00
Richard Antalik
22ca19dcb2 Cleanup: Add enum for referring to VSE strip handles.
This is used instead of unnamed enum `SEQ_SIDE_*`, which is used in
various operations and refers to direction in general.

Pull Request: https://projects.blender.org/blender/blender/pulls/121808
2024-05-15 01:48:18 +02:00
Harley Acheson
d42e507c14 UI: Fix AutoKeying Text
Recent changes overlay drawing code resulted in a call to draw the
"Autokeying" text being removed, showing only the icon.  This PR just
replaces one removed line.

Pull Request: https://projects.blender.org/blender/blender/pulls/121811
2024-05-15 01:41:10 +02:00
Sean Kim
7017091272 Fix #120761: Handle vert to face flushing in vert_hide_update
This PR changes the `vert_hide_update` function to flush visibility
from the selected vertices to their corresponding faces on the node
level instead of on the mesh level. This ensures that in certain cases
where vertices exist along the border of a nodes are selected that
all corresponding faces are updated and their PBVH nodes are tagged
for updating appropriately.

Additionally, this provides a roughly 15ms improvement over the current
implementation operating on a subdivided sphere of 32 million vertices
when selecting a relatively small portion of the mesh. (50ms -> 35ms).

Spawned from a discussion on #120798

Pull Request: https://projects.blender.org/blender/blender/pulls/121678
2024-05-14 21:24:57 +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
Hans Goudey
60bcbb50e4 Cleanup: Remove indirect includes from paint_intern.hh
Many files were including headers unnecessarily because
they were included incirectly here. Instead use more forward
declarations and includes in the specific files that need inline
functions. Also:
 - Add const to arguments for one function
 - Remove `flip_qt` and `flip_qt_qt`from the header
2024-05-14 12:24:21 -04:00
Omar Emara
3d1c8a3ff3 Compositor: Explicitly set device in test scripts
This patch explicitly sets the compositing device in the compositor test
scripts. This is done to make the tests more robust, since a developer
might accordantly save a file with a different device.
2024-05-14 19:03:55 +03:00
YimingWu
9512daee2d Fix #121751: Free CurvesTransformData on no selection
A `CurvesTransformData` is created to store transform points, but it's
not deleted when there's nothing selected, causing memory leak. Now
fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121767
2024-05-14 17:43:42 +02:00
Omar Emara
956eb9a034 Compositor: Update test for for Crop node
The file was accidentally saved with the execution device set to GPU,
which will not work on the build-bot. To update it to use the CPU device
again.
2024-05-14 18:42:25 +03:00
Pratik Borhade
0fa207d5ef GPv3: Disable mask property for default layers of primitives
Caused by 85ce2a34e31f764cab1eaf195a3f80f30b77cf06
Default layers added with the primitive gpv3 object has the `use_mask`
property enabled. To fix this, set `GP_LAYER_TREE_NODE_HIDE_MASKS`
inside `add_layer/groups()` function instead of the operator's code.

Falk found this in #121734

Pull Request: https://projects.blender.org/blender/blender/pulls/121780
2024-05-14 16:56:01 +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
Campbell Barton
981181ddde Extensions: show a one-time prompt to enable or dismiss online access
This is the preferences part of #120665.

- Use new URL https://extensions.blender.org/api/v1/extensions
- Disable extensions.blender.org by default.
- Enable "Check for Updates on Startup" for extensions.blender.org.
2024-05-15 00:16:18 +10: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
Campbell Barton
e86018fc43 Cleanup: correct checking wrong member for sizeof(..) 2024-05-14 20:42:44 +10:00
Campbell Barton
ac3098d8ad Extensions: show "Check for Updates on Startup" in the Add Repo operator
Ref #120613.
2024-05-14 20:08:59 +10:00
Campbell Barton
bc7b595362 Fix use_sync_on_startup flag being negated 2024-05-14 20:08:59 +10:00
Nathan Vegdahl
6709d598cf Anim: don't split keyframing error messages into singular and plural
Having different strings for singular/plural is meaningless or
insufficient in some languages, and thus complicates localization
unnecessarily.
2024-05-14 11:55:14 +02:00
Falk David
d4496f5bd4 Fix #121774: GPv3: Crash after undo
The undo system needs to invalidate all caches when decoding
an undo step for now. This was not done for some caches
(probably because they were added at a later stage).

The fix makes sure all caches on the `Drawing` runtime data
are tagged after decoding a step.

Pull Request: https://projects.blender.org/blender/blender/pulls/121777
2024-05-14 11:50:49 +02:00
Campbell Barton
566a77f605 UI: restore assert in CTX_wm_region_popup_set
This just hid that freed memory was being passed to
CTX_wm_region_popup_set.

The change from [0] exposed this issue, however the problem has
existed for a long time (likely since the inclusion of popups in the
context) it's just that setting the context member when popups
are first displayed made problems more likely to show up.

[0]: 38d11482f5e961e4d05930550452436da446dd4c
2024-05-14 19:34:21 +10:00
Pratik Borhade
60c9f4026b GPv3: Display layers in dopesheet and timeline
Include GPv3 layers/groups in dopesheet and timeline editor.
Call `animdata_filter_grease_pencil_data` in `animdata_filter_dopesheet_ob`
to draw layers.
Crash when transforming keys due to missing recalculation is also handled
in this PR.

Part of #110056

Pull Request: https://projects.blender.org/blender/blender/pulls/120605
2024-05-14 11:03:11 +02:00
Jeroen Bakker
5d5cbca7ed Vulkan: Refactor image views
Move ownership of image views to VKTexture. VKFramebuffer can request
access to the image views. This allows reconfiguring framebuffers when
the previous configuration is still in use by the render graph.

Pull Request: https://projects.blender.org/blender/blender/pulls/121727
2024-05-14 10:46:12 +02:00