Commit Graph

140361 Commits

Author SHA1 Message Date
Harley Acheson
bc43d243bb UI: SVG Icon ID Names Underscores Not Period
In order to recolor icons based on themes, some svg icons have specific
ID names. These names are currently of the pattern "blender.some_name".
However, although CSS ID names are allowed to contain a period in them,
these are problematic as selectors. This is because #tagname.something
looks like a combination of ID and class name. Although these can be
escaped like #tagname\.something that is a pain. This PR replaces the
periods with underscores.

Pull Request: https://projects.blender.org/blender/blender/pulls/126709
2024-08-24 00:28:34 +02:00
Sean Kim
0e5c6ec33f Cleanup: Remove sculpt_brush_types.cc
The file only had a single function remaining inside of it, moving it
inside `sculpt.cc` seems more prudent until we determine a better place
for related methods.

Pull Request: https://projects.blender.org/blender/blender/pulls/126708
2024-08-24 00:22:33 +02:00
Pratik Borhade
47223553f7 Fix #126550: Image editor paint mode crash in new window
Crash triggered due to null string. Enum list passed to `RNA_enum_from_value`
only has image-editor and UV items so the function returns -1 index in case of other
modes.  Because the mode variable is used to contain both editor type or modes,
just assume Image Editor when these are Image Editor modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/126584
2024-08-24 00:16:42 +02:00
Sean Kim
701b148530 Fix: Avoid potential UB when reprojecting GP
If the ray happens to not intersect the projection plane then currently
the `reproject` method attempts to transform an uninitialized `float3`

Pull Request: https://projects.blender.org/blender/blender/pulls/126623
2024-08-23 21:55:18 +02:00
Sean Kim
84615b0eac Cleanup: Break apart paint_intern.hh
This commit moves the namespaced functions inside `paint_intern.hh` into
their own header files, specifically:
* `blender::ed::sculpt_paint::hide` to `paint_hide.hh`
* `blender::ed::sculpt_paint::mask` to `paint_mask.hh`

This commit also moves methods defined in `sculpt_hide.hh` into their
own file (`sculpt_hide.cc`) out from `sculpt.cc` and `paint_hide.cc`

Pull Request: https://projects.blender.org/blender/blender/pulls/126668
2024-08-23 21:54:18 +02:00
Harley Acheson
f08ade0523 UI: Docking Improvements From Menu Item or Shortcut
Small changes to improve docking when initiated from a menu item or
keyboard shortcut, rather than corner action zones. Process gives
feedback immediately. Split assumes a start from top-left corner.
Canceling always resets mouse cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/126704
2024-08-23 21:03:38 +02:00
Jesse Yurkovich
58bd3d40ee Fix #124752: Push an undo step when USD background import completes
This was a very similar problem to Alembic's #77754 where a background
import can cause issues with Undo in some circumstances.

Mirror what was done for the Alembic fix here now too.

Pull Request: https://projects.blender.org/blender/blender/pulls/126539
2024-08-23 19:49:10 +02:00
Falk David
3ca9396cc3 Fix #126613: GPv3: Python: Writing to stroke.curve_type crashes Blender
Writing to the `curve_type` attribute directly is not allowed as there are other
updates needed and otherwise will result in a crash.

The fix makes sure the `curve_type` is read-only. To change the curve type,
the `grease_pencil.set_curve_type` operator has to be used for now.
2024-08-23 18:24:37 +02:00
Lukas Tönne
c510409cf6 Fix #126606: GPv3: Wrong projection and various other issues with exporters
Fixes the camera and View3D projection used for calculating the rendered
region for SVG/PDF export. Also drastically simplifies this code by
removing unnecessary variables and using an optional transform to
indicate when camera data is actual available.

Also fixes missing layers in export due to incorrect early exit in the
layer loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/126691
2024-08-23 17:51:26 +02:00
Hans Goudey
1376c78e46 Cleanup: Further explicit retrieval of data in PBVH draw 2024-08-23 11:17:17 -04:00
Hans Goudey
5ece086678 Cleanup: Separate PBVH VBO format creation to functions 2024-08-23 11:17:16 -04:00
Clément Foucault
e5ba4cc7b0 Fix: Overlay: Missing backface culling in facing overlay
Same fix as for legacy overlay.

Fix #126351
2024-08-23 17:10:42 +02:00
Clément Foucault
0bad30317c Fix: Overlay: Missing backface culling in facing overlay
It was a side effect of enabling the depth write.

The fix is to enable the backface culling when it can
be honored.

However, this only works in solid mode.

Candidate for backporting to 4.2

Fix #126351
2024-08-23 17:10:42 +02:00
Lukas Tönne
948d6a8866 Fix #126597: GPv3: Support the "insert on back" option in fill tool
This just swaps the order of old/new curves when combining them in the end.

Pull Request: https://projects.blender.org/blender/blender/pulls/126700
2024-08-23 17:06:05 +02:00
Clément Foucault
0d4c76c986 Fix: EEVEE: Material without Closure flag skip rendering
If a deferred layer doesn't contain any material with
a non-null closure flag, the deferred layer is skipped.

However, material with null closure flag exists and
still need to render opaque.

Fix this case by modifying the closure bits for the
deferred and probe pipelines.

Candidate for backporting to 4.2

Fix #126459
2024-08-23 16:45:01 +02:00
Hans Goudey
205d95107e Cleanup: Miscellaneous changes in draw_pbvh.cc
Reorganization to make the retrieval of data from the arguments struct
more explicit, combined with a bit of renaming. Mostly to make a future
diff visually simpler.
2024-08-23 10:18:38 -04:00
Clément Foucault
e673e89630 GPU: Add support for shader printf inside tests 2024-08-23 16:11:28 +02:00
Clément Foucault
65efde82c3 EEVEE: Update shadow finalize test 2024-08-23 16:11:28 +02:00
Julian Eisel
c0b725b2ff Cleanup: Paint: Use getter to get active brush
Only paint code and brush management code should access this member
directly. Normal code should just use the getter.

Case in point, !125449 might make the querying of the active brush more
involved, so the getter should definitely be used to avoid accessing the
wrong brush.
2024-08-23 16:03:55 +02:00
Pratik Borhade
c4c4b842e7 Fix #126637: GPv3: Eraser size is the same size of Brush size
Instead of using the radius of the draw brush when activating the temporary
eraser, use the radius of the eraser brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/126673
2024-08-23 15:36:09 +02:00
Jeroen Bakker
d48986eec9 Fix: Vulkan: EEVEE irradiance baking
Fix crash when using EEVEE irradiance baking. When reading back the
intermediate result the active rendering was not ended, resulting
in an assert as the rendergraph is cleared and assumed to be in an
initial state (not rendering).

Pull Request: https://projects.blender.org/blender/blender/pulls/126688
2024-08-23 14:45:40 +02:00
Lukas Tönne
e42b9a73be Fix: GPv3: Outline perimeter cap radius too small when points are not coplanar
Stroke outlines are used by modifiers, fill tool, exporters, etc. When
the input strokes are not co-planar (different depths from camera view)
the end caps have smaller radii than they should have.

When generating the outline caps the normal vector is created from
the point tangents in 2D (after projection). When points have different
depths (Z positions) the tangents have a non-zero Z component as well
and discarding it leaves them unnormalized, thereby scaling the radius
by an unwanted factor.

Normalizing the vector fixes the issue. Object scale is now also taken
into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/126687
2024-08-23 14:24:39 +02:00
Jeroen Bakker
6607d66274 Fix: EEVEE crash when baking light probes
Due to recent changes EEVEE crashes when baking light probes.
Film checks if the viewport compositor is enabled via
DST. In the baking thread this is not initialized and can crash
or lead to incorrect results.

Fixed by first checking if we are updating the viewport.

Pull Request: https://projects.blender.org/blender/blender/pulls/126685
2024-08-23 14:20:42 +02:00
Jacques Lucke
901cfac08b Fix #126568: add dropped asset collection to active collection
This is necessary for the case where we don't add an instance for it afterwards. The collection is always added, but it may be removed again in `collection_drop_exec` if "Instance" is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/126648
2024-08-23 12:49:04 +02:00
Bastien Montagne
c23bbadebf Refactor: I18N: Use C++ in msgfmt utils.
This makes the code somewhat simpler, and fixes theoritical memory leaks
reported in #120767.

MO binary ouptut was compared as identical with the one from previous
code for a few of out current PO files.

Pull Request: https://projects.blender.org/blender/blender/pulls/126682
2024-08-23 12:41:57 +02:00
Jacques Lucke
808119ec3b Fix: linked objects are moved
Found while investigating #126568.
2024-08-23 12:41:35 +02:00
Lukas Tönne
cda6f1721a Fix #126607: GPv3 SVG import has wrong object transform and missing gradient color
The imported GP object should start out in default X/Z plane
orientation. The `EulerXYZ` function expects radians.

Gradient colors are not supported by Grease Pencil. GPv2 was simple
ignoring them and using the `NSVGgradient` pointer as a "color" value,
leading to effectively random colors. GPv3 was outputting black instead,
but that is easy to mistake for a deliberate color. This patch computes
an average gradient color as an approximation, and also generates a
warning for the operator when gradients are encountered.

Using magenta as a visual indicator is also a possibility, but this
proxy color seems to work pretty well.

Pull Request: https://projects.blender.org/blender/blender/pulls/126650
2024-08-23 11:35:09 +02:00
Christoph Lendenfeld
51fd355c01 Anim: UI template for Action selectors
This PR is just taken over from @dr.sybren with
minor comments addressed.

Original PR: #125493

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/126561
2024-08-23 11:07:16 +02:00
Nathan Vegdahl
02e721275f Fix: make convenience array functions allocate the right type
The functions were allocating arrays of `T *` rather than `T`, and
then were reinterpret-casting to the correct type afterwards. This
coincidentally worked at the current call sites because `T` was always
a pointer type anyway, but the code was logically incorrect and wouldn't
work if anyone tried to use them with a non-pointer `T`.

This commit fixes this by correctly allocating an array of `T` instead,
and removing the unnecessary cast.

Pull Request: https://projects.blender.org/blender/blender/pulls/126656
2024-08-23 10:53:36 +02:00
Falk David
f1972deba1 View3D: Allow 3D cursor to snap to grease pencil geometry
The `Surface Project` option for setting the 3d cursor location ignored
grease pencil geometry. Since grease pencil is now it's own object, separate
from annotations, it makes more sense to now consider grease pencil objects.

This changes the `V3D_DEPTH_NO_OVERLAYS` to also render grease pencil.
If grease pencil shouldn't be considered, the `V3D_DEPTH_NO_GPENCIL`
flag should be used instead.

Note that annotations are independent of the `eV3DDepthOverrideMode`.
It seems like they are always rendered according to
`drw_draw_show_annotation()`.
The description for the options in `eV3DDepthOverrideMode` is
updated to reflect that.

Resolves #122700.

Pull Request: https://projects.blender.org/blender/blender/pulls/122705
2024-08-23 10:52:19 +02:00
John Kiril Swenson
a21a1a7b86 VSE: Set "box select" default tool for preview and show toolbars
Current default tool is "sample" which is a bit odd, and coupled with
the fact that the toolbar is hidden by default, this can be confusing
to new users, leading them to believe tweak/select tools are not
supported for the VSE preview.

This change:
- Sets "box select" as the default tool for the Preview
- Makes both Preview and Timeline toolbars shown by default

Pull Request: https://projects.blender.org/blender/blender/pulls/126336
2024-08-23 09:15:38 +02:00
Campbell Barton
46cd88f229 Fix #69164: Gizmos miss undo step
Gizmos adjusting properties missed an undo step.

When auto-keying is enabled this could crash on undo, see: #126617.
2024-08-23 15:06:29 +10:00
Campbell Barton
d254a0886e WM: use the gizmo-group type name for undo steps
Use a more meaningful name than "Gizmo" in undo steps.
2024-08-23 15:06:27 +10:00
Campbell Barton
5387605833 WM: prevent tweaking a gizmo performing an undo push when canceling
Canceling an action should never add an undo step.
2024-08-23 15:06:24 +10:00
Campbell Barton
a4667fbb3d Cleanup: use bool instead of int for a boolean array 2024-08-23 13:16:26 +10:00
Campbell Barton
878b52c072 Cleanup: quiet unused variable warning 2024-08-23 13:10:36 +10:00
Campbell Barton
bfd9b4dcc8 Cleanup: use "r_" prefixed return arguments 2024-08-23 13:09:20 +10:00
Campbell Barton
761b733787 Core: set the 'errno' on *nix when BLI_delete_soft fails
Gives a more detailed report for why BLI_delete_soft fails.
2024-08-23 12:28:27 +10:00
Campbell Barton
dc5ac1e1b1 Cleanup: minor clarification for delete_soft fork use on *nix
Order the child-process before the parent-process to match the order
the logic is executed.
2024-08-23 12:28:27 +10:00
Harley Acheson
6792d6dfbe UI: Docking Snapping
While docking, by default a snap to 50%. Pressing Alt gives greater
control without snapping to center. Pressing Ctrl snaps to eights.

Pull Request: https://projects.blender.org/blender/blender/pulls/126669
2024-08-23 03:02:08 +02:00
Campbell Barton
2ef76b89e4 Cleanup: remove duplicate code-comments 2024-08-23 10:19:53 +10:00
Campbell Barton
b76fcc3a1f Cleanup: add missing headers to CMake's file listing 2024-08-23 10:19:53 +10:00
Campbell Barton
07b11206eb Cleanup: sort cmake file lists 2024-08-23 10:19:53 +10:00
Campbell Barton
fdd0b93cfa Cleanup: spelling in comments 2024-08-23 10:19:53 +10:00
Campbell Barton
de0feaf08c Cleanup: white-space edit so license-checker passes 2024-08-23 09:58:30 +10:00
Iliya Katueshenock
76eed5c65a Fix clang-format & autopep8 do extra work when nothing to operate on
When passing `.py` paths to the format command, clang-format paths
would be empty and operate on all paths.

Resolve by detecting cases when there is nothing to format.

Ref: !126055
2024-08-23 09:55:30 +10:00
Campbell Barton
7971e6a9c2 Cleanup: return error code instead of sys.exit() for formatting utils 2024-08-23 09:55:30 +10:00
Hans Goudey
d5e591b3dc Refactor: Sculpt: Add helper function to access all BVH nodes
Previously we often passed an empty `FunctionRef` to the generic
`search_gather` function. The plan is to refactor `search_gather`
to return an `IndexMask` along with storing leaf nodes in a separate
array. Splitting access to all leaf nodes to a separate function simplifies
this process and makes code more expressive too.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/126667
2024-08-22 23:37:10 +02:00
Hans Goudey
0ff0e41c62 Cleanup: Sculpt: Remove unnecessary function prefixes in sculpt_pose.cc 2024-08-22 17:31:16 -04:00
Hans Goudey
fb7496f325 Cleanup: Sculpt: Simplify local function naming in sculpt.cc
Mostly remove the `sculpt_` prefix which is redundant in this file.
2024-08-22 17:24:14 -04:00