Commit Graph

134737 Commits

Author SHA1 Message Date
Lukas Tönne
d7c718dfd4 GPv3: Texture offset modifier
Port of the GPv2 texture modifier for transforming UVs of stroke points.

Pull Request: https://projects.blender.org/blender/blender/pulls/119050
2024-03-29 21:42:30 +01:00
Sebastian Parborg
6dfb1cdf22 Fix: Crash/Assert in the pusleaudio lib when pausing playback
After 91eb50ec2f, we would get random crashes/asserts from the pulseaudio library like:
`Assertion 'e->mainloop->n_enabled_defer_events > 0' failed at ../pulseaudio-17.0/src/pulse/mainloop.c:261, function mainloop_defer_enable(). Aborting.`

It seems like we would run into a race condition if we didn't guard the
pulseaudio flush command with the pulseaudio mutex.

This is probably because the pulseaudio thread would try to read the
buffer for a tiny bit even after pausing the playback.

Sadly the only way to reproduce this is to playback any scene (seem to happen more often if A/V sync is on) and spam play/pause.
Note that I could not reproduce this on every computer I tested this on.

But by expanding the main pulseaudio mutex lock, I can't seem to reproduce this anymore.
So I think that is the correct solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/120072
2024-03-29 19:47:16 +01:00
Nika Kutsniashvili
47ced73952 UI: Rename VCols to Color Attributes in edit mesh operators
A couple of edit mesh operators are still using "VCols" terminology,
which should be Color Attributes now. This just renames text seen
in redo panels. Internally it's still called VCols.

Pull Request: https://projects.blender.org/blender/blender/pulls/120075
2024-03-29 19:30:25 +01:00
Falk David
614a23e9f6 Fix: BLI: Bounds is_empty function
This was meant to be the same as `BLI_rct*_is_empty`
but wasn't because the `less_or_equal_than` was
effectively doing a logical "and", when it should have
been doing a logical "or".
2024-03-29 17:12:51 +01:00
Falk David
60e648a7e6 Fix: GPv3: Simplify modifier inconsistency with GPv2
The simplify modifier did not remove points in fixed mode
at level 1. This was the case in GPv2.
This makes sure to get the same result as in GPv2.
2024-03-29 16:48:36 +01:00
Clément Foucault
7797231c6d EEVEE-Next: Shadow: Add LOD system to directional clipmap shadows
This act in multiple phases:

- A shader scan the whole clipmap after tilemap finalize to gather
where valid tiles from lower LODs are available and write the page
location and LOD offset at invalid tiles location.

- At sampling time we add the LOD offset before the pixel page
modulo operation. This offset is equal to the amount of pages of
the **sampling** LOD needed to have the same modulo result as the
**sampled** LOD.

The whole thing being very tricky, I added a lot of unit testing.

This has no use for now but the system is needed to implement:
- Shadows from Volumetrics at lower cost & memory footprint.
- Fixing soft shadows artifacts.

These will be implemented in separate PRs.

Pull Request: https://projects.blender.org/blender/blender/pulls/120031
2024-03-29 16:22:55 +01:00
Falk David
96de8112ee Fix: GPv3: Crash in simplify modifier
The simplify modifier uses
`bke::curves_copy_point_selection` but didn't
build the `points_to_keep` index mask correctly.
This fixes the indices in the index mask and also
optimizes the edge cases of removing all the points/
keeping all the points.
2024-03-29 16:13:44 +01:00
Hoshinova
c78c6b0bdf Fix #119797: Noise Texture Precision Issues
The Perlin noise algorithms suffer from precision issues when a coordinate
is greater than about 250000.

To fix this the Perlin noise texture is repeated every 100000 on each axis.
This causes discontinuities every 100000, however at such scales this
usually shouldn't be noticeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/119884
2024-03-29 16:12:23 +01:00
Hans Goudey
8dbee79844 Fix: Debug build error after recent commit 2024-03-29 10:51:54 -04:00
Brecht Van Lommel
bd1f4343c3 Build: Improve OSL library dependency handling in Cycles
Might fix some missing symbols when the OSL library gets updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/119391
2024-03-29 15:24:30 +01:00
Hans Goudey
03cc78de31 Tests: Add modifier tests for shrinkwrap target normal project
This code didn't have regression tests yet. Add tests for #120051,
with meshes with and without boundary edges.
2024-03-29 10:11:22 -04:00
Hans Goudey
a78d4f31be Cleanup: Add detail to sculpt mesh variable name
Generally sculpt uses a combination of data from the original,
deformed, and final evaluated meshes. Keeping track of all that
is confusing and using a more specific variable name helps a bit.
2024-03-29 10:05:05 -04:00
Brecht Van Lommel
d99f2e8eb7 Refactor: Add ability for UI block to own operator
Instead of only referencing an existing one. This will be used for
collection exporter and presets, to make sure the operator instance
stays alive long enough for the preset to be able to be applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/120034
2024-03-29 14:52:35 +01:00
Brecht Van Lommel
bef3a7b978 Fix: Operator properties don't undo when owner is collection
For collection export, we need operator properties to not assume they
are owned by the window manager.

Pull Request: https://projects.blender.org/blender/blender/pulls/118855
2024-03-29 14:49:04 +01:00
Falk David
f3505f12d2 GPv3: Add brush falloff panel to tint tool
This was talked about in
https://projects.blender.org/blender/blender/pulls/119323.
Adds back the panel so that the falloff can be changed again.
2024-03-29 14:41:35 +01:00
YimingWu
127f879be9 GPv3: Tint tool
This implements the tint tool from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/119323
2024-03-29 12:43:15 +01:00
Falk David
5ce54fbd25 Fix: GPv3: Use const reference to avoid copy
This was resulting in a copy of the layer, which shouldn't
be done.
2024-03-29 12:02:00 +01:00
Sergey Sharybin
adaa55cecc Cleanup: Code formatting
Pull Request: https://projects.blender.org/blender/blender/pulls/120055
2024-03-29 11:58:14 +01:00
Sergey Sharybin
d174959759 Fix #120051: Crash when using shrinkwrap with Target Normal Project
The issue was introduced by b35831ad6c.

Since that commit `tree->boundary` will always be non-nullptr, even
when the target mesh had no boundaries. Some code was still relying
on the fact that `tree->boundary != nullptr` means the mesh has
boundary.

Update shrinkwrap code for this fact, avoiding access past array
boundaries.

Pull Request: https://projects.blender.org/blender/blender/pulls/120054
2024-03-29 11:43:15 +01:00
casey bianco-davis
7669ba7a5c GPv3: Handle UVs in Smooth Modifier
The smooth modifier was made before UVs were implemented.
This adds smoothing to the UV rotations.

Pull Request: https://projects.blender.org/blender/blender/pulls/120032
2024-03-29 11:18:06 +01:00
Campbell Barton
4365d0496a Cleanup: use a const pointer for unit-settings 2024-03-29 16:37:36 +11:00
Campbell Barton
e04aa7c188 Cleanup: remove unit scale initialization in UI logic
Versioning logic was added since 2.5x
2024-03-29 16:30:08 +11:00
Campbell Barton
0eb1317e70 Cleanup: remove unused exception value 2024-03-29 16:18:28 +11:00
Campbell Barton
3d2593b229 Cleanup: replace "derived mesh" with "evaluated mesh" in code comments
References to the evaluated mesh were referring to "derived mesh"
when DerivedMesh wasn't used.
2024-03-29 13:29:30 +11:00
Hans Goudey
ce9970c76b Cleanup: Remove duplicate function for copying edit mesh positions 2024-03-28 21:43:32 -04:00
Hans Goudey
e6808cd558 Cleanup: Make format 2024-03-28 20:55:23 -04:00
Jesse Yurkovich
f62f8852dc Cleanup: Remove BLI_array macros in editmesh_knife
This replaces the older dynamic c array macros with blender::Vector in
editmesh_knife. This area is 1 of only 2 remaining which use this
machinery.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/119976
2024-03-29 01:51:55 +01:00
Jesse Yurkovich
af7a34dee7 ImportHelper: Common methods for FileHandler drag and drop support
Provide common implementations for two operations that all Python
FileHandlers will typically use.

- `poll_file_object_drop` To be used inside the FileHandler `poll_drop`
   callback
- `invoke_popup` To be used inside the Operator `invoke` callback

The above code closely mirrors what is currently done inside the
existing Blender c++ FileHandlers.

Pull Request: https://projects.blender.org/blender/blender/pulls/119774
2024-03-29 01:22:51 +01:00
Harley Acheson
6dd0f6627e UI: Removal of Five Operator Confirmations
Removal of confirmation dialogs for the following five operators. For
each of these the UI module felt that they are all either very explicit
actions and/or are easily undone.
* ARMATURE_OT_separate (Move selected bones to a separate armature)
* CURVE_OT_separate - “Move selected points to a new object”
* OBJECT_OT_vertex_parent_set (Parent selected ob to selected vertices)
* OBJECT_OT_parent_no_inverse_set (Make Parent w/o inverse correction)
* FILE_OT_directory_new - (Create New Directory)

Pull Request: https://projects.blender.org/blender/blender/pulls/120036
2024-03-29 01:09:15 +01:00
Campbell Barton
01dceb6b89 Cleanup: remove redundant checks for known states 2024-03-29 10:30:42 +11:00
Campbell Barton
3cfd4b4aba Cleanup: simplify check for the existence of key-blocks
The active key was accessed to check if the key-blocks were empty,
the variable was then shadowed by the iterator.

Check if the key blocks list is empty instead.
2024-03-29 10:13:06 +11:00
Campbell Barton
99f93aa4c8 Cleanup: assign object & space variables from the context for reuse 2024-03-29 10:08:59 +11:00
Campbell Barton
ff92a23fe6 Cleanup: odd indentation, also assign a variable for reuse 2024-03-29 10:07:28 +11:00
Campbell Barton
a2dae7e4b4 Cleanup: consistent quotes for Python scripts 2024-03-29 10:07:28 +11:00
Sean Kim
6e997cc757 Sculpt: Add Line Hide tool
This PR adds the *Line Hide* tool and the corresponding
`PAINT_OT_hide_show_line_gesture` operator to Sculpt Mode.

*Line Hide* supports common modal functionality including:
* Snapping to angles
* Flipping the selection area
* Moving selection area

Addresses one of the tools in #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119671
2024-03-29 00:05:25 +01:00
Hans Goudey
bf04da96f3 Fix: Missing change in declaration from previous commit 2024-03-28 19:01:32 -04:00
Hans Goudey
82b88f130a Cleanup: Use const for evaluated cage meshes and related data
Also access the evaluated deform mesh with a function rather than
directly from object runtime data. The goal is to make it easier to use
implicit sharing for these meshes and to improve overall const
correctness.
2024-03-28 18:57:57 -04:00
Hans Goudey
510874f7b9 Mesh: Limit threading for copying positions to GPU data
See b99c1abc3a for more information about how using fewer
threads for just copying data can improve performance. In my simple
test file with mesh data re-uploaded every frame, this improved
performance from 23.5 FPS to 25.5 FPS (almost 9%).
2024-03-28 18:37:23 -04:00
Hans Goudey
5ed99e6361 Cleanup: Remove unused MeshRenderData variable 2024-03-28 18:28:35 -04:00
Hans Goudey
931206d3dc Cleanup: Rename mesh face deformed edit position variables
Use standard naming similar to their `Mesh` counterparts.
2024-03-28 18:28:35 -04:00
Hans Goudey
72347f11fe Cleanup: Use float3, Span, Array for vertex positions 2024-03-28 18:28:35 -04:00
Germano Cavalcante
5bdfec8d67 Fix: unhandled empty Optional in 'bounds_min_max()'
Continuation of fcfce8f69f
2024-03-28 18:59:33 -03:00
Hans Goudey
90c53d265b Cleanup: Outliner: Return early, reduce variable scope 2024-03-28 16:40:15 -04:00
Hans Goudey
9132679f1b Fix #119571: Weight paint vertex selection invisible
After bace4c9a29, the vertex position and vertex normal VBOs
are split. The `overlay_paint_point` shader depends on the normals VBO
because the selection is stored in the `.w` component of the vector.
2024-03-28 15:47:34 -04:00
Hans Goudey
684dbba6a1 Fix #119969: Crash rendering in sculpt mode with multires active
SubdvigCCG is null for the evaluated mesh in the render depsgraph
because of the `!for_render` check in `MOD_multires.cc`. But the PBVH
type is still `PBVH_GRIDS`. That's a weird inconsistency that ideally
wouldn't happen, but probably isn't simple to change. The simplest and
most obviously harmless fix is to just check whether the list of PBVH
nodes to update is empty.
2024-03-28 15:11:02 -04:00
Hans Goudey
0b80d5e755 Cleanup: Access sharp_face attribute with attribute API 2024-03-28 14:45:56 -04:00
Jesse Yurkovich
b37e825d89 Fix: MSVC ICE in MatBase stream output operator
Recently an internal compiler error has been popping up for folks
stemming from our MatBase matrix `operator<<`.

My guess is that the nested fold-expression (coming from `unroll`) and
the lambda is causing MSVC to become very upset in some instances.

Regardless of the actual cause, using simple for loops results in less
generated code and the use of `unroll` isn't required since these output
operators are mainly for debugging.

Unfortunately I've been unable to reproduce it in simpler contexts to
report it upstream.

Pull Request: https://projects.blender.org/blender/blender/pulls/119982
2024-03-28 19:31:18 +01:00
Hans Goudey
a5c5cf473e Fix #119992: Object transform ignored for shrinkwrap and flat shading
the transform was always ignored for face normals since b4b224dc08.
2024-03-28 13:43:20 -04:00
Hans Goudey
d5a61a8f55 Fix: Missing early return when asset isn't found
This didn't cause a crash since `resolve_asset_weak_reference_to_full_path`
doesn't actually use the `this` pointer, but it's still quite unsafe.
2024-03-28 13:43:20 -04:00
Hans Goudey
a7cdb9e94d Cleanup: Use "this" keyword to access class methods 2024-03-28 13:43:20 -04:00