Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_outputFile.cc
| Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | bNodeSocket *ntreeCompositOutputFileAddSocket(bNodeTree *ntree, | ||||
| const char *name, | const char *name, | ||||
| ImageFormatData *im_format) | ImageFormatData *im_format) | ||||
| { | { | ||||
| NodeImageMultiFile *nimf = (NodeImageMultiFile *)node->storage; | NodeImageMultiFile *nimf = (NodeImageMultiFile *)node->storage; | ||||
| bNodeSocket *sock = nodeAddStaticSocket( | bNodeSocket *sock = nodeAddStaticSocket( | ||||
| ntree, node, SOCK_IN, SOCK_RGBA, PROP_NONE, nullptr, name); | ntree, node, SOCK_IN, SOCK_RGBA, PROP_NONE, nullptr, name); | ||||
| /* create format data for the input socket */ | /* create format data for the input socket */ | ||||
| NodeImageMultiFileSocket *sockdata = MEM_cnew<NodeImageMultiFileSocket>(__func__); | NodeImageMultiFileSocket *sockdata = MEM_cnew<NodeImageMultiFileSocket>(MEM_AT); | ||||
| sock->storage = sockdata; | sock->storage = sockdata; | ||||
| BLI_strncpy_utf8(sockdata->path, name, sizeof(sockdata->path)); | BLI_strncpy_utf8(sockdata->path, name, sizeof(sockdata->path)); | ||||
| ntreeCompositOutputFileUniquePath(&node->inputs, sock, name, '_'); | ntreeCompositOutputFileUniquePath(&node->inputs, sock, name, '_'); | ||||
| BLI_strncpy_utf8(sockdata->layer, name, sizeof(sockdata->layer)); | BLI_strncpy_utf8(sockdata->layer, name, sizeof(sockdata->layer)); | ||||
| ntreeCompositOutputFileUniqueLayer(&node->inputs, sock, name, '_'); | ntreeCompositOutputFileUniqueLayer(&node->inputs, sock, name, '_'); | ||||
| if (im_format) { | if (im_format) { | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* XXX uses initfunc_api callback, regular initfunc does not support context yet */ | /* XXX uses initfunc_api callback, regular initfunc does not support context yet */ | ||||
| static void init_output_file(const bContext *C, PointerRNA *ptr) | static void init_output_file(const bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| bNodeTree *ntree = (bNodeTree *)ptr->owner_id; | bNodeTree *ntree = (bNodeTree *)ptr->owner_id; | ||||
| bNode *node = (bNode *)ptr->data; | bNode *node = (bNode *)ptr->data; | ||||
| NodeImageMultiFile *nimf = MEM_cnew<NodeImageMultiFile>(__func__); | NodeImageMultiFile *nimf = MEM_cnew<NodeImageMultiFile>(MEM_AT); | ||||
| ImageFormatData *format = nullptr; | ImageFormatData *format = nullptr; | ||||
| node->storage = nimf; | node->storage = nimf; | ||||
| if (scene) { | if (scene) { | ||||
| RenderData *rd = &scene->r; | RenderData *rd = &scene->r; | ||||
| BLI_strncpy(nimf->base_path, rd->pic, sizeof(nimf->base_path)); | BLI_strncpy(nimf->base_path, rd->pic, sizeof(nimf->base_path)); | ||||
| nimf->format = rd->im_format; | nimf->format = rd->im_format; | ||||
| ▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines | |||||