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
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
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
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
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
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
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
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
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
Caused by 85ce2a34e3
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
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
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
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
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
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]: 38d11482f5
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
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
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
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
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]: 38d11482f5
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
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
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.
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.
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.
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
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.