Commit Graph

109438 Commits

Author SHA1 Message Date
Sybren A. Stüvel 3edae09eaa Asset Library Service: fix failing unit test
On GCC in release mode (and maybe also debug mode without ASAN enabled),
allocating an `AssetLibraryService` will reuse the space that should
have just been freed. This made a test fail, as it was testing that new
memory was allocated and not some old instance reused.

To ensure that the calls that should allocate a new block of memory
return a unique pointer, I added some dummy allocation to the test.

No functional changes to Blender
2021-10-18 15:48:06 +02:00
Charlie Jolly 729b2d026d Geometry Nodes: Add shader Musgrave texture node
Port shader node musgrave texture

Differential Revision: https://developer.blender.org/D12701
2021-10-18 14:24:14 +01:00
Jacques Lucke de6bf5d4d2 Nodes: support sharing node declarations between nodes
Previously, every node had its own declaration. This isn't ideal, because
it's often the case that all nodes of the same type have the same declaration.
That's the case for all nodes using declarations currently. It will not be true
for e.g. group nodes in the future.

Sharing node declarations between nodes makes it a bit more efficient.

Differential Revision: https://developer.blender.org/D12898
2021-10-18 15:22:34 +02:00
Clément Foucault e150f171d5 Fix T92250 EEVEE: Render crash with Motion Blur and Overscan
This was caused by `DRW_view_data_texture_list_size_validate` which now
delete everything from the render engine.

This might change in the future but for now we just avoid calling it from
the render loop (when using DRW_cache_restart).
2021-10-18 15:15:04 +02:00
Pablo Dobarro 765b1c6b53 Fix T79005: Vertex color conversion operators changing the colors
CD_PROP_COLOR vertex data is stored in scene linear while legacy vertex
colors are srgb, so both operators also need to do this conversion

Reviewed By: sergey

Maniphest Tasks: T79005

Differential Revision: https://developer.blender.org/D8320
2021-10-18 15:01:37 +02:00
Jan-Willem van Dronkelaar 4de0e2e771 Animation: Motion Paths Refresh All
Adds a button, Update All Paths, to the Motion Paths property tabs and
will always show. The operator goes through all visible objects and
updates their motion paths.

The current implementation has a subtle functional change. Calculating
or updating motion paths for armature objects (through the Object tab,
not Armature tab) now also updates the paths for its bones. We could
preserve the old behavior but it doesn't seem necessary. It seems more
likely that the animator wants to update both anyways.

Reviewed by: sybren

Maniphest Tasks: T83068

Differential Revision: https://developer.blender.org/D11667
2021-10-18 14:36:26 +02:00
Sybren A. Stüvel f9113c4be8 Assets: add global `bke::AssetLibraryService` class
Add `blender::bke::AssetLibraryService` class that acts like a
blendfile-scoped singleton. It's allocated upon the first call to
`BKE_asset_library_load` and destroyed in the LOAD-PRE handler.

The `AssetLibraryService` ensures that edits to asset catalogs are not
lost when the asset browser editor closes (or even reloads). Instead,
the `AssetLibrary` pointers it owns are kept around as long as the blend
file is open.

Reviewed By: Severin

Maniphest Tasks: T92151

Differential Revision: https://developer.blender.org/D12885
2021-10-18 14:21:41 +02:00
Johnny Matthews 1f51037676 Geometry Nodes: Endpoint Selection Nodes
The Endpoint Selection node allows for the Selection of an aribitrary
number of endpoints from each spline in a curve. The start and end
inputs are evaluated on the spline domain. The result is outputted
as a boolean field on the point domain.

Differential Revision: https://developer.blender.org/D12846
2021-10-18 06:45:16 -05:00
Jacques Lucke 6f76bcc12c Fix: missing use-attribute property in geometry nodes modifier
The property was missing when a group input changed from not
supporting fields to supporting fields.
2021-10-18 12:58:30 +02:00
Erik Abrahamsson f9fe755dba Nodes: add default value to string socket declaration
Differential Revision: https://developer.blender.org/D12758
2021-10-18 11:59:49 +02:00
Jacques Lucke eb0d216dc1 Geometry Nodes: decouple multi-function lifetimes from modifier
Previously, some multi-functions were allocated in a resource scope.
This was fine as long as the multi-functions were only needed during
the current evaluation of the node tree. However, now cases arise
that require the multi-functions to be alive after the modifier is finished.
For example, we want to evaluate fields created with geometry nodes
outside of geometry nodes.

To make this work, `std::shared_ptr` has to be used in a few more places.
Realistically, this shouldn't have a noticable impact on performance.
If this does become a bottleneck in the future, we can think about ways
to make this work without using `shared_ptr` for multi-functions that
are only used once.
2021-10-18 11:46:21 +02:00
Campbell Barton 746ee29d36 Fix T91700: Strips can be transformed in scope display modes
Hide gizmos & prevent transform & selection in scope display.
2021-10-18 19:29:36 +11:00
Campbell Barton 4f3f79c382 Keymap: support key-activates-tools for shrink-fatten 2021-10-18 18:42:35 +11:00
Campbell Barton 3f4ba64ae3 Cleanup: use depends-on-cursor for "Object Transfer Mode" operator
Replace modal operator with the OPTYPE_DEPENDS_ON_CURSOR flag.

This has the advantage of showing the shortcut in the menu.
2021-10-18 17:20:06 +11:00
Campbell Barton 2a8e5128c1 WM: support setting the operators idle cursor
Support setting a cursor when an operator is waiting for input.
2021-10-18 17:18:48 +11:00
Campbell Barton 6bf8c95e52 UI: expose additional cursors to the Python API 2021-10-18 17:09:26 +11:00
Campbell Barton 59c95a8ca2 Cleanup: de-duplicate operator registration
Operators and operator-macros duplicated RNA properties.
2021-10-18 17:09:26 +11:00
Germano Cavalcante 69d6222481 Snap and Placement Gizmo Refactor
Move most of the gizmo snap and placement code to `view_cursor_snap.c`.

Simplify and extend the snap API.

Differential Revision: https://developer.blender.org/D12868
2021-10-18 01:58:00 -03:00
Campbell Barton be22e36692 Fix key-shortcut path for sequencer overlay 2021-10-18 15:47:31 +11:00
Campbell Barton f5edc69150 Fix frame overlay not refreshing the sequencer preview
Regression in 46aa70cb48
2021-10-18 15:47:29 +11:00
Campbell Barton e538b2c3a3 Cleanup: internal sequencer naming for overlays
- Rename RNA SpaceSeq.show_strip_overlay to show_overlays
  matching the 3D View, the term "strip" was misleading as this is used
  for the preview as well.

- Rename various RNA overlay settings to overlay_frame
  since "Frame Offset" is a specific feature, avoid having both
  Editor.show_overlay and SpaceSeq.show_overlays.

- Rename Editing `over_*` -> `overlay_frame_*` in DNA,
  as well as flags.
2021-10-18 15:47:28 +11:00
Campbell Barton c5a13ffcb4 Cleanup: spelling in comments 2021-10-18 12:13:10 +11:00
Pablo Vazquez 452c78757f UI: Improve contrast on playhead
Add an outine around the playhead, matching the color of the background (slightly darkened)
to improve the readability of the current frame line when placed against curves or strips
with a similar color.

{F10944336, size=full}

Differential Revision: https://developer.blender.org/D12810
2021-10-17 19:10:31 +02:00
Pablo Vazquez 962b17b3ca UI: Adjust header color when active instead of inactive
Currently, the background color of headers gets darkened when the editor is not active,
this makes it hard to theme, and adds contrast/noise when it's not needed.

This patch makes headers use the regular theme color when the editor is not active, so it
can be made to flush with the background more easily. And lightens the header (by +10,
same value as before) when the editor is active, providing the wanted highlight.

The motivations behind this change are:
* Simplify picking a theme color for headers.
* Widgets already become lighter on mouse hover, this change creates a connection with that concept.

Left: current master, inactive header is darkened.
Right: this patch, inactive header gets the theme color, active editor gets header in a slightly lighter color (like most widgets)

{F11052503, size=full, loop, autoplay}

Reviewed By: #user_interface, HooglyBoogly

Differential Revision: https://developer.blender.org/D12856
2021-10-17 18:49:59 +02:00
Pablo Vazquez 93544b641b UI: Visual style update to panels
Back in Blender 2.30, the GUI project brought panels into Blender among other important visual updates.
For the first time it was possible to move the wall of buttons around. Providing a clear separation
between sections (it even allowed the grouping of panels in tabs!)

During the 2.5 redesign, the separation between panels became a line on top of each panel, and panels received
theme settings for background and header colors. The default theme used the same color for both.

In 2.8 the background color of panels was different from headers in the default theme, so the separator
line was removed. While the separator line wasn't elegant (only on top, non-themeable, hard-coded emboss effect),
it provided a sort of separation between panels.

This patch solves the panels-separation by simply adding a margin space around them (not visible in default theme yet).
Even though the margin reduces the width of the working area slightly, it makes room for the upcoming always-visible scrollbars.

Other adjustments:
* Use arrow icon instead of triangle to collapse/expand
* Use rounded corners to match the rest of the UI (editor corners, nodes, etc).

{F10953929, size=full}

Margin on panels makes use of the `style->panelouter` property that hasn't been
used in a while. Also slight tweaks to `boxspace` and `templatespace` style properties so they
are multiples of 2 and operations on them round better.

There is technically no need to update the themes for them to work, so no theme changes are included in this patch.

{F10953931, size=full}

{F10953933, size=full}

{F10953934, size=full}

{F10954003, size=full}

----

A new theme setting under Style controls the roundness of all panels (added it to Style instead of ThemeSpace because I think controlling the panel roundness per editor is a bit overkill):
{F11091561, size=full, autoplay, loop}

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D12814
2021-10-17 18:31:24 +02:00
Jacques Lucke 19740b25c7 Geometry Nodes: bring back lazy evaluation for field types in Switch node
Differential Revision: https://developer.blender.org/D12878
2021-10-17 15:56:37 +02:00
Jacques Lucke 6b0719c0f3 Geometry Nodes: change field visualization when there is an error
This does not change the behavior when there are no mistakes in the node tree.
The visualization does change when a field is connected to an input that cannot
be a field.

Differential Revision: https://developer.blender.org/D12877
2021-10-17 15:51:33 +02:00
Hans Goudey 3c36803189 Cleanup: Fix unused variable warning in lite build 2021-10-16 22:58:30 -05:00
Johnny Matthews 4a00faca1a Fix: Geometry Nodes Subdiv Surface Crash
If there are no edges in the mesh, the process would crash.
Returning in this case.
2021-10-16 07:26:57 -05:00
Brecht Van Lommel 5c961b3b58 Revert "Fix T62325, T91990: changing Cycles presets does not update the Blender UI"
This reverts commit 1b6752e599. It is causing
constant redraws due to some ID properties seemingly being edited on every
redraw.
2021-10-16 13:54:29 +02:00
Julian Eisel b3c469153e Asset Browser: Use single column for asset library menu
Feedback was that the two column menu felt odd, and that the "Custom" and
"Built-in" headings for each column were more confusing than helpful. So
changing this to a single column menu with separator lines instead of headings.
2021-10-16 09:55:31 +02:00
Julian Eisel 73753e1a67 Asset Browser: Change default name of tags
Use "Tag" instead of "Unnamed Tag" as default name for tags. Other default
names in Blender also don't add "Unnamed" or similar.
2021-10-16 09:28:05 +02:00
Campbell Barton 1c18f05f0b Fix T92252: User after free when opening file after Blender starts
Oversight in 6e4ab5b761
2021-10-16 15:35:36 +11:00
Jesse Yurkovich 4586688323 Fix nonnull-compare warning in DNA_view3d_types.h
Was introduced in rB93a8fd1249f
2021-10-15 19:17:06 -07:00
Richard Antalik 5fed3aec4a VSE: Fix crash when scene strip is added to meta
Caused by 81514b0e91, missed sanitizing `sound->offset_time` usage in
`seq_update_sound_bounds_recursive_impl()`.
2021-10-16 01:28:59 +02:00
Aaron Carlisle 138fdf78ba PyAPI Docs: Fix example not using keyword parameter
Fixes T92238
2021-10-15 17:55:31 -04:00
Richard Antalik 73fbd3eebd VSE: Hide tool header by default
Tools currently used by VSE don't have much useful settings, but they
use a lot of space. Therefore these headers will be hidden by default.

Property `show_region_tool_header` was added to view menu to enable tool
settings.

This could be resolved by region overlap, but it isn't working well
currently.

Differential Revision: https://developer.blender.org/D12875
2021-10-15 23:42:26 +02:00
Jarrett Johnson 41dc558747 Geometry Nodes: Rotate Euler: Use "Local" instead of "Point"
Since points aren't relevant in function nodes, replace all mentions
of it with "local" to illustrate rotations done in local-space instead.

Differential Revision: https://developer.blender.org/D12881
2021-10-15 16:33:27 -05:00
Josef Raschen c383397d07 Fix versioning for sequencer color balance modifier.
Commit 213554f24a added slope/offset/power controls to the sequencer
color balance modifier, but colors in this mode were not initialized
with old files.

Initialize colors to default values.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D12806
2021-10-15 23:20:45 +02:00
Richard Antalik e11b33fec3 Remove math for 2D affine transform
Commit e1665c3d31 added math to do 2D affine transformations with 3x3
matrices, but these matrices are also used for 3D transformations.

Remove added functions and use 4x4 matrices for 2D transformation.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D12510
2021-10-15 23:20:45 +02:00
Richard Antalik 81514b0e91 Fix T91012: Scene strip doesn't play audio
Issue was caused by adding `seq->sound` check in ded68fb102 in
function `BKE_sound_scene_add_scene_sound` as `offset_time` field was
introduced to resolve sub-frame a/v misalignment.

Scene strips don't have `bSound` allocated but also don't suffer from
a/v misalignment.

Remove `seq->sound` check and don't apply any offset for scene strips.

Reviewed By: zeddb, sergey

Differential Revision: https://developer.blender.org/D12819
2021-10-15 23:20:45 +02:00
Richard Antalik 9a3c7da934 Fix T92184: Cage gizmo doesn't with area light
This is caused by removing `gizmo_cage2d_modal()` code in 482806c816.

Some areas use cage gizmo to modify RNA properties without using
transform operator like area light, image empty, and compositor preview.
This functionality is implemented in code that was removed.

Add this code back.

Reviewed By: zeddb, campbellbarton

Differential Revision: https://developer.blender.org/D12859
2021-10-15 23:20:45 +02:00
Manuel Castilla 9b1b1d9269 Cleanup: remove unused functions 2021-10-15 22:23:30 +02:00
Manuel Castilla 5b9a911c4b Fix T72583: Sun Beams node artifacts
The artifacts are due to the loss of precision when doing some
calculations with float precision.
2021-10-15 22:23:21 +02:00
Jarrett Johnson 88d295f952 Geometry Nodes: Updated Subdivision Surface Node
Replaces the old Subdivision Surface Node.

Changes:
 - Removes implicit instance realization, instead the node runs once
   per unique instance.
 - "Use Creases" becomes a crease field input applied to edges.
   The values are clamped between zero and one.

Addresses T91763

Differential Revision: https://developer.blender.org/D12830
2021-10-15 15:12:04 -05:00
Hans Goudey 19bab2a536 Geometry Nodes: Object info node optional instance output
The object info node output an instance as a performance optimization.
Before that optimization was (almost) invisible to the user, but now
that we aren't automatically realizing instances, it isn't intuitive
for a single object to become an instance.

I refactored the transform node so its ability to translate/transform
an entire geometry set was more usable from elsewhere and exposed the
function to get a geometry set from an object.

Differential Revision: https://developer.blender.org/D12833
2021-10-15 14:20:53 -05:00
Hans Goudey 76f386a37a Geometry Nodes: Fields transfer attribute node
This commit adds an updated version of the old attribute transfer node.
It works like a function node, so it works in the context of a
geometry, with a simple data output.

The "Nearest" mode finds the nearest element of the specified domain on
the target geometry and copies the value directly from the target input.

The "Nearest Face Interpolated" finds the nearest point on anywhere on
the surface of the target mesh and linearly interpolates the value on
the target from the face's corners.

The node also has a new "Index" mode, which can pick data from specific
indices on the target geometry. The implicit default is to do a simple
copy from the target geometry, but any indices could be used. It is also
possible to use a single value for the index to to retrieve a single
value from an attribute at a certain index.

Differential Revision: https://developer.blender.org/D12785
2021-10-15 14:09:08 -05:00
Hans Goudey 47a72ac4fd Cleanup: Refactor use of implicit inputs in geometry nodes
Instead of checking whether the socket value was hidden, use the proper
node declaration to check whether the socket has an implicit input. The
remaining larger change to make is allowing nodes to specify what their
implicit input should actually be.
2021-10-15 13:57:00 -05:00
Hans Goudey 4682aad432 Fix: Field type inference considers unavailable sockets
If a node had unused/unavailable inputs, they were still considered
when deciding whether the output is a field or not.
2021-10-15 13:54:08 -05:00
Leon Leno 45e16a6c96 UI: Remove extra padding around curve widget
This commit removes the constant padding around to the left and
right of the curve widget. The padding worked in screen space and
didn't take UI scale/zoom into account. This makes the curve widget
consistent with the more recently added curve profile widget used
for bevel profiles.

Differential Revision: https://developer.blender.org/D12883
2021-10-15 13:30:50 -05:00