diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-07-18 14:03:09 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-07-18 14:03:34 +0300 |
commit | bdda0964e0a5180bd0bc4fb8e38dbe2198bd9a9a (patch) | |
tree | e4222d0605f4dd0b67b8ca1c43623f283878fac8 /source/blender/blenloader | |
parent | 41045478ab7fd3efc989952bfd7a83c5cbb88dbc (diff) |
Compositor: Cryptomatte compositing node.
This patch adds a new matte node that implements the Cryptomatte specification.
It also incluces a custom eye dropper that works outside of a color picker.
Cryptomatte export for the Cycles render engine will be in a separate patch.
Reviewers: brecht
Reviewed By: brecht
Subscribers: brecht
Tags: #compositing
Differential Revision: https://developer.blender.org/D3531
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 4e845b9a60d..1def462b1ca 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3161,6 +3161,10 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) direct_link_curvemapping(fd, node->storage); else if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_R_LAYERS, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) ((ImageUser *)node->storage)->ok = 1; + else if (node->type==CMP_NODE_CRYPTOMATTE) { + NodeCryptomatte *nc = (NodeCryptomatte *) node->storage; + nc->matte_id = newdataadr(fd, nc->matte_id); + } } else if ( ntree->type==NTREE_TEXTURE) { if (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index e3a901f4211..4b64d0a3d3f 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1077,6 +1077,13 @@ static void write_nodetree_nolib(WriteData *wd, bNodeTree *ntree) } writestruct_id(wd, DATA, node->typeinfo->storagename, 1, node->storage); } + else if ((ntree->type == NTREE_COMPOSIT) && (node->type == CMP_NODE_CRYPTOMATTE)) { + NodeCryptomatte *nc = (NodeCryptomatte *)node->storage; + if (nc->matte_id) { + writedata(wd, DATA, strlen(nc->matte_id) + 1, nc->matte_id); + } + writestruct_id(wd, DATA, node->typeinfo->storagename, 1, node->storage); + } else { writestruct_id(wd, DATA, node->typeinfo->storagename, 1, node->storage); } |