Commit Graph

102408 Commits

Author SHA1 Message Date
Hans Goudey
fa34992def Cleanup: Remove unnecessary includes from C++ data structure headers
The hash tables and vector blenlib headers were pulling many more
headers than they actually need, including the C base math header,
our C string API header, and the StringRef header. All of this
potentially slows down compilation and polutes autocomplete
with unrelated information.

Also remove the `ListBase` constructor for `Vector`. It wasn't used
much, and making it easy to use `ListBase` isn't worth it for the
same reasons mentioned above.

It turns out a lot of files depended on indirect includes of
`BLI_string.h` and `BLI_listbase.h`, so those are fixed here.

Pull Request: https://projects.blender.org/blender/blender/pulls/111801
2023-09-01 21:37:11 +02:00
Harley Acheson
9f4b28bba8 UI: Highlight Selected Enum
Highlight the currently-selected item in enum, and some other, lists.

Pull Request: https://projects.blender.org/blender/blender/pulls/111074
2023-09-01 21:33:03 +02:00
Hans Goudey
e160a4ceca Fix: Memory leak with node interface forward compatibility
The runtime pointers are allocated when reading sockets,
they have to be freed when the legacy sockets are freed.
2023-09-01 15:30:19 -04:00
Hans Goudey
9fd4091f5b Fix: Incorrect assert in node tree interface copy
Panels could have parents if the parent was the root panel.
Anyway, the assert isn't really helpful here, better to keep that
just for higher level editing functions.
2023-09-01 15:30:19 -04:00
Hans Goudey
32ca4caaac Fix: Various crashes and issues dragging node group interface
Mostly the issues were because drag and drop moving to a different
index in the parent didn't take into account the root panel. Also add
a null check for safety similar to b36367e663.
2023-09-01 15:30:19 -04:00
Julian Eisel
781492fdb4 Refactor: Simplify outliner tree element creation using member function
With this, display modes and tree elements can add an element through
the tree-display object used for building the tree for this display
mode. This means we no longer have to pass the `SpaceOutliner` object
around, and we avoid boilerplate. Further such simplifications to the
tree element creations are planned and are easier now.

Also note that this centralizes the use of `SpaceOutliner`, so we can
more easily make tree-display and tree-element objects independent from
it. This could be useful for unit testing, for example.
2023-09-01 20:59:53 +02:00
Hans Goudey
b36367e663 Fix: Crash adding panel to node group
`move_to_parent` is called with a null parent by the Python code
that attempts to add new items to the active item if it's a panel.
2023-09-01 14:33:55 -04:00
Harley Acheson
8779f92e67 Cleanup: Make format
Just changes resulting from Make format.
2023-09-01 11:09:12 -07:00
Rawalanche
0e090369d6 Fix #109439: Use List Item widget colors for View Item widgets
As concluded in discussion under #109439, the View Item widgets are
supposed to use List Item widget theme colors. This patch does that.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111584
2023-09-01 20:02:20 +02:00
Julian Eisel
0a633a4e07 Refactor: Untangle confusing & unsafe outliner tree element data passing
The outliner tree element creation function passed a `void *idv`
argument and did weird and hard to follow stuff with it (like casting it
to `ID *` even though it wouldn't point to an ID, and further overriding
it based on the element type). This change tries to untangle this, so
that it's easy to follow what's going on, and so that a bunch of casts
from non-ID data to ID pointers are removed.

Basically the void pointer is split into an ID pointer for the owning ID
(if any) and a void pointer for custom data for the element creation.
This can be made type safe still, but that's for another commit. It also
allows us to remove some wrapper structs. The element creation function
itself no longer needs to know what kind of data is passed via the void
pointer. So this change has a number of benefits in fact.
Also improves/adds related comments.

Was quite careful to not cause behavioral changes.
2023-09-01 19:56:39 +02:00
Bastien Montagne
1bcd812a75 Fix (unreported) memory leak in Nodes versioning code.
Commit e071288ab2 do_version code was copying an allocated string from
old to new socket data, but not freeing it in the old data properly.

String can actually be moved directly from old to new data, instead of
duplicating it.
2023-09-01 19:31:39 +02:00
Bastien Montagne
bfdfde18e1 Fix invalid filedata passed to linked data for versioning.
Code would not keep filedata for read libraries long enough to be able
to pass along to the 'after_liblink' versioning code. Instead, it was
passing the main file data, leading to all kind of potential breakage in
versioning code, e.g. in case of checks on available DNA data.

Fix #111776.
2023-09-01 18:03:10 +02:00
Bastien Montagne
e3a8cd3141 Cleanup: Readfile: simplify internal library_link_begin code.
For private, internal code, there is no reason to pass a pointer of
pointer to the filedata.
2023-09-01 18:03:10 +02:00
Hans Goudey
3766084bf9 Cleanup: Remove unused BMesh include 2023-09-01 11:59:49 -04:00
Miguel Pozo
619f38514e Fix: Compilation error after 7e33c405fb 2023-09-01 17:36:30 +02:00
Hans Goudey
2a28112bb8 Fix #111698: Sculpt draws unchanged normals on first stroke
When entering sculpt mode, the normals cache is shared with the
evaluated mesh. `SharedCache::ensure()` un-shares the cache in order
to update it, so the pointers in the pbvh must be reset.
2023-09-01 11:29:19 -04:00
Miguel Pozo
7e33c405fb Fix: EEVEE-Next: Render Region
Fix render regions and make them work with overscan:
- Clarify and improve the naming used by the Film module.
- Convert Display texel coordinates to Film texel coordinates before
  calling `film_process_data`, and convert from Film texel coordinates to
  Render texel coordinates in `film_sample_get`.
- Returns the actual display extent (and not the film extent) in
 `Film::display_extent_get` so the overscan camera matrix is computed
  correctly when using render regions.

Regression caused by 567a2e5a6f.

Pull Request: https://projects.blender.org/blender/blender/pulls/111691
2023-09-01 17:15:38 +02:00
Harley Acheson
2dc1dcc43e UI: Slight reduction and centering of UI_BTYPE_SEPR_LINE
A small reduction in the vertical space used by the menu separating
rule. Also centers the line within its space. Looks more balanced when
used between titles and content.

Pull Request: https://projects.blender.org/blender/blender/pulls/111764
2023-09-01 17:12:48 +02:00
Germano Cavalcante
9c2e768f5b Snap: Show different symbols for different types
Add a set of symbols to improve visualization of different snap types.

- Circle: Represents snapping to a vertex.
- Two Aligned Lines: Represent snapping to an edge.
- Closed Aligned Square: Represents snapping to a specific part of an edge (center or perpendicular).
- Face-Aligned Circle with Midline: Represents snapping to a face.

Pull Request: https://projects.blender.org/blender/blender/pulls/109387
2023-09-01 17:08:07 +02:00
Germano Cavalcante
37bb00b245 Fix snap failing if target vertex is on same edge as the transformed one
7d54a756b9 did with only loose verties participating in the snap.
However, edges with a transformed vertices are ignored as well.
So some vertices may end up not participating in the snap.

Therefore, add then the vertices whose connected edge is being
transformed.
2023-09-01 11:40:33 -03:00
Nathan Vegdahl
ceb5981bff Versioning: move bone collection/color versioning to bumped subversion
Also bump the recorded minimum 3.6 subversion for opening files, to
correspond to a fix in the 3.6 branch that prevents bones from seemingly
disappearing when opening files with 4.x bone collections.
2023-09-01 16:11:28 +02:00
Miguel Pozo
fc0f2bd73e Workbench-Next: Support multiple samples for Viewport Image Render
Allow rendering multiple samples from a single draw callback.

Pull Request: https://projects.blender.org/blender/blender/pulls/111661
2023-09-01 15:57:21 +02:00
Miguel Pozo
3d7db929a4 Draw: draw_debug improvements
Allow using the drw_debug API in any shader file.
Remove the drw_debug API from Release builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/111710
2023-09-01 15:40:42 +02:00
Lukas Tönne
cf12d11de6 Fix #111713: Nodes crash when library overriding
Library overrides crashed with on trying to access the interface root
panel. The root panel should not be exposed through RNA, but also
accessing its position property should be allowed.

Several fixes here:
- Fix position property getter when the item has no parent panel
  (i.e. the root panel).
- Avoid infinite loops in the greedy override comparison: exclude the
  loopback parent property.
- Don't return the root panel via the parent property in the first
  place, just return nullptr.

Second attempt at fix, first one in #111755 broke the
bl_node_group_interface test due to incorrect handling of the nullptr
parent case (reverted by 68440742)

Pull Request: https://projects.blender.org/blender/blender/pulls/111782
2023-09-01 12:39:51 +02:00
Christoph Lendenfeld
d361d67e11 Fix: Cursor wrapping in Graph Editor slider operators
For operators that allow overshoot it is important that the cursor wraps,
so the user is not limited by the bounds of the screen.
This was missed on a few of the latest additions.

Pull Request: https://projects.blender.org/blender/blender/pulls/111785
2023-09-01 12:00:33 +02:00
Jacques Lucke
3ac5b64b20 Cleanup: remove unnecessary functions from public bake api 2023-09-01 11:50:13 +02:00
Jacques Lucke
7df19cfa67 Cleanup: remove unnecessary file
`BKE_simulation_state_serialize.hh` is not necessary anymore,
because the serialization is done at a lower level.
The functionality that lived there in the past is now part of
`BKE_bake_items_serialize.hh`.
2023-09-01 11:47:23 +02:00
Jacques Lucke
67bb0bd1a5 Cleanup: remove unused code 2023-09-01 11:47:23 +02:00
Weizhen Huang
b45dd4cfac EEVEE: change Principled BSDF to match Cycles
Ref: #99447

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111754
2023-09-01 11:28:12 +02:00
Jacques Lucke
da8ad3c2b6 Geometry Nodes: simplify bake state api
This introduces `BakeState` and `BakeStateRef` to replace
the use of `Map<int, BakeItem pointer>` in various places.
2023-09-01 11:25:36 +02:00
Jacques Lucke
f3a5d28e7e Cleanup: centralize bake file saving/loading 2023-09-01 11:25:36 +02:00
Weizhen Huang
be9555d118 EEVEE: change Glass BSDF to match Cycles
changes include:
* Use microfacet normal instead of macronormal. Previously Cycles used
macronormal for Glass BSDF and Transmission component in Principeld
BSDF, leading to artefacts at grazing angles. This has been corrected
in 5f9b518a8b and 89218b66c2. Now change EEVEE to match this behaviour.
* GGX distribution is now darker due to the shadowing-masking term,
while Multiscatter GGX preserves energy. This now matches Cycles too.

Pull Request: https://projects.blender.org/blender/blender/pulls/111687
2023-09-01 10:59:20 +02:00
Clément Foucault
05816e6f7a Fix GPU: MSL sources not considered by make format 2023-09-01 10:40:21 +02:00
Campbell Barton
523700030f Fix enabling experimental gpencil-v3 failing to refresh the keymap
Add an update function that ensures the key-configuration is reloaded.

Also prefer passing individual options instead of passing in
PreferencesExperimental to the key-map since it's no longer clear
which options impact shortcuts.
2023-09-01 14:31:06 +10:00
Campbell Barton
f99c6c8785 Cleanup: rename wmTimer struct members for clarity 2023-09-01 11:40:07 +10:00
Campbell Barton
18280b9a75 Cleanup: remove additional braces in switch statement 2023-09-01 11:39:49 +10:00
Campbell Barton
f79c9c4834 Docs: correct time_duration doc-string 2023-09-01 11:39:32 +10:00
Campbell Barton
cb582f82f6 Cleanup: remove redundant assignments
BLI_addtail doesn't require clearing links before adding
2023-09-01 11:38:09 +10:00
Campbell Barton
2a7b2e477f Fix potential non utf8 strings caused by truncation 2023-09-01 11:36:51 +10:00
Campbell Barton
c253d71c67 Fix ANIM_bonecoll_new using a temporary string for the allocation name
Use the function name instead.
2023-09-01 11:25:50 +10:00
Campbell Barton
23e8ffd72d Cleanup: various non-functional C++ changes, format 2023-09-01 11:19:44 +10:00
Campbell Barton
9b93164f09 Cleanup: remove unused variables 2023-09-01 11:18:47 +10:00
Campbell Barton
68440742ce Revert "Fix #111713: Nodes crash when overriding due to item.parent nullptr"
This reverts commit 2a94a99605.

This commit caused test `bl_node_group_interface` to fail.
2023-09-01 11:10:12 +10:00
Campbell Barton
8032ee9df2 Revert "Cleanup: Replace IO orientation enum with blenlib type"
This reverts commit 074dbf08cd.

This change caused PLY and OBJ tests not to compile,
even with the identifiers updated some OBJ tests fails
with different rotation values.
2023-09-01 10:35:14 +10:00
Germano Cavalcante
14a9c2b1aa Fix #111715: VSE: "Bounding Box Center" pivot point is the same as "Median Point"
The logic to calculate the bounds was missing.

Also add a notifier with `NC_SPACE | ND_SPACE_SEQUENCER` to update the
space.
2023-08-31 15:41:29 -03:00
Germano Cavalcante
d81a32dcaa UV: Deduplicate code that traverses each UV
The algorithm that traverses UV is a bit complex and is being iterated
a lot in different areas of the code.

This commit deduplicates this code by creating a foreach UV function.

At the moment only the `uvedit_ops.cc` file uses this function but
similar cleanups can also be done on many other files that use UVs.
2023-08-31 15:31:05 -03:00
Germano Cavalcante
91210d8172 Cleanup: Remove unused UV functions
The usages of `ED_uvedit_minmax` and `ED_uvedit_center_from_pivot` have
probably been replaced by `ED_uvedit_minmax_multi` and
`ED_uvedit_center_from_pivot_ex` in the process to support multi-object
editing and gizmo creation respectively.
2023-08-31 15:31:05 -03:00
Miguel Pozo
f70bb87dd1 Fix #111587: Enable SSBOs for Intel 4400/4600 GPUs 2023-08-31 20:27:55 +02:00
Harley Acheson
b122faf705 UI: Consistent Menu/Block/Popup Content Ordering
All Content is shown in natural top-down order regardless of where it
is initiated.

Pull Request: https://projects.blender.org/blender/blender/pulls/109798
2023-08-31 20:24:53 +02:00
Hans Goudey
bb181fb8f1 Cleanup: Remove redundant asserts about dirty normals
These asserts basically just reiterated the way things work-- there's no
no way for them to trigger with the current code. And even if they did,
that sort of change wouldn't happen by mistake, so it's not worth
an assert.
2023-08-31 14:22:22 -04:00