Commit Graph

102387 Commits

Author SHA1 Message Date
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
Hans Goudey
74bd927f7c Cleanup: Remove unnecessary/wrong solidify modifier normal recalculation
This modified the original normals cache, which is a more obvious error
now that the cache is shared between meshes. The goal of the code was
to reduce unnecessary calculation of normals in the result, but this is
not necessarily faster, and not worth the complexity, especially in an
already very complex area.
2023-08-31 14:15:28 -04:00
Hans Goudey
d600a38e44 Cleanup: Fix warning from mistaken copying od node tree
Mistake in 1e81d35138.
2023-08-31 14:08:55 -04:00
Hans Goudey
b81a257059 Fix: Build error after previous commit
Somehow variable rename went missing in these two places.
2023-08-31 14:05:37 -04:00
Hans Goudey
2228006d5b Subdiv: Use index instead of pointer for grid to face map
Switch from face pointers to indices, with the following benefits:
- Halve memory usage required for array (saves 16 MB with 1 million quads).
- Allow better code reuse with index-based utilities.
- Ease future replacement of `SubdivCCGFace` with mesh's face offsets.
- Allow future replacement of array with `Mesh::corner_to_face_map()`
- Potentially lower memory bandwidth required during multires evaluation
- Simplify retrieval of index in `BKE_subdiv_ccg_grid_to_face_index`.

For clarity, `gridfaces` was renamed to `grid_to_face_map`.

Pull Request: https://projects.blender.org/blender/blender/pulls/111078
2023-08-31 19:40:39 +02:00
Hans Goudey
074dbf08cd Cleanup: Replace IO orientation enum with blenlib type
This helps to document standard behavior, improves type
safety, reduces code duplication, and gets us closer to being
able to remove some of the older C math API.
2023-08-31 13:29:52 -04:00
Jacques Lucke
41bf578182 UI: support context dependent menus (aka assets) in menu search
The node add menu contains assets. The position of an asset in the menu
is determined by the catalog it's in. Submenus are generated automatically.
This works by having a context dependent menu (`NODE_MT_node_add_catalog_assets`).
The current catalog path is passed in as context. If the menu has submenus,
the sub-catalog paths are passed as context into those.

This generally works fine when using the menu. However, menu-search (F3)
does not support context dependent menus yet, so those menu entries are
just skipped. With this patch, the previously skipped context dependent menu
entries are also taken into account.

Note, when opening the search directly after opening Blender, the assets might
still be loading and therefor don't show up in the search.

Pull Request: https://projects.blender.org/blender/blender/pulls/111752
2023-08-31 18:56:57 +02:00
Lukas Tönne
2a94a99605 Fix #111713: Nodes crash when overriding due to item.parent nullptr
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.

Pull Request: https://projects.blender.org/blender/blender/pulls/111755
2023-08-31 18:52:56 +02:00
Hans Goudey
78dd7d91c4 Cleanup: Move IO headers to C++
See #103343
2023-08-31 12:52:04 -04:00
Jacques Lucke
eb3b55f2a7 UI: build menu search parent tree eagerly
Previously, a separate map was build that maps menu types
to their drawing info. This worked fine, but is incompatible
with context dependent menus (#111752).

Now, the menu parent tree is build eagerly which avoids the
need for the additional map. This also makes it easier to integrate
menus that use `menu_create_func`.
2023-08-31 18:26:51 +02:00
Miguel Pozo
8ea2364e36 Fix: Workbench-Next: Image Render crash 2023-08-31 18:07:18 +02:00
Hans Goudey
ceb3d75c18 Cleanup: Use const for context store variables
Generally the context store is owned by `uiBlock`. Other pointers
to the store (in `bContext` and other operator data) shouldn't change
it, so those variables are now const. One exception is the pointer in
`uiLayout`, but that has a clearly short lifetime, so that's okay.
2023-08-31 12:00:04 -04:00
Hans Goudey
feb14a4d38 Cleanup: Simplify bContextStore API with C++ concepts
Remove the need for `CTX_store_copy` and `CTX_store_free` by using
C++ copy constructors, unique pointers, and `std::optional`. A few types
are made non-trivial to support this.
2023-08-31 12:00:04 -04:00
Hans Goudey
1763a46cbf Cleanup: UI: Store uiBlock context stores in vector instead of list
Also fix an issue where contest stores were copied with the "used"
flag set after 7d7e90ca68.
2023-08-31 12:00:04 -04:00
Christoph Lendenfeld
9d0aed6589 Animation: Shear operator for Graph Editor
This is a combination of two PRs from Ares Deveaux: #106521 and #106522

This adds a new operator that allows shearing keys
based on the position of the segment ends.
By pressing `D` while the operator is in modal you can
switch if the operator takes the left or the right segment end as a reference.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111735
2023-08-31 17:09:01 +02:00
Bastien Montagne
d6ae841806 LibOVerride: Add resync callback to RNA (python) API of LibOverride data.
Essentially calls `BKE_lib_override_library_resync`, with either to
current ID as resync root for a partial resync, or the actual hierarchy
root for a complete resync of the whole hierarchy.
2023-08-31 16:46:25 +02:00
Jacques Lucke
e92c59bc9b Geometry Nodes: refactor simulation storage and how simulation nodes access it
Goals of the refactor:
* Internal support for baking individual simulation zones (not exposed in the UI yet).
* More well-defined access to simulation data in geometry nodes. Especially, it
  should be more obvious where data is modified. A similar approach should also
  work for the Bake node.

Previously, there were a bunch of simulation specific properties in `GeoNodesModifierData`
and then the simulation input and output nodes would have to figure out what to do with that
data. Now, there is a new `GeoNodesSimulationParams` which controls the behavior of
simulation zones. Contrary to before, different simulation zones can now be handled
independently, even if that is not really used yet. `GeoNodesSimulationParams` has to be
subclassed by a user of the geometry nodes API. The subclass controls what each simulation
input and output node does. This some of the logic that was part of the node before, into
the modifier.

The way we store simulation data is "transposed". Previously, we stored zone data per
frame, but now we store frame data per zone. This allows different zones to be more
independent. Consequently, the way the simulation cache is accessed changed. I kept
things simpler for now, avoiding many of the methods we had before, and directly
accessing the data more often which is often simple enough. This change also makes
it theoretically possible to store baked data for separate zones independently.
A downside of this is, that existing baked data can't be read anymore. We don't really
have compatibility guarantees for this format yet, so it's ok. Users will have to bake again.
The bake folder for the modifier now contains an extra subfolder for every zone.

Drawing the cached/baked frames in the timeline is less straight forward now. Currently,
it just draws the state of one of the zones, which usually is identical to that of all other
zones. This will change in the future though, and then the timeline drawing also needs
some new UI work.

Pull Request: https://projects.blender.org/blender/blender/pulls/111623
2023-08-31 16:28:03 +02:00
Pratik Borhade
daa4c0f91e Fix: set default bone collection active
Bone collection added by default along with the armature is not marked
as active. Visually this looks active but actually it's not (hover over the
properties like remove/move)

Also, when a new collection is added, mark that collection active.

Pull Request: https://projects.blender.org/blender/blender/pulls/111733
2023-08-31 16:26:57 +02:00
Christoph Lendenfeld
05f8d61ec6 Fix: Blend to Ease keyframes property name
The factor property of the "Blend to Ease" operator
in the Graph Editor had the same name and description as the "Ease" operator.
This patch fixes it and makes the description more accurate

Pull Request: https://projects.blender.org/blender/blender/pulls/111745
2023-08-31 16:21:56 +02:00
Iliya Katueshenock
d4ae417b1e Geometry Nodes: simplify outputting a GField from a node
Pull Request: https://projects.blender.org/blender/blender/pulls/111196
2023-08-31 16:02:19 +02:00
Iliya Katueshenock
e951924b33 Cleanup: forbid implicit copy and move for multi function
This avoids accidental copies/moves which are never really intentional.

Pull Request: https://projects.blender.org/blender/blender/pulls/110168
2023-08-31 16:01:29 +02:00
Jacques Lucke
d3eb85294f Cleanup: use C++ containers in menu search 2023-08-31 15:59:39 +02:00