Commit Graph

1209 Commits

Author SHA1 Message Date
Jeroen Bakker
e91dd645a9 Fix concern: lookup could fail.
Concern raised on {93e2491ee724}.
2021-03-17 09:18:39 +01:00
Jeroen Bakker
187f358f33 Cleanup: Use blender::MultiValueMap.
Fixed concern raise on {93e2491ee724}.
2021-03-17 09:14:38 +01:00
Jeroen Bakker
4ce5dfe54c Cleanup: NULL -> nullptr. 2021-03-16 15:08:23 +01:00
Jeroen Bakker
93e2491ee7 Cleanup: replace std::map with blender::Map. 2021-03-16 15:03:30 +01:00
Jeroen Bakker
4ca8e09b24 Cleanup: Replace std::vector with blender::Vector. 2021-03-16 15:03:30 +01:00
Jeroen Bakker
5266e17ed5 Cleanup: Modernize iterators. 2021-03-16 15:03:30 +01:00
Jeroen Bakker
0efca18df7 Cleanup: Modernize iter. 2021-03-16 15:03:30 +01:00
Jeroen Bakker
b43d4c63cf Cleanup: Removed commented out code. 2021-03-16 15:03:30 +01:00
Jeroen Bakker
8ea3ab5b42 Cleanup: Remove unimplemented declarations. 2021-03-16 15:03:30 +01:00
Jeroen Bakker
d49e7b82da Compositor: Redesign Cryptomatte node for better usability
In the current implementation, cryptomatte passes are connected to the node
and elements are picked by using the eyedropper tool on a special pick channel.

This design has two disadvantages - both connecting all passes individually
and always having to switch to the picker channel are tedious.

With the new design, the user selects the RenderLayer or Image from which the
Cryptomatte layers are directly loaded (the type of pass is determined by an
enum). This allows the node to automatically detect all relevant passes.

Then, when using the eyedropper tool, the operator looks up the selected
coordinates from the picked Image, Node backdrop or Clip and reads the picked
object directly from the Renderlayer/Image, therefore allowing to pick in any
context (e.g. by clicking on the Combined pass in the Image Viewer). The
sampled color is looked up in the metadata and the actual name is stored
in the cryptomatte node. This also allows to remove a hash by just removing
the name from the matte id.

Technically there is some loss of flexibility because the Cryptomatte pass
inputs can no longer be connected to other nodes, but since any compositing
done on them is likely to break the Cryptomatte system anyways, this isn't
really a concern in practise.

In the future, this would also allow to automatically translate values to names
by looking up the value in the associated metadata of the input, or to get a
better visualization of overlapping areas in the Pick output since we could
blend colors now that the output doesn't have to contain the exact value.

Idea + Original patch: Lucas Stockner
Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D3959
2021-03-16 07:43:17 +01:00
Jeroen Bakker
fd905c1059 Cleanup: fix clang-tidy errors when COM_debug is active. 2021-03-12 14:32:24 +01:00
Jeroen Bakker
7388f9df71 Cleanup: Compiler warnings with COM_TM_NOTHREAD active. 2021-03-12 13:36:49 +01:00
Campbell Barton
70e73974b5 Cleanup: spelling 2021-03-10 15:47:50 +11:00
Ankit Meel
cdb0b3cedc Compositor: Silence -Wself-assign
Use member initializer list for constructor.
Use `this->` for member function.
Introduced in rBef53859d24a9720882e3ca6c5415faefec6fb82c

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10653
2021-03-09 19:19:21 +05:30
Ankit Meel
be6b3923f5 Compositor: silence clang/clang-tidy override warnings
`-Winconsistent-missing-override` and `modernize-use-override`.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10654
2021-03-09 19:19:08 +05:30
Jeroen Bakker
1775ea74c1 Cleanup: Change extension .cpp to .cc 2021-03-08 13:41:52 +01:00
Jeroen Bakker
d5c727c6ea Fix windows compilation. 2021-03-05 16:08:11 +01:00
Jeroen Bakker
ffd5b0d91e Cleanup: Use blender::Vector. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
0729376a13 Fix: compilation OpenCL kernels Compositor.
introduced during cleanup.
2021-03-05 16:56:14 +01:00
Jeroen Bakker
d4c673d4c6 Cleanup: use blender::Vector. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
7c8ec99b9a Cleanup: use blender::Vector. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
7bccbce512 Cleanup: use snake case. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
921138cf5f Cleanup: rename private attribtue m_max_read_buffer_offset. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
87842d6388 Cleanup: Use blender::Vector in ExecutionGroup. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
fde150fee4 Cleanup: Use std::Vector for chunk execution status. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
e1d9b095e4 Cleanup: Use enum class for eChunkExecutionState. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
3d4a844a50 Cleanup: ExecutionSystem::find_output_execution_groups. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
8b2fb7aeed Cleanup: Remove unused method. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
6ebd34c802 Cleanup: Make WorkPackage a struct 2021-03-05 16:56:14 +01:00
Jeroen Bakker
ba5961b4cd Cleanup: use MIN2/MAX2 in compositor. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
3d3a5bb892 Cleanup: Remove using statements. 2021-03-05 16:56:14 +01:00
Jeroen Bakker
a592f7e6cb Cleanup: COM_convert_data_types parameters. 2021-03-05 13:46:25 +01:00
Jeroen Bakker
b12be5a872 Cleanup: Remove static struct without data. 2021-03-05 13:46:25 +01:00
Campbell Barton
12b529b3a6 Cleanup: redundant struct declarations 2021-03-04 17:17:19 +11:00
Jacques Lucke
3f716bb626 Cleanup: clang tidy
Warnings:
* readability-inconsistent-declaration-parameter-name
* readability-redundant-smartptr-get
2021-03-03 12:23:02 +01:00
Jacques Lucke
b9ee877752 Cleanup: make format 2021-03-03 12:14:06 +01:00
Jeroen Bakker
2d4b638a67 Cryptomatte: Read metadata from multilayer OpenEXR.
Currently the compositor reads cryptomatte meta-data from the render
result. When loading a multilayer open exr file the meta-data was ignored.
This patch will also load the cryptomatte meta-data from multilayer open
exr files.

This enabled workflows where the rendering and compositing are done in
separate scenes or for future changes where the cryptomatte node will
use the meta-data for name matching and color picking.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D10384
2021-03-02 11:20:01 +01:00
Jeroen Bakker
87ace46827 Cryptomatte: Manifest Parsing.
This patch adds manifest parsing to Cryptomatte. Normally when loading
cryptomatte layer from an OpenEXR file the manifest contains data to
convert a hash to its original name of the object/material. In the
future we want to use this to support lookup of cryptomatte
hashes and show it to the user.

Currently this logic isn't available to users (for now), but is required
by D3959 where a new cryptomatte workflow is implemented.
2021-02-26 14:13:15 +01:00
Hans Goudey
27fd066baf Cleanup: Clang tidy inconsistent parameter name 2021-02-18 13:59:08 -06:00
Campbell Barton
9df9269173 Cleanup: sort structs, file-lists 2021-02-19 02:19:53 +11:00
Jeroen Bakker
0da10b279a Cleanup: Use static struct for work scheduler. 2021-02-17 16:49:27 +01:00
Jeroen Bakker
3a4b7e2bc6 Cleanup: Use struct for WorkScheduler. 2021-02-17 16:49:27 +01:00
Jeroen Bakker
b452438d0a Cleanup: Use snake case for method names. 2021-02-17 16:49:27 +01:00
Jeroen Bakker
cc45dfa07f Cleanup: Remove definition in header without implementation. 2021-02-17 16:49:27 +01:00
Brecht Van Lommel
859118d8f6 BLI: add BLI_simd.h header to wrap SSE includes
In preparation of adding Neon support.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
Jeroen Bakker
0cbbb9edd7 Cleanup: Split COM_compositor into multiple functions. 2021-02-17 15:41:03 +01:00
Jeroen Bakker
37de612104 Cleanup: make local vars const. 2021-02-17 15:25:24 +01:00
Jeroen Bakker
4329a01d37 Cleanup: Bundle static globals in struct 2021-02-17 15:25:24 +01:00
Jeroen Bakker
52b2cb6ea3 Cleanup: Comment style 2021-02-17 15:25:24 +01:00
Jeroen Bakker
6afc04f2a0 Cleanup: Allocate Execution System on stack. 2021-02-17 15:25:24 +01:00