Commit Graph

130634 Commits

Author SHA1 Message Date
Guillermo Venegas
cf08b088ba Text Editor: Use active text selection as search query
If text is selected, use that as the search query.

Pull Request: https://projects.blender.org/blender/blender/pulls/115247
2023-11-30 18:26:53 +01:00
Aras Pranckevicius
93ca2788ff VSE: speedup Luma Waveform display output mode
Use multithreading, plus make the non-float / non-separate luma
calculations faster by avoiding byte->float->byte conversions
back and forth.

On a 4K resolution sequencer display, time taken to calculate the
waveform (Windows, Ryzen 5950X):

- regular images: 127.0ms -> 6.4ms
- regular images, separate colors: 160.3ms -> 13.1ms
- float images: 86.2ms -> 11.1ms
- float images, separate colors: 162.9ms -> 17.4ms

This also fixes curious "one black pixel row" in the middle of the
waveform, which was caused by the code spreading 256 possible luma
values over "off by one" vertical range:

Pull Request: https://projects.blender.org/blender/blender/pulls/115579
2023-11-30 18:19:40 +01:00
Nate Rupsis
da83b2951d Anim: Add "Add/delete" track operations to NLA context menu
Updating NLA context menu, adding in more relevant track operations (tracks add, tracks add above, tracks delete).

Pull Request: https://projects.blender.org/blender/blender/pulls/114202
2023-11-30 17:15:06 +01:00
Clément Busschaert
671f428ead GPv3: "Set Active Layer" operator and menu
Resolves #113915 .

Ports the `layer_active` operator to set the active layer from an index.
Adds the menu to set the active layer from a list.

Pull Request: https://projects.blender.org/blender/blender/pulls/115606
2023-11-30 16:10:06 +01:00
Philipp Oeser
6023a6a423 Fix #115526: missing normals on first chunk of array modifier
Exposed by 383a145a19.

Think the issue actually started in cfa53e0fbe, since then the new
destination normals were only filled from the first array copy onwards
(probably hidden by some recalculation of normals somewhere?).

In any case, starting the destination normals array with what we have
from the input mesh normals and then resizing the array (instead of
reinitializing it from scratch) fixes this.

Pull Request: https://projects.blender.org/blender/blender/pulls/115612
2023-11-30 15:49:52 +01:00
Philipp Oeser
864b07011a Fix #115037: Crash deleting tool node group from outliner
Prevent heap-use-after-free of SpaceNode `geometry_nodes_tool_tree`,
remapping it in `node_id_remap_cb` (so it get null when deleted).

Pull Request: https://projects.blender.org/blender/blender/pulls/115047
2023-11-30 15:48:42 +01:00
Falk David
0185609a26 Fix: GPv3: Smoothing even with factor of 0
The grease pencil draw tool would still do a lot of smoothing
even if the active smoothing factor was set to 0.0.

This was because the screen space coordinates were always pre-blurred
before being passed to the curve fitting. Even if the curve fitting
outputs a line that fits the input exactly, it would still use the pre
smoothed coordinates.

The fix makes sure to use the smoothing factor in the influence
of the pre-blur. This way, no pre-blur is used when the factor is 0
and the lines will be smoothed much less.

Note that we always do some smoothing to avoid artifacts such
as pixel-grid-aligned lines etc.
2023-11-30 14:48:28 +01:00
Christoph Lendenfeld
83287624bc Anim: Change how Only Insert Needed works
When keyframing with the `Only Insert Needed` flag enabled,
the code was able to delete keyframes in certain cases.
This behavior is removed and replaced with the following rules.

* If there is a key on the current frame, and it has the same value, skip it.
* If there is no key, but the FCurve evaluates to the same value, skip it.
* Add a key in all other cases.

Remove that functionality for consistency and simplify the code around it.

Pull Request: https://projects.blender.org/blender/blender/pulls/115360
2023-11-30 14:45:47 +01:00
Brecht Van Lommel
f47b1b41c2 Cleanup: compiler warning in release build 2023-11-30 14:32:54 +01:00
Brecht Van Lommel
9ffd6dabf0 Fix build error in freestyle when not using precompiled headers 2023-11-30 14:31:29 +01:00
Omar Emara
b8f4c45638 Realtime Compositor: Add utilities to handle texture formats
This patch adds a number of utilities to handle texture formats and
their relation to result types and precisions. This is needed for future
work, and also unifies the places one needs to update when adding a new
result type.
2023-11-30 15:21:56 +02:00
Germano Cavalcante
14c2f6856a Suppress warnings by removing unused properties from keymaps
Between Blender versions, properties of some operators may be removed.

When this happens, when importing the keymap from the previous version,
a series of warnings may appear in the console. For example:
```
Warning: property 'alt_navigation' not found in item 'TRANSFORM_OT_translate'
Warning: property 'alt_navigation' not found in item 'TRANSFORM_OT_rotate'
Warning: property 'alt_navigation' not found in item 'TRANSFORM_OT_resize'
Warning: property 'alt_navigation' not found in item 'VIEW3D_OT_edit_mesh_extrude_move_normal'
...
```

Therefore, it seems to be convenient to edit these properties when
versioning.

This commit implements a `remove_properties` utility that makes this
removal simpler.

Pull Request: https://projects.blender.org/blender/blender/pulls/114936
2023-11-30 12:22:47 +01:00
Nathan Vegdahl
908ce0dd1a Fix: allow overshoot numerical input in the Pose Breakdowner operator
You could already do overshoot via the mouse, but it was arbitrarily
disallowed when entering values numerically.  This simply lifts that
restriction so that numerical input is capable of the same things as
dragging the mouse.

Importantly, the operator slider code already appropriately clamps
both mouse and numerical input when needed.  So the checks and clamping
removed in this commit simply aren't needed, and removing them just
makes numerical input get constrained exactly the same as mouse input.

Pull Request: https://projects.blender.org/blender/blender/pulls/115534
2023-11-30 10:25:16 +01:00
Omar Emara
07e051d7cd Realtime Compositor: Implement zero cost external images
This patch implements a new mechanism for compositor results to wrap
external images, such as those cached in the static cache manager.
Thereby enabling zero cost use of those resources, which previously
needed a copy at each evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/115574
2023-11-30 09:10:41 +01:00
Campbell Barton
a226b14984 Fix #114609: compose key sequences includes continuation keys on Wayland
Suppress characters typed while composing.
2023-11-30 16:42:42 +11:00
Campbell Barton
dfbda79cbd Cleanup: declare pointers const where possible 2023-11-30 16:42:40 +11:00
Campbell Barton
6b22572967 Cleanup: various non-functional changes for C++ 2023-11-30 16:42:39 +11:00
Aras Pranckevicius
3f7ab7069e Cleanup: move writeffmpeg to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/115585
2023-11-30 06:03:18 +01:00
Campbell Barton
7897e2d299 Cleanup: remove warning suppression which is no longer needed
Since updating fmtlib these aren't needed.
2023-11-30 15:02:52 +11:00
Campbell Barton
7f8efbe593 Cleanup: quiet CLANG conversion warnings 2023-11-30 15:01:58 +11:00
Campbell Barton
15db0cb446 Cleanup: use style for doxygen comment blocks 2023-11-30 14:15:11 +11:00
Campbell Barton
b0746f4be2 Refactor: reduce complexity of object mode selection, minor optimization
Selection logic in ed_object_select_pick mixed operations for
object mode & other modes, making it difficult to reason about.

Refactor so object mode selection is isolated to it's own block,
following conventions for SelectPick_Params used by all other selection
picking operators.

This makes it possible to remove a call to de-select all objects
which was redundant in most cases.
2023-11-30 12:43:29 +11:00
Campbell Barton
09bd046975 Fix #115181: RMB Select sometimes to enter pose mode when selected
Pass-through selection allows select-drag not to activate an already
selected object - so an existing selection can be dragged without
changing the active/selection (see #96544) & [0],

This caused entering pose-mode to fail when selecting an armature
with "Lock Object Modes" disabled.

There is a logical conflict where pass-through is intended to keep the
current selection & active, which doesn't make sense when selecting the
armature should enter pose-mode (details in code-comments).

Resolve by disabling pass-through when the select action changes
the objects mode.

[0]: 618f39fca2
2023-11-30 11:15:09 +11:00
Clément Foucault
92bec9af0c Fix EEVEE: Compilation on Metal 2023-11-30 01:10:27 +01:00
Hans Goudey
34ec46934c Fix: Incorrect subdiv IndexMask construction
The indices have to be sorted. A different method of interpolating
the face selection to vertices would probably be better in the future.
2023-11-29 18:52:58 -05:00
Campbell Barton
8c473df8c3 Cleanup: suppress CLANG warnings, remove unused variables 2023-11-30 10:48:33 +11:00
Campbell Barton
3b5031f1cb Cleanup: use 'r_' prefix for output arguments, order last
Also clarify some naming.
2023-11-30 10:42:18 +11:00
Campbell Barton
2c2bd7d1e3 Cleanup: pass const arguments to BKE_mesh_fair functions 2023-11-30 10:42:16 +11:00
Damien Picard
3f5fd74953 Fix #95045: UI: keymap header in preferences truncated when filtering
Show untruncated headers in keymap editor while filtering.

Pull Request: https://projects.blender.org/blender/blender/pulls/114012
2023-11-29 22:36:05 +01:00
Aras Pranckevicius
df16f4931e VSE: speedup timeline drawing, and improve waveform display
Sequencer timeline UI repainting is 3x-4x faster now, for complex
timelines. On Sprite Fright Edit data set, with whole timeline visible
(2702 strips), repainting the timeline UI with all overlay options
(waveforms, offsets, thumbnails etc.):

- Windows (Ryzen 5950X, RTX 3080Ti, OpenGL): 62ms -> 18.6ms (16FPS -> 54FPS)
- Mac (M1 Max, Metal): 39.8ms -> 11.5ms (25FPS -> 86FPS)

This is achieved by:

- Avoiding tiny GPU draw calls (i.e. drawing one quad a time), instead
  batch all the quads / lines needed by the timeline display into
  series of about-1000 quads per draw.
- For retiming keys display, batch their keyframe point drawing too.
- For audio waveform overlay display, change it to draw batched quads
  instead of alternating between line strips and triangle strips. This
  actually changes how the waveform looks like (implements #115274)
  and fixes some visual issues with waveforms too.
- For fcurve overlays, also draw them as batched quads.

While at it, this also fixes an issue where while dragging strips over
other strips, their text labels would look as if they are behind the
background strips.

Pull Request: https://projects.blender.org/blender/blender/pulls/115311
2023-11-29 20:25:21 +01:00
Hans Goudey
5366ccd625 Fix: Debug and lite build errors after recent cleanup
Our `EnumerableThreadSpecific` wrapper doesn't accept an
example argument, only an initialization function. And some
removed variables were still used in asserts.
2023-11-29 13:23:03 -05:00
Hans Goudey
13c145ac02 Cleanup: Grammar in a few comments 2023-11-29 12:39:33 -05:00
Hans Goudey
8c59532106 Cleanup: Use C++ arrays to store subdiv ccg data
Decrease the amount of manual memory management
and pointer arithmetic.
2023-11-29 12:39:33 -05:00
Philipp Oeser
d3ff658b66 Fix #115572: shape_key_remove operator leaves shared normals
Caused by 383a145a19

Since above commit, normals were in a SharedCache, they need to be tagged dirty
for recalculation.

Instead of tagging the normals caches dirty explicitly, simply use
`BKE_mesh_tag_positions_changed` [which includes all this and also tags
positions dirty - which sounds also needed for updating other things]

Pull Request: https://projects.blender.org/blender/blender/pulls/115580
2023-11-29 18:17:30 +01:00
Hans Goudey
c2571cd259 Cleanup: Use const SubdivCCGFace variables 2023-11-29 11:47:00 -05:00
Hans Goudey
1a36feb7e5 Cleanup: Use references instead of pointers in subdiv_ccg.cc 2023-11-29 11:40:10 -05:00
Hans Goudey
63af8dbfca Multires: Use IndexMask for Subdiv CCG face updates
These updates are used to recalculate normals and average values between
grid boundaries during multires sculpting. In main the affected faces
are passed as an array of pointers. Using an `IndexMask` instead reduces
memory usage by 4x per affected face (8 byte pointer to 2 byte integer),
simplifies iteration and threading, and can also improve performance.
Finding which faces are affected is now multithreaded, with its runtime
changing from 0.63 ms to 0.12 ms in a simple test sculpting on a portion
of a 1 million face grid.

Also switch to VectorSet instead of GHash for finding affected adjacent
elements. That's a friendlier data structure that probably has better
performance as well.
2023-11-29 11:10:08 -05:00
Hans Goudey
dfc6b1deb6 Cleanup: Use C++ threading API in subdiv_ccg.cc
Allows removing various structs for passing around arguments,
and simplifies the use of thread-local storage.
2023-11-29 10:35:21 -05:00
Hans Goudey
c28cb3d0ac Cleanup: Remove unused curve positions variable 2023-11-29 10:35:21 -05:00
Germano Cavalcante
db3d59d94d Fix #115570: Crash when using snap to volume and clipping region
`ED_view3d_win_to_ray_clipped_ex` requires `ray_end` when
`do_clip_planes` is true.

Since the snap code uses `ray_depth` instead of `ray_end`, the solution
is to always calculate the `ray_end` and convert to `ray_depth` when
necessary.
2023-11-29 12:33:08 -03:00
Lukas Tönne
5bc82b5b7c Geometry Nodes: Remove experimental volume nodes
The new grid socket (#115270) will make these nodes obsolete and
provide more elegant ways of implementing the features. Removing
these nodes now to clean up and make future changes simpler.

Pull Request: https://projects.blender.org/blender/blender/pulls/115567
2023-11-29 16:02:06 +01:00
Miguel Pozo
21712cf746 Fix: EEVEE-Next: Object::visibility_flag in material_sync
Take `OB_HIDE_SHADOW` into account. (fix #115488)
Include the relevant visibility flags into `MaterialKey`.

Pull Request: https://projects.blender.org/blender/blender/pulls/115575
2023-11-29 15:44:15 +01:00
Hans Goudey
aa2cdf283a Cleanup: Use proper type for subdiv CCG faces 2023-11-29 08:47:58 -05:00
Jacques Lucke
7c1a0e57ca Cleanup: remove unused code 2023-11-29 14:35:04 +01:00
Iliya Katueshenock
2ce4c4e8d2 Fix #115548: Missed sort after multithreaded algorithm
To make sure result is deterministic, sorting is used.
This was missed in one of last speedup.

Pull Request: https://projects.blender.org/blender/blender/pulls/115568
2023-11-29 14:16:37 +01:00
Jacques Lucke
7a7b7196f9 Geometry Nodes: extract global data passed to a geometry nodes invocation to separate struct
This avoids some duplication between the modifier and operator evaluation
contexts and also makes it easier to make independent from a specific
evaluation context (so e.g. the simulation nodes code shouldn't care whether
it's used from a modifier or operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/115512
2023-11-29 13:22:20 +01:00
casey bianco-davis
1970de9d19 GPv3: Fix #113994: Overlay: Hide points for locked layers.
This makes so that locked layers don't show the points and the lines aren't visibly selected.

This separate the batch ensure function into two function, one for handling the visible grease pencil batch and one for handling the edit mode overlay batch.

This also makes it so that only selected curves show the points that make up it, (this matches legacy grease pencil).

Pull Request: https://projects.blender.org/blender/blender/pulls/114751
2023-11-29 11:31:50 +01:00
Campbell Barton
807993d2b7 Cleanup: use single underscore prefixes
Double underscores are reserved for implementation macros.
2023-11-29 18:09:01 +11:00
Campbell Barton
a144fcfa50 Cleanup: declare values for enums that may be written into blend files 2023-11-29 17:37:04 +11:00
Campbell Barton
c7593cc99f Cleanup: replace MAX2 with std::max 2023-11-29 17:11:09 +11:00