Commit Graph

135551 Commits

Author SHA1 Message Date
Harley Acheson
aa65bdbebc Fix #121108: Improved Poll Function for IMAGE_OT_clipboard_paste
Ensure that the current area is an Image Editor before allowing
clipboard paste, since that will fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/121142
2024-04-26 19:57:48 +02:00
Hans Goudey
83ed92d533 Geometry Nodes: Add Viewport Transform node
Add a node that outputs the transform of the viewport relative to the
self object's transform. This node can be used to build effects like
billboarding or aligning geometry to the current view. In combination
with the mouse position node in the future it will allow tools like
generating geometry at the mouse click position.

There are two output matrices. The first is the projection matrix
that takes positions in camera space and applies the final perspective
projection. The other is the "view" matrix which contains the location
and rotation of the camera. These are separate because though their
combination is useful, it isn't used like a typical rotation/transform matrix.

Pull Request: https://projects.blender.org/blender/blender/pulls/118680
2024-04-26 19:47:19 +02:00
Hans Goudey
33367b7d0c Fix: Assert in USD curves reader offset creation
The current code read past the end of `usdCounts`.
2024-04-26 13:42:53 -04:00
Alaska
afa66fc628 Shader: Clamp invalid inputs of various BSDF nodes
Clamp some of the inputs of the Glossy BSDF, Glass BSDF, Sheen BSDF,
and Subsurface Scattering nodes to improve consistency between render
engines and to avoid unexpected results.

* Clamp roughness to 0..1
* Clamp subsurface radius to 0..inf
* Clamp colors to 0..inf

Pull Request: https://projects.blender.org/blender/blender/pulls/120390
2024-04-26 17:39:39 +02:00
Hans Goudey
e3894f0a07 UV: Remove UV sculpt use of brushes
For the brush assets project (#116337) all editors with brushes are
getting an asset shelf, and the brush tools are combined, with
individual brushes accessed in the shelf. That design seems way
overkill for UV sculpting which is just three very simple tools.

In order to avoid one editor with inconsistent use of brushes, which
would significantly increase the complexity of the system after the
brush assets merge, port the three UV sculpt tools to be regular
modal operators that don't use the brush or paint system at all.

To be clear, this is a compromise that doesn't feel ideal, but no
one could think of a better solution. Theoretically this removes
some flexibility from UV edit "sculpting", in practice it probably
won't be a noticeable change.

Pull Request: https://projects.blender.org/blender/blender/pulls/120797
2024-04-26 17:10:04 +02:00
Brecht Van Lommel
5a458fe92a Build: Patch OIIO to not load plugins from (DY)LD_LIBRARY_PATH
This can cause crashes when loading incompatible plugins that happen to
be installed in one of the directories.

This change has been merged upstream, but there will likely be no stable
release in time for the next Blender release. So patch locally for now.

Fix #120480: Blender fails to launch on Steam on Arch Linux

Ref #118455

Pull Request: https://projects.blender.org/blender/blender/pulls/121136
2024-04-26 17:02:39 +02:00
Guillermo Venegas
615100acda IO: Use FileHandler in Node Editors
Use `FileHandlers` to handle file drag-n-drop in Node Editors. Drop-boxes
still remain since they handle Images ID drag-n-drop.

This also allows to open/drag-n-drop multiple files at once.

Also this will allow add-ons to also support drag-n-drop for images and
movies in node editors while still providing access to Blender's native
support since File Handlers let users choose which to invoke if there's
multiple configured.

Pull Request: https://projects.blender.org/blender/blender/pulls/121051
2024-04-26 16:40:16 +02:00
Bartosz Kosiorek
749433f20b UI: Add tooltips with node description to node titles
These were already displayed in the node add menu. But it can also be
useful to see node descriptions when opening existing projects.

Pull Request: https://projects.blender.org/blender/blender/pulls/119705
2024-04-26 16:29:46 +02:00
Falk David
c87e8790bb Fix: GPv3: Redraw editors showing grease pencil keys when new on is added
When e.g. using auto-key to draw on a new frame, the dopesheet
(and other editors) would not redraw to show the newly added keyframe.

This fix makes sure we send notifiers to those editors when a
keyframe is added.
2024-04-26 15:43:51 +02:00
Alaska
03cb588529 Refactor: Cycles: Replace fixed Tangent input with custom input
This replaces the fixed Tangent input in BsdfNode::compile
with a custom input.

This is done because very few nodes actually use the tangent input
and it would be better to have this slot available for other inputs
on different nodes in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/119042
2024-04-26 15:25:14 +02:00
Falk David
62151ffaeb Fix: GPv3: Thickness modifier conversion of "uniform thickness"
The "uniform thickness" was still in the legacy "pixel" space. The fix
makes sure that value is always converted to the right radius space.
We also convert the potentially animated property for the thickness
and scale the fcurves to be in the right space.

Pull Request: https://projects.blender.org/blender/blender/pulls/121128
2024-04-26 15:16:43 +02:00
Jeroen Bakker
7e3aa5a7a9 Vulkan: Add to_string functions for dynamic rendering
The plan is to use dynamic rendering. This PR adds to_string functions
for enums, structs related to dynamic rendering.
2024-04-26 14:55:50 +02:00
Jeroen Bakker
54d879fd24 Cleanup: Use GTest macros
Vulkan render graph test cases used BLI asserts. These
are now replaced with GTEST macros
2024-04-26 14:55:50 +02:00
Falk David
c0fc1fc938 Cleanup: GPv3: Remove wrap/unwrap macros for lineart 2024-04-26 14:49:54 +02:00
Christoph Lendenfeld
8b852f2ac2 Refactor: rename beztmap_to_data
No functional changes.

This just renames the function `beztmap_to_data` to
`update_transdata_bezt_pointers` to better represent what it is doing.

Pull Request: https://projects.blender.org/blender/blender/pulls/121125
2024-04-26 14:06:42 +02:00
Campbell Barton
5f6516a19a CMake: differentiate between C/C++ compiler versions in errors
In case C/C++ compiler versions differ, it's best to report which
is outdated.
2024-04-26 21:36:59 +10:00
Campbell Barton
d644873252 Preferences: add option to set the trackpad direction for Wayland
When using a version of Wayland that doesn't support trackpad direction
show an option to set the direction manually.

While this is a stop-gap measure until compositors support seat
version 9, the latest GNOME doesn't yet support this, so there will
be users for some years without this functionality.

Addresses issue raised in #107676.
2024-04-26 21:26:49 +10:00
Campbell Barton
95315e34bf PyAPI: add private API to access WM capabilities
Add _bpy._wm_capabilities(), needed for preferences code to check if
WM functionality is supported. This could be made into a public
function, see code comments for details.
2024-04-26 21:26:49 +10:00
Campbell Barton
c444f128d3 WM: add a capability flag for physical trackpad direction
Support detecting if the trackpad direction flag is propertly set
(currently unused).

Needed so Wayland compositors that don't support seat-version 9 or
newer (GNOME-46 & KDE5 for e.g) can have a working trackpad.

Eventually this option will be removed when the functionality is
widely supported.
2024-04-26 21:26:49 +10:00
Campbell Barton
954dc21581 WM: correct the last flag of ENUM_OPERATORS for eWM_CapabilitiesFlag 2024-04-26 21:26:49 +10:00
Christoph Lendenfeld
0dd0583a75 Refactor: move get_keyframing_flags function to animrig
No functional changes.

This PR moves the `ANIM_get_keyframing_flags` function to
animrig as `get_keyframing_flags`.
The docstring has been fixed since it was out of date.

Pull Request: https://projects.blender.org/blender/blender/pulls/121120
2024-04-26 13:21:55 +02:00
Clément Foucault
4d10bbe733 Fix: EEVEE-Next: Missing smoke volumes
Caused by mistake in b8e17cf531.
2024-04-26 13:13:27 +02:00
Clément Foucault
1f2b935146 EEVEE-Next: Display volumes in render mode if drawtype is not solid
This is for consistency with cycles behavior. This doesn't
change the behavior for final render.
2024-04-26 13:12:34 +02:00
Clément Foucault
bc1c35e201 EEVEE-Next: Change lights object matrix for more readability and compactness
This adds a new `Transform` type similar to cycles that reduces
the amount of data passed for a typical affine 3D transform.

This then applies this type to the light data and cleanup
all usage of the former `object_mat`. This also changes the axes
macros into utility accessor functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/121089
2024-04-26 12:54:08 +02:00
Falk David
c2504eb779 Cleanup: Use legacy radius conversion factor constant
This moves the seemingly arbitrary value of  "1 / 2000"
into a constant variable
(`bke::greasepencil::LEGACY_RADIUS_CONVERSION_FACTOR`)
so that it can be used in all the places where
legacy "thickness" values need to be converted.
This also expands the explanation of the factor a bit, so it's
clearer why it is needed.
2024-04-26 12:48:26 +02:00
Falk David
863743bcb5 Fix: GPv3: Simplify positions and radii not working
This was because the distance function was assuming that
the radii were still in the legacy `px` space rather than in the
same space as the positions.
The function wasn't updated after the merge of
07749b389d
The division by `2000.0f` can be removed.
2024-04-26 12:39:45 +02:00
Julian Eisel
f3778c88fd Cleanup: Use more const in asset shelf code 2024-04-26 12:38:48 +02:00
Campbell Barton
e5dfc814e9 CMake: check both C & C++ compiler versions
It was possible for an unsupported clang/gcc version to be used,
this seems the likely cause of errors in #120879.
2024-04-26 18:01:51 +10:00
Laurynas Duburas
12df5a68ba Curves: support transforming Bezier handles in edit mode
Allows user to transform Bezier handles.

Pull Request: https://projects.blender.org/blender/blender/pulls/120222
2024-04-26 09:32:26 +02:00
Campbell Barton
c42eeb0c38 Cleanup: avoid unnecessary buffer copy to access the filename 2024-04-26 16:39:11 +10:00
Campbell Barton
43121bcb67 UI: disable TTC & OTC fonts in the file selector
These are not fully supported, users who load these will not be able
to access all the faces within the TTC/OTC.

Existing uses of TTC/OTC won't be blocked, these are just not shown as
supported fonts in the file selector. Addresses #44254.

Ref !121060
2024-04-26 16:19:10 +10:00
Philipp Oeser
4d49c78e74 Fix: weight and vertex paint radial symmetry wrong with mirror
Both vertexpaint and weightpaint would only apply all of radial symmetry
for the "initial stroke".
When going over the combinations of symmetry axis, some of radial
symmetry would be skipped, e.g. when mirroring from right to left with
`Mirror X` turned ON, a dab on the right would have radial symmetry from
that point, and an additional dab on the left from mirroring (but the
mirrored dab would not have radial symmetry on its own).

This does not lead to symmetric results at all, sculptmode also does not
behave that way (there, radial symmetry is performed on the mirror axis
as well).

Now do the same thing as in sculptmode to get symmetric results when
using mirror and radial symmetry together.
Also use the utility function to skip invalid symmetry iterations.

Stumbled over this when looking into #120843

Pull Request: https://projects.blender.org/blender/blender/pulls/120931
2024-04-26 07:51:09 +02:00
Philipp Oeser
b47242314f Fix #120843: Brush texture not mirrored in vertex paint mode
While using texture on the brush in vertex paint mode (neither generated
or imported texture), the brush texture is sampled based off of the
unmirrored coordinate.

To resolve, use the same method that sculptmode uses in
`sculpt_apply_texture` (flipping the coordinate over the mirror axis).

Pull Request: https://projects.blender.org/blender/blender/pulls/120935
2024-04-26 07:49:36 +02:00
Philipp Oeser
b7772cfa8b Fix #120836: Armature Symmetrize mirror constraint X track axis
Previously, the track axis would remain X on the other side. It should
be flipped to -X to give a symmetrical result.

Building upon ee43cf5722, this adds support for flipping the track
axis in certain constraints, namely:
- Track To
- Locked Track
- Damped Track
- Shrinkwrap

Pull Request: https://projects.blender.org/blender/blender/pulls/120979
2024-04-26 07:48:56 +02:00
Philipp Oeser
e816b481e0 Fix #121004: bmesh.ops.dissolve_limit wrong in certain cases
Exposed by 6c774feba2

`BM_mesh_decimate_dissolve_ex` sets up `DelimitData` with layer offset
(start), size and end so that `bm_edge_is_contiguous_loop_cd_all` can
check a range of edges for being contiguous.

The way `cd_loop_offset_end` is calculated is wrong though, it does not
take the actual start into account (this has to be added to fix the
bug). When it is wrong, it can happen that start and end are the same,
so no check actually takes place and no delimiting edges are found.

It seems that prior to 6c774feba2 the customdata layer always had an
offset of zero, so never really showed in practice (at least I couldnt
make it break in 3.4), but after 6c774feba2 we can at least observe the
following:
- when creating a bmesh, an offset would to the uv layer would still be
zero in my tests
- however, as soon as we iterate loops of a face (as done in the
report), we get an additional layer `CD_BM_ELEM_PYPTR`
- this then changes the offset
- `BM_uv_map_get_offsets_from_layer` seems to do the right thing afaict

So to resolve, just add the "start" offset to the end, to get the right
range.

NOTE: there is a very similar `DelimitData` used in
`bmesh.ops.join_triangles` and the way in which `bm_edge_delimit_cdata`
sets up te range is exactly like what this PR proposes.

Pull Request: https://projects.blender.org/blender/blender/pulls/121033
2024-04-26 07:47:57 +02:00
YimingWu
71e7775bcb Fix: Mantaflow: move allocation after early return
Varibale `pic` is allowcated before an early return, which could cause
a memory leak. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121104
2024-04-26 06:31:22 +02:00
Campbell Barton
cb93603fb3 Cleanup: remove script-id for Python command line error message
While additional context is typically useful to include,
this is such a corner-case that it's not expected script authors
would run into this during regular development.
2024-04-26 14:04:58 +10:00
Campbell Barton
6456fa3b9e Cleanup: use C-style comment blocks 2024-04-26 13:55:38 +10:00
Campbell Barton
56f80ebbcd UV: avoid small allocations in PackIsland::finalize_geometry
Use the memory arena for convex vertices as well as the index buffer.
2024-04-26 13:55:37 +10:00
YimingWu
b9879b0ff7 Fix: memory leak in clip_buttons.cc
uiTemplateMarker could return early with a MarkerUpdateCb not freed,
now fixed.

Part of #120767

Pull Request: https://projects.blender.org/blender/blender/pulls/121101
2024-04-26 04:01:34 +02:00
Iliya Katueshenock
095d37c186 Fix #120592: File output node not showing up in search
Pull Request: https://projects.blender.org/blender/blender/pulls/121096
2024-04-25 21:53:16 +02:00
Hans Goudey
e3e52ccc00 Cleanup: Unused variable warning in release build 2024-04-25 15:28:11 -04:00
Hans Goudey
fdaf7a5db1 Cleanup: Remove unnecessary sculpt bose brush callback data struct
Since the flood fill callback uses FunctionRef now, there is no need to pack
the relevant arguments into a separate struct. Though there are a lot of
arguments now, there is one less indirection which hels when clicking
through the code.
2024-04-25 15:20:26 -04:00
Hans Goudey
5c73a543fa Cleanup: Use const argument to sculpt accessor functions 2024-04-25 15:20:25 -04:00
Hans Goudey
c4763443b0 Cleanup: Remove unnecessary sculpt flood fill lambda argument 2024-04-25 15:20:25 -04:00
Hans Goudey
fc1a4647cf Cleanup: Use C++ types for pose brush segments
Use unique_ptr, Array, float3, and references for stored pose brush segments.
2024-04-25 15:20:25 -04:00
Hans Goudey
5c70a64646 Cleanup: Use C++ matrix type for sculpt pose segment 2024-04-25 15:20:25 -04:00
Hans Goudey
a07dbf59b2 Cleanup: Use C++ Set for sculpt pose brush visited face sets 2024-04-25 15:20:25 -04:00
Hans Goudey
d40ee0af34 Cleanup: Return sculpt flood fill utility struct by value 2024-04-25 15:20:25 -04:00
Hans Goudey
f32a8bdac6 Fix #121039: Pose brush face sets FK rotation origins broken
Caused by a683d1b0c6 which didn't clear the flood fill like
used to happen in the "free_fill" function.
2024-04-25 15:20:25 -04:00