Commit Graph

106728 Commits

Author SHA1 Message Date
Pratik Borhade
da2ba2f3f6 Windows: Compile error due to missing header
Caused by 9e4129feeb
Error: `undeclared identifier M_PI and M_PI_2`

Pull Request: https://projects.blender.org/blender/blender/pulls/118185
2024-02-13 07:48:22 +01:00
Campbell Barton
c8961d150d Tests: update BLI_convexhull_2d_test since fixing vertical segments
Changing the angle was needed as there is no longer a duplicate
end-point added to the polygon for vertical lines.
2024-02-13 16:47:48 +11:00
Campbell Barton
688cf175e5 Merge branch 'blender-v4.1-release' 2024-02-13 16:44:56 +11:00
Campbell Barton
0053de6556 Fix buffer overflow passing a vertical segment to convexhull_2d
Convex hull calculation would "cap" line segments with the first point.
Besides causing a buffer overflow when passing in two points,
it's not needed as matching first/last ends aren't expected
to be set by this function.
2024-02-13 16:42:39 +11:00
Campbell Barton
680701e915 Cleanup: spelling in comments 2024-02-13 14:20:00 +11:00
Campbell Barton
7747b8c944 Fix convexhull_2d_test for macOS & re-enable the test
Use EXPECT_NEAR instead of EXPECT_EQ to account for a differences in
atan2 implementation on macOS, more generally relying on exact
float comparison for tests is error prone.
2024-02-13 14:07:26 +11:00
Campbell Barton
cc154144ef Cleanup: unused includes in source/blender/blenloader
Remove 45 includes.
2024-02-13 13:53:10 +11:00
Campbell Barton
fee47f6da8 Cleanup: unused includes in source/blender/sequencer
Remove 95 includes.
2024-02-13 13:37:56 +11:00
Campbell Barton
1a3b5452c4 Cleanup: unused includes in source/blender/nodes
Remove 166 includes.
2024-02-13 13:23:35 +11:00
Campbell Barton
51bc826ca1 Cleanup: unused includes in source/blender/python
Remove 72 includes.
2024-02-13 13:09:03 +11:00
Hans Goudey
1394907474 Cleanup: Move uvproject.c to C++ 2024-02-12 20:43:24 -05:00
Campbell Barton
bdd9f32f84 Cleanup: unused includes in source/blender/modifiers
Remove 359 includes.
2024-02-13 12:28:24 +11:00
Campbell Barton
e205772596 Cleanup: includes in source/blender/imbuf
Remove 25 includes.
2024-02-13 12:22:50 +11:00
Campbell Barton
6cc6ccecd0 Cleanup: unused includes from source/blender/windowmanager
Remove 56 includes.
2024-02-13 11:58:42 +11:00
Campbell Barton
c29fdd1e12 Fix error in recent blenkernel cleanup
The BLI_endian_defines.h include was removed in [0] because
the resulting object files were unchanged on little endian systems.
Using -Werror=undef with GCC prevents this from happening in the future.

[0]: 9e4129feeb
2024-02-13 11:54:46 +11:00
Campbell Barton
9e4129feeb Cleanup: unused includes in source/blender/blenkernel
Remove 397 includes.
2024-02-13 11:32:38 +11:00
Campbell Barton
de18b629f0 Cleanup: unused includes in source/blender/blenlib
Remove 30 includes.
2024-02-13 11:07:14 +11:00
Campbell Barton
b372ebae68 Cleanup: unused headers for source/blender/editors
Remove 1317 includes from editors.
2024-02-13 10:02:53 +11:00
Campbell Barton
eb318b7733 Cleanup: use FILE_MAX instead of PATH_MAX for paths based on blend files
The blend file path is limited to FILE_MAX.
2024-02-13 09:53:45 +11:00
Campbell Barton
22b382fc84 Cleanup: replace PATH_MAX with FILE_MAX_LIBEXTRA for file drawing 2024-02-13 09:43:04 +11:00
Campbell Barton
39f0dbf47a Cleanup: use FILE_MAX instead of PATH_MAX for operators
FILE_MAX is used by operators, avoid an MSVC specific include.
2024-02-13 09:19:47 +11:00
ok_what
751d9c5999 Fix: VSE transition strip factor is not clamped
Previewing strip outside of it's boundary caused overflow.
Clamp the factor to prevent overflow.

Pull Request: https://projects.blender.org/blender/blender/pulls/118086
2024-02-12 21:21:19 +01:00
Harley Acheson
332efa7250 Merge branch 'blender-v4.1-release' 2024-02-12 12:17:45 -08:00
Harley Acheson
d45175c919 UI: Fix Indentation Issue in Asset Browser
Remove extra indentation for non-collapsible icons that have ICON_NONE,
not needed since #117654

Pull Request: https://projects.blender.org/blender/blender/pulls/118159
2024-02-12 21:16:28 +01:00
Damien Picard
1410615079 Nodes: expose multi-input sockets to custom nodes in the Python API
Currently the multi-input sockets are not exposed to the custom nodes
Python API. This makes some features cumbersome to implement if one
wants a node to process an arbitrary number of inputs.
One workaround is to make inputs duplicate themselves when a link is
created, but a proper multi-input would be easier to use for both
add-on developers and users.

This commit exposes a new `use_multi_input` boolean parameter when
creating a new node socket. This makes it possible to declare a
multi-input, while still leaving the existing `is_multi_input`
property read-only so that existing nodes cannot be made unstable.

The parameter is optional so existing scripts stay compatible. It also
raises an error when used on output sockets, since it makes no sense
for those to be multi-input.

The Custom Node Tree Python template was updated to reflect this
change by making one of the inputs of the custom node multi-input.

Pull Request: https://projects.blender.org/blender/blender/pulls/114474
2024-02-12 20:28:56 +01:00
Julian Eisel
4f68fa453f Fix compiling after previous fix in release branch 2024-02-12 19:51:56 +01:00
Julian Eisel
0ffe2d4848 Merge branch 'blender-v4.1-release' 2024-02-12 19:51:40 +01:00
Hans Goudey
d691ed2f3b GPU: Use std::string instead of C strings for code gen output
The benefits are removing unnecessary reallocations of the string data
and unnecessary recalculations of the size, better type safety, and more
automatic memory management.

Pull Request: https://projects.blender.org/blender/blender/pulls/118045
2024-02-12 19:33:44 +01:00
Julian Eisel
d54a1b0364 Fix asset indexer string shortening breaking UTF-8 strings
Would shorten the string without ensuring the string isn't shortened in
the middle of a multi-byte UTF-8 character.
2024-02-12 19:25:20 +01:00
Harley Acheson
3ac9babe35 Fix #118087: Remove Bad Spacing Introduced With #117310
This reverts to the exact prior spacing values for layout separator
item, so only difference is vertical spacing if vertical bar.

Pull Request: https://projects.blender.org/blender/blender/pulls/118151
2024-02-12 19:10:48 +01:00
Germano Cavalcante
1c77779160 Refactor: Store a 'Mesh' in the editmesh snap cache and use it for snapping
In this commit, a temporary mesh is created representing the edit mesh.
This mesh is then used in the Edit Mesh snapping system instead of the
BMesh.

By using a Mesh object for snapping, we remove a considerable amount of
code and use a more optimized version of snapping.

This simplifies the code and makes it easier to implement new features.

## Performance test: Face + Edge + Vert
|        | Cache     | Gen. Snap |
|--------|-----------|-----------|
| Before | 680.88 ms | 0.1250 ms |
| After  | 489.06 ms | 0.1064 ms |
| Improv | 28.65%    | 14.88%    |

## Performance test: Face
|        | Cache     | Gen. Snap |
|--------|-----------|-----------|
| Before | 293.90 ms | 0.0230 ms |
| After  | 411.92 ms | 0.0256 ms |
| Improv | -40.15%   | -11.30%   |

Pull Request: https://projects.blender.org/blender/blender/pulls/117047
2024-02-12 18:59:13 +01:00
Miguel Pozo
7ca46bb25d Merge branch 'blender-v4.1-release' 2024-02-12 18:35:31 +01:00
Miguel Pozo
1323b9912c Cleanup: Remove outdated comment
gl_InvocationID is always available now.
2024-02-12 18:34:54 +01:00
Miguel Pozo
7821cf068c Fix: Workbench: Shadows
Broken shadows after c0c3565714
GPU_ARB_gpu_shader5 is never defined,
since gl_InvocationID is always available.
2024-02-12 18:34:12 +01:00
Michael Kowalski
e4c45cbce1 Merge branch 'blender-v4.1-release' 2024-02-12 11:58:02 -05:00
Hans Goudey
d434ef6566 Docs: Add comments to node tree runtime struct clarifying design
Currently we have some old code from shader/compositor/texture nodes
that stores runtime data during and after evaluation on the node tree
itself. This is meant to be avoided, since the node tree is just meant
to be evaluation _instructions_.

Pull Request: https://projects.blender.org/blender/blender/pulls/118056
2024-02-12 17:44:12 +01:00
Hans Goudey
b0b6bc86ab Cleanup: Use more standard face corner naming in mesh normals code
Mostly replace "ml" with "corner"
2024-02-12 11:15:01 -05:00
Hans Goudey
f3c55b9f9c Cleanup: Remove unused DerivedMesh function 2024-02-12 10:45:02 -05:00
Hans Goudey
e9b8460ebe Cleanup: Use blender::int2 instead of vec2i 2024-02-12 10:45:02 -05:00
Lukas Tönne
a4051b31d5 Fix #118135: Make sure the new active index is always valid
When deleting all the segments the active index is generally 0. Adding a
new segment increments the active index, which pushes it out of range.
The code should not expect active index to be inside the current range.

Pull Request: https://projects.blender.org/blender/blender/pulls/118143
2024-02-12 16:44:28 +01:00
Michael Kowalski
5dd48265bb USD: Fix duplicate shader nodes on import
Fixed duplicate nodes when converting texture scale/bias and
channel names on material import.  This required extending
the node caching to handle cases where a USD shader is converted
to multiple Blender nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118002
2024-02-12 16:42:26 +01:00
Omar Emara
98c0802ab0 Merge branch 'blender-v4.1-release' 2024-02-12 17:01:33 +02:00
Omar Emara
50d7f5a30f Fix #118096: Compositor Displace node produce NaN pixels
The GPU compositor Displace node produces NaN pixels if connected to the
Image node. That's because the Displace node access the MIP levels of
the texture produces by the Image node, but those levels were never
initialized, so fix this by completing the levels.
2024-02-12 16:58:23 +02:00
Clément Foucault
16c1e84c6c Fix: GPU: Fix shader builder option not building
This was caused by the recent change in DNA headers
making all extern data C++.
2024-02-12 15:04:53 +01:00
Campbell Barton
fb81bbaa60 Tests: disable BLI_convexhull_2d_test which fails on macOS 2024-02-13 00:34:44 +11:00
Germano Cavalcante
4618db7f5a Merge branch 'blender-v4.1-release' 2024-02-12 09:52:54 -03:00
Campbell Barton
ee0c5e28ad Cleanup: resolve missing declaration warning 2024-02-12 23:26:39 +11:00
Sergey Sharybin
18b594075c Fix #118034: Cycles: Driven View Layer property not considered in realtime
The issue was caused by Cycles doing dependency tracking on its
side, relying on the fact that view layer needs to be tagged as
modified when its properties change.

This was not the case when custom property on the a view layer is
modified via a driver.

Now the dependency graph will tag IDs which generic properties did
change as ID_RECALC_PARAMETERS, giving it a chance to render engines
to react to it.

Since this is quite generic code which might have unforeseen side
effects the change is not targeted to the current release branch.

Note that this chaneg does not fix the #103140, as the issue there
is use of RNA path to another data-block, without the node tree
registering relation to that data-block.

Pull Request: https://projects.blender.org/blender/blender/pulls/118134
2024-02-12 12:52:43 +01:00
Sean Kim
a2d96b0879 Sculpt: Disable sculpt sample detail size on invisible objects
Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118075
2024-02-12 12:27:53 +01:00
Sean Kim
ca6b75b106 Sculpt: Disable sculpt trim operators on invisible objects
Disables trim lasso and box gesture operators and the following
tools when attempting to operate on invisible objects:
* Lasso Trim
* Box Trim

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118072
2024-02-12 12:27:05 +01:00