Commit Graph

128389 Commits

Author SHA1 Message Date
Campbell Barton 01bc51e7eb Tests: move utilities into their own directory
These programs don't run as part of automated tests but can be useful
utilities for developers to expose issues or bisecting
(in the case of event simulation).
2023-09-27 16:50:09 +10:00
Gilberto Rodrigues 7bc4478484 Clarify UV align operator behavior. Fix tooltips.
Clarify operator behavior of UV align operator, and fix the tooltips.
The tooltips were either vague/ambiguous,
or even wrong, see https://projects.blender.org/blender/blender-manual/issues/78557

Pull Request: https://projects.blender.org/blender/blender/pulls/112704
2023-09-27 08:43:56 +02:00
Campbell Barton cdac2642ea Fix memory leak from loading files with legacy grease pencil palettes 2023-09-27 14:47:50 +10:00
Campbell Barton b4d3bd134b Cleanup: quiet ASAN warning with invalid value for eButGradientType
-1 was assigned to eButGradientType which isn't a valid value,
add UI_GRAD_NONE to resolve this.
2023-09-27 14:28:47 +10:00
Campbell Barton a9162dbba9 Fix memory leak for builds without fluid simulation enabled
Fluid-simulation data wasn't copied or freed when WITH_FLUIDSIM=OFF.
As this is modifier data which is created on load this should also
be freed.
2023-09-27 14:10:41 +10:00
Campbell Barton c29a78d80d Fix memory leak when the explode modifier is used with vertex groups
Initializing all vertices from the original could allocater vertex
groups into the custom-data which were later overwritten witout freeing.

The leak happened in the test file:
.../lib/tests/modifier_stack/explode_modifier.blend
2023-09-27 13:48:15 +10:00
Campbell Barton 329b8176f7 Fix crashes drawing in the sequencer
Follow up to ee4c45c612.
2023-09-27 13:14:38 +10:00
Campbell Barton 46263a85ab Cleanup: spelling in comments 2023-09-27 13:03:29 +10:00
Campbell Barton ee4c45c612 Fix crash drawing in the sequencer when Scene::ed is null
Regression in [0], also order checks so creating a map of sequencer
strips is done after the flag check.

[0]: 86a0d0015a
2023-09-27 13:02:35 +10:00
Lukas Stockner 2456897d9d Fix #112831: Cycles: Kernel assert and NaN in Sheen 2023-09-27 03:02:07 +02:00
Richard Antalik 86a0d0015a VSE: Improve retiming UI
Currently retiming is quite awkward, when you need to retime multiple
strips strips in sync. It is possible to use meta strips, but this is
still not great. This is resolved by implementing selection.

General changes:
Gizmos are removed, since they are designed to operate only on active
strip and don't support selection.
Transform operator code is implemented for retiming data, which allows
more sophisticated manipulation.
Instead of drawing marker-like symbols, keyframes are drawn to
represent retiming data. Retiming handles are now called keys. To have
consistent names, DNA structures have been renamed.
Retiming data is drawn on strip as overlay.

UI changes:
Retiming tool is removed. To edit retiming data, press Ctrl + R, select
a key and move it. When retiming is edited, retiming menu and
context menu shows more relevant features, like making transitions.
Strip and retiming key selection can not be combined. It is possible to
use box select operator to select keys, if any key is selected.
Otherwise strips are selected.
Adding retiming keys is possible with I shortcut or from menu.
Retiming keys are always drawn at strip left and right boundary. These
keys do not really exist until they are selected. This is to simplify
retiming of strips that are resized. These keys are called "fake keys"
in code.

API changes:
Functions, properties and types related to retiming handles are renamed
to retiming keys:
retiming_handle_add() -> retiming_key_add()
retiming_handle_move() -> retiming_key_move()
retiming_handle_remove() -> retiming_key_remove()
retiming_handles -> retiming_keys
RetimingHandle -> RetimingKey

Retiming editing "mode" is activated by setting `Sequence.show_retiming_keys`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109044
2023-09-27 01:45:59 +02:00
Jacques Lucke 46ade1c2df Fix #112916: crash when changing active repeat item
It seems like the cause for the crash was that the maps in
`AnonymousAttributeInferencingResult` use node indices as keys.
However, the order of nodes changes when changing node selection.
Generally, we don't want to trigger a more expensive update just
because we changed the selection, therefore things got out of sync
when building the lazy-function graph.

The solution here is not a full fix. Other things that cause a depsgraph
update but don't cause a tree-update could still cause the same kind
of crash. A better solution would be to address the root cause which
is that trivial operations like selection changes node order which is
used in many places. Also see `BKE_ntree_update_tag_node_reordered`.

Disabling depsgraph updates when changing the active simulation
or repeat item is correct as well though, and it solves this specific crash.
2023-09-27 01:35:40 +02:00
Brecht Van Lommel 3d39abc5e6 Fix build error after make format cleanup
The include order should not matter here, but do quick fix for now to
unbreak the builds.
2023-09-27 01:07:49 +02:00
Jacques Lucke 8418e41bf7 Fix: simulation nodes not working after copying object 2023-09-27 00:19:37 +02:00
Clément Foucault f966205022 EEVEE-Next: Add tracing options for diffuse rays
Also fixes diffuse surface always tracing
even when tracing is off.
2023-09-26 23:46:08 +02:00
Clément Foucault 3a4fc2c94e EEVEE-Next: Shadow Map Tracing Initial Implementation
Shadow Map Ray Tracing is a technique that ray cast against the shadow
depth buffer. The technique is described in "Soft Shadows by
Ray Tracing Multilayer Transparent Shadow Maps".
Note that we only implement the single layer approach since storing
multiple depth is prohibitively expensive.

Pull Request: https://projects.blender.org/blender/blender/pulls/111809
2023-09-26 23:42:40 +02:00
Hans Goudey 93b285be4b Fix: Use disabled status for non-selected node tool modes and types 2023-09-26 17:38:13 -04:00
Pablo Vazquez b41fc86003 UI: Match Node Editor Node menu with Context menu
Leftover work from when the Context Menu was refactored.

Mainly matching icons, separators, order, and show/hide submenu.

Pull Request: https://projects.blender.org/blender/blender/pulls/112924
2023-09-26 23:34:59 +02:00
Pablo Vazquez cdccb71bf7 UI: Move Bone Wireframe Opacity to general overlays
The poll made it so the Armature Overlays popover would
appear even in object mode only for this setting. Move
it to the general overlays next to other general/object
mode settings.

Closes #112765

Pull Request: https://projects.blender.org/blender/blender/pulls/112862
2023-09-26 23:33:15 +02:00
Harley Acheson b2b467cc8c Cleanup: Make format
Formatting changes resulting from Make Format
2023-09-26 14:10:32 -07:00
Harley Acheson e64e39e3d0 UI: Change Overlay Text Size with Label Text Style
Text Overlays are currently hard-coded to 11 points. This allows them
to be set with Preferences / Themes / Text Styles, Widget Label.

Pull Request: https://projects.blender.org/blender/blender/pulls/112875
2023-09-26 23:07:29 +02:00
Hans Goudey 2e6b81f151 Cleanup: Make format 2023-09-26 17:05:36 -04:00
Hans Goudey b49c84276c Geometry Nodes: Fix Support for extending nested menus with assets
The builtin asset catalog paths weren't properly updated after more
nesting was added to the geometry nodes add menu. This commit
resolves that and a few other issues extending menus like nested
menus in mesh edit mode. Unfortunately this requires some boilerplate
code duplicating the menu structure currently.
2023-09-26 17:01:50 -04:00
Hans Goudey e5e07c184e Fix: Crash deleting geometry nodes node group
Missing null check in ad169ba67a.
2023-09-26 17:01:50 -04:00
Hans Goudey 355ed0838c Geometry Nodes: Expose non-asset tools
Node tools are no longer required to be assets, and they aren't assets
by default anymore. Non-assets don't have catalogs for header menu
organization, so they are only exposed in the "Unassigned" menu, which
is now just an icon so it takes less spac, makes the connection to the
asset browser, and signals more that it's not the "final" place for a
tool. Tool node groups have fake user set by default, since they don't
have users. The "Is Tool" status of a node group is configurable in the
editor N-panel, just like the modifier status.

This is similar to af3461c387, and has the same check for
whether a node group is "local."
2023-09-26 17:01:50 -04:00
Pablo Vazquez ef18cdf8dc UI: Remove Masking dropdown from tool settings
In recent versions, masking is exposed as a popover in the header
so having this as well is confusing and takes up space.
2023-09-26 21:58:55 +02:00
Hans Goudey af3461c387 Geometry Nodes: Require modifier tag for add menu, show non-assets
Any geometry node group with the "Is Modifier" tag is exposed in the add
modifier menu. Local node groups that aren't assets are displayed in a
subsection of the "Unassigned" menu, as they are "asset wannabees"
that function similarly but aren't shared to other files.

Only modifier node groups can be assigned to the geometry nodes
modifier. Because of this, existing node groups are versioned to have
the tag if they have a geometry output.

Internally, this means the operator that used to only handle node group
assets has to also add local geometry node groups. That change isn't
so large though. The other changes are just UI, or changes to the
node group property poll functions.

Note: For assets, saving the file to generate asset meta-data may be
necessary for the versioning to affect the add modifier menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/112918
2023-09-26 21:53:20 +02:00
Hans Goudey 2d19e345cd Cleanup: Missing includes and forward declarations in header 2023-09-26 15:39:32 -04:00
Hans Goudey c095962d06 Fix #112900: Asset displaying mesh with hiding and no material indices
The case when there were no material indices, multiple materials, and
the mesh used hiding wasn't handled after 55970fa367.
This is a simple parallel loop adding up the non-hidden triangles.
2023-09-26 15:10:22 -04:00
Miguel Pozo b56d39bdcc EEVEE-Next : Object visibility settings for probes
Replace per-probe visibility collections with global per-object probe
visibility settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/112845
2023-09-26 20:37:15 +02:00
Jacques Lucke ad169ba67a Geometry Nodes: support baking individual simulations
Previously, it was only possible to bake all simulations at once. This is great
for simple use-cases that, but in more complex setups one can have independent
simulations that should also be baked independently. This patch allows baking
individual simulation zones.

Furthermore, each simulation zone can now also have its own bake path and
simulation frame range. By default the simulation frame range is the scene frame
range, but it can also be customized on the scene or simulation zone level. The
bake path is generated based on the modifier bake path by default, but can be
set to another absolute or relative (to the .blend file) path.

The timeline drawing has been modified as well to be able to show more information
in the case when some simulations are baked and others are not. Instead of showing
a line for every simulation, it shows a condensed view of the important information
using at most two lines:
Is something baked? Is something valid or invalid? Also see #112232.

Pull Request: https://projects.blender.org/blender/blender/pulls/112723
2023-09-26 20:30:46 +02:00
Nate Rupsis 8199132551 UI: Updating Animation Editors snapping from 'Modes' to no icon
Updates the animations editors (NLA, Dope Sheet, Graph editor) to have no icon instead of "Modes" (in absence of icon set).

Pull Request: https://projects.blender.org/blender/blender/pulls/112633
2023-09-26 20:28:57 +02:00
Miguel Pozo f07542d8cb EEVEE-Next: Fix Hair and Curves motion vectors
Hair and Curves need to call `DRW_curves_update` before
`geometry_steps_fill`, otherwise the copied geometry is just
uninitialized data.
However, doing so triggers an assertion:
> DRW_render_instance_buffer_finish had not been called before drawing.

This PR ports the `DRW_hair/curves_pos_buffer_get` functions to the new
`draw::Manager` API, so it can be called at any arbitrary point.
It also changes `VelocityModule::geometry_map` to use `uint64` keys
instead of `ID` pointers, since the same particle system can be used on
different objects and have multiple geometries.

Notes:
* The new functions are only used for
  `VelocityModule::step_object_sync` on image renders. Using them
  elsewhere would require modifying the old draw manager to do the
  init/update/free setup.
* Only the compute shader version has been ported.

Pull Request: https://projects.blender.org/blender/blender/pulls/112425
2023-09-26 19:55:46 +02:00
Brecht Van Lommel 05a4609583 Python API: add specular tint texture support to node_shader_utils 2023-09-26 19:46:38 +02:00
Miguel Pozo 049cb479b2 EEVEE-Next: Irradiance Grid clip distance and probe alignment
Implement a clip distance to irradiance grids, so surfaces farther than
the threshold don't generate surfels.
Align the capture view matrix to the probe rotation.

Pull Request: https://projects.blender.org/blender/blender/pulls/112863
2023-09-26 19:45:41 +02:00
Miguel Pozo a6536ca9c8 Fix: EEVEE-Next: Irradiance Grid minor fixes
Pull Request: https://projects.blender.org/blender/blender/pulls/112841
2023-09-26 19:27:30 +02:00
Brecht Van Lommel 2ed8df333b Fix Hydra not being disabled when USD library not found on Linux 2023-09-26 18:53:05 +02:00
Bogdan Nagirniak c0a0de617c Hydra: export Blender shader nodes as MaterialX node graph
This adds initial support for rendering Cycles and EEVEE shaders in Hydra
render engines that support MaterialX. Not all nodes are currently
supported, see the detailed compatibility list in #112864.

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl Pidhirskyi <vpidhirskyi@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/111765
2023-09-26 18:52:41 +02:00
Nathan Vegdahl 49eab72141 Fix #107030: return accurate action frame ranges from the Python API
This changes the `action.frame_range` Python API to return an accurate
frame range for actions.  Specifically, it was previously special-cased
to return a range with length 1 whenever the length was actually 0.  This
led to a bizarre situation where a real frame range of `[0.0, 0.2]` would
return that range as-is, but a real frame range of `[0.0, 0.0]` would
instead return a range of `[0.0, 1.0]`.

The new behavior simply always returns the real frame range.

The reason for the previous behavior was obscure: the relevant code was
also used internally in Blender's NLA system, and returning a zero-length
range could result in NLA strips getting infinite scale.  The code is now
separated out appropriately so that the NLA system still gets the
non-zero-length range, while the Python API for actions returns the real
range.

Pull Request: https://projects.blender.org/blender/blender/pulls/112709
2023-09-26 18:18:56 +02:00
Jeroen Bakker 4a78d7dc4c Fix 110976: Sequencer Scope Artifacts on NVIDIA 30/40 Series
This PR fixes an issue with the NVIDIA 3000/4000 series cards. The cause
might be that when blending is turned off and the fragment output has an alpha
of 0.0 the fragment might be discarded. This is a guess of course.

By setting the Alpha to 1.0 for scopes and enabling alpha blending when
drawing the meta data text seems to fix the issue.

Fixes #110976

Pull Request: https://projects.blender.org/blender/blender/pulls/112665
2023-09-26 17:29:59 +02:00
Pratik Borhade 9c20a29259 Fix #112904: Outliner: Bones appear in different places in different modes
c6b553d57c added the bone collection in
outliner. However, there is change in tree element order when switched
between pose and edit/object mode. Because order of tree building is
`edit bones -> bone collection -> pose bones`
To keep tree structure consistent between different modes, first draw
pose bone and then the ebone/bone collection.

Pull Request: https://projects.blender.org/blender/blender/pulls/112908
2023-09-26 17:26:26 +02:00
Julian Eisel 73460903fa Asset Shelf: Transparent asset shelf header with background for buttons
Draw the background of the asset shelf header fully transparent, with an opaque
background with rounded corners behind sections containing buttons. This
reduces the visual space consumed by the asset shelf, and makes the header
follow a tabbed folder metaphor better. Also, this works much better with our
click-through feature, where transparent parts of regions without buttons are
passed through the region under it (we might want to consider unifying code
here a bit).

The edge to drag for region resizing respects the transparent sections.
When there is little space between sections, the sections get merged so that
there are no small gaps in the bar.

Part of #107881.

----

Note that the core of this is implemented in a generic way, so this can be
reused for other regions.

Pull Request: https://projects.blender.org/blender/blender/pulls/112241
2023-09-26 17:12:37 +02:00
Sybren A. Stüvel c524fbe623 Anim: Improve readability of channel colors in channel list
Draw anim channel colors as a little rectangle in the channel list,
instead of taking over the entire channel name background. This keeps
the channel names readable, regardless of the channel colors.

Channel colors are typically set via the bone colors, and since those
are chosen for visual contrast in the 3D Viewport, they aren't
guaranteed to also be a suitable background color for the channel list.
Because of this, it's no longer used as such.

The channel 'data' background (i.e. the keyframe area) is now drawn with
a consistent color, and much more subtle.

This also enables the 'Channel Group Colors' setting in the preferences
by default, as it is now way less obnoxious and invasive.

Design task: https://projects.blender.org/blender/blender/issues/69059
Reviewed-On: https://projects.blender.org/blender/blender/pulls/112861
2023-09-26 17:06:35 +02:00
Julian Eisel ca2a8be15f Assets: Rename "Import Type" to "Import Method" in code/BPY
It was already called that way in the UI, since it's referring to a
behavior, not a type. Update the code to match that. Note that this is
a BPY compatibility breaking change for 4.0.
2023-09-26 16:48:47 +02:00
Hans Goudey 395f279166 Fix: Missing node asset menu updates after mark asset
Use of node group assets relies on a few properties written to asset
meta-data for proper filtering of assets in menus (add modifier menu,
node add menu, 3D view menus for tools). Currently these meta-data
properties are written when updating their source properties and when
saving the file. That means they *aren't* written when marking a group
as an asset, which is necessary because the meta-data doesn't exist
before when the group isn't an asset. Currently users have to save the
file to update menus in this case, which isn't intuitive.

As a fix, call the function to write the meta-data when marking a
data-block as an asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/112743
2023-09-26 16:38:50 +02:00
Jeroen Bakker 7dbe689b63 Vulkan: Use Point Shaders When Drawing Points
In Vulkan (and Metal) it is not possible to use a global as point
size. It needs to be set for each vertex when drawing points. Blender
has specialized shaders for that, but not all code respect those
shaders.

This PR will add an assert inside the vulkan backend when incorrect
usage of shaders are detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/112906
2023-09-26 16:04:08 +02:00
Clément Foucault e4c89baf53 EEVEE-Next: Port subsurface to compute shader
This makes the SSS processing more isolated to avoid
side effects in other passes.
Also this allow more optimization using LDS.

The radiance buffer is created by a setup phase using
direct and indirect lighting.

Splitting this into its own compute pass also fixes
a pass merging issue on Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/112901
2023-09-26 15:52:35 +02:00
Jeroen Bakker beb90b5573 Cleanup: Make format 2023-09-26 15:43:59 +02:00
Jacques Lucke 425a5a3158 Mesh: show attribute name collision warning in more panels
So far, only the attribute panel showed a warning when there were duplicate
attribute names. This patch adds the same warning to the vertex groups,
color attributes and uv maps panel. All of these attributes are in the same
namespace from the perspective of geometry nodes. Name collisions should
be avoided to so that ambiguities when referencing attributes don't come up.

With #112889, vertex groups can have the same name as other attributes again.
While we can handle this case somewhat gracefully in general, duplicate names
likely lead to problems down the line, so it's better if they can be avoided early.

Pull Request: https://projects.blender.org/blender/blender/pulls/112891
2023-09-26 15:36:40 +02:00
Jacques Lucke 5c5a041edd Fix #112022: allow vertex groups and attributes with same names again
This was discussed in #112022 and on devtalk:
https://devtalk.blender.org/t/vertex-groups-generic-attributes-and-name-clashing/31073

While vertex groups with the same name as attributes should be avoided, since
it can cause ambiguities when using attributes, it's something we can handle
gracefully for now. Enforcing unique names for vertex groups resulted in breaking
other functionality under some circumstances.

This effectively reverts 12ef20990b, except for
the bug fix in `BKE_id_attribute_new`.

#112891 adds a warning to avoid make users aware of duplicate names so that they
can be avoided in practice.

Pull Request: https://projects.blender.org/blender/blender/pulls/112889
2023-09-26 15:36:12 +02:00