Commit Graph

102171 Commits

Author SHA1 Message Date
Miguel Pozo
f63a0e670a Workbench-Next: Workaround lack of texture views support
Extract a mask from the stencil buffer and use that texture instead
when texture views are not available.
Needed for supporting the Windows ARM software driver.

The workaround is isolated on its own class so it's easy to remove once
it's no longer needed.

Note that while this adds a function to check if texture views are available
(`GPU_texture_view_support`), at the moment this always returns true in
practice, since OpenGL 4.3 is the minimum supported version.
A separate patch will be needed to allow Blender to run using
OpenGL 4.2 + extensions.

Pull Request: https://projects.blender.org/blender/blender/pulls/111402
2023-08-24 15:10:33 +02:00
Hans Goudey
45d8a8b0c3 Geometry Nodes: Initial basic rotation socket nodes
This PR adds an initial set of nodes using the new rotation socket.
6 nodes build rotations or convert them to other formats, a 7th rotates
a vector with a rotation, and the last inverts rotations.

The design task #109965 describes the choice to use separate nodes
for the rotation construction and separation operations. In the future,
a "Switch Node" operator (#111438) will help to make working with
these separated nodes faster.

- **Axis Angle to Rotation**
- **Rotation to Axis Angle**
- **Combine Quaternion**
- **Separate Quaternion**
- **Euler to Rotation**
- **Rotation to Euler**
- **Rotate Vector**
- **Invert Rotation**

See #92967

Pull Request: https://projects.blender.org/blender/blender/pulls/109030
2023-08-24 14:58:55 +02:00
Almaz-Shinbay
81eb7edc8b Outliner: Port view collection base elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new class for view collection base elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/111230
2023-08-24 14:44:43 +02:00
Christoph Lendenfeld
3f7eceea93 Fix: Memory leak in Graph editor keyframe jump
Introduced with #108549
Simply forgot to free the AnimData list

Pull Request: https://projects.blender.org/blender/blender/pulls/111464
2023-08-24 14:33:12 +02:00
Hans Goudey
d8757236e0 Cleanup: Remove unused sculpt function declaration
The function is static, it doesn't need to be declared in the header.
2023-08-24 08:21:10 -04:00
Michael Kowalski
5bbeb927a1 Fix: USD export: missing animation frames.
This fixes a bug where only the time sample for the first frame
is written to a USD animation.

Replaced the hard-coded USDExporterContext::time_code value with a
USDExporterContext::get_time_code function wrapper which is called
from USDAbstractWriter::get_export_time_code() to query the current
frame when writing an animation.

Pull Request: https://projects.blender.org/blender/blender/pulls/111248
2023-08-24 14:12:07 +02:00
Hans Goudey
7fc7441a7b Cleanup: Separate sculpt undo restore into types
Though this means a few loops are duplicated, overall the code is
easier to reason about because the cases are separated more. This
makes potential changes to the way normals are stored clearer
(related to !110479), and makes potential optimizations easier too.
2023-08-24 07:37:07 -04:00
Hans Goudey
4a0581eca2 Fix: Missing multires to faces visibility sync after box hide
The operator handled faces visibility change correctly but not
multires. Use the existing PBVH API function for that, also remove
a redundant call to the function that fetched the attribute pointers
again after the change.
2023-08-24 07:37:07 -04:00
Hans Goudey
4d82e1a7ee Cleanup: Simplify, parallelize multires to mesh visibility propagation
After undoing a visibility change, the visibility is propagated from
multires grids to mesh faces and vertices. This progress was completely
single threaded and more complicated than necessary. Simplify it
using newer C++ data structures and APIs.
2023-08-24 07:37:07 -04:00
Hans Goudey
a1dceeec00 Fix #110516: Geometry nodes use attribute toggle boolean values broken
The toggle was added before boolean IDProperties were added. The fix is
to support both integer types and boolean types, similar to a recent
change for other inputs, 9f30555faf.

Pull Request: https://projects.blender.org/blender/blender/pulls/111433
2023-08-24 13:36:25 +02:00
Hans Goudey
4b26fbbd02 Nodes: Change rotation socket color
The current color was just temporary. The new color
is meant to be in between "Vector" and "Boolean"--
close to the vector color but distinct enough to allow
seeing the difference at a glance.

Pull Request: https://projects.blender.org/blender/blender/pulls/111446
2023-08-24 13:34:36 +02:00
casey bianco-davis
5bed3ef827 GPv3: Dissolve Operator
Adds the Dissolve operator.

note that this pull request contains some of the same menu code also included in #110938

Pull Request: https://projects.blender.org/blender/blender/pulls/111079
2023-08-24 11:06:18 +02:00
Jeroen Bakker
bce23aa0f5 Fix: Crash On Exit When Using Vulkan
Vulkan device was deallocated, but when destroying the GHOST context
the GPU context is reactivated and want to allocate buffers lazilly.

This is solved by de-initializing the device on platform exit, resetting
buffer pointers so double free can be detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/111462
2023-08-24 10:23:21 +02:00
Campbell Barton
24a8d6425a CMake: include missing files in source files 2023-08-24 11:51:25 +10:00
Campbell Barton
a56200c1ed Cleanup: sort cmake file lists 2023-08-24 11:38:41 +10:00
Campbell Barton
a13823057c Cleanup: format 2023-08-24 11:37:29 +10:00
Campbell Barton
4492742487 License headers: manually integrate existing copyright into SPDX text
Some GLSL files already contained copyright information,
manually merge this into existing SPDX headers.

Ref !111247
2023-08-24 10:57:19 +10:00
Campbell Barton
0148293520 License headers: add SPDX licenses for '*.glsl' files
When GLSL sources were first included in Blender they were treated as
data (like blend files) and had no license header.
Since then GLSL has been used for more sophisticated features
(EEVEE & real-time compositing)
where it makes sense to include licensing information.

Add SPDX copyright headers to *.glsl files, matching headers used for
C/C++, also include GLSL files in the license checking script.

As leading C-comments are now stripped,
added binary size of comments is no longer a concern.

Ref !111247
2023-08-24 10:57:03 +10:00
Campbell Barton
8d1ffe14b2 Cleanup: use a bool for BKE_mesh_orco_verts_transform invert argument 2023-08-24 10:45:34 +10:00
Campbell Barton
3ec489000f Cleanup: spelling in comments 2023-08-24 10:43:45 +10:00
Almaz-Shinbay
668b31c5d8 Outliner: Port layer collection elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new class for layer collection elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/111220
2023-08-23 18:17:14 +02:00
Bastien Montagne
110eb666ca Fix #111439: liboverride object cannot be made local from 3DView, if it has a local parent.
The code ensuring that an object (or obdata) is not made local if it is
used by linked data that is not tagged to be made local was blatantly
buggy, leading to over-detecting such cases.

Note that this code remains fairly fragile imho, think the whole Main
data-base of IDs should be checked, other data-types than Objects can
use objects! But this is for another day.
2023-08-23 17:27:54 +02:00
Bastien Montagne
445fabeae9 Fix (unreported) crash when loading files with py-defined ID IDProperties.
New code exposing ID Pointers CustomProperties to the UI (b3c7f3c8a9)
would cause invalid data access when calling `as_dict()` on py-defined ID
pointers ID properties, since these have no ID type defined by default.

The code of `as_dict()` will now forcefully generate a valid ID type
value, either by using the type of the currently assigned ID, or falling
back to the Object ID type.

Found while opening some lighting production files from the Pets
Project.
2023-08-23 16:44:56 +02:00
Bastien Montagne
8bb5916183 Readfile: Replace the 'expand' specific code by generic usage of foreach_id.
The `expand` callback is 'trivial' to replace, since it is only iterating
over ID pointers and calling a callback.

The only change in behavior here is that some pointers that were not
processed previously will now be.

In practice this is not expected to have any real effect (usually
the IDs used by these pointers would have been expanded through other
usages anyway). But it may solve a few corner cases, undocumented issues
though.

Part of implementing #105134: Removal of readfile's lib_link & expand code.
2023-08-23 16:44:56 +02:00
Bastien Montagne
c79642fa98 Core: foreach_id: Do not mutually exclude 'no origpointer access' and 'readonly' flags anymore.
There are actually cases where you do not want to access the original
ID pointers, even though the callback will not modify them. One example
is the incoming generic 'expand' readfile callback, which will replace the
dedicated one for all ID types.

Related to #105134: Removal of readfile's lib_link & expand code.
2023-08-23 16:44:56 +02:00
Hans Goudey
e7abe1fd76 Cleanup: Remove unused node function 2023-08-23 10:37:09 -04:00
Weikang Qiu
5dd9e57878 Cleanup: Refactor Switch View node to use dynamic declarations
See [#108728](https://projects.blender.org/blender/blender/issues/108728).

Use new API (`declare_dynamic`) for the node, avoid modifying sockets directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/110042
2023-08-23 16:35:36 +02:00
Miguel Pozo
8d8f03be9c Cleanup: Draw: Clarify comment 2023-08-23 16:10:38 +02:00
Miguel Pozo
89dc2e1649 Fix: EEVEE-Next: Object Info > Random 2023-08-23 16:01:31 +02:00
Miguel Pozo
45f3426559 Fix: UserDef_Experimental padding
Fix compiler error after 85b02b893a
2023-08-23 15:33:02 +02:00
Miguel Pozo
85b02b893a Workbench-Next: Enabled by default
Replace Workbench with Workbench Next.
The old Workbench code is still there for now,
but it should be unreachable.

Pull Request: https://projects.blender.org/blender/blender/pulls/111403
2023-08-23 15:09:37 +02:00
Iliya Katueshenock
d732478574 Cleanup: Geometry Nodes: Unnecessary components to check
Only point cloud and mesh is supported. All other components
is unnecessary to check and return.

Pull Request: https://projects.blender.org/blender/blender/pulls/110439
2023-08-23 14:53:57 +02:00
Amelie Fondevilla
1193f2d7ec GPv3: Refactor code for the hard eraser
This patch refactors most of the code of the hard eraser, both for readability purpose, and to prepare the integration of the soft mode of the eraser.
The refactoring includes :
 - the use of specific structures and enum types `SegmentCircleIntersection`, `PointCircleSide`, and `PointTransferData` to handle the data more easily,
 - improve readability of the intersections functions (better naming, and more accurate and generic comments),
 - definition of a more generic `compute_topology_change` function that handles point insertion, removal, and curve splitting for curves geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/111390
2023-08-23 14:13:50 +02:00
Sergey Sharybin
beaf4854b1 Fix #110328: Clay Strip symmetry does not mirror rotation
Caused by 351034891e

This change is a partial revert of the change.

The SCULPT_cube_tip_init() does not deal with the symmetry passes.

Additionally, the commit changed the way how the Z component of
the matrix was constructed: displaced vs. non-displaced area
coordinate.

While the code duplication is often to be avoided, sometimes it is
more clear than a centralized place with a lot of arguments passed
to a function. We can have a pass of de-duplication later on, and
make a better decision, but for now restore user level behavior to
what it is expected to be.

Pull Request: https://projects.blender.org/blender/blender/pulls/111425
2023-08-23 12:21:44 +02:00
Julian Eisel
7bb693581f UI: Move asset shelf out of experimental
This makes the asset shelf available as a standard, non-experimental
feature. Currently no script makes use of it, so it will still not be
available. However the pose library will be updated to use this for its
UI instead.

Initially the asset shelf was committed as experimental feature, even
though it seemed ready for non-experimental. After double checking with
some people (Dalai and Brecht) we decided to go ahead with this.

There are still some futher changes planned, see #107881.
2023-08-23 12:15:33 +02:00
Philipp Oeser
e2a35debde Fix #94129: Unable to remove added keying set from context menu
Mistake in (7-year-old) f6c09eadf0.

The operator was just cancelled if the right button was found, instead
it should only cancel if the button is _not_ found.

Pull Request: https://projects.blender.org/blender/blender/pulls/111373
2023-08-23 09:39:38 +02:00
Lukas Tönne
26e2f07dad Fix #111381: Crash when inserting a node onto a link inside a frame
`discover_tree_zones` requires the node topology cache, make sure it is available before calling.

Pull Request: https://projects.blender.org/blender/blender/pulls/111383
2023-08-23 08:51:05 +02:00
Campbell Barton
3aa0715d65 Cleanup: remove calls to snprintf
Use BLI_snprintf/SNPRINTF to ensure the strings are null terminated.
2023-08-23 15:04:12 +10:00
Campbell Barton
24ef5e097a Cleanup: balance doxy sections 2023-08-23 14:54:46 +10:00
Campbell Barton
c52965e9c7 Cleanup: simplify struct declarations 2023-08-23 13:45:19 +10:00
Campbell Barton
f66fa32ada Cleanup: spelling in comments 2023-08-23 13:30:55 +10:00
Harley Acheson
6e20beba22 UI: Statistics Overlay Improvements
Miscellaneous improvements to the Statistics 3DView Overlay. Shows
internal details for selected objects while in Object Mode, including
triangles. Removes the useless "0" shown in the stats while in Sculpt
mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/104663
2023-08-23 01:13:53 +02:00
Bastien Montagne
709ec52c7d Core: foreach_id: Add a new callback flag to skip processing at readfile time.
In readfile context, some ID pointers have to be ignored: typically the
'owner_id' pointers of embedded data.

Currently unused, but required for replacing `blend_read_lib`/
`blend_read_expand` by `foreach_id` (#105666).
2023-08-22 22:17:04 +02:00
Bastien Montagne
710b47fe7c Tweak SpaceNode foreach_id callback handling of nodetree ID pointer.
The fact that this pointer may be either to a regular ID, or an embedded
one, without any way to tell it withour accessing the nodetree data,
makes it tricky to handle properly when such 'other ID' access is not
allowed. Here there can still be assumptions and heuristics based on
other data, but this remains fragile and really sub-optimal code.

Should not have any behavioral change in current code, but required for
replacing `blend_read_lib`/`blend_read_expand` by `foreach_id`
(#105666).
2023-08-22 22:17:04 +02:00
Hans Goudey
1857df8d5b Cleanup: Use FunctionRef for PBVH filtering callback
Call functions directly in lambdas rather than passing their
arguments in a separate void * argument. This can be changed
more in the future to move callback arguments out of smaller
structs.
2023-08-22 15:06:42 -04:00
Leon Schittek
899d723da8 Fix: Display nodelinks consistently across different UI scales
Adjust the width, dash length and amount of anti-aliasing of node links
so they look the same independent of the UI scaling.

Adding another parameter to the shader exceeded the limit of 16
attributes. Therefore the parameters to describe the dashes (length,
factor, alpha) are passed in together as a vector.

Ref  #102919

Pull Request: https://projects.blender.org/blender/blender/pulls/111270
2023-08-22 19:24:07 +02:00
Hans Goudey
42bf06a57d Fix #111255: Sculpt mode crash for mesh with no faces 2023-08-22 12:29:36 -04:00
Bastien Montagne
7a0a406ff8 Core: foreach_id: add optional support for deprecated ID pointers.
This commit adds a new option flag to the lib_query foreach_id code,
which will make deprecated ID pointers to be processed as well.

NOTE: Currently there is no report to the callbakcs about the fact that
it is processing a deprecated ID. This can be easily added later if it
becomes necessary.

Part of implementing #105134: Removal of readfile's lib_link & expand code.
2023-08-22 17:47:57 +02:00
Bastien Montagne
b075c84ba3 Fix (unreported) invalid memory access in new 'newer blendfile version' code.
When choosing the new 'overwrite' option when trying to save a blendfile
from a newer version of Blender, it would cause invalid (use-after-free)
memory access.

Issue caused by the main commit (a1d7ec7139) of the new blendfile
compatibility handling. No idea how it was not detected earlier.

Many thanks to @weizhen for spotting the issue and doing some initial
investigation on it.
2023-08-22 17:26:37 +02:00
Amelie Fondevilla
6cfda322a6 Fix: GPv3: Stroke Eraser does not work with one-point strokes.
The stroke mode of the eraser only tests distance with segments of the strokes, so it does not take into account strokes that only have one point, and thus no segment. This patch fixes the issue by testing if the point is inside the eraser in the case of a one-point stroke.

Pull Request: https://projects.blender.org/blender/blender/pulls/111387
2023-08-22 17:04:51 +02:00