Commit Graph

108123 Commits

Author SHA1 Message Date
Richard Antalik a57ba4147f Fix T88237: Prefetch crash on rendering scene strip
Prefetch needs to avoid rendering scene strips, because

 - Rendering in background needs own dependency graph, which fails to
   initialize from evaluated data.
 - This locks UI and can make it unresponsive for long time periods.

In T88237 prefetch failed to avoid scene strip, because of effect strip
was attached to scene strip.

Ensure, that no effect that is attached to scene strip either directly
or indirectly would be rendered.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11247
2021-08-24 00:58:01 +02:00
Richard Antalik 709ce44617 Fix T90407: Split fails on transition strips
When splitting strips, first they are duplicated and then offsets
adjusted. This can fail on cross transitions, because some strips don't
overlap with split frame.

All strips, that relate to each other must be duplicated to ensure
correct relations after splitting, so solution is to delete non
overlapping strips from left or right side respectively.

Since cross transition don't have to overlap with source strips,
splitting such strips would lead to effect being deleted, which
could cause crash when iterating over strips in python. Therefore
splitting of such strips is now forbidden and will generate error.

Splitting of transition will also generate error solely because such
operation is illogical.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D12121
2021-08-24 00:52:24 +02:00
Richard Antalik 24a3446787 Fix T90646: VSE hangs when strips overlap
When all strips are selected and overlap is caused, this causes VSE to
hang in infinite loop, because such situation should never happen.

To prevent infinite loop, ensure, that strip overlap is not tested
against single overlapping strip itself.

Prevent overlap that can not be handled because of issue described above
by moving overlapping strip between channels.

Reviewed By: campbellbarton

Differential Revision: D12209
2021-08-24 00:46:34 +02:00
Richard Antalik a0c8ee057a Fix T90467: Initialize CurveMapping on demand
`CurveMapping.evaluate` function expectes `CurveMapping` to be
initialized, while this wasn't documented.

I don't see any reason for not initializing `CurveMapping` on demand.
Initialization was added in rBf16047c2df1e8be56bf76524f9eb1fa5ecde2176

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D12145
2021-08-24 00:37:32 +02:00
Himanshi Kalra 875c2ea5b5 Using relative threshold for floats in mesh comparison
Changes the threshold comparison from absolute to relative.
Removes threshold for MLoopCol comparison.

Adds a compare relative threshold function.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12273
2021-08-24 00:50:03 +05:30
Germano Cavalcante be1891e895 Cleanup: move the buffer list to 'MeshBufferCache'
The cache is used to fill the buffer list.
2021-08-23 13:44:31 -03:00
Germano Cavalcante cbe4036406 Cleanup: Isolate the batch list struct into a struct called MeshBatchList
This allows for a simplification of macros and combines with
`MeshBufferList`.
2021-08-23 13:43:45 -03:00
Germano Cavalcante eb0c50ac78 Cleanup: rename 'MeshBufferExtractionCache' to 'MeshBufferCache'
Matches the existing `MeshBatchCache`.
2021-08-23 13:43:42 -03:00
Germano Cavalcante 6e51ef9531 Cleanup: rename 'MeshBufferCache' to 'MeshBufferList'
`MeshBufferList` is more specific and can avoid confusion with
`MeshBufferExtractionCache`.
2021-08-23 13:41:03 -03:00
Germano Cavalcante ebdae75736 Cleanup: Move 'tris_per_mat' member out of 'MeshBufferCache'
`MeshBufferCache` is a struct representing a list of buffers.

As such, `GPUIndexBuf **tris_per_mat` is out of place as it does not
represent one of the buffers in the list.

In fact this member should be close to `GPUBatch **surface_per_mat` as
they are related.

The code for dependencies between buffer and batch had to be reworked
as it relies on the member's position.

Differential Revision: https://developer.blender.org/D12227
2021-08-23 13:37:32 -03:00
Manuel Castilla 7d17f2addf Fix T89998: Cryptomatte node output values doubled with Multi-View
When using a Cryptomatte node and selecting 2 views in Multi-View,
its output values are doubled. When selecting 3 tripled and so on.
This causes incorrect compositing results for all the views.

The node creates an input operation for each rendered cryptomatte
pass. In Multi-View, passes are rendered for each view but compositor
is executed per view and should only create operations for those
corresponding to the current view being executed. Otherwise duplicated
operations add up later in cryptomatte operation.

Reviewed By: jbakker

Maniphest Tasks: T89998

Differential Revision: https://developer.blender.org/D12216
2021-08-23 17:09:59 +02:00
Manuel Castilla 4c6d207343 Compositor: Fix crash enabling buffer groups on full frame
Full frame doesn't support this option as all operations are already
buffered. UI option will be removed in the future.
2021-08-23 17:09:59 +02:00
Manuel Castilla 42f89b9212 Compositor: Fix incorrect copying of uchar buffers
Row stride and the area x coordinate offset were not taken into
account.
2021-08-23 17:09:59 +02:00
Manuel Castilla 153b45037f Compositor: Full frame matte nodes
Adds full frame implementation to Channel Key, Chroma Key, Color Key,
Color Spill, Cryptomatte, Difference Key, Distance Key, Keying,
Keying Screen and Luminance Key nodes. The other nodes
in "Matte" sub-menu are submitted separately.

No functional changes.

Part of T88150.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12220
2021-08-23 17:09:59 +02:00
Manuel Castilla daa7c59e38 Compositor: Full frame Bokeh Blur and Blur nodes
Adds full frame implementation to these nodes operations.

When enabling "extend bounds" node option, tiled implementation
result is slightly different because it's using `TranslateOperation`
with bilinear sampling for centering.
Full frame always uses nearest to don't lose image quality.
It has the disadvantage of causing image jiggling on backdrop
when switching size values as it's not pixel perfect.
This is fixed by rounding to even.

No functional changes.

Part of T88150.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12167
2021-08-23 17:08:45 +02:00
Manuel Castilla 344aca3b1b Compositor: Full frame distort nodes
Adds full frame implementation to "Displace", "Crop", "Flip",
"Plane Track Deform", "Corner Pin", "Movie Distortion",
"Lens Distortion" and "Map UV" nodes.

The other nodes in "Distort" sub-menu are implemented
separately in other commits.

No functional changes.

Part of T88150.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12166
2021-08-23 17:07:37 +02:00
Manuel Castilla 064167fce7 Compositor: Full frame transform nodes
Adds full frame implementation to "Rotate", "Transform" and
"Stabilize2D" nodes.
To avoid sampling twice when concatenating scale and rotate
operations, a `TransformOperation` is implemented with all
the functionality.
The nodes have no functional changes.

Part of T88150.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12165
2021-08-23 16:36:09 +02:00
Manuel Castilla a95e56b741 Compositor: Add sampling methods for full frame
Current sampling methods have off by one issues on full frame:
- Bilinear sampling do not fully sample bottom and left image border,
 creating edges.
- Single elem buffers are not sampled at all when they should be
 at least on the borders to smooth edges.
- EWA filtering is partially implemented on `ReadBufferOperation`, it
 needs to be moved to `MemoryBuffer` on full frame.

In order to not affect tiled implementation, this commit creates
specific sampling methods for full frame needs.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12164
2021-08-23 16:36:09 +02:00
Manuel Castilla 8f4730e66f Compositor: Full frame convert nodes
Adds full frame implementation to all nodes in "Converter" sub-menu
except "ID Mask" which is implemented separately.
No functional changes.

Part of T88150.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12095
2021-08-23 16:36:08 +02:00
James Partsafas 21d4a888b8 Fix T88107: rename Convertor to Converter nodes to correct spelling
Differential Revision: https://developer.blender.org/D11198
2021-08-23 16:27:33 +02:00
Mikhail Matrosov cd118c5581 Fix T90423: black pixels after shadow terminator geometry offset
Solves an error in the principled diffuse BSDF, where it was not correctly
rejecting directions outside the hemisphere.

Differential Revision: https://developer.blender.org/D12283
2021-08-23 15:47:34 +02:00
Germano Cavalcante 27f138f4c8 Cleanup: rename parameter in transform utility
`inv_unit_scale` is not descriptive.
2021-08-23 09:49:01 -03:00
Germano Cavalcante 2f0e350ffd Fix T90872: Dopesheet messes up keyframe handles
Y coordinate was not being constrained.

Caused by {rBb0d9e6797fb866e7a58876c7977c98a190070310}
2021-08-23 09:49:01 -03:00
YimingWu b4b3f518aa GPencil: Fix memory leak in split & trim functions
Authored by Henrik Dick (weasel)

Reviewed By YimingWu (NicksBest), Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D12284
2021-08-23 20:46:38 +08:00
Philipp Oeser 5aa3167e48 Fix T90772: Image Editor not sampling color from the the currently
selected pass

Caused by {rBebaa3fcedd23}.

Seems this above commit assumed an ImageUser's multi_index is only used
for Multiview/Stereo? This is not the case, multi_index also stores the
index for layer/pass combination.

If we call both BKE_image_multilayer_index and BKE_image_multiview_index
(even though this is not appropriate/needed for multilayer images?), we
might end up overwriting multi_index again.

note: looking at this I was also wondering why we update the ImageUser
in image-buffer-aquiring funnctions [and not from the UI, e.g.
template_image_layers, but that is a whole different story I guess, see
comment in T90772 as well]

note2: this could also use a utility function (this is not the only
place where this is done), this is fo a cleanup commit.

Maniphest Tasks: T90772

Differential Revision: https://developer.blender.org/D12267
2021-08-23 13:54:52 +02:00
Jeroen Bakker 8165333de9 Pipeline: Use more explicit cuda versions. 2021-08-23 13:47:40 +02:00
Philipp Oeser 9564b6cf23 Fix T90651: camera reconstruction crash without scene camera
This was working differently in 2.79, tried tracking this down and it
seems this was wrong since the 2.8 beginning in {rB7907dfc40018}.

This would not only crash without an active scene camera, but would also
result in different tracks from different camera's constraints could not
be selected.

So select id depends on corresponding camera, remove the dependency on
scene camera completely.

Maniphest Tasks: T90651

Differential Revision: https://developer.blender.org/D12230
2021-08-23 12:52:23 +02:00
Campbell Barton 0682af0d63 RNA: add length augmented to RNA_string_get_alloc
This was noted as a TODO as it wraps RNA_property_string_get_alloc
which takes a length return argument.
2021-08-23 15:08:48 +10:00
Campbell Barton 62f2204d65 Cleanup: rename len to str_len for BLF functions
Make it obvious which variable this is the length of.
2021-08-23 15:08:28 +10:00
Campbell Barton aa067bef5e Cleanup: use BLI_str_utf8 prefix
Rename:

- BLI_str_utf8_invalid_byte  (was BLI_utf8_invalid_byte)
- BLI_str_utf8_invalid_strip (was BLI_utf8_invalid_strip)
2021-08-23 15:02:13 +10:00
Germano Cavalcante 0de3d4e8c7 Fix T90847: snap to face of Add Primitive tool not working in edit mode
BVHTree was being created but not balanced.
Error introduced in {rBfcc844f8fbd0}.
2021-08-22 23:48:54 -03:00
Ankit Meel b477333473 Cleanup: fix comment about compiler support.
Differential Revision: https://developer.blender.org/D12288
2021-08-22 22:15:28 +05:30
Harley Acheson a1e91fbef3 BLF: Remove space_userpref.py font_kerning_style
Remove `font_kerning_style` from `space_userpref.py` since this is no
longer valid.

See more details in D12276

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

Reviewed by Campbell Barton
2021-08-22 09:26:06 -07:00
Lukas Stockner 721fad37a1 Fix Windows builds after Zstandard commits 2021-08-21 23:31:51 +02:00
Lukas Stockner 67c29bc5a2 Use Zstandard compression for the sequencer cache
Reviewed By: campbellbarton, brecht, mont29

Differential Revision: https://developer.blender.org/D5799
2021-08-21 21:39:06 +02:00
Lukas Stockner 2ea66af742 Add support for Zstandard compression for .blend files
Compressing blendfiles can help save a lot of disk space, but the slowdown
while loading and saving is a major annoyance.
Currently Blender uses Zlib (aka gzip aka Deflate) for compression, but there
are now several more modern algorithms that outperform it in every way.

In this patch, I decided for Zstandard aka Zstd for several reasons:
- It is widely supported, both in other programs and libraries as well as in
  general-purpose compression utilities on Unix
- It is extremely flexible - spanning several orders of magnitude of
  compression speeds depending on the level setting.
- It is pretty much on the Pareto frontier for all of its configurations
  (meaning that no other algorithm is both faster and more efficient).

One downside of course is that older versions of Blender will not be able to
read these files, but one can always just re-save them without compression or
decompress the file manually with an external tool.

The implementation here saves additional metadata into the compressed file in
order to allow for efficient seeking when loading. This is standard-compliant
and will be ignored by other tools that support Zstd.
If the metadata is not present (e.g. because you manually compressed a .blend
file with another tool), Blender will fall back to sequential reading.

Saving is multithreaded to improve performance. Loading is currently not
multithreaded since it's not easy to predict the access patterns of the
loading code when seeking is supported.
In the future, we might want to look into making this more predictable or
disabling seeking for the main .blend file, which would then allow for
multiple background threads that decompress data ahead of time.

The compression level was chosen to get sizes comparable to previous versions
at much higher speeds. In the future, this could be exposed as an option.

Reviewed By: campbellbarton, brecht, mont29

Differential Revision: https://developer.blender.org/D5799
2021-08-21 21:39:06 +02:00
Lukas Stockner 2b170f16d6 Refactor low-level blendfile reading into separate files
Instead of handling mmap, compression etc. all directly in readfile.c, refactor
the code to use a generic FileReader.
This makes it easier to add new compression methods or similar, and allows to
reuse the logic in other places (e.g. thumbnail reading).

Reviewed By: campbellbarton, brecht, mont29

Differential Revision: https://developer.blender.org/D5799
2021-08-21 21:38:57 +02:00
Ankit Meel 34a05f39be Clang: warn about C++20 designated initializers
With the ongoing transition to C++ files, Windows build
breaks often because of designated initializers.
Now we have two compilers to catch the MSVC build error on.

Reviewed By: #platform_macos, brecht, campbellbarton
Differential Revision: https://developer.blender.org/D11940
2021-08-21 14:02:50 +05:30
Campbell Barton 0b7947e855 Cleanup: minor changes to blf_font.c
- Use early return when kerning isn't used.
- Remove early return that prevented matching acquire/release calls.
2021-08-21 17:46:50 +10:00
Campbell Barton 47e68537f8 Cleanup: organize blf_font.c functions using doxy-sections
Functions in this file were scattered and not well organized.
2021-08-21 17:41:40 +10:00
Campbell Barton c671bfe14e Cleanup: spelling in comments & minor cleanup
Also hyphenate 'mouse-move' use doxy sections in render_update.c &
move function comment from the header to the source.
2021-08-21 13:26:54 +10:00
Campbell Barton aed5a27755 Correct build error from 0d7aab2375 2021-08-21 13:22:47 +10:00
Harley Acheson 0d7aab2375 Refactor: BLF Kerning Cache After Use
Optimization of font kerning by only caching kerning values after a
pair is encountered. Also saves unscaled values so they don't have to
be rebuilt between font size changes.

See D12274 for more details and speed comparison.

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

Reviewed by Campbell Barton
2021-08-20 17:48:42 -07:00
Aaron Carlisle b6a1bf757d DocPy: Cleanup missing newline resulting in wrong html generation 2021-08-20 14:54:46 -04:00
Aaron Carlisle 86622467c5 DocPy: Update Dependancies
Updates sphinx and the theme to the latest version along with any of their dependencies.

Note that we will be sticking to sphinx 4.1.1 until sphinx 4.2 for the same reasons listed in:
https://developer.blender.org/rBM8334
2021-08-20 13:46:38 -04:00
Alaska cd8d9383e7 Fix T90804: small grammatical error in noise threshold description
Differential Revision: https://developer.blender.org/D12277
2021-08-20 17:43:24 +02:00
Kévin Dietrich 1b5f17b867 Cleanup, use BKE_scene_uses_cycles_experimental_features 2021-08-20 15:00:58 +02:00
Kévin Dietrich 6a404bc633 Cleanup, remove extra code from previous commit
This got accidentally introduced while revising dependencies between
patches for this feature, did not notice until it was too late.
2021-08-20 14:48:47 +02:00
Kévin Dietrich 9bfc47c933 Alembic Procedural: basic cache control settings
This adds a setting to enable data caching, and another one to set the
maximum cache size in megabytes.

When caching is enabled we load the data for the entire animation in
memory, as we already do, however, if the data exceeds the memory limit,
render is aborted.

When caching is disabled, we simply load the data for the current frame
in memory.

Ref D10197

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11163
2021-08-20 14:34:43 +02:00
Germano Cavalcante accf3045be Fix memory leak while processing mouse event
Assignment missed.
2021-08-20 09:06:19 -03:00