[Bf-blender-cvs] [950c53608e0] compositor-cryptomatte-workflow: Merge branch 'master' into compositor-cryptomatte-workflow
Jeroen Bakker
noreply at git.blender.org
Mon Mar 8 15:05:55 CET 2021
Commit: 950c53608e0426897b2e45955cd947ac316f4381
Author: Jeroen Bakker
Date: Mon Mar 8 13:49:21 2021 +0100
Branches: compositor-cryptomatte-workflow
https://developer.blender.org/rB950c53608e0426897b2e45955cd947ac316f4381
Merge branch 'master' into compositor-cryptomatte-workflow
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/cryptomatte.cc
index 4be99288aad,55426f738ff..bb8b0de7b65
--- a/source/blender/blenkernel/intern/cryptomatte.cc
+++ b/source/blender/blenkernel/intern/cryptomatte.cc
@@@ -182,26 -182,9 +182,24 @@@ float BKE_cryptomatte_hash_to_float(uin
return blender::bke::cryptomatte::CryptomatteHash(cryptomatte_hash).float_encoded();
}
+/* Find an ID in the given main that matches the given encoded float. */
+bool BKE_cryptomatte_find_name(const CryptomatteSession *session,
+ const float encoded_hash,
+ char *r_name,
+ int name_len)
+{
+ std::optional<std::string> name = (*session)[encoded_hash];
+ if (!name) {
+ return false;
+ }
+
+ BLI_strncpy(r_name, name->c_str(), name_len);
+ return true;
+}
+
char *BKE_cryptomatte_entries_to_matte_id(NodeCryptomatte *node_storage)
{
- std::stringstream ss;
- ss.precision(9);
-
+ DynStr *matte_id = BLI_dynstr_new();
bool first = true;
LISTBASE_FOREACH (CryptomatteEntry *, entry, &node_storage->entries) {
if (!first) {
diff --cc source/blender/makesdna/DNA_node_types.h
index 13c56a1e207,82509599931..f470d51794a
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@@ -1068,19 -1068,14 +1068,20 @@@ typedef struct CryptomatteEntry
} CryptomatteEntry;
typedef struct NodeCryptomatte {
+ /* iuser needs to be first element due to RNA limitations.
+ * When we define the ImageData properties, we can't define them from
+ * storage->iuser, so storage needs to be casted to ImageUser directly. */
+ ImageUser iuser;
+
+ /* Contains `CryptomatteEntry`. */
+ ListBase entries;
+
float add[3];
float remove[3];
+ /* MAX_NAME */
+ char layer_name[64];
- char *matte_id DNA_DEPRECATED;
+ /* Stores `entries` as a string for opening in 2.80-2.91. */
+ char *matte_id;
- /* Contains `CryptomatteEntry`. */
- ListBase entries;
- int num_inputs;
- char _pad[4];
} NodeCryptomatte;
typedef struct NodeDenoise {
More information about the Bf-blender-cvs
mailing list