Commit Graph

124605 Commits

Author SHA1 Message Date
Christoph Lendenfeld
98d48c16a3 Paint: Add loop select for faces
Add loop selection identical to the behavior of ALT+Click in Edit Mode.

* ALT click: select loop
* ALT Shift click: add loop while retaining current selection
* ALT Shift Ctrl click: deselect loop

Pull Request: https://projects.blender.org/blender/blender/pulls/107653
2023-06-01 14:58:58 +02:00
Hans Goudey
50bfe1dfe3 Geometry Nodes: Rewrite mesh delete geometry node
Replace the implementation of the separate and delete geometry nodes
for meshes. The new code makes more use of the `IndexMask` class, which
was recently optimized. The main goal is to make more of the work scale
with the size of the result mesh rather than the input. For example,
instead of keeping a map from input to output elements, the maps used
to copy attributes go from output to input elements.

The new implementation is generally 2-4x faster, depending on the mode
and the number of elements selected. The new code is also able to skip
more work when nothing is removed.

This also allows using more existing attribute interpolation code,
allowing the overall removal of over 300 lines. Some of the attribute
utilities from a similar change for curves (f63cfd8e289da0078266) are
reused directly.

The indices of the result changes, so the test file needs to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/108435
2023-06-01 14:55:21 +02:00
Hans Goudey
c5694fdf10 Cleanup: Use unique_ptr, references for UV aabb islands
Using unique_ptr is typically the better practice since it makes memory
management automatic and makes ownership clear. Also use references
when retrieving items from the span, and don't unnecessarily specify
specific lambda captures.

Pull Request: https://projects.blender.org/blender/blender/pulls/108510
2023-06-01 14:13:28 +02:00
Almaz Shinbay
8374208a57 Outliner: Port curve 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 tree-element class for curve IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/108498
2023-06-01 12:43:59 +02:00
guishe
f957fd227e Fix: Avoid windows.h min/max macro definition in BLI_winstuff.h
When moving io_allembic to c++, the compiler would throw the error
`type "unknown-type" unexpected`.

Pull Request: https://projects.blender.org/blender/blender/pulls/108471
2023-06-01 12:26:34 +02:00
Campbell Barton
d3e5c1bfa6 Merge branch 'blender-v3.6-release' 2023-06-01 18:15:36 +10:00
RedMser
6bea428b7f UI: Incorrect add-ons button label in preferences
"Remove addon" button was in the row labeled "Internet", which is
misleading when no documentation buttons appears in the same row.

Now a separate row is created instead.

Ref !108429.
2023-06-01 18:14:34 +10:00
Campbell Barton
532560eba3 Merge branch 'blender-v3.6-release' 2023-06-01 17:03:49 +10:00
Campbell Barton
db1344530f Cleanup: unused argument warning 2023-06-01 16:33:10 +10:00
Chris Blackbourn
63f2114759 Merge branch 'blender-v3.6-release' 2023-06-01 11:53:58 +12:00
Chris Blackbourn
f87f119c2f UV: Update ui for the uv pack islands operator
Reorder options and improve naming for UV Pack Islands

Update names of constants to match names in the UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/108253
2023-06-01 01:45:07 +02:00
Chris Blackbourn
69ae7500d0 Merge branch 'blender-v3.6-release' 2023-06-01 11:34:47 +12:00
Chris Blackbourn
f78d1fd114 Fix memory leak during uv packing
Regression from [0].

[0]: 91020ccde15a4d473e2b6360e96b660384a47ae5
2023-06-01 11:29:06 +12:00
Iliya Katueshenock
a63c0a8fca Fix: Crash in 2.8 versioning after recent cleanup
Fix a mistake in 30a25a42e64daf697d8.

Pull Request: https://projects.blender.org/blender/blender/pulls/108476
2023-05-31 19:12:06 +02:00
Almaz Shinbay
f63c3075cb Outliner: Port mesh 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 tree-element class for mesh IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/108437
2023-05-31 18:43:46 +02:00
Falk David
b14cdb440a GPv3: Add operator to create new grease pencil object
This adds the operator `OBJECT_OT_grease_pencil_add` to create a new grease pencil object.

Currently it supports the `EMPTY` and `STROKE` type.
This also replaces the add menu for the legacy grease pencil type in the Shift+A menu when the experimental option is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/108462
2023-05-31 18:00:26 +02:00
Miguel Pozo
4808856dc2 Draw: Fix: Clear layer_views_ on Texture::free() 2023-05-31 17:54:29 +02:00
Falk David
e18325b2b9 GPencil: Fix memory leak when creating layers
Use `MEM_new` and `MEM_delete` to allocate and free the memory.
2023-05-31 17:37:54 +02:00
Julian Eisel
06be652055 Cleanup: Clang-format 2023-05-31 17:18:20 +02:00
Hans Goudey
49b48209e7 BLI: Improve IndexMask::complement() performance
IndexMask::complement() is often used in geometry processing
algorithms when a selection needs to be inverted, mostly just in
curves code so far.

Instead of reusing `from_predicate` and lookup in the source mask,
scan the mask once, inserting segments between the original indices.

Theoretically this improves the performance from O(N*log(N)) to O(N).
But with the small constant offset of the former, the improvement is
generally just 3-4 times faster. However in some cases like empty
and full masks, the new code takes constant time.

![image](/attachments/d2f6b0be-f195-4206-9bf4-c0ab20041d1b)

Pull Request: https://projects.blender.org/blender/blender/pulls/108331
2023-05-31 17:11:04 +02:00
Julian Eisel
ad50eedb16 Cleanup: Remove unused argument in recursive function
Was just passing this to its own recursive call.
2023-05-31 17:05:46 +02:00
Sergey Sharybin
83ffc108e4 Merge branch 'blender-v3.6-release' 2023-05-31 16:49:22 +02:00
Sergey Sharybin
8bd14cb3aa Update the copyright.txt
This is the copyright file which is distributed with the
official Blender builds distributed via blender.org project,
with the intent to indicate that the build is done by the
blender foundation.

This change makes the file shorter, avoiding stating agreements
in the file itself, and instead referring to the license.

This matches more closely to how other open source projects
tackle the COPYING file.

The updated content has been reviewed by Ton.

Ref #107295
2023-05-31 16:43:55 +02:00
Sergey Sharybin
eb9209c1f5 Cleanup: Deprecation warning in the FFmpeg
Since avuitl 57.30.100 the pkt_duration is deprecated, and
the duration is to be used instead.

The units seems to match, and also from the avcodec decoder.c
the `frame->pkt_duration = frame->duration;` so does not seem
we need to do any conversion.

The change in FFmpeg is from 2022, which is a bit recent, so
the access to the duration is hidden behind a compatibility
API.

Pull Request: https://projects.blender.org/blender/blender/pulls/108451
2023-05-31 16:41:47 +02:00
Sergey Sharybin
c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Bastien Montagne
5251f9d877 Merge branch 'blender-v3.6-release' 2023-05-31 15:44:21 +02:00
Bastien Montagne
9f1a4a2e3f Fix (studio-reported) LibOverride from Outliner not working well.
In case a part of an override hierarchy would still be linked data, and
there would be other liboverride hierarchies sharing usage of that same
linked data, trying to create a partial override of that linked data
into a hierarchy would create very unreliable results.

This commit now only process each ID at most once, to ensure that the
liboverride will only be put in one liboverride hierarchy.

This is only a partial fix, results now should at least always be
valid. However, due to inheritently broken Outliner code when it comes
to same data in more than one path of the tree, the place where
(hierarchy in which) the new liboverride will be created is currently
'random' and unpredictable from user perspective.

This commit contains some code to try to alliviate that (by enforcing
processing of the active elements first), but unfortunately this does
not work either.
2023-05-31 15:31:45 +02:00
Bastien Montagne
12a52c03c8 Fix (unreported) liboverride creation glitches:
- Do not remap local liboverrides from other hierarchies when a
   liboverride hierarchy root is provided (such that in case a linked
   data is overridden as part of one hierarchy, the new liboverride does
   not get assigned to other liboverride hierarchies of the same reference
   data).
 - Do not attempt to instanstiate newly overridden collections or objects
   when they are part of a hierarchy and not the root of that hierarchy
   (as they can be sondiered as already handled through that hierarchy
    processing). Avoids attempts to instantiate them when doing partial
   liboverride into an already existing hierarchy.
2023-05-31 15:27:14 +02:00
Soeren Schmidt-Clausen
fdc3ed798d Geometry Nodes: Add Corners of Edge node
Adds the "Corners of Edge" topology node to geometry nodes.
Combining this node with the "Face of Corner" node allows getting
informations about the faces connected to an edge. The behavior is
slightly non-obvious-- the node only gives the corner neighbors
that come *before* the current edge in directly neighboring faces.
This allows the operation to be easily reversed and reduces
redundancy between nodes.

See the devtalk thread: https://devtalk.blender.org/t/29379

Pull Request: https://projects.blender.org/blender/blender/pulls/107968
2023-05-31 15:25:48 +02:00
Iliya Katueshenock
1706ce032f Fix #108456: Missed declaration function in Shortest Edge Paths node
2ffd08e952 introduced new system to control attribute life time.
Some specific function for that system is missed in `Shortest Edge Paths`.
This pull request add this functions:
1. `reference_pass_all` for socket declarations.
2. `for_each_field_input_recursive` for field input nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/108460
2023-05-31 15:21:06 +02:00
Bastien Montagne
688e63f950 Fix (unreported) BKE add_collection allowed to add to liboverride.
Probably typo, should check if collection is a liboverride, not if its
liboverridable.
2023-05-31 15:12:03 +02:00
Philipp Oeser
eae0a24afb Merge branch 'blender-v3.6-release' 2023-05-31 15:02:19 +02:00
Philipp Oeser
eb4ea0b51d Fix #108266: sculpt auto created color attribute not set as render color
When entering sculpt mode on an object without any color attributes and
starting to paint, the newly created color attribute was set active, but
not default (camera icon).

Now set it default as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/108271
2023-05-31 15:00:39 +02:00
Campbell Barton
37e8147da0 Cleanup: clang-tidy files in uvedit 2023-05-31 19:58:08 +10:00
Sergey Sharybin
0eecf63907 Cleanup: unused variable warnings
Pull Request: https://projects.blender.org/blender/blender/pulls/108450
2023-05-31 11:51:44 +02:00
YimingWu
397663a7cb Fix #107956: Simulation reset on fps change
Resets simulation cache when frame rate changes, so we don't get
inconsistent accumulations when frame rate is changed in the middle of
the simulation.

Pull Request: https://projects.blender.org/blender/blender/pulls/108004
2023-05-31 10:05:58 +02:00
Campbell Barton
c8ed927eac Cleanup: use nullptr and function style casts for numbers 2023-05-31 17:33:20 +10:00
Campbell Barton
623a40b9d0 UV: move editor files to C++
For the most part this simply resolves build warnings for C++
although BLI_array.h has been replace by blender::Vector.
2023-05-31 17:31:08 +10:00
Campbell Barton
f80e2c9f93 Cleanup: remove redundant struct qualifiers in 'uvedit' 2023-05-31 17:12:31 +10:00
Campbell Barton
e2cb52594a code_clean: add 'remove_struct_qualifier' edit
Removes struct qualifier when it's not needed.
2023-05-31 17:12:19 +10:00
Aras Pranckevicius
3672f9c437 Tests: add PLY import test coverage for #107299 2023-05-31 10:01:42 +03:00
Aras Pranckevicius
86b54a3015 Merge branch 'blender-v3.6-release' 2023-05-31 09:44:28 +03:00
Aras Pranckevicius
e097415c2c Fix #107299: new PLY importer does not skip unknown custom data elements
Properly skip any unknown/unrecognized custom data elements,
fixes #107299.
2023-05-31 09:43:56 +03:00
Campbell Barton
bdc79caf0e Cleanup: use EXIT_SUCCESS/FAILURE from calls to exit()
Missed from 4408fea0928e614951bdab1a9084dd14ee2959e2.
2023-05-31 15:30:19 +10:00
Campbell Barton
4408fea092 Cleanup: use EXIT_SUCCESS/FAILURE from calls to exit() 2023-05-31 14:01:39 +10:00
Campbell Barton
bd23eb4742 Merge branch 'blender-v3.6-release' 2023-05-31 13:51:59 +10:00
Campbell Barton
5242f442a5 Fix crashes accessing freed memory from the material clipboard
Follow up to [0], some material data wasn't accounted for.

- The embedded node-tree's owner_id wasn't set.
- Animation data (both the material & it's embedded node-tree).
- Updating depsgraph relations is needed when animation data is freed
  as part of paste too.

Also report when paste fails.

[0]: 5b5a1e358102cb14eb9b0e60c91a5a41f50b62ec
2023-05-31 13:51:10 +10:00
Campbell Barton
3f253af0fb Merge branch 'blender-v3.6-release' 2023-05-31 13:25:26 +10:00
Campbell Barton
f5ad77adbf Fix material copy-buffer memory leak on exit
Commented [0] (2.5x refactor that disabled many free functions),
for some reason this call was never re-enabled.
Add back the free call along with other clipboard buffers.

---

Cherry picked [1] from main as other fixes material clipboard
are difficult to validate when memory is leaking.

[0]: a1c8543f2acd7086d412cb794b32f96794b00659
[1]: cb0c4f04d4b318963158a1a2707b259c49e210e5
2023-05-31 13:22:50 +10:00
Campbell Barton
12e5241876 BKE_main: simplify & update debugging block for tracking freed ID's
Use a macro to make the ID-free switch more compact & use ID indices
for better readability. Also typedef the enum so missing types in the
switch will report compiler warnings.
2023-05-31 13:22:48 +10:00