Commit Graph

106208 Commits

Author SHA1 Message Date
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
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
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
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
Aras Pranckevicius
5ed2eea0f6 ImBuf: Refactor pixel interpolation functions
There exist a bunch of "give me a (filtered) image pixel at this location"
functions, some with duplicated functionality, some with almost the same but
not quite, some that look similar but behave slightly differently, etc.
Some of them were in BLI, some were in ImBuf.

This commit tries to improve the situation by:
* Adding low level interpolation functions to `BLI_math_interp.hh`
  - With documentation on their behavior,
  - And with more unit tests.
* At `ImBuf` level, there are only convenience inline wrappers to the above BLI
  functions (split off into a separate header `IMB_interp.hh`). However, since
  these wrappers are inline,   some things get a tiny bit faster as a side
  effect. E.g. VSE image strip, scaling to 4K resolution (Windows/Ryzen5950X):
  - Nearest filter: 2.33 -> 1.94ms
  - Bilinear filter: 5.83 -> 5.69ms
  - Subsampled3x3 filter: 28.6 -> 22.4ms

Details on the functions:
- All of them have `_byte` and `_fl` suffixes.
- They exist in 4-channel byte (uchar4) and float (float4), as well as
  explicitly passed amount of channels for other float images.
- New functions in BLI `blender::math` namespace:
  - `interpolate_nearest`
  - `interpolate_bilinear`
  - `interpolate_bilinear_wrap`. Note that unlike previous "wrap" function,
    this one no longer requires the caller to do their own wrapping.
  - `interpolate_cubic_bspline`. Previous similar function was called just
    "bicubic" which could mean many different things.
- Same functions exist in `IMB_interp.hh`, they are just convenience that takes
  ImBuf and uses data pointer, width, height from that.

Other bits:
- Renamed `mod_f_positive` to `floored_fmod` (better matches `safe_floored_modf`
  and `floored_modulo` that exist elsewhere), made it branchless and added more
  unit tests.
- `interpolate_bilinear_wrap_fl` no longer clamps result to 0..1 range. Instead,
  moved the clamp to be outside of the call in `paint_image_proj.cc` and
  `paint_utils.cc`. Though the need for clamping in there is also questionable.

Pull Request: https://projects.blender.org/blender/blender/pulls/117387
2024-01-25 11:45:24 +01:00
Jason Fielder
81c1490877 Fix #117169: Resolve crashing hair and curve tests in Metal
Remove divergent code paths for hair refinement. Metal
previously opted for transform-feedback based hair
refinement due to improved performance, but best
to utilise the same compute path with new engines in
mind.

Separate PRs can be made to optimize the compute
path.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/117477
2024-01-25 05:02:19 +01:00
YimingWu
f2d08d2cbe Fix #104982: Ensure view layer when baking line art.
This is more like a hack, which ensures view layer depsgraph evaluation
when baking line art. It should fix the problem where the camera marker
switch would cause `view_layer->object_bases_array == null`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117227
2024-01-25 04:33:37 +01:00
Campbell Barton
4b4ebc0f5c Unbreak build with freestyle from syntax error
Error in 7436b578dd.
2024-01-25 12:53:33 +11:00
Campbell Barton
7436b578dd Cleanup: force wrapping all uses of PyDoc_STRVAR
Without this, minor edits can re-indent the whole doc-string at a
different level, causing diffs to be unnecessary noisy.
2024-01-25 10:22:16 +11:00
Campbell Barton
0ea0573349 PyDoc: remove unnecessary newlines which caused invalid syntax
Resolves all warnings building Python docs.
2024-01-25 10:22:15 +11:00
Jesse Yurkovich
bc39b1b27c Fix: build break 2024-01-24 22:07:56 +01:00
Jesse Yurkovich
0c0885d323 Fix #117411: In memory UDIMs fail to pack correctly
Broken from 72ab6faf5d

Because the `IMA_GEN_TILE` flag was not cleared during the memory pack,
the tile was regenerated on reloading. Mimic what is done during save
and clear the flag if all tiles pack successfully.

Pull Request: https://projects.blender.org/blender/blender/pulls/117472
2024-01-24 21:28:48 +01:00
Jesse Yurkovich
7bb78be256 Cleanup: Use CLOG instead of iostream for USD logging
Straightforward change from usage of iostream to CLOG.

Using CLOG unifies info/warning/error logging under a common
infrastructure that provides facilities for standardized filtering,
categorization, and printing. It also removes direct dependencies on
`<iostream>` which can be detrimental to compile times.

Pull Request: https://projects.blender.org/blender/blender/pulls/117429
2024-01-24 21:27:59 +01:00
Bastien Montagne
03e0de14c5 Fix (unreported) wrong logic in reports about unknown operators.
This (likely copy-pasted) check to report either an unknown operator
type, or a known operator type missing its RNA struct definition, had a
reversed logic. It would report a 'missing srna' for unknown operator,
and vice-versa.
2024-01-24 21:02:27 +01:00
Germano Cavalcante
99fd9ced5c Cleanup: Pass some non-nullptr pointers by reference
Passing non-nullptr pointers by reference for cleaner function
interfaces.
2024-01-24 20:38:46 +01:00
Hans Goudey
f7303dbaa2 Cleanup: Move curves sculpt poll functions to C++ namespace 2024-01-24 14:09:15 -05:00
Brecht Van Lommel
b689027b3a Fix #114028: Cycles displace splits faces with smooth and flat faces
Cycles can use a per face flag to determine if a face is smooth or flat,
and there is no need to use corner normals in such cases. So revert to
not doing that as before, which also saves a bit of memory.

There is a pre-existing issue where faces are split by sharp edges and
autosmooth, which is not solved by this. It's only fixing the regression.
2024-01-24 19:55:31 +01:00
Hans Goudey
95dbea0a61 Cleanup: Remove unused include
BLI_time.h was unused after 0d420ee97a.
2024-01-24 13:19:52 -05:00
Hans Goudey
75f06bf92a Fix #117459: Sharp shading from only edges ignored in edit mode
The fix in the logic is similar to 5875349390. It's needed
because we now skip computing face corner (BMLoop) normals when the
BMesh is completely flat shaded. It might be completely flat shaded
just because of edge smoothness though, which wasn't taken into
account before.
2024-01-24 12:59:03 -05:00
Brecht Van Lommel
ae27daf834 Fix: only use preserveInvariance for Z fighting when supported by macOS
Pull Request: https://projects.blender.org/blender/blender/pulls/117484
2024-01-24 18:30:26 +01:00
Hans Goudey
6fc7f99a95 Cleanup: Make format 2024-01-24 12:24:12 -05:00
Hans Goudey
9ab356fe6e Cleanup: Return Vector for View Layer objects and bases retrieval
This simplifies code using these functions because of RAII,
range based for loops, and the lack of output arguments.
Also pass object pointer array as a span in more cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/117482
2024-01-24 18:18:14 +01:00
Hans Goudey
d02d6ec4e5 Cleanup: Remove unnecessary keywords in C++ headers 2024-01-24 11:46:39 -05:00
Hans Goudey
500f09b88a Cleanup: Move metaball BKE headers to C++ 2024-01-24 11:46:39 -05:00
Hans Goudey
f5bb6ac8df Cleanup: Move armature_intern.h to C++ 2024-01-24 11:46:39 -05:00
Hans Goudey
0896e2805a Cleanup: Move mesh_intern.hh to C++ 2024-01-24 11:46:39 -05:00
Lukas Tönne
7e87513368 GPv3: Offset modifier
Ported the Offset modifier from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/117446
2024-01-24 16:57:58 +01:00
Hans Goudey
2eabfc4854 Cleanup: Move uvedit_intern.h to C++ 2024-01-24 10:55:16 -05:00
Hans Goudey
02582213de Cleanup: Move BKE_layer.hh to C++ 2024-01-24 10:55:16 -05:00
Jason Fielder
6498809dfd Metal: Fix Z-fighting in EEVEE Next
Small change to always opt-in to using
invariant position in the vertex shader.
This ensures precision between position
calculations from different shaders which
need to produce the exact same result, by
disabling fastMath on only those instructions.

After benchmarking, the impact of this change
does not appear to affect performance bottlenecks
but will reduce the need for additional bias calculations.

Authored by Apple: Michael Parkin-White.

Pull Request: https://projects.blender.org/blender/blender/pulls/117478
2024-01-24 14:42:14 +01:00
YimingWu
b6e5b02ede Cleanup: GPv3: Use consistent modifier RNA names
"GREASEPENCIL_" changed to "GREASE_PENCIL_".
2024-01-24 21:20:42 +08:00
Sergey Sharybin
aca0cf27e3 Fix cryptomatte GPU compositor node on NVidia Linux
This commit fixes node_cryptomatte test in the matte category
when using GPU compositor on Linux with NVidia GPU. Before this
fix the result image was squished horizontally.

The issue was caused by mismatch in the shader info and the
actual allocation of the matte image.

Pull Request: https://projects.blender.org/blender/blender/pulls/117475
2024-01-24 13:58:47 +01:00
Thomas Dinges
c683925f6d Cleanup: make format 2024-01-24 13:28:51 +01:00
YimingWu
756f7cf1e8 GPv3: Add Catmull-Clark option in subdivide modifier
This adds the "Catmull-Clark" option to the subdivide modifier.
Since this option is creating 2^n segments, the "Simple" method was adjusted to do the same.
This is now consistent with the old GPv2 modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/117382
2024-01-24 13:14:07 +01:00
Pratik Borhade
d5766dfdce Fix: Obj crash exporting curve without modifier property
`BKE_object_get_pre_modified_mesh` returns curve object data, later
accessing non-existing edge/face data triggered the crash.
`apply_modifiers` seems valid for mesh data only.

Pull Request: https://projects.blender.org/blender/blender/pulls/117471
2024-01-24 12:37:08 +01:00