Commit Graph

101242 Commits

Author SHA1 Message Date
Iliya Katueshenock
3a3886953b Cleanup: Prepare versioning_250.c to move on C++
To move this file on C++, a lot of changes have to be done.
To avoid adding a lot of long cast operator in loops, and make too
much changes, this usually replaced by using macros.
This is a non-trivial change and done as a separate cleanup.
See: #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/109801
2023-07-16 05:31:08 +02:00
Joseph Eagar
a1a08610b6 Paint: Fix drawing delay bug with paint modes
The paint code doesn't invoke `stroke->redraw`
on `INBETWEEN_MOUSEMOVE` events.  This causes
drawing lag on devices that tends to generate
more of them, like pen tablets.

The code no longer does this.  It does still exclude
inbetween events for updating the paint cursor.

I checked, and only the two paint modes (3d texture paint and image paint) actually
use `stroke->redraw`.  Both are implemented to only draw when necessary:

* `paint_2d_redraw` checks for `.need_redraw` flag on tiles.
* `paint_proj_redraw` checks `ProjStrokeHandle.need_redraw`.

I believe this may be the cause of #93796

Pull Request: https://projects.blender.org/blender/blender/pulls/110119
2023-07-15 20:34:41 +02:00
Clément Foucault
3478093183 GHOST: Bump OpenGL minimum version to 4.3
This removes the GL 3.3 fallback because default viewport engine
now require some features only present in GL 4.3.
Blender now also check for GL version 4.6 instead of 4.5 in some
cases.

Note that this does not remove the OpenGL support on Apple
hardware.

Pull Request: https://projects.blender.org/blender/blender/pulls/109390
2023-07-15 15:31:40 +02:00
Jacques Lucke
35e398ae7a Cleanup: more consistent variable names
The term "state" was used in an earlier version of the code.
2023-07-15 15:07:01 +02:00
Jacques Lucke
831f40bf4a Fix: nested node group ids not stable when grouping/ungrouping
The old code accidentally relied on the random number generator
always producing the same sequence. This was fixed by
22b98a1a55 but made the
underlying bugs more visible.
2023-07-15 15:05:07 +02:00
Campbell Barton
87fc14e52d Fix UV pin invert being used for P/Alt-P shortcuts
Running "Invert Pins" stored the invert option when setting/clearing
pins afterwards.
2023-07-15 16:23:24 +10:00
Campbell Barton
68fbdda77f UI: remove recently added PIE progress display type
PIE was too similar to RING, as there is no need for two similar display
styles - make only one available.

Removal based on replies to !109882.
2023-07-15 16:14:10 +10:00
Campbell Barton
3889baab4f Cleanup: spelling in comments 2023-07-15 15:54:55 +10:00
Campbell Barton
cf95198491 Cleanup: remove static WindowStateGlobal struct in wm_playanim.c
Make this part of the PlayState.
2023-07-15 15:54:45 +10:00
Campbell Barton
f957a6da22 Cleanup: compiler warnings (unused functions & variable) 2023-07-15 15:45:03 +10:00
Hans Goudey
5a86705d4c Cleanup: Move ED_curves.h to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110115
2023-07-15 03:44:58 +02:00
Clément Foucault
d8e4fe3207 EEVEE-Next: Add back fresnel functions 2023-07-14 19:03:08 +02:00
Miguel Pozo
1a24b5f81f EEVEE Next: Hair & Curves
Finalize the hair & curves implementation for EEVEE Next.

- Ensure Hair particles have their own `ResourceHandle` and
  `ObjectKey`, so Motion Blur works correctly.
  (Note that the `ObjectHandle` and the `ObjectKey` are always created
  "on the fly" instead of being stored as `DrawData`, since it's not
  supported for particle system `ID`s).
- The (unused) `ObjectKey::use_particle_hair` has been replaced by an
  integer `sub_key`, so multiple particle systems per object can be
  supported.
- `VelocityModule::step_object_sync` now has 2 extra optional
  parameters for syncing Hair particle systems.
- Update `DRW_curves_update` so it's safe to call it from "Next"
  engines.
- Disable the `sampling.reset()` call from `step_object_sync`, since
  `is_deform` is always true for objects with particle modifiers, and
  this causes the renderer to get stuck at sample 1.

Pull Request: https://projects.blender.org/blender/blender/pulls/109833
2023-07-14 18:23:26 +02:00
Miguel Pozo
e48d0c3cda EEVEE Next: Point Clouds
Add support for point cloud rendering in EEVEE Next.

Update `point_cloud_sub_pass_setup` to retrieve texture based
attributes, since that's the way they're actually meant to be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/109832
2023-07-14 17:23:29 +02:00
Joseph Eagar
9175d9b7c2 Fix: Removing layer in BMesh can destroy others
CustomData_bmesh_copy_data_exclude_by_type was excessively optimized.
It only worked if the ordering (by name) of the attributes in both
customdata sets were the same.

Note that a blender::Set is used (with 32 slots of static storage)
to keep track of uninitialized destination layers.

Alternatives include:
  * Storing a bitflag in CustomDataLayer.flag
  * Using a static bool vector instead.

I don't especially care how it's done, pick one.

Pull Request: https://projects.blender.org/blender/blender/pulls/108683
2023-07-14 17:12:49 +02:00
Hans Goudey
2c1a7d6960 Cleanup: Make format 2023-07-14 10:46:37 -04:00
Hans Goudey
d74b984467 Fix #110107: Subdivide curves crash with empty input 2023-07-14 10:46:31 -04:00
Joseph Eagar
a75b7e1551 Sculpt: Split paint_vertex.cc into paint_weight.cc
Functions shared between the two now live in a new `blender::editors::vwpaint` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/109996
2023-07-14 16:31:17 +02:00
Campbell Barton
b85c7ade70 Cleanup: make ButterworthCoefficients a private struct
As the coefficient members are specific to the implementation,
there is no need for the struct to be public.
2023-07-14 22:33:58 +10:00
Iliya Katueshenock
c38a52885b Fix #110037: uninitialized result array and typos
Regression introduced in 2cfcb8b0b8.

Pull Request: https://projects.blender.org/blender/blender/pulls/110098
2023-07-14 14:08:17 +02:00
Clément Foucault
93d2a202b2 DRW: Fix wrong integer type for drw_view_id 2023-07-14 12:32:03 +02:00
Sietse Brouwer
0a2d4289c0 Fix #109986: Crash when using GP grab tool on object with Subdivide modifier
The grab tool could crash when applied to a Grease Pencil object with a
Subdivide modifier (or any other modifier that changes the number of
points in strokes). This patch prevents the grab tool from crashing.

- Removed a grab tool exception that was no longer necessary.
- Added a missing null check.

Pull Request: https://projects.blender.org/blender/blender/pulls/110078
2023-07-14 12:16:43 +02:00
Jeroen Bakker
03ead30027 Eevee-next: Reflective Light Baking
This PR introduces baking reflective light from light probes. Light probes
are baked on the fly when the light probe data has changed. It doesn't update
directly when other scene data is changed in the viewport.

When doing image rendering the light probes are updated on each frame.

Currently the world probe and closest reflection probe are composited
together in shader. This allows different resolutions. We expect that we
eventually composite it before usage. This would improve the performance.
Unclear if we would support both compositing options eventually.

Pull Request: https://projects.blender.org/blender/blender/pulls/109909
2023-07-14 11:22:18 +02:00
Clément Foucault
a1faf4d678 Metal: Address some mixed integer type warnings 2023-07-14 11:09:46 +02:00
Campbell Barton
32fb40fa76 Cleanup: use function style casts for C++ 2023-07-14 12:31:00 +10:00
Iliya Katueshenock
962e4c3056 Fix #110083: Fix incorrect initialization of bounds max
See: https://en.cppreference.com/w/cpp/types/numeric_limits

Pull Request: https://projects.blender.org/blender/blender/pulls/110084
2023-07-14 03:16:05 +02:00
Joseph Eagar
474b492b38 Sculpt: versioning fix
Moved versioning code back to BKE_sculpt_toolsettings_data_ensure.

Pull Request: https://projects.blender.org/blender/blender/pulls/110081
2023-07-14 00:52:21 +02:00
Joseph Eagar
6220bfe31d Sculpt: Fix memory leak
Reverted blo_update_defaults_scene to simply load the default
Sculpt.flags.
2023-07-13 13:30:38 -07:00
Joseph Eagar
d70b36faed Sculpt: Implement proper versioning code for Sculpt struct
The old Sculpt initialization code did double duty
as versioning code.  This commit implements proper
versioning logic in versioning_400.cc; the existence
of the default fields are checked in DNA and if they
don't exist they're initialized.  This is similar to
how the old code checked if the fields were zero.
2023-07-13 11:06:43 -07:00
Joseph Eagar
27974faa57 Sculpt: Use DNA default system for Sculpt struct 2023-07-13 10:48:49 -07:00
Brecht Van Lommel
7551767f9f USD: more complete import and export of lights
* Exposure import
* Diffuse factor support
* Correct disk radius
* Better non-normalized intensity import
* Sun radius export

Pull Request: https://projects.blender.org/blender/blender/pulls/109929
2023-07-13 19:14:04 +02:00
Falk David
f2f0426980 GPv3: Refactor root_group to be a pointer in DNA
This turns the embedded group into a pointer.

Note: Older files will not load the grease pencil v3 object properly after this.
The objects will not have any layers in them.

Pull Request: https://projects.blender.org/blender/blender/pulls/110007
2023-07-13 18:24:19 +02:00
Jacques Lucke
3a2f5fb9db Editors: move transform code to C++
Also see #103343.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/110049
2023-07-13 17:59:52 +02:00
Nate Rupsis
10428bd2b4 Fix #109787: filter out non Fcurve channels from nlatrack_truncate_temporary_tracks
## Overview

Adding ANIMFILTER_FCURVESONLY  filter to  nlatrack_truncate_temporary_tracks to fix index out of bounds crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/110032
2023-07-13 16:09:57 +02:00
Falk David
7cf8bfd2a0 GPv3: Draw paint cursor 2023-07-13 15:58:16 +02:00
Christoph Lendenfeld
39cc72ea25 Fix: Stepping issue with Butterworth filter
The same issue for Smooth (Gaussian) which was reported in #109799 also affects the Butterworth filter.
When keys were not exactly on the frame, but offset even by minimal values the filter would introduce stepping.
Fix it by using `round()` instead of `(int)` when calculating the index to the filtered values array

Pull Request: https://projects.blender.org/blender/blender/pulls/110060
2023-07-13 15:47:29 +02:00
Christoph Lendenfeld
2e246e355e Fix #109799: Smooth (Gaussian) introduces stepping
When keys were not perfectly on the frame, the index logic
would fail and duplicate data across 2 frames.
Using `round()` solves this. It does not add subframe support though.

Pull Request: https://projects.blender.org/blender/blender/pulls/110059
2023-07-13 15:37:46 +02:00
Sergey Sharybin
cbdb04d88b Refactor: Move external engine to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/110046
2023-07-13 14:39:32 +02:00
Christoph Lendenfeld
babc650779 Fix #109781: Linked datablocks are keyable
Add a simple check when inserting keyframes to ensure the data is not linked

Pull Request: https://projects.blender.org/blender/blender/pulls/109813
2023-07-13 14:09:50 +02:00
Julian Eisel
80cc0dfef2 Fix grid view sometimes dropping last row
As an important optimization, grid views skip items that are not in
view, and instead add empty space to the layout still has the right
dimensions (for scrolling). Calculations were off though, leading to the
last row being dropped when it had too few items to fill it completely.
2023-07-13 14:03:12 +02:00
Falk David
9356e18d15 GPv3: Add on_stroke_begin callback
This adds a new virtual function `on_stroke_begin` to
`GreasePencilStrokeOperation`. It's only called on the first input.
2023-07-13 13:57:23 +02:00
Pratik Borhade
414a17ab4f GPv3: Missing property updates after initial dopesheet support
When property is changed in dopesheet, it is not reflected in
layer block, add notifier in `anim_channels_defines.cc` to fix this.
Also redraw the dopesheet region when layer is added or removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110055
2023-07-13 13:51:14 +02:00
Iliya Katueshenock
c48f8cd12b Geometry Nodes: Rotation socket tooltip
Formatted inspection strings for field/single value of new rotation
type of socket. Called `Rotation`, displayed as XYZ Euler degrees.

See: #92967

Pull Request: https://projects.blender.org/blender/blender/pulls/109851
2023-07-13 13:21:46 +02:00
Joseph Eagar
8db97728b5 Core: fix crash in legacy mesh conversion code. 2023-07-13 00:28:49 -07:00
Christoph Lendenfeld
7acd6e61ab Animation: Butterworth Smoothing filter
Implements the Butterworth Filter
(https://en.wikipedia.org/wiki/Butterworth_filter) for smoothing FCurves.

This filter is ideal for smoothing dense data, like motion capture recordings.
It has the advantage of keeping the shape of the curve
intact while reducing minimal fluctuations.
The disadvantage is the impulse response has a twang,
meaning extreme spikes cause fluctuations to either side.

The implementation is based on the GPL code found here:
https://exstrom.com/journal/sigproc/dsigproc.html

In order to avoid phase shifting, the filter is run forward and backward,
effectively doubling the filter order.

The Redo panel offers the following options

* Frequency Cutoff: 0-n value, where 0 means it cuts everything
so the curve will become straight, the max value is the Nyquist frequency
and depends on the frame rate and the "Samples per Frame" option

* Filter Order: Higher values mean the frequency cutoff is steeper

* Samples per Frame: Before the filter is applied, the curve is resampled
at this interval to avoid errors when there are uneven spaces between frames.
If the keys are on subframes, e.g. a 60fps file in a 30fps scene, increase this value to 2

* Blend: 0-1 value to blend between the original curve and the filter result

* Blend In/Out: The number of frames at the start and end for which
to blend between the filtered and unfiltered curve.
This can help reduce any resulting jumps in the animation at the selection border

The operator can be called from the Key menu. (Key->Smooth->Butterworth Smooth)

Pull Request: https://projects.blender.org/blender/blender/pulls/106952
2023-07-13 09:10:42 +02:00
Campbell Barton
25279acc91 Cleanup: add SPDX copyright 2023-07-13 13:43:20 +10:00
Campbell Barton
ef1ddbaaca Cleanup: remove double spaces after a full-stop 2023-07-13 13:40:25 +10:00
Campbell Barton
f8dea82aaa Cleanup: rename seq_cache_relink_keys to seq_cache_key_unlink
The term relink made some sense when when two links were passed in.
As this removes the link, use the term "unlink" (matching listbase API).
2023-07-13 13:25:40 +10:00
Ray Molenkamp
370ca90632 Cleanup: Add missing copyright notice
missed in the initial commit.
2023-07-12 19:53:19 -06:00
Lucas Tadeu
b11540a65f VSE: Process audio strips waveforms in parallel
A TaskPool is used to execute tasks in the backghround.

Whenever a new sound strip needs their waveform to be computed, it's
added as a task to the TaskPool.

Once the PreviewJob has submitted all available tasks to the task pool,
it waits for all of them to finish before exiting.

The TaskPool is configured to start tasks as soon as they are pushed
onto the task queue.

Authored-by: Lucas Tadeu Teixeira <lucas@lucastadeu.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108877
2023-07-13 03:22:51 +02:00