diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2017-01-19 01:53:24 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2017-01-20 07:46:32 +0300 |
commit | 1049ea8476dc3644989caa078f3d64bf67c1efee (patch) | |
tree | 485141429ec09157a1a1b51da9e92c80d02703a0 /source/blender/blenloader | |
parent | ca6d583008ffb5f0d23ab66a324f5ad5311da951 (diff) |
Cycles/Render API: Get rid of Render Pass flags and port Denoising passes to the new system
This also means that the temporary uint64_t passflag hack is removed now.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 7 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 28 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 5 |
3 files changed, 37 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a63b9ed7d19..24361a68bb2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3089,7 +3089,7 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) else if (ntree->type==NTREE_COMPOSIT) { if (ELEM(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT)) direct_link_curvemapping(fd, node->storage); - else if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) + 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 ( ntree->type==NTREE_TEXTURE) { @@ -6085,6 +6085,11 @@ static void direct_link_scene(FileData *fd, Scene *sce) link_list(fd, &(sce->r.layers)); link_list(fd, &(sce->r.views)); + + for (srl = sce->r.layers.first; srl; srl = srl->next) { + srl->prop = newdataadr(fd, srl->prop); + IDP_DirectLinkGroup_OrFree(&srl->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + } for (srl = sce->r.layers.first; srl; srl = srl->next) { link_list(fd, &(srl->freestyleConfig.modules)); } diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 8bb6ebf6115..410e186ca2c 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -76,6 +76,8 @@ #include "BLO_readfile.h" +#include "NOD_composite.h" + #include "readfile.h" #include "MEM_guardedalloc.h" @@ -1494,7 +1496,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } /* To be added to next subversion bump! */ - { + if (!MAIN_VERSION_ATLEAST(main, 278, 5)) { /* Mask primitive adding code was not initializing correctly id_type of its points' parent. */ for (Mask *mask = main->mask.first; mask; mask = mask->id.next) { for (MaskLayer *mlayer = mask->masklayers.first; mlayer; mlayer = mlayer->next) { @@ -1508,5 +1510,29 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + FOREACH_NODETREE(main, ntree, id) { + if (ntree->type == NTREE_COMPOSIT) { + bNode *node; + for (node = ntree->nodes.first; node; node = node->next) { + if (ELEM(node->type, CMP_NODE_COMPOSITE, CMP_NODE_R_LAYERS)) { + int pass_index = 0; + const char *sockname; + for (bNodeSocket *sock = node->outputs.first; sock && pass_index < 31; sock = sock->next, pass_index++) { + if (sock->storage == NULL) { + NodeImageLayer *sockdata = MEM_callocN(sizeof(NodeImageLayer), "node image layer"); + sock->storage = sockdata; + BLI_strncpy(sockdata->pass_name, node_cmp_rlayers_sock_to_pass(pass_index), sizeof(sockdata->pass_name)); + + if (pass_index == 0) sockname = "Image"; + else if (pass_index == 1) sockname = "Alpha"; + else sockname = node_cmp_rlayers_sock_to_pass(pass_index); + BLI_strncpy(sock->name, sockname, sizeof(sock->name)); + } + } + } + } + } + } FOREACH_NODETREE_END } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ad1999c0bc7..343aed390e6 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1041,7 +1041,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) writestruct(wd, DATA, NodeImageMultiFileSocket, 1, sock->storage); } } - if (node->type == CMP_NODE_IMAGE) { + if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_R_LAYERS)) { /* write extra socket info */ for (sock = node->outputs.first; sock; sock = sock->next) { writestruct(wd, DATA, NodeImageLayer, 1, sock->storage); @@ -2812,6 +2812,9 @@ static void write_scenes(WriteData *wd, ListBase *scebase) for (srl = sce->r.layers.first; srl; srl = srl->next) { writestruct(wd, DATA, SceneRenderLayer, 1, srl); + if (srl->prop) { + IDP_WriteProperty(srl->prop, wd); + } for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) { writestruct(wd, DATA, FreestyleModuleConfig, 1, fmc); } |