Compare commits
3 Commits
node-group
...
temp-T9790
Author | SHA1 | Date | |
---|---|---|---|
0825869c82 | |||
cc66340c7e | |||
7aec4a8a45 |
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "COM_MetaData.h"
|
||||
|
||||
#include "BKE_idprop.h"
|
||||
#include "BKE_image.h"
|
||||
|
||||
#include "RE_pipeline.h"
|
||||
@@ -14,6 +15,17 @@ void MetaData::add(const blender::StringRef key, const blender::StringRef value)
|
||||
entries_.add(key, value);
|
||||
}
|
||||
|
||||
static void add_property(IDProperty *id_prop, void *user_data)
|
||||
{
|
||||
MetaData *meta_data = static_cast<MetaData *>(user_data);
|
||||
meta_data->add(id_prop->name, IDP_String(id_prop));
|
||||
}
|
||||
|
||||
void MetaData::add(IDProperty *id_prop)
|
||||
{
|
||||
IDP_foreach_property(id_prop, IDP_TYPE_FILTER_STRING, add_property, this);
|
||||
}
|
||||
|
||||
void MetaData::add_cryptomatte_entry(const blender::StringRef layer_name,
|
||||
const blender::StringRefNull key,
|
||||
const blender::StringRef value)
|
||||
|
@@ -43,6 +43,8 @@ class MetaData {
|
||||
*/
|
||||
void replace_hash_neutral_cryptomatte_keys(const blender::StringRef layer_name);
|
||||
void add_to_render_result(RenderResult *render_result) const;
|
||||
void add(IDProperty *properties);
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("COM:MetaData")
|
||||
#endif
|
||||
|
@@ -215,4 +215,13 @@ void ImageDepthOperation::update_memory_buffer_partial(MemoryBuffer *output,
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<MetaData> ImageOperation::get_meta_data()
|
||||
{
|
||||
MetaData meta_data;
|
||||
if (buffer_->metadata != nullptr) {
|
||||
meta_data.add(buffer_->metadata);
|
||||
}
|
||||
return std::make_unique<MetaData>(meta_data);
|
||||
}
|
||||
|
||||
} // namespace blender::compositor
|
||||
|
@@ -78,6 +78,7 @@ class ImageOperation : public BaseImageOperation {
|
||||
void update_memory_buffer_partial(MemoryBuffer *output,
|
||||
const rcti &area,
|
||||
Span<MemoryBuffer *> inputs) override;
|
||||
std::unique_ptr<MetaData> get_meta_data() override;
|
||||
};
|
||||
class ImageAlphaOperation : public BaseImageOperation {
|
||||
public:
|
||||
|
@@ -201,6 +201,11 @@ void ViewerOperation::update_image(const rcti *rect)
|
||||
rect->xmax,
|
||||
rect->ymax);
|
||||
|
||||
std::unique_ptr<MetaData> metadata = image_input_->get_meta_data();
|
||||
if (metadata.has_value()) {
|
||||
// TODO: metadata.add_to_id_prop.
|
||||
}
|
||||
|
||||
/* This could be improved to use partial updates. For now disabled as the full frame compositor
|
||||
* would not use partial frames anymore and the image engine requires more testing. */
|
||||
BKE_image_partial_update_mark_full_update(image_);
|
||||
|
Reference in New Issue
Block a user