Commit Graph

115143 Commits

Author SHA1 Message Date
Omar Emara
afdbef449b Cleanup: Compositor: Remove redundant includes 2024-11-21 16:26:49 +02:00
Omar Emara
0d83aafd4b Compositor: Implement Bilateral Blur for new CPU compositor
Reference #125968.
2024-11-21 16:24:21 +02:00
Omar Emara
8b720eb6ea Compositor: Implement Filter node for new CPU compositor
Reference #125968.
2024-11-21 16:22:43 +02:00
Hans Goudey
c497d5c3fa Refactor: Move quad triangulation function to blenlib
Make this available for a Mesh-based triangulation implementation
implemented elsewhere. Part of #112264.
2024-11-21 08:30:28 -05:00
YimingWu
d37a855973 Fix #130569: Grease Pencil tint modifier should use gradient alpha
Grease pencil tint modifier in gradient mode did not do alpha mix with
the original stroke color, making original color completely black even
when gradient color has alpha. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130575
2024-11-21 13:42:02 +01:00
Miguel Pozo
0df7cf4be8 Fix: Overlay-Next: Disable background images on selection
They can't be selected, and default_fb is invalid in selection mode, which causes null dereferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/130627
2024-11-21 12:19:11 +01:00
Jeroen Bakker
5665a9d712 Fix #130555: Vulkan: Crash when using legacy gpu API
Add-ons can still use the legacy API that only works on OpenGL. Vulkan
however was crashing as there is no shader create info available.

Adding a pre-check when finalizing shaders on availability of shader
create info.

Pull Request: https://projects.blender.org/blender/blender/pulls/130660
2024-11-21 11:14:11 +01:00
Sebastian Parborg
1d1811c54b CMake: Linux/Mac: Fix CMP0177 policy warnings
Follow up to: 536937b4d4

Pull Request: https://projects.blender.org/blender/blender/pulls/130602
2024-11-21 11:07:08 +01:00
Julien Duroure
dbc8b29519 glTF: Draco: Fix #130545 - Windows Draco dll was not in right directory
This is a regression by a0f653c002

Pull Request: https://projects.blender.org/blender/blender/pulls/130572
2024-11-21 10:29:20 +01:00
Philipp Oeser
ba92a25e1c Fix: Crash renaming modifier in Outliner and then toggling a property
If a modifier gets renamed elsewhere (through the UI in the Properties
Editor, python, ...) this ends up calling `rna_Modifier_name_update` --
which went fine because it does the neccessary depsgraph relations
update.

Doing the same from the Outliner missed that which then lead to crashes
in depsgraph modifier evaluation.

To resolve, add a case for `TSE_MODIFIER` in the Outliners
`namebutton_fn` that adds the required depsgraph relations update.

Also adds an appropriate notifier, so the name changes appear
immediately elsewhere in the UI.

Fixes #130536

Pull Request: https://projects.blender.org/blender/blender/pulls/130587
2024-11-21 09:31:49 +01:00
Omar Emara
15cdeae620 Fix: Compile error in Despeckle node for Metal
We can't use the `threshold` uniform name in Metal because it is used as
a local variable in one of the library files, because uniforms are
defines in Metal, so it causes an error. Change the name to
`color_threshold` as a fix.
2024-11-21 09:37:44 +02:00
Jesse Yurkovich
2c3397aa51 Cleanup: replace the removed std::shared_ptr::unique API in C++20
C++20 removes the `std::shared_ptr::unique()` API with the suggestion to
use the `use_count()` method instead.

Note that we are using the unique/use_count APIs in a way that is
generally cautioned against though our usage patterns may be fine.

See: https://en.cppreference.com/w/cpp/memory/shared_ptr/unique
Example errors: https://godbolt.org/z/1j3zzd1hP

Ref #125881
2024-11-21 05:09:35 +01:00
Jesse Yurkovich
39e96d9c0f Fix #130155: Handle opacityThreshold controlled with individual image channels
When EEVEE next removed the Alpha Threshold option a node graph setup
was used instead. Based on a USD test asset[1] the original code was
designed around only using the Image A channel during import to wire
up the nodes. However, the other channels (R, G, or B) are just as
valid.

We now handle this by wiring up the Separate RGB node, that is already
inserted for the scenario in general, to the shader nodes handling the
threshold calculation. Also adds additional test coverage for both
export and import as well.

The Round and LessThan+OneMinus networks remain the only shapes that
will be recognized for the processing.

[1] https://github.com/usd-wg/assets/tree/main/test_assets/AlphaBlendModeTest

Pull Request: https://projects.blender.org/blender/blender/pulls/130346
2024-11-21 03:50:11 +01:00
Harley Acheson
7c81ec922c UI: Calm Warning in #130617 About Variable Mismatch
Fix compiler warning about variable mismatch (int versus uint) in
commit bc5fcbe1c3.

Pull Request: https://projects.blender.org/blender/blender/pulls/130633
2024-11-20 22:58:43 +01:00
Jesse Yurkovich
2523958e0e USD: Add support for animated point instancers
The existing point instancer reader is slightly refactored to allow for
animated setups. The primary change is simply to inherit from
`USDGeomReader` rather than `USDXformReader`. This allows access to the
`read_geometry` API used by the cache modifier.

The existing `read_object_data` method is split into two parts with
`read_geometry` loading per-frame USD data and `read_object_data`
coordinating the initial loading process, including creating the GN node
tree just once.

A new test has been added (a variation of the nested point instancer
file) with time samples on various attributes and on both point
instancers. This also fixes #129502 and the file provided in that issue.

----
The already added test file is `tests/data/usd/usd_point_instancer_anim.usda`

Pull Request: https://projects.blender.org/blender/blender/pulls/129881
2024-11-20 22:03:32 +01:00
Harley Acheson
8bcb714b9e UI: Face Orientation Front Color Transparent
This PR changes the default theme color for TH_FACE_FRONT, used by the
Face Orientation overlay, to have zero alpha. That way, by default, it
can be used always and not interfere with the display of (normal) front
faces.

Pull Request: https://projects.blender.org/blender/blender/pulls/130618
2024-11-20 21:39:40 +01:00
Sean Kim
94fda917de Cleanup: Avoid comparing bool to int value
Pull Request: https://projects.blender.org/blender/blender/pulls/130483
2024-11-20 20:48:42 +01:00
Sean Kim
9945d511a9 Fix #130548: Crash on selecting brush tool in older blender version file
This commit adds extra filtering when applying versioning code to older
files to support the Image Editor paint brushes with brush assets.

Previously, the versioning code updated all of the View3D space tools
that used a paint context to have a specific hardcoded tool name - this
unfortunately misses the default startup.blend Texture Paint brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/130560
2024-11-20 20:34:02 +01:00
Harley Acheson
bc5fcbe1c3 UI: Notification When Hiding Objects
This shows a "2 object(s) hidden" notification on the status bar when
hiding objects, the same as we do when deleting objects.  Pressing "H"
can be done accidentally so this is at least some indication of what
happened, both on the status bar in Info Editor. Obviously does nothing
if nothing is selected when you press "H"

Pull Request: https://projects.blender.org/blender/blender/pulls/130617
2024-11-20 20:10:51 +01:00
Clément Foucault
32696991f1 Fix: Overlay-Next: Armature custom shapes have no anti-aliasing
The uniform value was not set properly.
2024-11-20 19:24:16 +01:00
Miguel Pozo
03909f2691 Fix: Overlay-Next: Images
Several fixes for Camera and Empty images.

Pull Request: https://projects.blender.org/blender/blender/pulls/130345
2024-11-20 19:05:22 +01:00
Harley Acheson
f339ab4325 UI: Minimum Docking Target Size
When dragging an area to a new location, current code limits the size
of the target area to AREAMINX and HEADERY, which is the minimum sizes
that an area can occupy. This is too small and results in frustration
for some users. When moving an existing area you are unlikely to want
it to be an unusable size. This PR makes the minimum target size 3X
wider. If an area is not large enough to be bisected into two such
areas then it won't be offered as a docking target in that orientation.

Pull Request: https://projects.blender.org/blender/blender/pulls/130546
2024-11-20 19:02:42 +01:00
Harley Acheson
09e6bab7bc UI: Changes to Docking Operation Descriptions
Changes to the text descriptions shown when dragging an area to a new
location. "Split Area" -> "Move area here", "Replace Area" -> "Replace
this area".  Removes some confusion regarding "split" since we normally
use that word for a different operation. The "this" and "here" help to
remove ambiguation with the word "area" (source or target).

Pull Request: https://projects.blender.org/blender/blender/pulls/130554
2024-11-20 18:27:29 +01:00
Clément Foucault
29356e2bf7 Fix: Overlay-Next: Loose edges is drawn with less intensity when selected
This was caused by the fresnel effect darkening the selection
color when there was no normal attribute available.
Now default to no darkening when no attribute is available.
2024-11-20 18:25:59 +01:00
Clément Foucault
b35fdac069 Fix: Overlay-Next: Broken light cone display
The depth test was not set correctly for the front pass.
The shader was writting to the antialiasing buffer. Using
a dedicated shader avoid breaking the renderpass to bind
another framebuffer.
2024-11-20 17:35:18 +01:00
Clément Foucault
2b72bc142c Fix: Overlay-Next: Armature custom shapes have no anti-aliasing
Blend state was incorrect for shape wires.
2024-11-20 17:04:38 +01:00
Clément Foucault
b6ba86d3e2 Fix: Overlay-Next: Stipple pattern difference
Was caused by reversed order of provoking vertex.
2024-11-20 16:23:23 +01:00
Clément Foucault
cc85ac20bd Fix: Overlay-Next: Wireframe always drawn in sculpt mode 2024-11-20 16:07:27 +01:00
Clément Foucault
1e7e776b34 Fix: Overlay-Next: Broken edit mode on some Nvidia GPU / drivers
One of the framebuffer output was not written to.
2024-11-20 16:04:01 +01:00
Bastien Montagne
406e93525f Fix #130535: Name of Object not updated in viewport when name clashes.
Now that another ID can be renamed (again), it also needs to be properly
tagged as needing resync in the depsgraph too.

This commit:
* Moves/add depsgraph tagging to `BKE_id_rename`.
* Moves the WM notifier creation to `ED_id_rename`.

Pull Request: https://projects.blender.org/blender/blender/pulls/130596
2024-11-20 15:24:46 +01:00
Omar Emara
e49498a795 Compositor: Implement Classic Kuwahara for new CPU compositor
Reference #125968.
2024-11-20 16:15:49 +02:00
Omar Emara
71e971700c Compositor: Implement Summed Area Table for new CPU compositor
Reference #125968.
2024-11-20 15:57:39 +02:00
Omar Emara
f4767bea72 Compositor: Implement Pixelate for new CPU compositor
Reference #125968.
2024-11-20 15:56:21 +02:00
Omar Emara
11a5e362d4 Compositor: Implement Denoise for new CPU compositor
Reference #125968.
2024-11-20 15:55:33 +02:00
Omar Emara
5e806db594 Compositor: Implement Despeckle for new CPU compositor
Reference #125968.
2024-11-20 15:53:28 +02:00
Omar Emara
e5352b11da Cleanup: Use is_equal method in Despeckle node 2024-11-20 15:52:17 +02:00
Omar Emara
5036c5338b Compositor: Implement Sun Beams for new CPU compositor
Reference #125968.
2024-11-20 15:51:30 +02:00
Clément Foucault
c365f08b39 Fix #130467!: Overlay-Next: Selection overlay missing GP vertex paint mode
It was unimplemented feature.
2024-11-20 14:41:34 +01:00
Clément Foucault
0c1cbc281f Fix #130497: Overlay-Next: GPencil selection mode overlay from edit mode visible in sculpt mode
Was testing the wrong selection_domain for sculpt.
2024-11-20 14:26:13 +01:00
Bastien Montagne
c51615923b Fix #130420: Undo/Redo broken when using Transfer Mode operator.
Regression from 9e0b673467.

Not sure why the extra undo step is required after changing active object
(maybe because the mode switching to Sculpt mode of the new object
generates a 'Sculpt' undo step and not a 'Global' one?).

Pull Request: https://projects.blender.org/blender/blender/pulls/130472
2024-11-20 12:43:12 +01:00
Jacques Lucke
e62aa986b2 Format: use fmt::format correctly with runtime format strings
The `fmt::format` can process the format string at compile time. Currently, we
don't seem to be using that as we don't use `FMT_STRING`. Starting with C++20,
that will be the default though, and one has to explicitly opt out in places
where the string is not known at compile time using `fmt::runtime(...)`.
Currently, our code does not compile as C++20 because of that. Unfortunately, we
have many places with runtime format strings, because of i18n.

Pull Request: https://projects.blender.org/blender/blender/pulls/130392
2024-11-20 10:41:29 +01:00
Jacques Lucke
251731accc Cleanup: Blenloader: simplify writing BHead
This adds a `write_bhead` utility function and also reduces the scope of
some `BHead` variables. The separate `write_bhead` function was quite
useful for #129751 and will likely be useful in a potential separate
implementation too.

Pull Request: https://projects.blender.org/blender/blender/pulls/130457
2024-11-20 10:39:58 +01:00
Jorn Visser
2bf7fac176 Creator: Ensure OpenMP runtime is initialized as soon as possible
This is to make sure duplicate libomp/libiomp5 runtime conflicts are
detected as soon as a second runtime is initialized. Otherwise, it may
not crash until Blender's OpenMP runtime is initialized by a feature
that uses it, making such issues possibly go unnoticed. Such a conflict
can happen when an add-on has a native module that uses OpenMP and links
to a different libomp runtime, as was the case in #125255.

Currently Blender only ships with libomp on MacOS.

---
When libomp detects such an issue it should abort and print the following message:
```
OMP: Error #15: Initializing libomp.a, but found libomp.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/
```

Pull Request: https://projects.blender.org/blender/blender/pulls/130407
2024-11-20 10:23:57 +01:00
ernst-ellert
73a3ebea56 Fix #129389: Lineart modifier updates when camera changes
The bug occurred when the user changed the camera of the scene.
The lineart modifier was not updating when changing the camera, but only
when changing other elements in the scene or moving the camera.

This is resolved by adding a depsgraph update for scene parameters, such
as when changing the camera.

Testing:
Add two cameras, add a Grease Pencil Collection Line Art, go into camera
perspective view and then switch to the other camera.
The Grease Pencil Line Art now updates automatically.

Co-authored-by: YimingWu <chengdulittlea@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/129935
2024-11-20 04:47:05 +01:00
Ray Molenkamp
536937b4d4 CMake: Windows: Fix CMP0177 policy warnings
CMake 3.31+ have begun emitting warnings when you feed install()
paths that are not normalized (ie have, '.' or '..' in them) easiest
fix is just not use them.

This cleans up the windows sections of the build system, the other
platform devs will have to take a look on their respective platforms.
2024-11-19 18:53:41 -07:00
Hans Goudey
c57ebc99eb Cleanup: Use StringRef instead of std::string in a few cases
Pull Request: https://projects.blender.org/blender/blender/pulls/130534
2024-11-19 19:47:27 +01:00
Charles Flèche
428ab699dc USD: Add option to merge transform and shape on export
Adds the option `merge_parent_xform` to the USD export operator and
panels so the transform and shapes are merged into a single USD Prim.

Without the option (existing default), a top-level mesh would be
exported as a top-level `Xform` that has a `Mesh` child:
```
def Xform "MyBlenderMeshObject"
{
  matrix4d xformOp:transform = ...

  def Mesh "MyBlenderMeshData"
  {
  }
}
```

This matches the Blender data model, where a transformable object
contains a geometric shape (like a mesh). This structure is also very
valid in USD, where we don't want to directly instantiate geometric
primitives[1]

However, "since number of prims on a stage is one of the primary factors
that governs how USD scale"[2], to reduce the number of prims in a
stage, geometric primitives *are transformable* themselves (see the
inheritence diagram[3]).

As such, the new export option allows to export geometric primitives
without the parent transform:
```
def Mesh "MyBlenderMeshObject"
{
  matrix4d xformOp:transform = ...
}
```

This MR adds a the `is_object_data_context` flag to the
`HierarchyContext` context structure. The point of this change is to
make unambiguous in `USDHierarchyIterator::create_usd_export_context`
the fact that an `object` or a `data` is currently being exported: the
new `merge_parent_xform` option is meaningless for `object`. Only `data`
can be exported with a parent `Xform` or as a child of said `Xform`.

Ideally this flag would not be needed at all: the final USD prim path
*could* be computed in an override of the virtual
`AbstractHierarchyIterator::get_object_data_path` method. However, this
would mean that an `object` and a `data` would have the same export path.
This does not currently play well with
`AbstractHierarchyIterator::ensure_writer`, where `writers` are cached
*by their export path*: it would cache a transform writer, but will skip
the subsequent data writer.

Additionally, another new `is_parent` flag is added to handle the case
where merging the Xform is invalid: objects that are parents to other
objects should remain unmerged as otherwise that would yield invalid USD
files.

[1] https://openusd.org/release/glossary.html#usdglossary-gprim
[2] https://openusd.org/release/glossary.html#usdglossary-instancing
[3] https://openusd.org/release/api/class_usd_geom_xformable.html

Co-authored-by: Odréanne Breton <odreanne.breton@ubisoft.com>
Co-authored-by: Sttevan Carnali Joga <sttevan.carnali-joga@ubisoft.com>
Co-authored-by: Charles Flèche <charles.fleche@ubisoft.com>
2024-11-19 19:18:53 +01:00
Miguel Pozo
acf82cb711 Overlay-Next: Add Texture Space support
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/130528
2024-11-19 18:10:34 +01:00
Clément Foucault
2a35551ad3 Fix: Overlay-Next: Object center selection radius too big
The selection framebuffer can be very small which leads
to different pixel density than the regular viewport.
Under this circumstance, gl_PointSize is a multiplier
of the viewport size in terms of selection radius.

Make sure `gl_PointSize` is set to 1 for selection.
2024-11-19 18:06:23 +01:00
Clément Foucault
6aedb317b0 Fix: Overlay-Next: Origins are not selectable
The implementation was missing.
2024-11-19 17:55:41 +01:00