Commit Graph

105855 Commits

Author SHA1 Message Date
Falk David
13ed151e3d Cleanup: GPv3: Use enum values for cap defaults instead of int 2024-01-12 10:38:22 +01:00
Falk David
ff12ee890d GPv3: Rendering "hardness" curve attribute
This adds support for rendering the hardness curve attribute.
The attribute cannot be written from within GPv3, but is added when
converting from the legacy Grease Pencil type.
2024-01-12 10:38:22 +01:00
Weizhen Huang
8bdb97e5ff EEVEE-Next: implement less noisy GGX VNDF sampling for reflections
from paper "Bounded VNDF Sampling for Smith–GGX Reflections"

Pull Request: https://projects.blender.org/blender/blender/pulls/116773
2024-01-12 10:32:40 +01:00
Weizhen Huang
ea669cb8dc EEVEE-Next: implement more efficient GGX VNDF sampling
from paper "Sampling the GGX Distribution of Visible Normals"
2024-01-12 21:20:28 +13:00
Guillermo Venegas
950759a526 Cleanup: Move Text Editor runtime data to a separate allocation
The struct `SpaceText_Runtime` already separates runtime data from
`SpaceText`, however it is still allocated inside `SpaceText`, read and
write file operations still copy this data, but is override on read.

This changes separate allocation of `SpaceText_Runtime` from
`SpaceText`.

Ref !115418
2024-01-12 14:00:59 +11:00
Campbell Barton
e202c81b41 Fix #115117: Crash displaying status info on undo with subsurf mesh
After undo, a depsgraph update could free run-time modifier data.

In the case of the subsurf modifier a reference to this is held
in the meshes run-time data which also needs to be cleared.
2024-01-12 12:16:49 +11:00
Richard Antalik
16741e735b Fix: Uninitialized variable in retiming drawing
Caused by a7d641eb58.
2024-01-11 22:04:14 +01:00
Hans Goudey
a76b2bfbcc Cleanup: Small change to face set scupt undo
Flip condition to un-indent code, change order of variable declarations.
2024-01-11 15:59:32 -05:00
Hans Goudey
1406cdd7b3 Fix #117022: Incorrect sculpt undo values when creating face sets
When the "before" state of the face set brush gets stored in an undo step
and there is no face set attribute yet, 0 was stored instead of 1. 0 currently
has special meaning and isn't the default white color.
2024-01-11 15:59:32 -05:00
Richard Antalik
f33e476004 VSE: Set speed operator usability improvement
Pre set speed operator property with speed of selected segment or strip.
If more than 1 item is selected, speed is pre set to 100%
2024-01-11 21:58:01 +01:00
Hans Goudey
13377dd423 Cleanup: Fix variable name from copy and paste
This function isn't specific to vertices since it's been generalized.
2024-01-11 15:29:47 -05:00
Richard Antalik
a7d641eb58 Fix: Incorrect retiming key type
Right "fake key" was shown as transition type. This was used for
debugging, but forgot to change it back.
2024-01-11 21:17:02 +01:00
Richard Antalik
c2a2e422ad Fix: Frist retiming key can not be selected.
Area for clicking on keys was wider than strip which caused problems.
Instead of finding best strip candidate and then a key, make clickable
area wider, but inside of the strip itself.
2024-01-11 21:12:53 +01:00
Julian Eisel
766cec9e9a Assets: Don't load previews when fetching asset list for menus
These UIs don't display previews, now need to load them.

Currently the UI code doesn't actually know which previews will be
visible, so it loads them all. This adds quite some memory overhead.

Likely fixes #115372.

Pull Request: https://projects.blender.org/blender/blender/pulls/116987
2024-01-11 21:05:28 +01:00
Michael Kowalski
3fc97a3ed4 Fix: USD import: lazily create cache file
This fixes an issue where a CacheFile was always created for the USD
file, causing USD_create_handle() to be called unnecessarily even if the
USD does not have animating meshes or transforms.

This bug would sometimes result in the stage remaining open in a
CacheArchiveHandle after import (because the CacheFile is never
freed), preventing the USD from being reloaded from disk.

The cache file is now accessible to readers through an
ImportSettings::get_cache_file function wrapper which creates a
CacheFile as needed, the first time the function is called.

The allocated CacheFile pointer is now stored in a new
ImportJobData::cache_file member.

Pull Request: https://projects.blender.org/blender/blender/pulls/116242
2024-01-11 20:54:03 +01:00
Miguel Pozo
935ed0791f Fix #116709: EEVEE-Next: Missing gbuffer closure writes
Outdated subpass_transition layout after f4275cc4df
2024-01-11 20:01:32 +01:00
Jacques Lucke
8896446f7e Python: add Python API for layout panels
This adds a Python API for layout panels that have been introduced in #113584.
Two new methods on `UILayout` are added:
* `.panel(idname, text="...", default_closed=False) -> Optional[UILayout]`
* `.panel_prop(owner, prop_name, text="...") -> Optional[UILayout]`

Both create a panel and return `None` if the panel is collapsed. The difference lies
in how the open-close-state is stored. The first method internally manages the
open-close-state based on the provided identifier. The second one allows for
providing a boolean property that stores whether the panel is open. This is useful
when creating a dynamic of panels and when it is difficult to create a unique idname.

For the `.panel(...)` method, a new internal map on `Panel` is created which keeps
track of all the panel states based on the idname. Currently, there is no mechanism
for freeing any elements once they have been added to the map. This is unlikely to
cause a problem anytime soon, but we might need some kind of garbage collection
in the future.

```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="Before")

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

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

        layout.label(text="After")

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

Pull Request: https://projects.blender.org/blender/blender/pulls/116949
2024-01-11 19:08:45 +01:00
Nate Rupsis
d499710218 Fix #115978: FCurve extrapolation ignored in NLA.
The fix in 9da88301ef forgot to add the `NLASTRIP_FLAG_NO_TIME_MAP` flag, and thus FCurve extrapolation on actions is ignored.

Pull Request: https://projects.blender.org/blender/blender/pulls/116382
2024-01-11 11:49:54 -06:00
Hans Goudey
6438d0ad1f Cleanup: Grammar in comments 2024-01-11 11:01:50 -05:00
Miguel Pozo
2bbf65f6e5 Fix #116985: Workbench: Skip volume depth test in Wireframe mode 2024-01-11 16:35:44 +01:00
Sergey Sharybin
c78a0f3aa6 Fix #114692: Sculpt on certain modifiers does not update normals
Caused bu 5af8b839cf.

This solution tags both mesh positions and normals for update when
drawing happens from the modifier stack evaluation result.

This is needed because the sculpt session modifies original mesh
positions, and the modifier stack is not guaranteed to modify them
further (and hence tag normals for update).

Pull Request: https://projects.blender.org/blender/blender/pulls/117033
2024-01-11 16:15:35 +01:00
Sergey Sharybin
fd3669c3db Fix #115214: Incorrect vertex paint with image texture
The issue is caused by 087612c042 which changed type of
vpd->paintcol from byte to float. Some of the code was
expecting it to be byte, and did C-style cast to a pointer
of uchar.

This is a minimalistic fix, which makes it so the
paint_and_tex_color_alpha() operates on proper types and
avoids reading from the result color before overriding the
value.

Pull Request: https://projects.blender.org/blender/blender/pulls/117030
2024-01-11 16:10:24 +01:00
georgiy.m.markelov@gmail.com
9a7ea993d0 Hydra: Support legacy hair particle curves
Ref #110765

Co-authored-by: Bogdan Nagirniak <bodyan@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/114197
2024-01-11 15:44:26 +01:00
Sybren A. Stüvel
15c7c77967 Anim: fix assertion when un-assigning bone collection parent
When using `bone_collection.parent = None` in Python, debug builds would
hit an assertion. This is now fixed.
2024-01-11 14:37:11 +01:00
Sybren A. Stüvel
649eec7774 Fix #116061: BoneCollection ID property user count handling incorrect
Ensure that `armature_free_data(ID *id)` (the `IDTypeInfo::free_data`
function) does not decrement user counts for ID properties of type 'pointer'.
2024-01-11 14:37:11 +01:00
Jacques Lucke
6c9d77be3b Cleanup: replace raw function pointer with FunctionRef 2024-01-11 14:17:13 +01:00
Jeroen Bakker
69ac64df54 GPU: Shader Builder CMake Fixes
This PR cleans up shader builder CMake files and fixes vulkan includes
that could not be found on all platforms.

* Reduce code duplication
* Use private var for MANIFEST on windows
* Add system includes when compiling

Pull Request: https://projects.blender.org/blender/blender/pulls/115889
2024-01-11 13:42:17 +01:00
Jeroen Bakker
6e17b9c640 Vulkan: Fix: DEPTH_COMPONENT24
Tests for DEPTH_COMPONENT24 crash, so add an implementation to support it.

Co-authored-by: vnapdv <kaz380@hotmail.co.jp>
Pull Request: https://projects.blender.org/blender/blender/pulls/117026
2024-01-11 12:55:33 +01:00
Jeroen Bakker
cd8218d9e4 Vulkan: Fix Image Range Validation Error
Co-authored-by: vnapdv <kaz380@hotmail.co.jp>
Pull Request: https://projects.blender.org/blender/blender/pulls/117024
2024-01-11 12:47:11 +01:00
Pratik Borhade
8ce2bacaf9 Fix #116996: Problem linking to reroute nodes
Cause by d19e7cbb5a
Skip reroute node case when cursor is over header

Pull Request: https://projects.blender.org/blender/blender/pulls/117014
2024-01-11 12:18:54 +01:00
Jeroen Bakker
6e26249671 Vulkan: Fix vkCmdCopyBufferToImage validation error
Fixes validation error {0xbd041cbe}VUID-VkBufferImageCopy-aspectMask-00212.

Co-authored-by: vnapdv <kaz380@hotmail.co.jp>
Pull Request: https://projects.blender.org/blender/blender/pulls/117021
2024-01-11 11:47:45 +01:00
Jeroen Bakker
46a79ba5a2 Vulkan: Fix Samplers Extend mode
Patch provided by @vnapdv

Pull Request: https://projects.blender.org/blender/blender/pulls/117020
2024-01-11 11:41:35 +01:00
Jeroen Bakker
72d6ca3aff Vulkan: Fix Anisotropic Filtering Validation Error
When anisotropic filtering is enabled on a sampler its value must be
between 1 and 16. In blender it is possible to set a value lower than 1.
0 actually means that anisotropic filtering is disabled in Blender.
This would trigger a validation error in Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/117018
2024-01-11 11:12:35 +01:00
Jacques Lucke
a94146b82c Cleanup: move BKE_pointcloud.h to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/116990
2024-01-11 10:54:47 +01:00
Andrew Oates
2e48712508 Fix #115829: Add Metal <-> OpenGL fallbacks for userpref
Starting with Blender 4.0, Blender refuses to load a userpref.blend file
that had been generated on a macoOS machine, exiting immediately with an
unsupported GPU error.  This is because when the userdef was written on
the macOS machine (assuming a recent version), it has gpu_backend set to
GPU_BACKEND_METAL (which is rejected).  The same is true in reverse.

Prior to commit cdb8a8929c there was a runtime fallback such
that the setting for Metal backend would be ignored on non-Metal
platforms.

This adds a check in blo_do_versions_userdef() for if gpu_backend is set
to an unsupported backend; if so, it is set to a default supported value
for the current platform (Metal on macOS, OpenGL otherwise).  This
replaces the current versioning check, as this isn't strictly related to
versioning.  The new logic handles the narrower versioning case (a macOS
user upgrading to 4.0+ with a userprefs selecting OpenGL) as well.

This should be future-proof for other GPU backends, as it only overrides
in the case of an unsupported value.  The logic could be generalized in
the future, perhaps.

Co-authored-by: Andrew Oates <andrew@andrewoates.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/116861
2024-01-11 09:30:34 +01:00
Campbell Barton
e904432a1f Fix #117015: Crash with subsurf mesh & loose edges in edit-mode
The result of bm_original_edge_get() was missing a null check,
all other callers check for null.
2024-01-11 18:19:20 +11:00
Campbell Barton
7a4f7a1d51 Cleanup: spelling in comments, comment blocks 2024-01-11 16:46:46 +11:00
Campbell Barton
d2c392dec6 Docs: add doc-strings for modifier mapping flags & edit-mesh cage 2024-01-11 14:07:36 +11:00
Campbell Barton
0c89e2d60e Fix #115169: Loop Cut overlay broken with Mirror Bisect Modifier
Oversight in [0] which assumed the cage meshes vertices were aligned
with the edit-mesh vertices which isn't always the case.

Check the cage mesh only has deformations applied before using it.

[0]: 29a338811c
2024-01-11 12:44:14 +11:00
Campbell Barton
d0359d066d UI: context menu support for changing menu & panel shortcuts
While the shortcuts would be shown for menus & panels,
there was no way to edit them from the context menu.

This was reported as a bug since moving "Undo History" from an operator
to a menu meant it was no longer possible to assign a shortcut from
the context menu.

Resolves: #97431.
2024-01-11 11:18:57 +11:00
Thomas Wilshaw
f79425fe82 Fix #116988: TIFF ignores compression type None
When saving an image as TIFF with compression type None, explicitly set
the OIIO ImageSpec attribute "compression" to "none" as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/117005
2024-01-11 00:56:40 +01:00
Brecht Van Lommel
eb747c5d20 Fix: invalid memory access in Hydra world and material export 2024-01-10 20:54:40 +01:00
Harley Acheson
4e0d604035 Fix #116950: Redraw Issues in Open Recent Previews
When drawing tooltips that include images the blend mode must be left
with GPU_BLEND_NONE, otherwise can interfere with later drawing. Also
slight refactor in that buttons with a custom tooltip function get a
"ui_tooltip_data_from-*" function like the other types.

Pull Request: https://projects.blender.org/blender/blender/pulls/117001
2024-01-10 20:34:52 +01:00
Brecht Van Lommel
7271f303fe Cleanup: make format 2024-01-10 20:34:30 +01:00
Thomas Barlow
2b9aa55a03 RNA: Remove bitmask from BoolAttributeValue.value
Bool attributes are treated as contiguous arrays of `bool` rather than
using a bitmask.

Using a bitmask also disables raw array access, and with raw array
access, the property is faster to access through the Python API with
bpy_rna.cc#foreach_getset.

Pull Request: https://projects.blender.org/blender/blender/pulls/116997
2024-01-10 20:30:19 +01:00
Dyvine57
eca14d5b40 Nodes: add int and bool to shader nodegroups
These are handled as floats by Cycles and EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/115026
2024-01-10 20:09:37 +01:00
Hans Goudey
ba4d7fc2d9 Cleanup: Continue loop to corner rename in some mesh code
Change mesh normals code and mesh topology map functions.
2024-01-10 13:12:22 -05:00
Harley Acheson
5680ea2986 Refactor: "Warning" -> "Confirm" for Custom Confirmations
As suggested by Campbell, this changes structure, variable, and
callback names to use "confirm" terminology rather than "warning"
for code related to custom confirmations.

Pull Request: https://projects.blender.org/blender/blender/pulls/116992
2024-01-10 18:41:42 +01:00
Omar Emara
cbb738191e Compositor: Redesign Sun Beams node for CPU
This patch ports the new GPU implementation of the Sun Beams node to the
CPU compositor. Introduced in 9e358fcd44.
2024-01-10 19:36:52 +02:00
Miguel Pozo
c08ba9b0bd FIx: EEVEE-Next: Forward SSS shader compilation 2024-01-10 18:35:00 +01:00