Commit Graph

135120 Commits

Author SHA1 Message Date
Jacques Lucke
0a192c5da4 Cleanup: fix compilation
Missing from e27889dc12e16a9a7f2c72210fa3e6cb3b968100.
2024-04-14 10:50:54 +02:00
Campbell Barton
c9a79f9a3c WM: handle multiple wheel events from GHOST
Scrolling the mouse wheel fast can generate multiple click-steps
which were ignored by window manager events.

This meant scrolling fast with a trackpad (with "Multi-touch gestures"
disabled) for e.g. would zoom less than the gesture made more slowly.
2024-04-14 17:55:20 +10:00
Campbell Barton
c4745a24b2 GHOST/Wayland: bump xdg_toplevel_listener version from 1 to 6 2024-04-14 17:55:17 +10:00
Campbell Barton
cc9edd2d35 GHOST/Wayland: bump zxdg_output_manager_v1 version from 2 to 3 2024-04-14 17:55:15 +10:00
Campbell Barton
dcec5ce635 GHOST/Wayland: bump wl_compositor_interface version from 3 to 6 2024-04-14 17:55:14 +10:00
Campbell Barton
6689053e43 GHOST/Wayland: bump wl_output_listener version from 2 to 4 2024-04-14 17:55:13 +10:00
Campbell Barton
8d86fb43a4 GHOST/Wayland: bump wl_seat_interface version from 5 to 9
This ensures callbacks are called to detect "natural" scroll direction
on the touch-pad, see: #107676.
2024-04-14 17:55:11 +10:00
Campbell Barton
98cb5da6d1 GHOST/Wayland: add an interface version clamping macro
This macro makes it convenient to define a supported version range for
an interface.

Uncommenting USE_VERBOSE_OLD_IFACE_PRINT prints when newer versions
of an interface are supported by the compositor which Blender could
be updated to support.

This makes it more convenient to bump interface versions as they
become available so bumping multiple versions at once doesn't
cause unexpected changes in behavior as happened with #120587.
2024-04-14 17:55:10 +10:00
Campbell Barton
df87770ca1 GHOST/Wayland: resolve mouse wheel being treated like touchpad scroll
Resolves the issue reported in #120587, which occurred when bumping the
supported version of the seat API to 9.

Smooth scrolling values were set in without calling the discrete step
callback. Resolve by calculating discrete values from the:
wl_pointer_listener::axis_value120 handler.

The functional changes from this commit only apply once the version
of the seat API is increased - which isn't part of this commit.
2024-04-14 17:55:09 +10:00
Campbell Barton
e27889dc12 Cleanup: use const references for GWL_RegistryHandler parameters 2024-04-14 17:54:59 +10:00
Campbell Barton
dce8668b1f GHOST/Wayland: use discrete zoom steps with multi-touch disabled
This matches behavior on macOS as well as the property description.

On Wayland, smooth scrolling doesn't use the touchpad API,
so disabling multi-touch gestures doesn't change the behavior as it
does on macOS.

Resolve by converting vertical touch scrolling to mouse-wheel events.
2024-04-14 14:56:30 +10:00
Campbell Barton
f12d20a819 Cleanup: always reset discrete mouse-wheel
A correctness issue, this didn't cause any bugs.
2024-04-14 14:23:36 +10:00
Campbell Barton
a70d6d79dd Cleanup: various non-functional C++ changes 2024-04-14 12:24:17 +10:00
Campbell Barton
6e3eaae299 Cleanup: spelling in comments 2024-04-14 12:13:55 +10:00
Harley Acheson
968528bde6 UI: Slight Adjust Last Operation Changes
Adjust Last Operation dialog gets a title with a line underneath and
slight change to margins to better match other similar dialogs. A
change agreed to in our last UI meeting.

Pull Request: https://projects.blender.org/blender/blender/pulls/120625
2024-04-14 04:03:43 +02:00
Campbell Barton
43179864f4 Cleanup: remove strcpy usage 2024-04-14 11:58:14 +10:00
Campbell Barton
bf3ca83df9 Cleanup: use C-style comments for descriptive text in GHOST/Cocoa 2024-04-14 09:40:19 +10:00
Iliya Katueshenock
dd672c38b1 Fix #117515: Geometry Nodes: Count of unique face neighbors
Regular topology mapping does not care about deduplication of relations. And
this is correct for a lot of the case where we expect creating difference of this
relations in next operations. But this is not the case for users, since this should
be actually trivial info. Due to this reason, construct full topology map and count
number of unique connections. Performance side: difference linear check and
hash set for different sizes of connections set.

Pull Request: https://projects.blender.org/blender/blender/pulls/118848
2024-04-14 01:08:10 +02:00
Bastien Montagne
48baa80a05 Fix #120287: Annotations GPv2 data must not be converted.
This commit ensures that no legacy GP data is shared between GP objects
and annotations, before doing the conversion, by duplicating annotation
data when required.

Conversion code can then completely ignore annotation GPv2 IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/120581
2024-04-13 15:44:51 +02:00
Clément Foucault
fdf5a05bde Fix: EEVEE-Next: Broken shader compilation because of displacement
Oversight inside f371624b2ea390bbb8027a4b73b83f3601c5ceea
2024-04-13 12:57:50 +02:00
Clément Foucault
f371624b2e Fix: EEVEE-Next: Displacement: Wrong output space
The space of the displacement socket on the ouput node
is local space. We now scale it back to world space
as expected by the consumer code.
2024-04-13 12:37:29 +02:00
Clément Foucault
b0e291952b EEVEE-Next: Light: Explicit loop unrolling for better codegen
Now that there is a condition in the loop count there is
possibility the compiler doesn't optimize this. Be
conservative an manually unroll for better codegen.
2024-04-13 12:21:07 +02:00
Clément Foucault
16059aca59 Fix: EEVEE-Next: Shadow with transmission
This fixes a few issues:
- Split of shadows in different direction caused by
  the shadow normal bias.
- Fixes #120599 by reverting to light vector to
  bias the shadow test.

Cleanup now unused variables.
2024-04-13 12:08:08 +02:00
Clément Foucault
a4e9224317 Fix: EEVEE-Next: Shadow broken for transmission BSDFs
Was not inverting the normal for `shadow_ray_above_horizon_ensure`.
2024-04-13 10:50:33 +02:00
Clément Foucault
ba0921e75e Fix: EEVEE-Next: Broken refraction thickness
Some parts were not offseting the ray in the right
directions.
2024-04-13 09:14:14 +02:00
Clément Foucault
b07d392b5a MTL: Remove warning in debug build 2024-04-13 09:12:22 +02:00
Hans Goudey
c91449836a Cleanup: Move BKE_workspace.h to C++ 2024-04-12 17:03:18 -04:00
Hans Goudey
75077a8b0e Refactor: Move node tools OperatorComputeContext to blenkernel
For socket value logging this needs to be used in a couple other places.
Also remove the operator name argument. For the forseable future this
will only be used with the existing node tools operator anyway.
2024-04-12 16:16:55 -04:00
Clément Foucault
77638a6bec EEVEE-Next: Fix missing shadow caused by ray going below surface
This should fix the light leaking present in most curved surfaces.
This is completely ad-hoc and should be fixed better.
2024-04-12 22:08:38 +02:00
Clément Foucault
8dfcb121d4 EEVEE-Next: Add consistent support for thickness output
This add support for the thickness output in a consistent
manner across all BSDF.

If thickness is above zero, for any ray going below the
surface, the object is modeled as a sphere tangent to
the shading point and of diameter equal to the given
thickness. The ray is then intersected with that sphere
and transmitted out.

This model perfectly matches a raytracer behavior
for a sphere model of diameter equal to thickness.

This replaces the old refraction depth model which was
modelling a infinite slab of material.

For simplicity, we do not do 2 microfacet transmission
events. We simply use the main lobe direction for the
first interface. This still matches the raytracer
behavior for smooth surfaces. Weirdly enough the
apparent roughness doesn't need to be amended.

To get shadowing and translucency approximation
to work, this splits the transmission BSDF evaluation
to its own light loop. This simplifies a lot of logic
and assumes only one transmission BSDF is ever
sampled in a nodetree.

This changes the behavior of the thickness output
with regard to the thickness from shadow. We now take
the min instead of the max between both. This
break a lot of file since the default thickness is
set to `0.1`.

This patch doesn't change the default thickness output
behavior but it will be changed in another PR.

Note this might change the shadow sampling pattern
since translucent and non-translucent are now
sampling them separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/120329
2024-04-12 22:06:25 +02:00
Jesse Yurkovich
b24ac18130 Alembic: Support new Curves object type for export
Support the new Curves object type in Alembic when exporting curve data.
Make corresponding fixes to importing at the same time.

Summary of changes
 - Exporter now supports the `Curves` object type during Export
   including when using the convert to mesh option
 - Exporter will now enforce that only 1 combination of curve type and
   periodicity are in a given object [0].
 - Catmul-rom basis curves are now supported and will be used for Hair
   data [1].
 - Bezier curves are exported with their left/right handle data [2].
 - Cyclic bezier and nurbs curves should be handled correctly now.

Along the way this required changes on the Import side as well in order
to be complete
 - Importer will now load bezier curve handle data correctly
 - Importer could fail to set the correct cyclic data on the last spline
   of a multi-curve object

See PR for screenshots

[0] See https://github.com/alembic/alembic/blob/master/lib/Alembic/AbcGeom/OCurves.h#L55
Prior to this change the Alembic exporter could write invalid data to
the file in these cases.
[1] Alembics created with the new Curves Hair object with this patch
will not be loadable in prior versions of Blender. The importer does not
handle the curve data correctly and will crash.
[2] There was a long-standing TODO about how to handle bezier curve data
since nothing is documented on Alembic's side. Bezier data wouldn't even
round-trip properly inside Blender itself. On a hunch, because USD was
influenced by certain aspects of Alembic which came before it, I decided
to try writing out the data the same way as USD. That turned out to work
quite well in at least 1 external software so that's what this patch
will use for both import and export.

Pull Request: https://projects.blender.org/blender/blender/pulls/119894
2024-04-12 21:27:15 +02:00
Germano Cavalcante
f38c4d42bd Fix #120244: Snap cursor does not work in some Quad-View regions
The xy coordinates depend on the region, so we need to make sure we
pass the correct region.
2024-04-12 15:01:38 -03:00
Hans Goudey
3744b54790 Cleanup: Fix location of #pragma once in some headers 2024-04-12 12:52:51 -04:00
Hans Goudey
5c10f9fcb3 Fix #120549: Broken triangles in viewport with multiple materials
Error in 0f46e02310c98e212f50dc0af9a46a76c844358a

The maximum index in the triangles index buffer was set incorrectly,
causing the GPU code to switch to using 16 bit integers when it shouldn't.
2024-04-12 12:38:25 -04:00
Dalai Felinto
fae60893c7 Extensions: Rename Local Cache
The existing name was not clear. Renamed it to: "Clean Files After
Install".

I changed the RNA boolean to be positive, to match the name change.

Note: This only changes the UI label and tooltip.

TODOs to be tackled separately:
* Rename the RNA property to match its UI name.
* Make it True by default.
* Doversion.

Designed with Pablo Vazquez.

Part of #120589.
2024-04-12 18:20:01 +02:00
Dalai Felinto
af09a475e4 Extensions: User Interface: Sort advanced repository options
Local Cache and module are not related, so they should not be on the
same row. Instead group Local Cache with custom directory.

Designed with Pablo Vazquez.
2024-04-12 18:20:01 +02:00
Dalai Felinto
8771534434 Extensions: User Interface: Replace Label with icon and add placeholder
Design by Pablo Vazquez.
2024-04-12 18:20:01 +02:00
Dalai Felinto
3399f75150 Extensions: Rename Update Repository operator
Follow up for: blender/blender-addons-contrib@d5862549d3
2024-04-12 18:20:01 +02:00
Dalai Felinto
c1edc32fe5 Extensions: User Interface
Remove label from Repositories popover, since it is now accessed via a
menu which already has the label.

Follow up for: blender/blender-addons-contrib@d5862549d3
2024-04-12 18:20:01 +02:00
Clément Foucault
d1d90ecbec Cleanup: MEM: Remove outdated comment 2024-04-12 18:01:26 +02:00
Clément Foucault
60a3d85b88 MEM: Make MEM_cnew return aligned memory
Now made it so that `MEM_cnew()` can be used for types with any
alignment.

Fixes #120407.

Pull Request: https://projects.blender.org/blender/blender/pulls/120569
2024-04-12 17:52:27 +02:00
Lukas Tönne
77451ea83f Fix #120542: Add a poll function to GPv3 sculpt mode keymap
The sculpt mode keymap needs a poll function to avoid showing tools like
the radial controls in object mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/120588
2024-04-12 17:50:38 +02:00
Hans Goudey
30c3f8eafb Revert "Fix #107676 detection of "natural" touchpad scrolling on Wayland"
This reverts commit af88ff04848b1ff299514514fb18ecf401553bb4.

That commit broke scrolling (at least in some cases).
Reverting the commit resolves #120587
2024-04-12 11:47:03 -04:00
Falk David
089a435376 Fix: GPv3: Default value for fill opacity in opacity modifier
Make sure the default value for the fill opacity is 1 instead of 0.
2024-04-12 17:42:42 +02:00
Falk David
5e04afcfa8 Fix: GPv3: Vertex colors don't show in render
The vertex color opacity was always set to 0.
This makes sure that during rendering, vertex colors are used.
2024-04-12 17:42:42 +02:00
Falk David
f9499d71f0 Fix: GPv3: Use fill opacities in batch cache
The `fill_opacity` attribute was used (e.g. by the opacity modifier)
but not added in the batch cache for rendering.
This fixes the issue.
2024-04-12 17:42:42 +02:00
Falk David
3fe348fc07 Fix: GPv3: Tint modifier icon
Was using the opacity modifier icon by mistake.
2024-04-12 17:42:42 +02:00
Philipp Oeser
6c045f7335 Fix #114428: clamp setting object active_material_index
There were multiple reports with objects having many empty material
slots.
The underlying reason for this is the behavior of adding/assigning
materials [which makes room in the form of empty material slots based on
the current `active_material_index` -- which atm. can be set to
arbitrary values]. So just e.g. setting this to 100 in a fresh file and
assigning a material would create 99 empty slots.

To resolve, now clamp to the existing number of material slots.

NOTE: there is already a range function defined, but this actually only
kicks in from the animation system (so clamping would take place there),
so clamping is expected to happen in the set functions (there is also a
related comment in `RNA_property_int_set`)

Pull Request: https://projects.blender.org/blender/blender/pulls/120434
2024-04-12 17:35:22 +02:00
Hans Goudey
2361f90264 Cleanup: Resolve integer type conversion warnings 2024-04-12 11:29:20 -04:00
Sergey Sharybin
a4b36cd0d5 Guarded allocator: Ensure alignment and size of MemHead
Ensure that the MemHead and MemHeadAligned are such that memory
allocation followed with the head offset keeps the allocation
aligned to at least MEM_MIN_CPP_ALIGNMENT.

Pull Request: https://projects.blender.org/blender/blender/pulls/120582
2024-04-12 17:22:46 +02:00