Commit Graph

102431 Commits

Author SHA1 Message Date
Clément Foucault
2aebfb596e Cleanup: EEVEE-Next: Rename G1 to G1_V to avoid confusion 2023-09-03 16:42:53 +02:00
Clément Foucault
2637bbf016 EEVEE-Next: Add LUT test
This avoid the generation code to become desync with
the precomputed tabled.

This is also a good way to test any changes to them.
2023-09-03 16:42:53 +02:00
Clément Foucault
7b54fce723 EEVEE-Next: Port LUT generation code
This ports the LUT using compute shader.
All LUT are computed by the same compute shader
to avoid boiler plate code to add new LUTs.

As for the generation code itself it is mostly the
same except for the use of `hammersley_2d` instead of
regular grid sampling. Regular grid did not improve
anything and was a bit more cumbersome.

This also bumps the number of samples very high
for more precision.

The new utility class for computing the LUT has
methods to write the content to a PFM image file
or as C++ array header.
2023-09-03 16:42:53 +02:00
Jacques Lucke
7d2c854261 Geometry Nodes: generalize modifier simulation cache storage names
The main goal here is to rename things in a way that makes sense for
simulation baking, but also for the upcoming bake node.

This also removes some versioning code from 3.6 which initialized the
default bake path. Baked data from back then can't be loaded anymore
anyway, and the way the default path is generated is different now as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/111845
2023-09-03 16:14:11 +02:00
Jacques Lucke
7f00cfeab4 Cleanup: move bake items code to separate namespace 2023-09-03 13:37:50 +02:00
Campbell Barton
e8c812a307 Cleanup: spelling in comments, update dictionary 2023-09-03 21:35:07 +10:00
Jacques Lucke
d1c2b45836 Geometry Nodes: rename bdata to blob
Blob stands for "binary large object" and is a known term. I used to use the term `bdata`
to mean "binary data", mainly because I didn't think of a better name. Blob is a much
better name as it captures the intend of those files much better.

This change breaks existing bakes, because I rename the folder from `bdata` to `blobs`.
I think that is ok, because I also just broke bakes two days ago in a larger refactor
(e92c59bc9b).

Pull Request: https://projects.blender.org/blender/blender/pulls/111822
2023-09-03 12:33:59 +02:00
Campbell Barton
3082037743 Cleanup: spelling in comments 2023-09-03 16:15:01 +10:00
Pratik Borhade
3d798e8486 Cleanup: Remove unused parameter
`relbase` is unsed after 1c0a1ae801
2023-09-03 10:22:20 +05:30
Clément Foucault
5ad7d81549 Cleanup: EEVEE-Next: Fix compilation warning and errors on Metal 2023-09-02 23:17:36 +02:00
Germano Cavalcante
7b0b2e4a5d Fix conditional logic in 'synced_selection' check
The conditional `(selected ? 0 : bm->totvert)` should be evaluated first.
2023-09-02 14:51:02 -03:00
Lukas Tönne
79a6a6977a Fix #111721: Node interface root panel flag missing
The file in question does not have the default (internal) root panel
flag for allowing child panels. This was probably saved before the flag
was added. A simple versioning snippet takes care of this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/111828
2023-09-02 15:58:19 +02:00
Lukas Tönne
7ddf1820ff Fix #111763: Incorrect string copy function for default_attribute_name
`default_attribute_name` is an allocated string, unlike most other strings in `bNodeSocket`.

Pull Request: https://projects.blender.org/blender/blender/pulls/111823
2023-09-02 14:07:54 +02:00
Bastien Montagne
2698dbd6a4 Also pass relevant filedata to versioning code in linking code.
Folloup to bfdfde18e1, forgot to add this for the linking/appending code
path (similar change to what was done for the main blendfile readfile code).
2023-09-02 12:55:25 +02:00
Philipp Oeser
b0d5f3dc22 Fix #111711: bone collection visibility cannot be overridden
Since the switch from bone layers to bone collections in
998136f7a7, visibility could not be
overridden anymore. Moreso, layer visibility could also be toggled even in linked
state in 3.6 [those changes get lost on file reload, but it was still
useful and expected behavior].

Both are now restored.

Pull Request: https://projects.blender.org/blender/blender/pulls/111775
2023-09-02 10:38:23 +02:00
Pratik Borhade
1c0a1ae801 Fix #109561: Overwrite existing imagepath based on relativepath property
Update the filepath of an image when it already exists in the main
storage. This is useful when `relative_path` property is changed and we
attempt to open the same image file again.

Also remove `is_relative_path` parameter. Not required anymore because
`range->filepath` is correctly set to absolute/relative. This is also
passed in `BKE_image_load_exists_ex` to set path to non-exiting image.

Pull Request: https://projects.blender.org/blender/blender/pulls/109815
2023-09-02 07:19:54 +02:00
Harley Acheson
a7ad0ad8fb UI: Theme Versioning for Enum Highlighting
Theme versioning to ListItem InnerSel required for highlighting
the selected Enum value from #111074.

Pull Request: https://projects.blender.org/blender/blender/pulls/111819
2023-09-02 05:33:13 +02:00
Hans Goudey
78495acaa0 Fix: Crash dragging node interface panels at root level
Similar to 32ca4caaac
2023-09-01 23:07:51 -04:00
Hans Goudey
840769d855 Cleanup: Small C++ changes to two tree view uses
- Use `this->` to access class methods.
- Follow style guide for class definition order.
- Avoid unnecessary namespace redefinition.
- Make data struct local to node interface file.
2023-09-01 23:07:51 -04:00
Hans Goudey
da0c7ca0c2 Cleanup: Correct outdated tree view item comment 2023-09-01 23:07:51 -04:00
Harley Acheson
afa71adbb1 UI: Improved Enum Title Determination
Show Enum titles if there is a non-blank label before on the same row.

Pull Request: https://projects.blender.org/blender/blender/pulls/111818
2023-09-02 05:03:56 +02:00
Vitor Boschi
f662d8acb0 PyAPI: Better error msg when re-using internal node id
Give a better error message when the user tries to register a node
having the same id as an internal one.
Before:
`RuntimeError: Error: Registering node class: 'NodeDummy', bl_idname 'NodeGroupInput' could not be unregistered`

After:
`RuntimeError: Error: Registering node class: 'NodeDummy', bl_idname 'NodeGroupInput' is an internal node`

This is a followup to #111615

Authored-By: @vitorboschi (Vitor Boschi)

Pull Request: https://projects.blender.org/blender/blender/pulls/111799
2023-09-02 04:41:07 +02:00
Iliya Katueshenock
4b899588eb Fix: Vert to corner topology map assert for mesh with no faces
Fix of mistake from 226359ec48. `reverse_indices_in_groups` is
used in other one function (`build_vert_to_corner_indices`), so handling of
empty corners array should be moved into itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/111815
2023-09-02 03:55:42 +02:00
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