Commit Graph

120055 Commits

Author SHA1 Message Date
Aras Pranckevicius
3d7359a38f Fix #130969: OBJ import shading artifacts when file contains zero-area faces
When OBJ file contains vertex normals, this can in some cases confuse
the custom loop normals code inside Blender. Since it does not simply
just use custom normals, but rather projects them into "lnor space".
But that "lnor space" calculation can go haywire sometimes, when
degenerate faces are present in the input.

Mark zero-area faces as "sharp" before doing custom normals. This will
make them not try to share the "smooth fan" lnor space with other faces,
and things will look correct.

Previously, OBJ importer was (wrongly) always setting all faces
as "sharp", which avoided this problem, but caused other issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/131041
2024-11-27 22:03:15 +01:00
Miguel Pozo
1105f2573e Fix #130846: Workbench: X-Ray incoming vector
Regression from
9396c8f388
2024-11-27 21:26:52 +01:00
Sean Kim
4c1cb3be9d Fix: Filter Mesh crash when using operator panel
`CTX_data_ensure_evaluated_depsgraph` ultimately ends up freeing the PBVH
meaning that any associated data still held may be a use-after-free error.

Pull Request: https://projects.blender.org/blender/blender/pulls/131011
2024-11-27 20:57:23 +01:00
Miguel Pozo
a39bec7197 Fix: Overlay-Next: GP Points/Segments in edit modes
The previous code didn't support disabling them.
This is a copy of the Legacy behavior.
2024-11-27 20:52:49 +01:00
Sean Kim
b53a9a671d Fix #130783: Image editor tools do not set active brush
Missed in a38c96b92c

Pull Request: https://projects.blender.org/blender/blender/pulls/130946
2024-11-27 20:50:30 +01:00
Miguel Pozo
6e6b9abf55 Fix: Overlay-Next: GP Vertex paint points 2024-11-27 20:08:28 +01:00
Miguel Pozo
83dca75cdf Fix #130815: Overlay-Next: Disabled overlays still visible 2024-11-27 20:07:15 +01:00
Julian Eisel
a66a5a3f50 Fix #130882: Asset shelf filter by active tool option doesn't redraw 2024-11-27 18:53:05 +01:00
Clément Foucault
f08c2b8aa1 Fix: Overlay-Next: Wireframe display conflicting with edit cage 2024-11-27 18:45:31 +01:00
Omar Emara
292ad6b00e Compositor: Implement Keying node for new CPU compositor
Reference #125968.
2024-11-27 19:28:16 +02:00
Omar Emara
0efb0ce48e Compositor: Implement Dilate node for new CPU compositor
Reference #125968.
2024-11-27 19:28:16 +02:00
Omar Emara
b43c36e801 Compositor: Implement Morphological Distance Feather algorithm for CPU
Reference #125968.
2024-11-27 19:28:16 +02:00
Omar Emara
32186ca908 Compositor: Implement Morphological Distance algorithm for CPU
Reference #125968.
2024-11-27 19:28:16 +02:00
Omar Emara
939242b100 Compositor: Implement Morphological Distance Feather Weights to CPU
Reference #125968.
2024-11-27 19:28:16 +02:00
Omar Emara
8f77e0d7fe Fix: Zero division in Dilate node 2024-11-27 19:28:16 +02:00
Clément Foucault
00a8d006fe GPU: Move Polyline shader to primitive expansion
This port is not so straightforward.

This shader is used in different configurations and is
available to python bindings. So we need to keep
compatibility with different attributes configurations.

This is why attributes are loaded per component and a
uniform sets the length of the component.

Since this shader can be used from both the imm and batch
API, we need to inject some workarounds to bind the buffers
correctly.

The end result is still less versatile than the previous
metal workaround (i.e.: more attribute fetch mode supported),
but it is also way less code.

### Limitations:
The new shader has some limitation:
- Both `color` and `pos` attributes need to be `F32`.
- Each attribute needs to be 4byte aligned.
- Fetch type needs to be `GPU_FETCH_FLOAT`.
- Primitive type needs to be `GPU_PRIM_LINES`, `GPU_PRIM_LINE_STRIP` or `GPU_PRIM_LINE_LOOP`.
- If drawing using an index buffer, it must contain no primitive restart.

Rel #127493

Co-authored-by: Jeroen Bakker <jeroen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/129315
2024-11-27 17:37:04 +01:00
Aras Pranckevicius
611940805e Fix #107493, #98480: video rotation metadata is not read
Videos files recorded on most phones were coming in sideways; files
recorded on some laptop cameras were coming in upside down. In both
cases the display_matrix metadata of the video stream was not applied.

This required changing internal container format of movie proxies to
be MP4 instead of AVI, since AVI does not support rotation metadata.
File extension kept at ".avi" to not disturb existing expectations.

It might be better to "bake" rotation into proxies while building them,
but right now we do not have a trivial way of doing that.

Note that this is a potential behavior change; if someone
already had manually rotated video strips, they would have
to undo that rotation now.

Pull Request: https://projects.blender.org/blender/blender/pulls/130455
2024-11-27 17:08:37 +01:00
Philipp Oeser
5aa95941d1 Fix #130998: Crash changing Color Palette in Object/Edit/Pose modes
Caused by 7b0ea0f1b4

By default, Color Palettes are only drawn in the UI in the context of
**painting**. UI button code then tries to update an appropriate brush
from edits to the palette.

In the report though, a palette was created and displayed via python,
making changes in Object/Edit/Pose would then crash.

So a valid `Paint` and `Brush` were assumed. `Paint` was already checked
for in a324a19f1b, but since 7b0ea0f1b4, `Paint`(if we actually have
it, e.g.from `ImagePaintSettings` [see a324a19f1b]) only has its
`brush` set once we enter texturepaint once.

Solved by checking we have a valid Brush in corresponding UI code to
begin with.

Pull Request: https://projects.blender.org/blender/blender/pulls/131031
2024-11-27 15:41:26 +01:00
Hans Goudey
953c4f1599 Cleanup: Remove references to legacy Grease Pencil object
These are converted on startup to the new type. There are still
some references left, mostly where it looked like there still needs
to be changes to properly deal with the new object type.
2024-11-27 09:17:16 -05:00
Philipp Oeser
1448967287 Fix #130748: selection of bones in grease pencil weightpaint mode fails
Two places that were not ready for GPv3:
- armatures were not set to posemode when entering weightpaint
- armatures were not in the object list when OpenGL selecting (thus
their bones were missing)

Both of them because existing code only respected
`eModifierType_Armature` (and not `eModifierType_GreasePencilArmature`
as well).

This is now corrected.

Similar to bdfb3ea6e7

Pull Request: https://projects.blender.org/blender/blender/pulls/130908
2024-11-27 14:44:26 +01:00
Habib Gahbiche
4de34c8205 UI: Implement snapping for node resizing
When snap is active, resizing nodes now snaps the edge of the node to
grid. Holding `CTRL` inverts snapping.

Part of https://projects.blender.org/blender/blender/issues/128612

Pull Request: https://projects.blender.org/blender/blender/pulls/130379
2024-11-27 11:09:48 +01:00
Campbell Barton
8fba37cea7 Fix #129657: Broken pipe from a Python script closes Blender
Since [0] PyConfig_InitIsolatedConfig was used which disables
Python's signal handlers, re-enable them as they're needed for
Python's own error handling to work properly.

[0]: cd5dd6e454
2024-11-27 20:32:50 +11:00
YimingWu
ca78cae828 Fix #130992: Grease Pencil: Edit wire/vertex color usage fix
In legacy overlay the wire/vertex color used to draw grease pencil was
wrong, this means users can't effectively adjust grease pencil specific
wire colors. Currently this shader is used for both legacy and overlay
next, so this fix would be also beneficial down the line.

Pull Request: https://projects.blender.org/blender/blender/pulls/131023
2024-11-27 10:13:20 +01:00
Campbell Barton
f088bb1bc8 Cleanup: spelling in comments 2024-11-27 19:01:02 +11:00
Campbell Barton
b9f055459a Cleanup: ensure trailing space around comment blocks 2024-11-27 19:01:00 +11:00
seanterelle
6e9d988018 Geometry Nodes: Add dynamic label to warning node
Implementation of auto-label for the warning node based on the type
(similar to the Math node).

Pull Request: https://projects.blender.org/blender/blender/pulls/131000
2024-11-27 01:41:49 +01:00
Marco Rotili
e6d941cdf4 Fix #129178: Opening the context menu on a numeric input shows the wrong cursor
Use non-modal setting of mouse cursor type so that the correct one is
shown for the numerical input context menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/129455
2024-11-27 00:58:38 +01:00
Clément Foucault
112b3bae84 Fix: GPU: Asserts when building WITH_GPU_DRAW_TESTS but without WITH_GTEST 2024-11-26 22:39:13 +01:00
Clément Foucault
7faec42236 Fix #130867: Overlay-Next: Crash on startup on intel macs
Loading the matrix first to local variable fixes the
internal compiler error.
2024-11-26 22:21:40 +01:00
Clément Foucault
badedb204a Overlay-Next: Move wireframe depth buffer copy before rendering
This avoid renderpass splitting and make overlay follow
the overlay interface.

Also fix the infront wireframe not copying the correct depth
buffer.
2024-11-26 21:32:27 +01:00
Clément Foucault
ebcc3dbc41 Fix: UI: Broken Geometry node socket display on macOS
Fix various warnings (that were errors) referring to
variables used inside their own initialization.
2024-11-26 21:32:27 +01:00
Clément Foucault
76a19fd3c5 Cleanup: Overlay: Remove OB_GPENCIL_LEGACY support 2024-11-26 21:32:27 +01:00
Sean Kim
14ca9998eb Cleanup: Use SI_MODE_PAINT instead of string comparison
Pull Request: https://projects.blender.org/blender/blender/pulls/130947
2024-11-26 19:57:47 +01:00
Sean Kim
893e9b5f49 Cleanup: Add example mapping pairs for bToolRef#mode
Pull Request: https://projects.blender.org/blender/blender/pulls/130949
2024-11-26 19:57:06 +01:00
Hans Goudey
569869b422 Cleanup: Remove unused attribute access definition 2024-11-26 13:03:20 -05:00
Hans Goudey
2dd124b391 Fix #130979: Curve object edit mode crash with evaluated mesh
Currently the text measure stats overlay is written to assume there
is an original edit mesh. It has to be disabled when that isn't the case.
2024-11-26 12:11:19 -05:00
Iliya Katueshenock
7126134309 Fix #130967: hidden sockets are made visible when dragging nodes
Never unhide a sockets as side effect. This was introduced as feature to automate
something in 3dead22c73.

Today this is just a source of confusion and annoying.

Pull Request: https://projects.blender.org/blender/blender/pulls/130984
2024-11-26 17:27:13 +01:00
Clément Foucault
f071385315 Cleanup: Overlay-Next: Split flat object sync to its own function
This allow to use the `Overlay` base class as intended.
2024-11-26 17:11:18 +01:00
Clément Foucault
1da9919841 Cleanup: Overlay-Next: Move Resource acquisition and release to class method 2024-11-26 17:11:18 +01:00
Falk David
ed1c262bb3 Cleanup: Remove unused Grease Pencil shader file
This file was completely unused and caused confusion.

Pull Request: https://projects.blender.org/blender/blender/pulls/130982
2024-11-26 17:09:42 +01:00
Jacques Lucke
7dc630069b Nodes: support subpanels in node group interface
Previously, only one level of panels was supported. Now, they can be nested arbitrarily.
Panels still have to come at the bottom though.

The panel color used to be just the node color darkened a bit. Now it uses the
`TH_PANEL_SUB_BACK` theme setting which is also used by panels in other places
in Blender. However, the contrast of that is a bit weaker than what we had in nodes before.
Therefore I increased the contrast a bit.

Pull Request: https://projects.blender.org/blender/blender/pulls/128886
2024-11-26 17:01:14 +01:00
Jacques Lucke
29bfd8ddcc Core: move FileData to C++
This is a simple cleanup as many similar ones before. The goal is to support
having C++ containers in `FileData`.

Pull Request: https://projects.blender.org/blender/blender/pulls/130980
2024-11-26 16:44:12 +01:00
Jacques Lucke
1d39bb4c80 Core: remove leftover IDOverrideLibrary
This is a leftover from an earlier version of overrides, but is effectively dead
code currently. It was used when there were proportional diffing capabilities.
However, Bastien mentioned that this would be implemented differently nowadays
anyway if it becomes necessary again.

This simplifies the write ID loop quite significantly.

Pull Request: https://projects.blender.org/blender/blender/pulls/130928
2024-11-26 16:09:59 +01:00
Nathan Vegdahl
409697a962 Anim: rename action_slot_name to last_slot_identifier
`AnimData`, NLA strips, and action constraints all have an `action_slot_name`
field in RNA. The purpose of this field is to store the identifier of the most
recently assigned slot, so that it can be used for auto-assignment when later
assigning different actions.

However, this field name is misleading in two ways:

1. In accordance with #130740, it's actually the slot *identifier*, not name.
2. It could be mistaken as a way to rename the currently assigned slot, which it
   is not.

To resolve both of those issues, we're renaming the field to
`last_slot_identifier`, which better communicates its actual nature.

As a bonus, this also ends up decluttering Python autocomplete when looking
for things related to action_slot.

Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130911
2024-11-26 16:05:40 +01:00
Clément Foucault
cbc185dbbd Cleanup: Overlay-Next: Move ShapeCache access to Resources 2024-11-26 15:43:01 +01:00
Jeroen Bakker
492830e9ac Fix #130832: Vulkan: Texture painting
When using texture painting Blender could freeze, crash or not showing
any results depending on the platform being used.

There were several issues:
- texture painting could send a layer offset of -1, which would select
  an incorrect layer
- source data wasn't copied correctly in the staging buffer as it
  ignored `texture_unpack_row_length`

Pull Request: https://projects.blender.org/blender/blender/pulls/130973
2024-11-26 15:15:25 +01:00
Omar Emara
f9420bd58a Compositor: Implement vector Blur for new CPU compositor
Reference #125968.
2024-11-26 16:10:56 +02:00
Omar Emara
43d2538087 Compositor: Implement Inpaint node for new CPU compositor
Reference #125968.
2024-11-26 16:10:56 +02:00
Omar Emara
be19daaa06 Compositor: Implement Directional Blur for new CPU compositor
Reference #125968.
2024-11-26 16:10:56 +02:00
Omar Emara
a9f8eca927 Compositor: Implement Symmetric Separable Variable Size Blur for CPU
Reference #125968.
2024-11-26 16:10:56 +02:00