Commit Graph

136119 Commits

Author SHA1 Message Date
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
Jeroen Bakker
9b531609bd Vulkan: Fix push constants tests
This fixes several issues with push constants.

Push constants test were failing due to setting incorrect parameters.
The pipeline stage was used as if it was a shader stage.

When using push constants fallback the uniform was loaded to the
descriptor set after the descriptor set was checked.

Suppress updating push constants of non render graph, when render
graph is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/121772
2024-05-14 10:44:10 +02:00
Jeroen Bakker
b1b0f1207c Vulkan: Suppress GCC14 compiler warnings
Although this needs to be fixed before we can move to CPP20.

Pull Request: https://projects.blender.org/blender/blender/pulls/121770
2024-05-14 09:12:47 +02:00
Jeroen Bakker
f625c4e63d Vulkan: Fix compute test cases
Compute tests were failing due to recent changes.
* Incorrect image layout was used for writable image bindings.
* Incorrect pipeline stage was used for indirect command buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/121744
2024-05-14 08:22:18 +02:00
YimingWu
29dc4a85f7 Fix #121766: Softbody ensure current position
When reading a cached frame the unmodified goal positions are not
synchronized along. Now fixed.

Co-authored by @bjornmose

Pull Request: https://projects.blender.org/blender/blender/pulls/121768
2024-05-14 06:49:30 +02:00
Alaska
9320ee2a36 Print Blender branch when running --version command
Ref: !121769
2024-05-14 14:33:35 +10:00
Campbell Barton
a39e78ec29 Cleanup: declare uiPopupBlockHandle on assignment 2024-05-14 14:27:12 +10:00
Campbell Barton
9ed5ed1a2b Fix #121686: Regression: Context Menu has many operations disabled
Resolve own regression in [0] which caused operators poll functions
in context menus to fail because the menus own region was set
causing the button clicked on not to be detected as the active button.

Resolve by passing "can_refresh" as an argument to ui_popup_block_create
which only sets the "region_popup" context item for popups that can
refresh. This is done because previously "region_popup" was only ever
set for temporary regions that refreshed (details in code-comments).

[0]: 38d11482f5e961e4d05930550452436da446dd4c
2024-05-14 14:08:28 +10:00
Campbell Barton
01a78bf3e6 Cleanup: avoid matching names for public & static functions
While supported it's confusing to use the same name for a public
function and it's private implementation.
2024-05-14 13:27:18 +10:00
Campbell Barton
521cd53f29 Fix dangling references to temporary variables 2024-05-14 13:13:04 +10:00
Hans Goudey
ac7ceba950 Fix: Asset shelf missing deactivation if new item hidden
When a new item is active, other items are only deactivated in the
`set_state_active` method. This doesn't run if the new item is not
displayed by the shelf for whatever reason (e.g. catalog filters).
To fix this, just set the item inactive. This may be redundant with
the deactivation in `set_state_active`, or it might not be, depending
on whether the active item is visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/121589
2024-05-14 05:11:07 +02:00
Clément Foucault
1589f3713a Fix: EEVEE-Next: Fix Shadow resolution limit step
The step is already multiplied by 0.01 internally.
2024-05-13 23:51:15 +02:00
Harley Acheson
41bbbd2359 UI: Color Tooltips
Hovering over a color button shows a tooltip that includes the color
values and a large sample.

Pull Request: https://projects.blender.org/blender/blender/pulls/117815
2024-05-13 23:48:29 +02:00
Harley Acheson
92e0545e9f UI: Remove BLF_draw_default_shadowed
With Aras's recent changes in #121383, our text shader now supports
outline shadows, which gives a result that has more contrast than can
be achieved with BLF_draw_default_shadowed. This removes that function.

Pull Request: https://projects.blender.org/blender/blender/pulls/121676
2024-05-13 22:32:59 +02:00
Weizhen Huang
68de483bf3 Fix: Ray Portal BSDF changing sd->flag when closure is not allocated
when ray exceeds `max_bounce`, we do not allocate any closure at
intersection. However, Ray Portal BSDF still added `SD_BSDF` flag,
resulting in undefined behavior in
`integrate_surface_bsdf_bssrdf_bounce()`.
This part of code was similar to Transparent BSDF, however, Transparent
closure was still allocated in this case.
To fix the undefined behavior, add `SD_BSDF` flag only when the Ray
Portal closure was allocated.
2024-05-13 19:10:02 +02:00
Falk David
fccdf7da0c Refactor: GPv3: Paste keyframes operator
The operator used `layer->remove_frame` which has been
replaced with `grease_pencil.remove_frames`.

Also makes a few variables `const` and cleans up some
namings.
2024-05-13 18:41:08 +02: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
Falk David
65f05f4284 Cleanup: GPv3: Remove unnecessary layer group API functions
The `LayerGroup` class had an API to add layers and layer groups.
The only thing these did was allocate a new layer/group and then
call the `add_node` API.

This removes these functions (they were only used in a single
place anyway) and does the allocation of the new layer/group
directly in the grease pencil API. This removes a few lines of
code and makes everything a bit easier to read.
2024-05-13 18:01:20 +02:00
Falk David
7006eb4805 Cleanup: GPv3: Rename add_layer to duplicate_layer
There was an overloaded version of `add_layer` that took
a const reference to a source layer. The function would
duplicate that layer.

The function name `add_layer` was a bit confusing in this
case. Calling it `duplicate_layer` makes it a bit clearer.
2024-05-13 17:44:10 +02:00
0caf6397df Anim, remove Action::binding_for_id() method
Remove the `Action::binding_for_id()` method, as it is a bit dangerous,
only useful in a very specific situation, and can be removed altogether
with just a little bit of refactoring. This in turn made some other
functions a bit simpler too.

Almost no functional changes. The only change is that when through some
magic (aka data corruption or other bug) the Binding is no longer valid
for the animated ID's type, the IDs properties may still show as
animated in the interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/121748
2024-05-13 17:30:37 +02:00
Falk David
10b5a401dc Refactor: GPv3: Use insert_frame API in duplicate layer operator
This is part of #121565.

Uses the newer `GreasePencil::insert_frame` API to insert
a key and create a drawing. This means we no longer need
to deal with the drawing index, as this is handled by
`insert_frame` internally.
2024-05-13 17:03:02 +02:00
Brecht Van Lommel
9bc8e438ef Cleanup: make format 2024-05-13 16:54:52 +02:00
Iliya Katueshenock
cff53fdb53 Nodes: Increase size of shader attribute name
This can be a path to a property, so this field has to be longer.

Pull Request: https://projects.blender.org/blender/blender/pulls/121595
2024-05-13 16:51:26 +02:00
Clément Foucault
f16f9d9a96 EEVEE-Next: Use closure_light_set in foward lib
Was missing from the commit that introduced it.
2024-05-13 16:33:05 +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
Falk David
5c9fad1582 Refactor: GPv3: Use get_drawing_at in various helper functions
Part of #121565.

Updates `get_editable_frames_for_layer` and
`retrieve_editable_drawings_grouped_per_frame`
functions to not use drawing indices, but the
`get_drawing_at` function.
2024-05-13 16:27:46 +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
Iliya Katueshenock
75d17b1db5 Cleanup: Move BKE_node to namespace
Move all header file into namespace.
Unnecessary namespaces was removed from implementations file.
Part of forward declarations in header was moved in the top part
of file just to do not have a lot of separate namespaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/121637
2024-05-13 16:07:12 +02:00