Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_output_file.cc
| Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | |||||
| void ntreeCompositOutputFileSetLayer(bNode *node, bNodeSocket *sock, const char *name) | void ntreeCompositOutputFileSetLayer(bNode *node, bNodeSocket *sock, const char *name) | ||||
| { | { | ||||
| NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)sock->storage; | NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)sock->storage; | ||||
| 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, '_'); | ||||
| } | } | ||||
| namespace blender::nodes::node_composite_outputFile_cc { | |||||
| /* 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>(__func__); | ||||
| ImageFormatData *format = nullptr; | ImageFormatData *format = nullptr; | ||||
| ▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | else { | ||||
| if (is_multiview) { | if (is_multiview) { | ||||
| uiTemplateImageFormatViews(layout, &imfptr, nullptr); | uiTemplateImageFormatViews(layout, &imfptr, nullptr); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_outputFile_cc | |||||
| void register_node_type_cmp_output_file() | void register_node_type_cmp_output_file() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_outputFile_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT); | cmp_node_type_base(&ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT); | ||||
| node_type_socket_templates(&ntype, nullptr, nullptr); | node_type_socket_templates(&ntype, nullptr, nullptr); | ||||
| ntype.draw_buttons = node_composit_buts_file_output; | ntype.draw_buttons = file_ns::node_composit_buts_file_output; | ||||
| ntype.draw_buttons_ex = node_composit_buts_file_output_ex; | ntype.draw_buttons_ex = file_ns::node_composit_buts_file_output_ex; | ||||
| ntype.initfunc_api = init_output_file; | ntype.initfunc_api = file_ns::init_output_file; | ||||
| ntype.flag |= NODE_PREVIEW; | ntype.flag |= NODE_PREVIEW; | ||||
| node_type_storage(&ntype, "NodeImageMultiFile", free_output_file, copy_output_file); | node_type_storage( | ||||
| node_type_update(&ntype, update_output_file); | &ntype, "NodeImageMultiFile", file_ns::free_output_file, file_ns::copy_output_file); | ||||
| node_type_update(&ntype, file_ns::update_output_file); | |||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||