Commit Graph

98462 Commits

Author SHA1 Message Date
Campbell Barton
2de2db0f79 Cleanup: BLI_array_store comments, use const variables 2023-03-23 10:52:40 +11:00
Campbell Barton
274c554f4c BLI_array_store: avoid unnecessary memcmp when detecting duplicates
Memory chunks that were in the same hashed bucket but had different keys
were comparing memory unnecessary.

In practice this didn't happen all that often in my tests so the
performance improvement isn't significant.

Follow up to 4f10800094.
2023-03-23 10:52:38 +11:00
Hans Goudey
6addd195fa Fix: Unused variables mistake from previous commit 2023-03-22 17:58:06 -04:00
Hans Goudey
73d0531f50 Cleanup: Remove mesh poly macros, simplify loops
These `ME_POLY_LOOP_PREV` are redundant, since they're similar to
the `poly_corner_prev` inline functions. They were also confusing,
since they took an index into the poly and returned an index into
the entire corner range. Instead structure code to use the function
version, and simplify some loops in the process.
2023-03-22 17:48:07 -04:00
Hans Goudey
ce140c1b15 Cleanup: Remove unused polys variable 2023-03-22 17:15:30 -04:00
Hans Goudey
5c3f4195b6 Cleanup: Move poly topology lookup functions to C++ header
Standardize naming, use spans and references for input parameters,
and improve documentation. Now the functions expect the lookups to
succeed as well, they will fail and assert otherwise.

The functions are also simple enough that it likely makes sense to keep
them all inlined
2023-03-22 17:11:41 -04:00
Hans Goudey
59050f3fdd Cleanup: Make SculptSession a C++ only type
This allows adding spans, arrays, etc. directly to SculptSession, which
simplifies accessing mesh data, especially in #105938. A few files
aren't moved to C++ yes, so I had to add three C accessor functions.
2023-03-22 17:11:41 -04:00
Julian Eisel
a2d0f7049a UI: Generalize drop target API, support drop targets for UI views
Previously UI view items would support custom drop controllers (so they
could react to data being dragged over them and dropped). This is now
more generalized so the views themselves can do this as well.

Main changes:
- Support calculating a bounding box for the view, so this can be used
  for recognizing mouse hovering.
- Rename "drop controller" to "drop target", this is more clear, less
  abstract naming.
- Generalize drop controllers/targets. There is a new
  `ui::DropTargetInterface` now.
- Add support for drop targets in the `ui::AbstractView` base class, so
  custom views can use this.

Pull Request: https://projects.blender.org/blender/blender/pulls/105963
2023-03-22 18:45:35 +01:00
Brecht Van Lommel
15c673175d Merge branch 'blender-v3.5-release' 2023-03-22 18:20:40 +01:00
illua1
b0045cc797 Fix #106002: crash when passing field into Switch node when it doesn't support it
Pull Request: https://projects.blender.org/blender/blender/pulls/106006
2023-03-22 17:54:27 +01:00
Jeroen Bakker
8b2d959344 Cleanup: Remove references to Blender 3.7.
Blender 3.7 is skipped. Update references to this release
to Blender 4.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/106003
2023-03-22 16:24:26 +01:00
Campbell Barton
35b69c578c Merge branch 'blender-v3.5-release' 2023-03-23 01:12:18 +11:00
Campbell Barton
4f10800094 Mesh: optimize edit-mesh undo with selection (address #105205)
BLI_array_store still performed poorly for boolean arrays or any arrays
where many memory chunks had identical contents since the temporary hash
had many collisions, making lookups slow.

Resolve by ensuring duplicate chunks aren't added to the hash table.

Also increase the memory chunk size for edit-mesh undo to 64kb
which performs well with high poly meshes as it reduces the overhead of
having to manage many small memory chunks.

Notes:

- Before this change performance was quite bad (10-20x worse than v3.3).
- Performance from the test in #105046 is roughly the same as before.
- Performance of #105205 compared with v3.3 is close, even faster at
  times but varies much more (likely caused by threading).
2023-03-23 01:09:35 +11:00
Brecht Van Lommel
a36841af13 Merge branch 'blender-v3.5-release' into main 2023-03-22 14:21:28 +01:00
Shane Ambler
0e6cc4f86a Build: changes needed to build on FreeBSD
* Fix SDL not finding Xlib.h
* Link to clangSupport library for newer LLVM versions
* Add FreeBSD essential symbols to symbols_unix.map

Pull Request: https://projects.blender.org/blender/blender/pulls/105892
2023-03-22 14:15:46 +01:00
Hans Goudey
40bd35c9c4 BLI: Add dirty and cached checks to shared cache
While these aren't needed that often, it can be helpful to avoid
using a cache if it isn't necessary and it doesn't already exist.
2023-03-22 08:50:27 -04:00
Sergey Sharybin
95a4049633 Cleanup: Unused private fields
Pull Request: https://projects.blender.org/blender/blender/pulls/105988
2023-03-22 12:44:11 +01:00
Hans Goudey
7c952d6d15 Cleanup: Avoid unused includes in EnumerableThreadSpecific header 2023-03-22 07:43:26 -04:00
Sergey Sharybin
ad96939a66 Fix warning in points to volume node
Strict compiler was generating possible-uninitialized warning.

Added an explicit initialization and asserts to solve the noisy
output and catch possible errors early on.

Pull Request: https://projects.blender.org/blender/blender/pulls/105990
2023-03-22 12:35:19 +01:00
Shane Ambler
c21b534680 Build: skip installing .gitea files, deduplicate code
* With the move to gitea, .gitea doesn't need to be copied into installs.
* Add .github and .gitignore in more places for future proofing.
* Deduplicate ìnstall_dir macro.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/105980
2023-03-22 12:29:26 +01:00
Brecht Van Lommel
69ba34fa21 Merge branch 'blender-v3.5-release' 2023-03-22 10:55:46 +01:00
Jason Fielder
f73d1ddce4 Fix #104266: Metal AMD refractions
Workaround for compiler issue on AMD
platforms resulting in the erroneous
discarding of valid rays in fragment
raytracing.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/105967
2023-03-22 09:57:30 +01:00
Martijn Versteegh
466cad8bfb Python API: Add deprecation warning to MeshUVLoop
Add ui_text to the MeshUVLoop python struct definition containing a
deprecation warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/105970
2023-03-22 09:11:44 +01:00
Campbell Barton
e4300bbf2d Cleanup: quiet warnings by using system-includes for ./extern/
extern/json & extern/fmtlib reported warnings with GCC 12.2.1.
As these libraries aren't maintained as part of Blender, treat them as
system-includes.
2023-03-22 14:18:14 +11:00
Campbell Barton
3afe88b6c7 Cleanup: cmake indentation 2023-03-22 14:14:15 +11:00
Campbell Barton
ca08de5de4 PyAPI: raise an exception when removing an AOV which is not found
This is in keeping with how other remove functions behave.
2023-03-22 14:08:09 +11:00
Alexander Revkov
a1f52a02a8 Mesh: Set bounds eagerly for spherical and cylindrical primitive nodes
Eager bounds calculation for cylindrical and spherical primitive nodes,
implemented in constant time rather than as a loop over all positions.
Takes into account the segments count of the circle from which they
are constructed. Solution of the task #105551.

Pull Request: https://projects.blender.org/blender/blender/pulls/105743
2023-03-21 22:38:40 -04:00
Campbell Barton
2ba1556e69 Cleanup: spelling in comments, use doxygen syntax 2023-03-22 12:22:55 +11:00
Chris Blackbourn
99ecd6a900 Cleanup: Skip copying data between C++ and C
No functional changes.
2023-03-22 14:11:54 +13:00
Campbell Barton
075baf895e Fix building in debug mode 2023-03-22 12:04:38 +11:00
Chris Blackbourn
d2b502f213 Cleanup: Following naming convention and more const
Adding "_" suffix on private member variables.
Add const qualifier where possible.

No functional changes.
2023-03-22 13:06:27 +13:00
Chris Blackbourn
64ef514ec9 Cleanup: format 2023-03-22 12:48:04 +13:00
Hans Goudey
dd7e1a3574 Fix: Hide corner vert and edge attributes in UI
These are meant to be like other low-level attributes--
hidden from the UI, at least by default. This was just
missing from the initial commit that added these
because seeing them was useful for debugging.
2023-03-21 18:30:51 -04:00
Germano Cavalcante
45379d9b59 Fix (unreported): Snap not enabled if Ctrl is pressed before operation
Regression introduced by 88e2542398.

The transform operator has a special way of detecting when the snap
modifier is pressed before the modal.
2023-03-21 19:17:25 -03:00
Hans Goudey
dab0ab673e BLI: Add a default constructor to OffsetIndices
Though it's not common, sometimes it is necessary to declare this class
without immediately assigning a value, and `Span` already supports this.
2023-03-21 16:53:57 -04:00
Martijn Versteegh
45a05d351d Python API: Add deprecation warning to MeshUVLoop
Add ui_text to the MeshUVLoop python struct definition containing a
deprecation warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/105970
2023-03-21 21:05:24 +01:00
Bastien Montagne
5bb4d733a6 Fix (unreported) potential invalid memory access in BKE_main_collection_sync_remap.
After remapping there is no guarantee that collections' parent pointers
are still valid, so using these to free the object cache of all the
collections' ancestors is potentially accessing invalid memory.

Further more, it is noticiably inefficient, as a same collection may be
processed many times.

So instead, introduce (and use in resync case) a new
`BKE_main_collections_object_cache_free`, which iterates over all
collections of given Main and only free their own cache.
2023-03-21 18:38:04 +01:00
Jacques Lucke
e858be84fa Cleanup: move space_action folder to c++
I'm doing this because I want to work on the timeline integration for
simulation nodes caching. Also see #103343 for more info regarding moving
files to C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/105962
2023-03-21 17:49:23 +01:00
Hans Goudey
711a830ede Fix #105949: Uninitialized array used when counting material triangles
Mistake in 5256b2ca62. Return the array by value so the
caller doesn't have to know about the need for zero initialization.
2023-03-21 12:04:51 -04:00
Sybren A. Stüvel
45c1deac4f Bone relation lines: optionally draw between bone heads
Add control over how bone relation lines are drawn. Instead of always
drawing from the head of the child to the tail of the parent, give users
a choice for the parent side of the line. This can now be toggled
between the head and the tail of the bone, where the tail is Blender's
original behaviour and is retained as default value.

Pull request: https://projects.blender.org/blender/blender/pulls/105427
2023-03-21 15:16:13 +01:00
Omar Emara
04d128f545 Fix: Realtime compositor outputs wrong EXR passes
The Image node in the realtime compositor will output wrong passes if multiple passes are used at the same time. This is because images can only store a single layer, pass, and view at a time. Furthermore, they rely on operators and RNA callbacks to invalidate the cache when a different layer, pass, or view is requested. In effect, when the image node requests multiple passes at the same time without any kind of cache invalidation, wrong passes are output.

While a proper fix is to allow caching of multiple layers, passes, and views at the same time. This patch implements a temporary workaround by explicitly ensuring an up-to-date cache through a call to BKE_image_ensure_gpu_texture() when before requesting a GPU texture.

Pull Request: https://projects.blender.org/blender/blender/pulls/105547
2023-03-21 14:57:12 +01:00
Damien Picard
2ce23b069e I18n: Translate Node Add menus generated from asset files
The Node Add menu can have special submenus containing node assets.
These submenus are generated by parsing the asset blend files from
release/datafiles/assets, and the interface drawing is specific to
these menus.

This commit enables the translation of these dynamic menus, including
their names and the description of the operators.
2023-03-21 12:41:10 +01:00
Damien Picard
c73ae00cfc I18n: translate painting error message
An error message in paint mode is built out of several possible
components, depending on what is missing in the context for the
painting operation to work.

The main message was properly extracted, but not its individual
possible components.

Although such composite messages should generally not be used, in this
case I'm not sure it's worth it writing 15 different messages with all
possible combinations.
2023-03-21 11:40:21 +01:00
Chris Blackbourn
79a6fd57bc UV: Reduce round-off error during UV Packing in Geometry Nodes
Migrate #mul_v2_m2_add_v2v2 to `blender::geometry::`
2023-03-21 21:56:49 +13:00
Campbell Barton
db762d5508 Cleanup: various C/C++ code cleanups, use utility macros 2023-03-21 19:47:21 +11:00
Chris Blackbourn
e0d05da826 UV: Add option to Pack UVs using the xatlas strategy
Loosely based on the "xatlas" algorithm.
See https://github.com/jpcy/xatlas

Adds `shape_method` with ED_UVPACK_SHAPE_AABB, ED_UVPACK_SHAPE_CONVEX
and ED_UVPACK_SHAPE_CONCAVE

Ref #68889, #105680

Pull Request: https://projects.blender.org/blender/blender/pulls/105821
2023-03-21 09:15:06 +01:00
Jeroen Bakker
16275ca1de Cleanup: Remove unused const. 2023-03-21 08:43:41 +01:00
Jeroen Bakker
242dfbcd75 Code-style formatting. 2023-03-21 08:27:48 +01:00
Habib Gahbiche
8bfe34b285 Fullframe compositor: support backdrop offset for viewer node
Translating an image in fullframe compositor now also translates
the backdrop image for the viewer node.

Attached gif shows the behavior. Notice how gizmo moves with correct
values with the image but the frame stays to indicate what will get
rendered.

Note: This patch is a continuation of [D12750]
(https://archive.blender.org/developer/D12750). In a previous patch,
display offset on screen was not computed correctly. This has now
been fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/105677
2023-03-21 08:27:05 +01:00
Remy Fayet
439beb20c3 UI: Clicking camera icon while rendering should open render window
During rendering, clicking on the Camera icon of the jobs panel
should focus or open a Render Window.

Pull Request: https://projects.blender.org/blender/blender/pulls/105765
2023-03-21 07:53:31 +01:00