Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2022-05-11 17:50:26 +0300
committerJeroen Bakker <jeroen@blender.org>2022-05-11 17:50:26 +0300
commit7e4b85820ea8c0921fcac95562f092312f2e0133 (patch)
treea89a7dbd53b06f28edb288d8016c1d2560401ae4
parent541fa83ba42f1e53ccc0ef667889275fe0f9893c (diff)
Query the metadata from input nodes.temp-T97905-compositor-meta-data
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.h19
-rw-r--r--source/blender/compositor/operations/COM_ReadBufferOperation.cc5
-rw-r--r--source/blender/compositor/operations/COM_ReadBufferOperation.h1
3 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h
index aa9e4329ab6..a297a21bb98 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.h
+++ b/source/blender/compositor/intern/COM_NodeOperation.h
@@ -610,6 +610,25 @@ class NodeOperation {
* The return parameter holds an instance or is an nullptr. */
virtual std::unique_ptr<MetaData> get_meta_data()
{
+ for (NodeOperationInput &input : inputs_) {
+ if (input.get_data_type() != DataType::Color) {
+ continue;
+ }
+ std::unique_ptr<MetaData> meta_data = input.get_reader()->get_meta_data();
+ if (meta_data.get()) {
+ return meta_data;
+ }
+ }
+
+ for (NodeOperationInput &input : inputs_) {
+ if (input.get_data_type() == DataType::Color) {
+ continue;
+ }
+ std::unique_ptr<MetaData> meta_data = input.get_reader()->get_meta_data();
+ if (meta_data.get()) {
+ return meta_data;
+ }
+ }
return std::unique_ptr<MetaData>();
}
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cc b/source/blender/compositor/operations/COM_ReadBufferOperation.cc
index 81f046af1b9..b9356fc1c77 100644
--- a/source/blender/compositor/operations/COM_ReadBufferOperation.cc
+++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cc
@@ -122,4 +122,9 @@ void ReadBufferOperation::update_memory_buffer()
buffer_ = this->get_memory_proxy()->get_buffer();
}
+std::unique_ptr<MetaData> ReadBufferOperation::get_meta_data()
+{
+ return get_memory_proxy()->get_write_buffer_operation()->get_meta_data();
+}
+
} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h
index 54c363eff7a..4be6d234eed 100644
--- a/source/blender/compositor/operations/COM_ReadBufferOperation.h
+++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h
@@ -57,6 +57,7 @@ class ReadBufferOperation : public NodeOperation {
}
void read_resolution_from_write_buffer();
void update_memory_buffer();
+ std::unique_ptr<MetaData> get_meta_data() override;
};
} // namespace blender::compositor