Commit Graph

132198 Commits

Author SHA1 Message Date
Jason Fielder
ac61dad14f EEVEE Next: Resolve motion blur intermittent rendering
Fixes issue where motion blur would not display for
certain objects intermittently due to uninitialized
parameters in the ObjectKey struct causing the
motion object map look-up to fail and for motion
parameters to be reset to default, disabling the
effect for the given objects.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/117560
2024-01-26 20:48:00 +01:00
Hans Goudey
1bb358f423 Fix: Tooltip memory leak
Use std::string for custom tooltip function return value.
2024-01-26 14:39:05 -05:00
Hans Goudey
3b2a99af3e Fix: Build error in debug build 2024-01-26 13:47:50 -05:00
Hans Goudey
2a5531b253 Cleanup: Use StringRef instead of const char * in OBJ export 2024-01-26 13:18:58 -05:00
Hans Goudey
2a0c8593c9 Cleanup: Use C++ Array in OBJ import 2024-01-26 13:17:30 -05:00
Hans Goudey
0d03ae4a4d Cleanup: Update mesh naming in OBJ IO code 2024-01-26 13:16:01 -05:00
Hans Goudey
899546d4e4 Cleanup: Use utility to fill index range in OBJ mesh export 2024-01-26 12:58:45 -05:00
Hans Goudey
94ca3aea83 OBJ: Use mesh normals domain properly for normals storage
- Only calculate the necessary normals based on smooth/flat/mixed shading
- Use cached face normals instead of computing them
- Use a `VectorSet` for deduplication instead of a `Map`
- Deduplicate vertex normals and store indices in separate loops
- Avoid unnecessary duplication of face normal indices
- Inline simple function for slicing index span

Export time (ms) of 1.8m vertex mesh:
| Normals Domain  | Before | After |
| --------------- | ------ | ----- |
| Face (flat)     | 559    | 469   |
| Vertex (smooth) | 659    | 466   |
| Corner (mixed)  | 656    | 640   |

The change of using normals from different domains and using a
VectorSet for de-duplication change the order of normals in the OBJ
files. Other than that, the results should be unchanged.

Fixes #117510

Pull Request: https://projects.blender.org/blender/blender/pulls/117522
2024-01-26 18:54:58 +01:00
Jeroen Bakker
ec80264d09 Vulkan: Bundle Calls in DrawList
A draw list bundles multiple draw commands for the same geometry
and sends the draw commands in a single command. This reduces
the overhead of pipeline checking, resource validation and can
keep the load higher on the gpu as more work needs to be done.

Previously the draw list didn't bundle any commands and would still
send each call separately to the GPU. This PR implements the bundling
of the commands.

Pull Request: https://projects.blender.org/blender/blender/pulls/117548
2024-01-26 17:45:18 +01:00
Brecht Van Lommel
3f0f26ee8a Tests: make reports summary HTML work with relative links
So that downloading the test results from the buildbot has working links.
2024-01-26 17:04:22 +01:00
Hans Goudey
b0a4dd56aa Fix: Build error with asserts enabled
74128855be removed a function used in debug builds.
2024-01-26 10:50:13 -05:00
Philipp Oeser
eead38ab97 Fix #117520: Data Transfer modifier not working with Vertex Groups
This was the case for custom normals.

There was an optimization in 91b4f9f1f6 that was skipping computation of
existing normals if the Mix Factor in the UI was at 1.0 (under the
assumption that in this case no old normals would be needed.

Problem is that the resulting mix factor is the product of the Mix
Factor in the UI and the weights, so just doing the check as in the
culprit commit is not enough.

Need to consider if weights are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/117538
2024-01-26 16:44:59 +01:00
Hans Goudey
ebcdf19537 Cleanup: Use consistent camel case for test class names 2024-01-26 10:25:48 -05:00
Philipp Oeser
37e89714ff Fix: Entering node group via icon after exiting it via ctrl+tab broken
This is because the `NODE_OT_group_edit` operator reuses the last value
of the `Exit` property and once this is set it would always try to pop
(instead of push [which is what we want from the icon]) the nodegroup.

Callers of the operator set `Exit` explicitly elsewhere (just not
from node drawing -- where the way it is called [via a more general
callback] makes it difficult to set operator properties from there).

Solve by not saving the property for following usages (flag
`PROP_SKIP_SAVE`).

Fixes #117530.

Pull Request: https://projects.blender.org/blender/blender/pulls/117542
2024-01-26 16:23:02 +01:00
Philipp Oeser
a324a19f1b Fix #117526: Crash when Changing Color Palette in Edit Mode
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.

So a valid `Paint` and `Brush` were assumed. This is not a problem for
objectmode (because `BKE_paint_get_active_from_context` then defaults to
`ImagePaintSettings`'s `Paint`), but other modes dont guarantee this
(editmode only returns a valid `Paint` when uv sculpting).

In the report, a palette was created and displayed via python, making
changes in editmode would then crash.

Solve by checking we have a valid Paint in corresponding UI code to
begin with.

Similar to 9e82e48937 .

Pull Request: https://projects.blender.org/blender/blender/pulls/117544
2024-01-26 16:21:48 +01:00
Hans Goudey
adf67f8a49 Fix: Missing normals cache tag when clearing custom normals data
Also use a proper depsgraph tag and split the implementation for BMesh
and Mesh a bit more, to avoid mixing different abstraction levels.
2024-01-26 10:02:11 -05:00
Hans Goudey
74128855be Cleanup: Fix unused function and variable in node RNA 2024-01-26 10:02:11 -05:00
Falk David
73e5e975e2 Cleanup: GPv3: Add fixme comment to _defs_paint_grease_pencil 2024-01-26 15:24:00 +01:00
Falk David
9f563c3ec2 GPv3: Add poll function to brush_stroke operator
This adds a proper poll function to the `brush_stroke` operator.
Ensures that this operator is only used by tools that are brushes.

Also changes the poll for the drawing of the cursor to only run
with tools that are brushes.
2024-01-26 15:24:00 +01:00
Falk David
f3c9449521 Cleanup: GPv3: Move poll/keymap/macro definitions to grease_pencil_ops.cc 2024-01-26 15:24:00 +01:00
Falk David
cb9fef3841 Cleanup: GPv3: Default keymap definitions 2024-01-26 15:24:00 +01:00
Jeroen Bakker
af25e2d5df RenderTests: Disable Cycles Only Tests for other Engines
This PR disables cycles only render tests for the gpu/viewport based
render engines. These render engines include EEVEE, Workbench, but
also the Hydra viewport engines. Disabling those test would reduce
test time.

Tests that are being disabled are features that are only supported
by Cycles.
- Light groups
- Light linking
- Shadow catcher
- Denoising
- Path guiding
- Reports

Pull Request: https://projects.blender.org/blender/blender/pulls/117540
2024-01-26 14:46:04 +01:00
Lukas Tönne
5ad49f4142 Geometry Nodes: Menu Switch Node
This patch adds support for _Menu Switch_ nodes and enum definitions in
node trees more generally. The design is based on the outcome of the
[2022 Nodes Workshop](https://code.blender.org/2022/11/geometry-nodes-workshop-2022/#menu-switch).

The _Menu Switch_ node is an advanced version of the _Switch_ node which
has a customizable **menu input socket** instead of a simple boolean.
The _items_ of this menu are owned by the node itself. Each item has a
name and description and unique identifier that is used internally. A
menu _socket_ represents a concrete value out of the list of items.

To enable selection of an enum value for unconnected sockets the menu is
presented as a dropdown list like built-in enums. When the socket is
connected a shared pointer to the enum definition is propagated along
links and stored in socket default values. This allows node groups to
expose a menu from an internal menu switch as a parameter. The enum
definition is a runtime copy of the enum items in DNA that allows
sharing.

A menu socket can have multiple connections, which can lead to
ambiguity. If two or more different menu source nodes are connected to a
socket it gets marked as _undefined_. Any connection to an undefined
menu socket is invalid as a hint to users that there is a problem. A
warning/error is also shown on nodes with undefined menu sockets.

At runtime the value of a menu socket is the simple integer identifier.
This can also be a field in geometry nodes. The identifier is unique
within each enum definition, and it is persistent even when items are
added, removed, or changed. Changing the name of an item does not affect
the internal identifier, so users can rename enum items without breaking
existing input values. This also persists if, for example, a linked node
group is temporarily unavailable.

Pull Request: https://projects.blender.org/blender/blender/pulls/113445
2024-01-26 12:40:01 +01:00
Jeroen Bakker
dd0798927f EEVEE: HiZ Buffer Allocation
EEVEE uses an HiZ buffer. The size of the HiZ buffer is based on the render extent.
Probes assume that the render extent is always bigger than needed for rendering
probes. This assumption is incorrect.

Although this PR fixes this by allocating the required size, it is still renders with
artifacts. These artifacts originate from the lighting module and also needs to be
fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/117502
2024-01-26 12:06:42 +01:00
Aras Pranckevicius
b7cf71d567 VSE: add Cubic Mitchell filtering, rename previous cubic to Cubic BSpline
Part of overall "improve filtering situation" (#116980) task:

Add "Cubic Mitchell" filtering option to VSE strips. This is a cubic (4x4)
filter that generally looks better than bilinear, while not blurring the image
as much as the Cubic BSpline filter that exists elsewhere within Blender. It is
also default in many other apps.

Rename the (very recently added) VSE Bicubic filter option to Cubic BSpline.

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/117517
2024-01-26 11:57:19 +01:00
Jacques Lucke
932b2d1727 Cleanup: simplify naming of get_default_hash 2024-01-26 11:45:56 +01:00
Pratik Borhade
a6258d6b8b Cleanup: rename BKE_pbvh_node_mark_normals_update
This was discussed in !117192

Pull Request: https://projects.blender.org/blender/blender/pulls/117498
2024-01-26 11:24:55 +01:00
Pratik Borhade
4dc345ab1e Fix #117494: Crash when dropping collection
Caused by 7ca4dcac5a
Crash is due to wrong return value.

Pull Request: https://projects.blender.org/blender/blender/pulls/117496
2024-01-26 11:23:09 +01:00
Sybren A. Stüvel
9c172d739f Anim: refresh 'solo active' on armature after removing bone collection
After removing a bone collection that was marked as 'solo', refresh
the armature's 'solo active' flag. The deleted bone collection might have
been the last solo'ed one.
2024-01-26 11:12:25 +01:00
Sybren A. Stüvel
848f83e210 Anim: bone collections, add 'un-solo all' operator
Add an operator that clears the 'solo' flag from all bone collections.
2024-01-26 11:09:06 +01:00
Sybren A. Stüvel
f623c8f7bc Anim: remove 'Solo Visibility' bone collections operator
Remove the 'Solo Visibility' operator that singles out a bone collection.
It was a workaround for not having a true 'solo' flag, which is there
now.
2024-01-26 11:05:00 +01:00
Sybren A. Stüvel
a7f41fc938 Anim: bone collections, add 'solo' flag
Add the 'solo' flag to bone collections, effectively adding another
layer of visibility controls.

If there is _any_ bone collection with this flag enabled, only this
collection (and others with this flag enabled) will be visible.

In RNA, the following properties are exposed:
- `bone_collection.is_solo`: writable property to manage the solo flag.
- `armature.is_solo_active`: read-only property that is `True` when any
  bone collection has `is_solo = True`.

The RNA property `bone_collection.is_visible_effectively` now also takes
the solo flag into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/117414
2024-01-26 10:21:52 +01:00
Sybren A. Stüvel
8a569a8da4 Refactor: Anim, rename BoneCollection::is_visible_effectively()
Rename `BoneCollection::is_visible_effectively()` to
`is_visible_with_ancestors()`. Soon a "solo" flag will be introduced,
and the effective visibility of the bone collection will depend on that
too. This particular function doesn't take that into account, though,
and thus needs a rename.

Note that this does NOT rename the RNA property
`is_visible_effectively`. That will be updated when the "solo" flag is
introduced to also take that into account.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/117414
2024-01-26 10:21:52 +01:00
Jesse Yurkovich
ddd06eeb8f UI: Add ability to configure the header row of layout panels
There are many instances where customizing the header row is desired so
return both the header row layout and the main body layout.

For consistency and correctness, the arrow symbol and the is_open check
are always performed so callers only need to perform layout tasks.

The C++ side now receives a `PanelLayout` structure containing both:
```cpp
PanelLayout panel_layout = uiLayoutPanelWithHeader( ... );
uiItemL(panel_layout.header, ... );
if (panel_layout.body) {
    ...
}
```

And the Python side receives a tuple:
```python
header, body = layout.panel( ... )
header.label(...)
if body:
    ...
```

```python
import bpy
from bpy.props import BoolProperty

class LayoutDemoPanel(bpy.types.Panel):
    bl_label = "Layout Panel Demo"
    bl_idname = "SCENE_PT_layout_panel"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout
        scene = context.scene

        layout.label(text="Basic Panels")

        header, panel = layout.panel("my_panel_id", default_closed=True)
        header.label(text="Hello World")
        if panel:
            panel.label(text="Success")

        header, panel = layout.panel_prop(scene, "show_demo_panel")
        header.label(text="My Panel")
        if panel:
            panel.prop(scene, "frame_start")
            panel.prop(scene, "frame_end")

        layout.label(text="Customized headers")

        # Add a checkbox to the Panel header. text must be None for this panel
        header, panel = layout.panel("my_panel_id-2", default_closed=True)
        header.prop(scene, "use_checkmark", text="") # text must be empty for the checkbox
        header.label(text="Checkmark at beginning")
        if panel:
            panel.label(text="Success")

        header, panel = layout.panel("my_panel_id-3", default_closed=True)
        header.label(text="Buttons at the end")
        header.operator("mesh.primitive_cube_add", text="", icon='EXPORT')
        header.operator("mesh.primitive_cube_add", text="", icon='X')
        if panel:
            panel.label(text="Success")

        header, panel = layout.panel("my_panel_id-4", default_closed=True)
        header.prop(scene, "use_checkmark2", text="")
        header.label(text="Both")
        header.operator("mesh.primitive_cube_add", text="", icon='EXPORT')
        header.operator("mesh.primitive_cube_add", text="", icon='X')
        if panel:
            panel.label(text="Success")

bpy.utils.register_class(LayoutDemoPanel)
bpy.types.Scene.show_demo_panel = BoolProperty(default=False)
bpy.types.Scene.use_checkmark = BoolProperty(default=False)
bpy.types.Scene.use_checkmark2 = BoolProperty(default=False)
```

Pull Request: https://projects.blender.org/blender/blender/pulls/117248
2024-01-26 10:11:22 +01:00
Guillermo Venegas
da77f90744 Fix unreported: Avoid using unknown file types in dropboxes
Most of the `WM_DRAG_PATH` poll functions include
unknown file types (`0`) as fallback, preventing file handlers
from being used with explicit defined file extensions.

Pull Request: https://projects.blender.org/blender/blender/pulls/117189
2024-01-26 03:43:31 +01:00
Hans Goudey
b61496c508 Fix #117424: Sculpt undo misses changes propagated to shape keys
For modification the important point is that to propagate changes to
other keys it's necessary to know what the changes are, which means
comparing the old an new values, so you can't modify shape key data
in place.
2024-01-25 15:41:27 -05:00
Harley Acheson
354def3fbe UI: Confirmations Using Std::String
Refactor operator confirmations to use std::string, not char arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/117519
2024-01-25 19:55:18 +01:00
Hans Goudey
e2e4c95258 OBJ: Combine global scale parameter into transform matrix
Remove the need for the `calc_vertex_coords` function by combining
the scale into the existing transform needed to export vertex positions
in global space. This simplifies code and may slightly improve performance
(I only observed a few percent difference in the positions export, which is
not a slower part of the export).
2024-01-25 13:54:30 -05:00
Hans Goudey
a08e636bbc Cleanup: Use C++ math types in OBJ export 2024-01-25 13:10:22 -05:00
Hans Goudey
9f0c6e0685 Cleanup: Clarify OBJ IO use of Span, Vector, and Array
- Use Span where ownership is unnecessary
- Use Array when dynamic growth is unnecessary
- Use Vector in all other cases

Also remove unnecessary namespace specification.
2024-01-25 13:10:22 -05:00
Jeroen Bakker
49d07653f9 RenderTests: Fix Incorrect Command in Report
When running the render test for EEVEE-Next the command printed on
the report to update the reference images was incorrect. In stead of
displaying
`BLENDER_TEST_UPDATE=1 ctest -R eevee_next` it displayed
`BLENDER_TEST_UPDATE=1 ctest -R eevee next`.

The cause of this is that the title of the report is used to create
the command. EEVEE-Next has a space in its title which generates
an incorrect command.

A quick fix would be to replace spaces with underscores. But it would
be better to fix this more clearly by adding an attribute containing the
engine name.

This PR adds a `set_engine_name` method to the Report class. By
default the engine name is set based on the title.

Pull Request: https://projects.blender.org/blender/blender/pulls/117503
2024-01-25 18:55:28 +01:00
Harley Acheson
5c4779f872 UI: Remove Unnecessary Confirmation Options
Remove red_alert (not needed), confirm_default (redundant),
and cancel_button (not wanted). Rename confirm_button to
confirm_text.

Pull Request: https://projects.blender.org/blender/blender/pulls/117518
2024-01-25 18:49:03 +01:00
Julian Eisel
6a8fbfb15e BKE: Add support for boolean ID properties in json serializer
Boolean ID property support was added in ef68a37e5d, but the JSON
serializer for ID properties was not updated for it. This would be a
forward compatibility issue, if future json files containing boolean
properties would be read with old versions. Such properties are added
in #106303, for example.
2024-01-25 18:23:40 +01:00
Christoph Lendenfeld
1ea97dde6d Fix: Applying active keying set from menu not working
When a keying set is enabled and the keying set option
"Active Keying Set" was chosen from the menu, it would
give an error.

That is because the active keyingset uses a special
ID string (`"__ACTIVE__"`)
that doesn't actually exist as a keying set.
To fix it, explicitly check against that string and return
the active if encountered.

Pull Request: https://projects.blender.org/blender/blender/pulls/116192
2024-01-25 16:59:48 +01:00
Christoph Lendenfeld
d05d6f500b Fix: Consistency for appearing menu when applying keying sets
The recently landed PR #115798has made it so the
hotkey `K` would call `anim.keyframe_insert_menu` with the property
`always_prompt` set to `True`.
This property still defaulted to `False` when called
from the menu leading to inconsistent
behavior when a keying set is active.

Fix it by setting `always_prompt` to `True` for the menu entries.

Pull Request: https://projects.blender.org/blender/blender/pulls/117511
2024-01-25 16:18:05 +01:00
Sergey Sharybin
ca767644eb Compositor: Align matte edge calculation to GPU implementation
The CPU implementation had the following downsides:

- The kernels sizes below 3 did not make much sense, often leading
  to a full white image.
- The way how the total number of pixels in the kernel was calculated
  quite strangely.

From these points of view the GPU compositor behaves more user friendly.

There is a versioning code which lowers the kernel size, to match the
result prior to these tweaks.

Pull Request: https://projects.blender.org/blender/blender/pulls/117505
2024-01-25 15:57:15 +01:00
Sergey Sharybin
6f681105ec Cycles: Skip denoising during bake when pass does not support denoising
This changes fixes the slowdown when baking data passes like Normal with
the denoiser enabled on scene settings.

When baking to 4K textures denoising could take considerable amount of
time, which is better be avoided.

Pull Request: https://projects.blender.org/blender/blender/pulls/117483
2024-01-25 15:56:20 +01:00
Alaska
ddc0aceefd Cycles UI: Hide HIP-RT settings on Linux
Hide the HIP-RT setting on Linux since it's not supported there yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/117492
2024-01-25 15:16:13 +01:00
Christoph Lendenfeld
87fc8e8ddd Anim: Add hotkey for keying set operators
This is in response to feedback to the changes from #113504
While it does simplify inserting keyframes,
sometimes artists want to insert keys only to e.g. Location.
This takes longer to do now, since the option is in a menu.

This PR changes the following:

* new `K` hotkey to bring up the "Keying Set" menu.
This will always show the menu, even if a keying set is active.

* `Shift + K` will open a menu to set the active keying set

* with "Pie Menu on Drag" enabled in the user preferences,
hitting `I` and moving the mouse will bring up a pie menu
to insert only specific transform channels

Conceptually this separates the keying set behavior from the
insert keyframe behavior.
`I` will always add keyframes.
While `K` always shows keying set options.

Pull Request: https://projects.blender.org/blender/blender/pulls/115798
2024-01-25 14:46:04 +01:00
Sergey Sharybin
9fdf3bc1f4 Fix missing generation of alpha difference images in render tests
The part of the patch wasn't properly applied from a working branch,
and it wasn't very visible because the development environment already
had all files on disk.

Pull Request: https://projects.blender.org/blender/blender/pulls/117504
2024-01-25 14:20:30 +01:00