Commit Graph

104694 Commits

Author SHA1 Message Date
Germano Cavalcante 07b5e1bd80 Fix #115153: Snap Base in Camera View crashes Blender
Snap to geometry is not supported when moving camera in camera view.

This is because the camera would make jumps that would be difficult to
predict and control.

The same happens if Snap Base were supported.

Therefore, disable Edit Snap Base when transforming camera into camera
view.
2023-11-20 11:09:55 -03:00
laurynas 6ccb30246d Fix #114860: Edge bevel weights in complex solidify
"Solidify" modifier in "Complex" mode was creating redundant layer
"bevel_weight_edge.001", if mesh has bevel weights for vertex set.
All modifier's  custom edge bevel weight calculations went there and got lost.

Pull Request: https://projects.blender.org/blender/blender/pulls/115178
2023-11-20 14:44:15 +01:00
Jeroen Bakker c9ba4f694b Cleanup: Make format 2023-11-20 14:19:16 +01:00
Jeroen Bakker 27fdfb6538 Vulkan: Memory Statistics
This PR shows the memory footprint in the statusbar when activated.
Only memory allocated on the VRAM is counted. Memory allocated on host
memory is not counted.

![image](/attachments/33cedc89-9ada-4c0a-9a94-6c1b3e22b64b)

Pull Request: https://projects.blender.org/blender/blender/pulls/115184
2023-11-20 14:08:19 +01:00
Hans Goudey b63e31df57 Fix #115170: Sculpt mode crash
If there isn't an evaluated mesh, use the original.
2023-11-20 07:45:52 -05:00
Philipp Oeser 85ffb71e44 Fix #115105: Edge Crease Doesn't Transfer
Caused by e5ec04d73c

Since above commit, the edge crease is a named attribute and considered
a "fake" customdata layer (similar to bevel weights or UV seams --
`CD_FAKE`). Thus, a special case in
`data_transfer_layersmapping_generate` has to be added for
`CD_FAKE_CREASE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/115180
2023-11-20 13:32:23 +01:00
Bastien Montagne 98ed3d3538 Fix print format warning with `int64_t` value.
There is no portable I18N-compatoible way to printf-format an `int64_t`
value, so convert it back into an `int`.
2023-11-20 12:43:07 +01:00
Miguel Pozo 4dc1c23384 Fix #114742: Draw: Buffers never shrink
The buffers from the new Draw Manager increase their size as needed,
but they never shrink.

Add `StorageArrayBuffer::trim_to_next_power_of_2` function that can
downsize the buffer following the same heuristic as `get_or_resize`.
Add `StorageVectorBuffer::trim_and_clear`, which calls
`trim_to_next_power_of_2` automatically.

Pull Request: https://projects.blender.org/blender/blender/pulls/114857
2023-11-20 12:23:12 +01:00
Bastien Montagne 7ce745a76b UI messages fixes/cleanups. 2023-11-20 12:20:58 +01:00
Aras Pranckevicius 0d0aad6280 IO: add STL import/export tests
Pull Request: https://projects.blender.org/blender/blender/pulls/115164
2023-11-20 11:19:50 +01:00
Antonio Vazquez 90a7ca7ed0 GPv3: Cleanup style and change depsgraph tag 2023-11-20 10:07:19 +01:00
Jacques Lucke a976cf4876 Cleanup: reduce boilerplate for equality operators for structs
Pull Request: https://projects.blender.org/blender/blender/pulls/115088
2023-11-20 09:39:13 +01:00
Jason Fielder b8c84d03cd Fix #107025: Resolve incorrect UV stretch color on macOS
Modify `UVStretchAngle` vertex struct alignment to match
4-byte struct alignment for Metal. This includes reordering
array elements to the front and adding additional padding
to the struct in Metal such that the raw-data write size
matches the padded vertex format.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/114923
2023-11-20 08:45:56 +01:00
ok_what c433f6666a Fix (unreported): Incorrect calculation of meta strip range
The meta strip range was calculated before the effect strip range was
updated. This resulted in incorrect range. To the user this appeared
as the meta strip erratically jumping to another location in the
timeline when transforming it, when it contained effect strips.

Pull Request: https://projects.blender.org/blender/blender/pulls/114644
2023-11-20 04:18:18 +01:00
Hans Goudey 41f9f2753a Refactor: Mesh: Include wrapper positions in bounds result
Avoid the need to call the separate `BKE_mesh_wrapper_minmax` function
that dealt with the edit mesh wrapper. This makes the API inconsistent,
since other mesh functions don't implicitly deal with the wrapper.
But the bounds are a bit of a special case anyway in regard
to the GPU subdivision wrapper already, and this is much more
convenient in the rest of the refactors for #96968.
2023-11-19 18:36:19 -05:00
Hans Goudey 48c6e682e0 Cleanup: Remove unnecessary extern "C" in legacy GP header 2023-11-19 17:32:02 -05:00
Hans Goudey dd902d97ab Cleanup: Add missing forward struct declaration 2023-11-19 17:31:37 -05:00
Hans Goudey 86cb5307ea Cleanup: Remove unnecessary references to BoundBox
Ongoing refactoring #96968 is working to reduce usage of this struct.
2023-11-19 17:31:20 -05:00
Hans Goudey bc61167d8e Cleanup: Access mesh bounds directly for Python raycast
See c56912eade
2023-11-19 17:07:14 -05:00
Hans Goudey 62b4555d01 Cleanup: Return Bounds type directly in mesh to volume code 2023-11-19 16:57:13 -05:00
Hans Goudey 8792f73446 Fix: Error in previous crazy space cleanup 2023-11-19 16:48:04 -05:00
Hans Goudey 8a0079053f Cleanup: Remove mistaken reference binding to temporary 2023-11-19 15:55:55 -05:00
Hans Goudey ee9265710a Cleanup: Use C++ BitVector for sculpt boundary info 2023-11-19 15:13:03 -05:00
dupoxy 323259a7da Fix: IO: C++ STL exporter using 'PLY' in error message
Pull Request: https://projects.blender.org/blender/blender/pulls/115148
2023-11-19 18:33:50 +01:00
Hans Goudey a0b9865aa6 Cleanup: Simplify crazyspace loop over mesh corners
Use functions to retrieve the next and previous corners
in a face. The complexity of tracking them manually isn't
worth it here. Also standardize naming a bit and use a
C++ BitVector instead of the C equivalent.

Pull Request: https://projects.blender.org/blender/blender/pulls/115146
2023-11-19 18:31:37 +01:00
Hans Goudey 4dede4efa8 Fix #115060: Swapped custom data mask in BMesh code 2023-11-19 10:46:07 -05:00
Aras Pranckevicius 17c793e43c IO: C++ STL exporter
There was a C++ STL importer since Blender 3.3, but no corresponding C++ STL exporter. This PR is adding said exporter: taking https://projects.blender.org/blender/blender/pulls/105598 and finishing it (agreed with original author).

Exporting Suzanne with 6 level subdivision (4 million triangles), on Apple M1 Max:
- Binary: python exporter 7.8 sec -> C++ exporter 0.9 sec.
- Ascii: python exporter 13.1 sec -> C++ exporter 4.5 sec.

Co-authored-by: Iyad Ahmed <iyadahmed430@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/114862
2023-11-19 16:41:20 +01:00
Iliya Katueshenock 31abb2b3af Geometry Nodes: Edge Paths to Selection node speedup
Parallelize vertex and edge selection loops.
In a test file, the node runtime changed from 5.08 to 0.83 ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/115131
2023-11-19 15:32:01 +01:00
Harley Acheson 2793b37f17 Fix #115085: Multicolumn Menus without Category Names
Handle menus that are meant to be multicolumn, with section dividers,
but not all sections have category names, just separators.

Pull Request: https://projects.blender.org/blender/blender/pulls/115102
2023-11-18 17:21:42 +01:00
Lukas Tönne c845233d1c Nodes: Move ValueOrField struct into blenkernel
This struct is currently defined in the `functions` module but not actually used there. It's only used by the geometry nodes module, with an indirect dependency from blenkernel via simulation zone baking. This scope is problematic when adding grids as socket data, which should not be part of the functions module.

The `ValueOrField` struct is now moved to blenkernel, so it can be more easily extended to other kinds of data that might be passed around by geometry nodes sockets in future. No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/115087
2023-11-18 13:11:39 +01:00
Hoshinova 0b11c591ec Nodes: Merge Musgrave node into Noise node
This path merges the Musgrave and Noise Texture nodes into a single
combined Noise Texture node. The reasoning is that both nodes
intrinsically do the same thing, which is the layering of Perlin noise
derivatives to produce fractal noise. So the patch de-duplicates code
and unifies the use of fractal noise for the end use.

Since the Noise node had a Distortion input and a Color output, while
the Musgrave node did not, those are now available to the Musgrave types
as new functionalities.

The Dimension input of the Musgrave node is analogous to the Roughness
input of the Noise node, so both inputs were unified to follow the same
behavior of the Roughness input, which is arguable more intuitive to
control. Similarly, the Detail input was slightly different across both
nodes, since the Noise node evaluated one extra layer of noise. This was
also unified to follow the behavior of the Noise node.

The patch, coincidentally fixes an unreported bug causing repeated
output for certain noise types and another floating precision bug
#112180.

The versioning code implemented with this patch ensures backward
compatibility for both the Musgrave and Noise Texture nodes. When
opening older Blender files in Blender 4.1 the output of both nodes are
guaranteed to always be exactly identical to that of Blender files
created before the nodes were merged in all cases.

Forward compatibility with Blender 4.0 is implemented by #114236.
Forward compatibility with Blender 3.6 LTS is implemented by #115015.

Pull Request: #111187
2023-11-18 09:40:44 +01:00
Richard Antalik b77f21f6ef Fix #114999: VSE preview doesn't update when snapping handle
Caused by missing cache invalidation.
2023-11-18 04:13:00 +01:00
Jacques Lucke 02bc43d08e Fix: versioning code results in duplicate node links
This issue was caused by having some hidden links and the changes in
8149678d5e to `version_geometry_nodes_replace_transfer_attribute_node`.
2023-11-17 23:15:08 +01:00
Bastien Montagne 6ce5f87d5b BLI_fileops rename unittests: add tests for directory rename.
Pull Request: https://projects.blender.org/blender/blender/pulls/115073
2023-11-17 22:53:58 +01:00
Jacques Lucke f3cd25370c Nodes: ungroup all selected group nodes instead of just the active one
It's useful to be able to ungroup multiple groups at once when trying to
see how much complexity there is in a node setup.
2023-11-17 22:48:53 +01:00
Bastien Montagne cb06b30587 Add 'rename' unittest for BLI_fileops' BLI_rename/_overwrite().
Pull Request: https://projects.blender.org/blender/blender/pulls/115067
2023-11-17 20:52:03 +01:00
Harley Acheson c11d5b4180 UI: Color Picker Position Indication
Changes to how the current positions in the color picker are shown.

Pull Request: https://projects.blender.org/blender/blender/pulls/113753
2023-11-17 19:18:28 +01:00
Miguel Pozo f27e87db7a Fix #114918: Workbench: Negative scaled sculpt mesh artifacts 2023-11-17 16:37:59 +01:00
Iliya Katueshenock 8149678d5e Geometry Nodes: use dynamic declaration for some nodes
This changes a bunch of nodes that have a data type drop-down to using a dynamic
node declaration that changes based on the selected data type instead of always having
all sockets. This greatly simplifies the code and is less weird than having suffixes on
socket identifiers.

Backward compatibility and forward compatibility remain due to #113497 and #113984.

One user-visible change is that changing the data type in these nodes does not break
the link anymore.

It may be necessary to bring back some functionality from link-drag-search afterwards.

Pull Request: https://projects.blender.org/blender/blender/pulls/113553
2023-11-17 16:23:34 +01:00
Christoph Lendenfeld a4f086ec1b Refactor: move autokeyframe_pose
No functional changes.

Move the function `autokeyframe_pose` from
`transform_convert_armature.cc` to `keyframing_auto.cc`

The function has a lot of overlap with `autokeyframe_object` so it
can potentially be simplified later on.

Pull Request: https://projects.blender.org/blender/blender/pulls/115051
2023-11-17 16:06:15 +01:00
Jacques Lucke e62179ce04 Fix: assert when running deform modifier tests in debug build
The issue was that `dco` had a different size than was expected
because it was intentionally larger than strictly necessary.
2023-11-17 13:10:51 +01:00
Germano Cavalcante e581dde40f Transform: remove restricted assert
`t-val` and `t->loc` can share same pointer, as long as `t->loc` is 3D.

This partially reverts 9dcf73c715
2023-11-17 08:55:27 -03:00
Christoph Lendenfeld 10fae637aa Refactor: Extract function to initialize a BezTriple
No functional changes.

The function `insert_vert_fcurve` also initialized a `BezTriple` from the flags it got.
Extract that logic into a separate function so it can be reused elsewhere

Pull Request: https://projects.blender.org/blender/blender/pulls/115039
2023-11-17 11:34:30 +01:00
Falk David a884968593 GPv3: Use immutable layer references
In `retrieve_editable_drawings` the code was using mutable pointers
to the layers when it could use immutable ones.
2023-11-17 10:43:12 +01:00
Falk David 143b891ff9 Fix: GPv3: Using current frame twice in multi-frame
The function that returns the frame numbers for a layer would
include the current frame twice if multi frame editing was used.
2023-11-17 10:43:12 +01:00
Bastien Montagne 21a54d5b58 Fix 'Make LibOverride' on Empty-instanced collection making everything editable.
Logic handling the 'make everything editable' option was wrong, this is
currently not exposed in 3DView operator, and should always be false.
2023-11-17 10:42:29 +01:00
Bastien Montagne 35cd6397d5 Fix 'Make LibOverride' from 3DView failing in some trivial cases.
Slightly non-trivial linked collections hierarchy could cause 'Make
LibOverride' operation from 3DView fail, reporting that more than one
potential root collections were found.

Logic here was way to simple, now this error should only happen when
there are effectively more than one potential 'good' root collection
(i.e. when two unrelated collections both contain (directly or not) the
selected objects(s).
2023-11-17 10:42:29 +01:00
Antonio Vazquez 00b04e1030 GPv3: Fix Remove Material Slot and Unused Slots
There was two problems because these operators were not supported in GPv3:

* If you remove the slot, the material was not reassigned and the material index attribute could get a wrong index. This also affected the unused slots.
* The Unused Materials operator was executed, but it was doing nothing because there was not support for new GPv3 object.

This PR adds support for new Grease Pencil object.

Pull Request: https://projects.blender.org/blender/blender/pulls/114850
2023-11-17 10:37:56 +01:00
casey bianco-davis 4dfed520a3 GPv3: Delete operator
Adds the delete operator to edit mode grease pencil, and also adds it to the delete menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/111571
2023-11-17 10:35:56 +01:00
Antonio Vazquez 39f30e848c GPv3: Show All Materials Operator
Adds the Show All Materials operator.

Also includes a refresh of despgraph when the hide prop changes.

Note: The actual render engine does not support hiding by materials.

Related to #114997

Pull Request: https://projects.blender.org/blender/blender/pulls/115001
2023-11-17 10:32:35 +01:00