Commit Graph

109894 Commits

Author SHA1 Message Date
Jeroen Bakker
abcf55d15a Vulkan: Only support device vertex buffers
BLF font rendering isn't compatible with render graph as it
rewrites buffers that are not yet drawn. To work around this issue
the vertex buffers should always be created on device and not
directly altered by CPU code.

Pull Request: https://projects.blender.org/blender/blender/pulls/122648
2024-06-03 10:58:27 +02:00
Omar Emara
a162149cfa Fix #121761: Crash when compositing while rendering
Blender crashes when the interactive GPU compositor is running in a node
editor while rendering. This is because the GPU compositor is sharing
the same GPU context used for rendering, which is not allowed. To fix
this, we use a dedicated render list for interactive compositing, to use
its dedicated GPU context.

This is implemented by keeping another render list for the purpose of
compositing and similarly clearing its context when it is no longer
needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122472
2024-06-03 09:56:58 +02:00
Philipp Oeser
ba3fac92af Fix #122598: Curves Grow brush broken on curves with only two points
Code was getting a direction (to grow in) from the last point in a curve
and another point in the middle of the curve.
On a curve with only two points, these points were the same, resulting
in a zero delta and thus doing nothing.

To resolve, take the root point instead in this scenario to get a valid
direction.

Pull Request: https://projects.blender.org/blender/blender/pulls/122644
2024-06-03 09:20:07 +02:00
Jesse Yurkovich
5bc71c8704 Cleanup: style changes for newly added USD DomeLight support code
A variety of non-functional style changes for the recently added
DomeLight code:

- Remove unused includes and forward decls
- Changed NULL -> nullptr
- Use `motionSampleTime` name consistently
- Moved the `r_value` out parameter to the last position per our coding
  guidelines

Pull Request: https://projects.blender.org/blender/blender/pulls/122641
2024-06-03 04:41:39 +02:00
Hans Goudey
e2402eb4a9 Cleanup: Use C++ types, references for CCGElem access 2024-06-02 20:36:33 -04:00
Hans Goudey
d374b5abf7 Cleanup: Miscellaneous changes in BKE_ccg.hh
- Remove unnecessary declarations for inline functions
- Remove typedef keyword
- Use C++ casting instead of C-style casts
2024-06-02 20:36:33 -04:00
Hans Goudey
49b52b35d5 Cleanup: Move BKE_ccg.h to C++ 2024-06-02 20:36:33 -04:00
Jesse Yurkovich
05f8d35652 Fix #122606: fully map Blender's INT8 type to USD's UChar
While USD does not have a signed, 8-bit, integer type we can use its
UChar type instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/122610
2024-06-02 22:26:12 +02:00
Iliya Katueshenock
81c5e42ec5 Cleanup: BLI: Support IndexMask as universe for mask complement
Pull Request: https://projects.blender.org/blender/blender/pulls/122616
2024-06-02 19:40:20 +02:00
Pratik Borhade
ab5f8d9f3a Fix #122491: DOF pick in context menu grayed out
Caused by 7f8d4df410
Changes in poll function had excluded the case of context menu button.
Fix this by returning true if operator identifier is `UI_OT_eyedropper_depth`

Pull Request: https://projects.blender.org/blender/blender/pulls/122532
2024-06-02 14:59:41 +02:00
Campbell Barton
cfd199b7a2 Fix passing allocated strings to guarded-alloc 2024-06-02 20:39:06 +10:00
Campbell Barton
1aa5eddab3 Correct error in last commit
Correct flipped check in 96c4be169f.
2024-06-02 19:23:06 +10:00
Campbell Barton
96c4be169f Cleanup: minor changes relating to operator macros
- Consistent naming for wmOperatorTypeMacro variables.
- Reduced right-shift.
- Use boolean types.
2024-06-02 19:20:53 +10:00
Jesse Yurkovich
55a7e62f8a Cleanup: unused includes in source/blender/io/usd
Reduce dependence on Blender headers as much as possible and move closer
to an include-what-you-use setup.

- Removes unnecessary includes
- Replaces some includes with more appropriate, narrower, substitutes

Pull Request: https://projects.blender.org/blender/blender/pulls/122619
2024-06-02 04:46:02 +02:00
Jesse Yurkovich
dbc842b21e Fix #122582: Missing button assignment caused wrong precision to be used
The missing button assignment caused the previous button ("Z:") to have
its precision set to the incorrect value.

Pull Request: https://projects.blender.org/blender/blender/pulls/122583
2024-06-01 19:55:28 +02:00
Harley Acheson
30168752cf Fix #122590: Revert "Fix #122423: Fix Gizmo Map Crash after Area Join"
This reverts commit e48eacd672.

Pull Request: https://projects.blender.org/blender/blender/pulls/122604
2024-06-01 19:19:58 +02:00
Clément Foucault
46ace12a46 EEVEE-Next: Add base page tagging for punctual shadow
This avoid missing tiles artifacts during tracing or
filtering of shadow maps.

Fixing it for directionnal is a bit more complex and
will be done in another commit.

Fix #121618

Pull Request: https://projects.blender.org/blender/blender/pulls/122597
2024-06-01 17:29:38 +02:00
Hans Goudey
7e5f061851 Fix: Assert in mesh draw edit UV tris extraction
Caused by e916cd5d69.
2024-06-01 11:17:51 -04:00
Clément Foucault
135377a54f Fix: EEVEE-Next: Wrong factor in pdf_to_lod 2024-06-01 15:04:17 +02:00
Hans Goudey
e686d1b38a Sculpt: Improve Set Pivot Position UI
- Don't show the "Mouse X" and "Mouse Y" properties in the redo panel
  for all the modes that don't use them.
- Use the recently added dynamic version of the "depends on cursor"
  setting to only wait for mouse click for the "cursor surface" mode.

Arguably these should be different operators anyway.
2024-06-01 08:45:36 -04:00
Campbell Barton
d002703484 PyAPI: fixes for defining operator macros
- Support passing in operator ID's using Python dot syntax.
- Support define operators that haven't yet been registered
  matching Blender's own behavior.

Also add doc-string for bpy.types.Macro.define.
2024-06-01 16:17:02 +10:00
Campbell Barton
5f5d851d13 WM: add extra check for Python operator names
Check the "." separator isn't at the beginning/end of the string.
2024-06-01 16:08:53 +10:00
Campbell Barton
8c542ce15f WM: assert operator names are valid when appending
Add WM_operator_bl_idname_is_valid utility function.
2024-06-01 16:08:51 +10:00
Campbell Barton
7eecd708ea Cleanup: quiet compiler warnings 2024-06-01 16:08:49 +10:00
Campbell Barton
8f0270731c Cleanup: simplify status text logic
Checking for exact flags known to draw before the current item was
becoming overly complicated, more so now showing extension updates
depends on checking other settings.

Instead, keep track of the status info being populated or not.
2024-06-01 13:07:35 +10:00
Clément Foucault
0d7d6b00c9 EEVEE-Next: LightProbe Bake: Add better feedback when allocation fail
- Add a report to explain why allocation fails and display
  the current limit.
- Add heuristic to avoid out of memory issue.
- Remove the delay property that did not do anything
  right now.
- Reduce default clip end by half.

Fix #121916

Pull Request: https://projects.blender.org/blender/blender/pulls/122572
2024-05-31 22:55:05 +02:00
Jesse Yurkovich
358ccb8146 Cleanup: minor CLOG output wording changes
Also included a c++ functional cast style change.
2024-05-31 21:59:27 +02:00
Harley Acheson
02798f8438 UI: Mesh Shear Status Display
While using Mesh Shear, show only changing values in the area header and
only keymap entries on the Status Bar

Pull Request: https://projects.blender.org/blender/blender/pulls/122341
2024-05-31 21:51:42 +02:00
Charles Wardlaw
3e73b9caa5 USD Export: Add the ability to downsample textures for USDZ
This allows for exporting multiple versions of an asset's textures
without having to manually save or do manual edits from within the UI.
This is beneficial for game creators who might want to store the
original textures at full resolution, but then bake down at export time
for multiple different targets quality levels.  It can also be good for
compressing textures for VR usage.

This only affects USDZ exports.

Default option: Keep textures at the same resolution. Choosing a
resolution will downsample any images that exceed that maximum
resolution while leaving the others.

A custom setting is provided to allow the user to manually enter their
desired size if the provided options aren't suitable.

Co-authored-by: Charles Wardlaw <cwardlaw@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121237
2024-05-31 21:47:47 +02:00
Jesse Yurkovich
9182d449d1 Fix #122513: Add CD_PROP_QUATERNION in copy_primvar_to_blender_attribute
Missed the CD_PROP_QUATERNION case.

Also discovered that both USD and Blender's Quaternions are ordered as
W, x, y, z (instead of W last).

Pull Request: https://projects.blender.org/blender/blender/pulls/122529
2024-05-31 19:24:21 +02:00
Iliya Katueshenock
4de9da31a2 Geometry Nodes: Properly support Matrix data type in Viewer node
Just add handling of new data type in necessary places.

Pull Request: https://projects.blender.org/blender/blender/pulls/122550
2024-05-31 17:44:49 +02:00
Lukas Tönne
b588daa68b Fix #122538: crash calling curves_copy_point_selection with empty selection
This is accessing curve offsets, which don't have entries for empty
geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/122499
2024-05-31 16:24:35 +02:00
Jacques Lucke
28cef56ad2 Geometry Nodes: support capturing multiple attributes at once
By capturing multiple attributes with one node, the user can make sure that those
are evaluated together in the same context. This can be quite a bit more efficient
compared to capturing multiple fields separately (also because we don't optimize
grouping multiple capture nodes together yet).

The change is fully backward compatible. Forward compatibility has been added
for some cases. Especially, files created in older versions that are saved with this
newer version will still work in the older version.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121665
2024-05-31 16:23:31 +02:00
Clément Foucault
62bfb3623d DRW: Invalid clip data if view is from planar reflection
The plane and corner extraction code was just not correct.

Fix #122067
Pull Request: https://projects.blender.org/blender/blender/pulls/122516
2024-05-31 16:15:52 +02:00
Omar Emara
1c315c62d2 Fix: Crash when duplicating node editor
Blender crashes when duplicating a node editor with an active
compositor session. That's because the runtime data of the editor is
nullptr upon duplication. This is a regression in 51a7961e09, where the
runtime data was set to nullptr upon duplication, while it should be
assigned a newly allocated structure or duplicate the existing
structure. To fix this, we do the former and allocate a new structure
because that's what the developer intended in the original patch.

The crash is rare and went unnoticed because the runtime data is
initialized in the init method as well, which typically gets called
quickly right after the area is duplicated.

Pull Request: https://projects.blender.org/blender/blender/pulls/122506
2024-05-31 15:22:21 +02:00
Pratik Borhade
c80e30684c GPv3: Lock material layer property
This ports the `lock_material` layer property to GPv3.
For this, the `layer_index` is also required in `retrieve_editable_points`
and `retrieve_editable_strokes` to choose strokes based on
the `lock_material` property.
In `retrieve_editable_elements` we now pass the `MutableDrawingInfo`
to get both the `drawing` and `layer_index`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119913
2024-05-31 15:13:35 +02:00
Dalai Felinto
26d7fb3df3 UI: Extensions: Status bar offline not showing if updates were available
How to reproduce it:
* Launch Blender
* Make sure there are updates available
* Disable "Allow Online Access"

The offline icon would not show on the status bar.
2024-05-31 14:40:14 +02:00
Dalai Felinto
96424cd2a5 UI: Extensions: Fix status bar
* Show offline icon when offline.
* Don't show the vertical split when there are no updates (since we
  don't draw any information in this case.

Reviewed by Campbell Barton.

Ref !122548
2024-05-31 14:33:21 +02:00
Campbell Barton
fd4a69660b Correct sub-version check for status bar update flag 2024-05-31 21:46:55 +10:00
Campbell Barton
8bd3be2160 Extensions: show extension updates in the status bar
Move extension update display from the splash screen to the status bar.
Based on !122413 with minor changes & removal of splash text.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
2024-05-31 21:37:37 +10:00
Iliya Katushenock
fb6b9092a7 Geometry Nodes: new Instance Transform attribute input node
New node to access `instance_transform` built-in attribute of instances.

Pull Request: https://projects.blender.org/blender/blender/pulls/122477
2024-05-31 12:55:40 +02:00
Falk David
a8d395388d Cleanup: GPv3: Remove uses of layers.first_index
Remove uses of `GreasePencil::layers().first_index(...)`.
Use `GreasePencil::get_layer_index` instead.
2024-05-31 12:28:18 +02:00
Sergey Sharybin
1a9db9992a Fix #122451: Crash on animated viewport visibility + animated mesh positions
Move the bounding box synchronization to the geometry evaluation component.
This way it is ensured that it is only done when the geometry is actually
evaluated, solving the problem of accessing stale data when object level
flags are modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/122509
2024-05-31 11:51:36 +02:00
Jacques Lucke
ee8e195946 Nodes: allow identifier lookup in nodes which use dynamic declarations now
This check was added for 4.0 where we knew that some identifiers will change soon.
Now those identifiers have changed (mostly as part of 8149678d5e),
so it's ok to support identifier lookup now.
2024-05-31 11:00:16 +02:00
Bastien Montagne
dd3222d2f8 BLI math: Do not use BLI_ASSERT_ C-style checks in modern cpp code.
The old C-style `BLI_ASSERT_UNIT_V...` assert macros have a few issues:
* They are named `unit`, but also consider a zero-length vector as valid.
* They use a fairly high epsilon value, which was defined because
  vertex normals used to be stored as shorts.

Fortunately, these are used only in one place in the modern BLI_math C++
code AFAICS, which is `math::rotate_direction_around_axis`.

This commit adds some utils to check for vectors being (almost) unit
or zero length, using more modern bases for epsilon values (from
`std::numeric_limits`).
* `is_zero` keeps its existing default arror of `0` (i.e. strictly null
  vector by default). That way, current behavior is not changed, and in
  most cases null vectors are explicitely created as exactly null.
* `is_unit` uses a default 10 times the type's epsilon, as a zero
  epsilon would virtually never succeed here.

And it modifies `rotate_direction_around_axis` to:
* Assert that `axis` is a unit vector.
* Early-out in case given `direction` is a null vector, or rotating
  angle is zero.
* Assert about `direction` being a unit vector otherwise.

Note that this will make `rotate_direction_around_axis` use much
stricter epsilon error factors. This does not seem to affect any of the
files that triggered asserts prior to recent fix in e18dd894b8 though.

Pull Request: https://projects.blender.org/blender/blender/pulls/122482
2024-05-31 10:58:19 +02:00
Jesse Yurkovich
dce293b62f Fix unreported: wrong serialization of Quaternion during bake
The `w` field is first in the struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/122530
2024-05-31 09:17:16 +02:00
Campbell Barton
e771ea3d98 Fix use of uninitialized stack memory when registering a Macro
The draw callback could be assigned even when it's not in the Python
class.
2024-05-31 15:26:39 +10:00
Campbell Barton
494686b29f Fix potential dangling reference errors 2024-05-31 13:41:11 +10:00
YimingWu
dc69abcb70 Fix #122503: GPv3: Always Initialize vertex_color_ when drawing
Lack of initialization of `vertex_color_` will cause garbled color to
show up in later interpolated points while drawing in material mode with
curves already have `vertex_color` attribute. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122528
2024-05-31 04:51:55 +02:00
Campbell Barton
24abd35d14 Extensions: use "extensions" category for operator
Replace use of "bl_pkg" operator category with "extensions",
this naming was used while the functionality was experimental,
not intended to be used once extensions was moved out of experimental.
2024-05-31 10:32:01 +10:00