The compositor previously overloaded the vector type to represent multiple dimensions that are always stored in a 4D float vector. This patch introduce a dedicated type for float4, leaving the vector type to always represent a 3D vector, which will be done in a later commit. This is not exposed to the user as a separate socket type with a different color, it is only an internal type that uses the same vector socket shape and color. Since the vector socket represents both 4D and 3D vectors, code generally assumes that such sockets represents 3D vectors, and the developer is expected to set it to a 4D vector if needed in the node operation constructor, or use the newly added skip_type_conversion flag for nodes that do not care about types, like the File Output node. Though this should be redundant once we add a dimension property for vector sockets. Pull Request: https://projects.blender.org/blender/blender/pulls/134486
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include <string>
|
|
|
|
#pragma once
|
|
|
|
namespace blender::compositor {
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Cryptomatte Meta Data
|
|
*
|
|
* Stores the Cryptomatte meta data as specified in Section 1 "Metadata" in the Cryptomatte
|
|
* specification. The Cryptomatte layer name is not stored because it is determined by the user
|
|
* when saving the result to file. */
|
|
struct CryptomatteMetaData {
|
|
std::string hash;
|
|
std::string conversion;
|
|
std::string manifest;
|
|
};
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Meta Data
|
|
*
|
|
* Stores extra information about results such as image meta data that can eventually be saved to
|
|
* file. */
|
|
struct MetaData {
|
|
/* The result stores non color data, which is not to be color-managed. */
|
|
bool is_non_color_data = false;
|
|
/* Stores Cryptomatte meta data. This will only be initialized for results that represent
|
|
* Cryptomatte information. See the CryptomatteMetaData structure for more information. */
|
|
CryptomatteMetaData cryptomatte;
|
|
|
|
/* Identifies if the result represents a Cryptomatte layer. This is identified based on whether
|
|
* the Cryptomatte meta data are initialized. */
|
|
bool is_cryptomatte_layer() const;
|
|
};
|
|
|
|
} // namespace blender::compositor
|