Commit Graph

107074 Commits

Author SHA1 Message Date
Germano Cavalcante 4a7951fede Cleanup: Separate each extractor into specific compile units
Makes code cleaner and easier to find.
2021-07-01 11:13:58 -03:00
Julian Eisel 4617172740 Fix race condition when loading multiple File/Asset Browsers at once
When multiple File or Asset Browsers would load at once (e.g. when loading a
file with two File Browsers open) and they would load multiple directories or
.blend files (using the Recursions option in the File Browser or loading an
asset library with multiple .blends), often only one File/Asset Browser would
correctly load all files. Others would be incomplete or entirely empty. That
was because of a race condition, where the directories or .blend files would be
loaded concurrently and the first one that finished would cancel the other
ones. This again happened because they used the job system with the same
"owner", which by design makes all jobs with the same owner cancel as soon as
the first is finished.
Address this by making sure they have different owners. That is, not the scene
anymore, but the filelist the job belongs to. Doesn't make much sense to use
the scene as owner for scene-unrelated file loading anyway.

Steps to reproduce were:
* Open two File Browsers as regular editors.
* In the Display Settings popover, set "Recursions" to 2 or 3 levels.
* Navigate to a directory with plenty of subdirectories in both File Browsers.
* Save the file.
* Reload the file, one of the File Browsers likely has an incomplete file list.

Alternatively, use Asset Browsers and open an asset library containing multiple
.blends.
2021-07-01 15:22:12 +02:00
Jörg Müller a112adf16a Audaspace: porting pulseaudio fixes from upstream. 2021-07-01 14:26:13 +02:00
Jörg Müller 19d19970e4 Fix T88887: Audio causes issues with Playback when PC put to Sleep, Hibernate or when Screensaver appears
Porting WASAPI device reinitialization from upstream.
2021-07-01 14:26:13 +02:00
Brecht Van Lommel 8c3855dc6e Fix broken physics modifiers after cleanup commits
4f3ec0110 and 5a64c687dd should have removed the entire conditional to skip
time depedent modifiers, rather than always enable it.
2021-07-01 12:58:42 +02:00
Paul Golter 229c0580e2 Fix: Export subtitles timecode relative to scene start frame, ignore muted strips
This patch writes the timecode in the .srt file relative to the start
frame of the scene. If the timecode is global but scene does not start
at frame 0 the subtitles don't match if they get loaded in an external
video player. Muted strips will be ignored. Don't allow negative
timecodes in .srt.

Reviewed By: Richard Antalik
Differential Revision: http://developer.blender.org/D11762
2021-07-01 12:21:31 +02:00
Campbell Barton 96d487b3ae Cleanup: remove redundant calls to BMO_error_clear 2021-07-01 17:25:27 +10:00
Campbell Barton aaa8ee1307 Cleanup: remove bmesh-operator error code
The error codes could be used to look up messages from a table
of messages however this wasn't especially useful.

Now all calls to BMO_error_raise must inclue a message.
2021-07-01 17:01:19 +10:00
Campbell Barton 927456491a Fix edit-mesh partial update regression when snapping to normals
Edit-mesh partial update logic assumed translate didn't need normals
to be recalculated (for faces with all vertices being transformed).

However translate can optionally rotate which requires
all transformed normals to be updated.

Check for this case and use the previous partial-update method
when it modified extra geometry, so the normals are properly reset.
Further updates need not recalculate them.
2021-07-01 14:53:01 +10:00
Campbell Barton 02df67875a Cleanup: replace booleans with enum for storing translate rotation 2021-07-01 13:30:19 +10:00
Campbell Barton f578e31a8e Correction to T89571 fix 4546f176eb
Supporting both object & edit-mode is more involved.
Both cases are now supported with object mode tracking the last-used
state for rotation so it's only reset once when rotation is disabled.
2021-07-01 12:58:10 +10:00
Campbell Barton 4546f176eb Fix T89571: Align Orientation to Target keeps rotation when toggled 2021-07-01 11:54:05 +10:00
Campbell Barton 1e532eb37a BLI_linklist_stack: use cast to prevent warnings when used in C++ 2021-07-01 11:24:54 +10:00
Campbell Barton aa112dc77c Cleanup: spelling 2021-07-01 11:16:25 +10:00
Campbell Barton 39188f3c99 Cleanup: rename playhead to current-frame 2021-07-01 11:06:04 +10:00
Campbell Barton 930ecef9b5 Cleanup: outdated IPO references in comments 2021-07-01 11:06:04 +10:00
Campbell Barton 753806c731 Cleanup: spelling 2021-07-01 10:25:49 +10:00
Campbell Barton a689b5932d Cleanup: remove unused internal grease pencil definitions 2021-07-01 10:25:49 +10:00
Campbell Barton dba675fb65 Cleanup: split normal calculation into it's own file
Normals now includes many functions including normal splitting &
custom normal manipulation split this into it's own file
to centralize related functions.
2021-07-01 10:25:49 +10:00
Campbell Barton 924596abad Cleanup: clang-format, clang-tidy 2021-07-01 10:25:49 +10:00
Johnny Matthews c1fc180861 Geometry Nodes: Curve Primitive Circle
This node has two modes: the first mode computes a circle from three
locations and a resolution. The second takes radius and resolution.
The first mode also outputs the center of the computed circle as
a vector.

Differential Revision: https://developer.blender.org/D11650
2021-06-30 19:22:13 -05:00
Hans Goudey 5a64c687dd Cleanup: Fix compiler warning from previous commit
The use_deform argument was always passed as zero or one, so the "< 0"
check is no longer necessary.
2021-06-30 18:03:45 -05:00
Hans Goudey 4f3ec01101 Cleanup: Use bool instead of int, rename variable
The "useDeform" argument was only passed as 1 or 0, so even though
there was an odd "< 0" comparison, it can be passed as a boolean.
2021-06-30 16:41:53 -05:00
Jacques Lucke 17a67bf778 UI: custom free function improvements
This changes `UI_but_func_tooltip_set` so that it allows passing a custom free function, which has two benefits:

* The caller can pass `null` to indicate that the value should not be freed.
* Arbitrary c++ data can be passed to the callback (before the struct had to be trivially destructible).

I added `uiFreeArgFunc` and used it in other places where appropriate.

Differential Revision: https://developer.blender.org/D11738
2021-06-30 17:46:59 +02:00
Philipp Oeser ca12d70af0 Cleanup: variable naming for texture/material SocketPropertyType
Copy-Pasting error in rB3025c348253a

Maniphest Tasks: T88701

Differential Revision: https://developer.blender.org/D11755
2021-06-30 17:29:14 +02:00
Germano Cavalcante 5737193d81 Fix bad versioning of snapping flags
If the value of a macro has changed. We need to change all references to
that macro in the versioning code.
2021-06-30 10:42:09 -03:00
Philipp Oeser 8de8ab38f6 Fix T89535: FCurve.mute UI text wrong
Copy-paste mistake in rB4e9817a4fb29 (copied from fmodifier).

Maniphest Tasks: T89535

Differential Revision: https://developer.blender.org/D11753
2021-06-30 15:38:06 +02:00
Philipp Oeser 0e4245bc28 Fix T89554: UV snapping broken
Caused by {rBfba9cd019f21}.

Above commit reordered toolsettings snapping flags but missed remapping
these for the UV toolsettings in versioning code.

Differential Revision: https://developer.blender.org/D11756
2021-06-30 15:15:32 +02:00
Sebastian Parborg be451354c9 Fix T89153: Follow Path for empty works only in negative values
The old code only clamped cyclic curves
2021-06-30 11:20:42 +02:00
Campbell Barton 918d9291d6 Cleanup: store the result of isLockConstraint for reuse
This was being called for every element in some situations.
2021-06-30 18:40:16 +10:00
Campbell Barton c57b0cae28 Cleanup: rename transform mode variables
Use the term 'mat_final' for calculated matrices used for transforming.
Also rename 'pivot' to 'pivot_local'.
2021-06-30 18:18:30 +10:00
Campbell Barton 4f9ef65dac Transform: support multi-threading for bend 2021-06-30 18:01:14 +10:00
Campbell Barton 2d4ec90497 Transform: support multi-threading for most modes
Multi-threading support for transform modes: bevel-weight, crease,
push-pull, rotate, shear, shrink-fatten, skin-resize, to-sphere,
trackball & translate.

This is done using a parallel loop over transform data.

From testing a 1.5million polygon mesh on a 32 core system
the overall performance gains were between ~20-28%

To ensure the code is thread-safe arguments to shared data are const.

Reviewed By: mano-wii
2021-06-30 16:53:55 +10:00
Campbell Barton 501d2443d0 Cleanup: use const arguments for accessor functions 2021-06-30 16:42:19 +10:00
Campbell Barton df9597cfba Cleanup: use const for datatoc declarations 2021-06-30 16:42:19 +10:00
Johnny Matthews 8884d2d61b Geometry Nodes: Curve Primitive Bezier Segment
Creates a Curve with 1 Bezier Spline from four positions (start,
start handle, end handle, end) and a resolution. The handles are
aligned and mirrored automatically. An "Offset" mode is also included
to allow specifying the handles relative to the control points.

The default settings recreate the existing default Bezier Curve in the
3D viewport add menu.

Differential Revision: https://developer.blender.org/D11648
2021-06-30 00:03:55 -05:00
Campbell Barton c36d2a9a7a Cleanup: rename 'count' to 'len'
Reserve the term count for values that require calculation
(typically linked lists).

Without this convention it's difficult to know if using a length
accessor function in a loop will be O(N^2) without inspecting the
underlying implementation.
2021-06-30 14:39:32 +10:00
Campbell Barton 77ac1f39c4 Cleanup: unused arg warnings 2021-06-30 14:32:53 +10:00
Johnny Matthews d3788207aa Geometry Nodes: Curve Primitive Quadratic Bezier Segment
This patch is for a node that creates a poly spline from a
3 point quadratic Bezier. Resolution is also specified.

Curve primitives design task: T89220

Differential Revision: https://developer.blender.org/D11649
2021-06-29 22:39:26 -05:00
Johnny Matthews 21ebee2580 Geometry Nodes: Curve Primitive Spiral
This node creates a curve spline and gives control for the number of
rotations, the number of points per rotation, start and end radius,
height, and direction. The "Reverse" input produces a visual change,
it doesn't just change the order of the control points.

Differential Revision: https://developer.blender.org/D11609
2021-06-29 22:22:28 -05:00
Johnny Matthews 86c6769e20 Geometry Nodes: Curve Primitive Spiral
This patch adds a Curve Primitives menu in Geometry nodes with an
initial entry of a star primitive.

The node is a basic star pattern node that outputs a poly spline.
Options control the inner and outer radius, the number of points,
and the twist of the valleys.

Differential Revision: https://developer.blender.org/D11653
2021-06-29 22:00:29 -05:00
Germano Cavalcante 2d35eed34d Cleanup: split uses of _snap_sequencer_apply according to transform mode
The `applySnap` callback of each mode was overwriting the value
calculated in `transform_snap_sequencer_apply`.
2021-06-29 18:08:41 -03:00
Germano Cavalcante 929d9ec0c7 Cleanup: Deduplicate code 2021-06-29 17:42:48 -03:00
Germano Cavalcante dd14ea1819 Cleanup: split CalcSnapGeometry in smaller functions 2021-06-29 17:38:34 -03:00
Richard Antalik fba9cd019f VSE: Improved Snapping
Change snapping behavior to snap strip edges when they are close to snap point.
Default behavior is, that each transformed strip is snapped to any other strip.

Implement snapping controls in sequencer tool settings. These controls include:

 - Snapping on/off
 - Ability to snap to playhead and strip hold offset points
 - Filter snap points by excluding sound or muted strips
 - Control snapping distance

Snapping controls are placed in timeline header similar to 3D viewport

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11646
2021-06-29 20:30:31 +02:00
Julian Eisel ea43ae4194 Fix crash on link/append for asset data-blocks in Thumbnails mode
Same fix as 03a83b4eb5, but for the Thumbnails display mode.
2021-06-29 20:09:07 +02:00
Brecht Van Lommel 516a060bb3 Fix T89523: Cycles OpenCL compile error after recent changes
Also correctly used inverse transposed matrix for normal transform.
2021-06-29 19:47:11 +02:00
Harley Acheson 999f1f7504 Win32: Window Placement DPI and Scale Adjustment
When using multiple monitors that differ in scale and/or dpi, the
varying sizes of the window titles and borders can cause the placement
of those windows to be out by a small amount. This patch adjusts for
those differences on Windows 10 and newer.

see D10863 for details and examples.

Differential Revision: https://developer.blender.org/D10863

Reviewed by Ray Molenkamp
2021-06-29 09:29:40 -07:00
Julian Eisel 2ff714269e UI: Support setting operator properties for `UILayout.operator_menu_enum()`
`UILayout.operator_menu_enum()` now returns the operator properties, just like
`UILayout.operator()`. This makes it possible to set options for the operator
displayed in the menu. In C it can be done through the new
`uiItemMenuEnumFullO()` or `uiItemMenuEnumFullO_ptr()`.

It's reasonable to have this, probably just a small thing never bothered to
add. D10912 could use it, the following comment can be addressed now too:
https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_nla/nla_buttons.c$583-586
2021-06-29 18:20:56 +02:00
Harley Acheson 63aa6dd845 Cleanup: Win32 Window Creation
This is just some cleanup of the Win32 window creation code. After
CreateWindowExW() this patch uses some early exits to replace some
potentially confusing if blocks. No functional changes.

Differential Revision: https://developer.blender.org/D11446

Reviewed by Ray Molenkamp
2021-06-29 08:51:51 -07:00