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
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
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
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
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.
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
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]: 38d11482f5e961e4d05930550452436da446dd4c
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]: 38d11482f5e961e4d05930550452436da446dd4c