From 803c7fb4d49b51de750751a5707ebc57c653b959 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Tue, 8 Feb 2011 09:02:16 +0000 Subject: Finished the node type definition cleanup started in r34682. All static node types should now use the node_type_* definition helpers to initialize their bNodeType structs. --- source/blender/blenkernel/BKE_node.h | 4 +- source/blender/blenkernel/intern/node.c | 271 +++++++++++---------- source/blender/nodes/CMP_node.h | 134 +++++----- source/blender/nodes/SHD_node.h | 42 ++-- source/blender/nodes/TEX_node.h | 66 ++--- .../blender/nodes/intern/CMP_nodes/CMP_alphaOver.c | 31 ++- .../nodes/intern/CMP_nodes/CMP_bilateralblur.c | 31 ++- source/blender/nodes/intern/CMP_nodes/CMP_blur.c | 30 ++- .../nodes/intern/CMP_nodes/CMP_brightness.c | 27 +- .../nodes/intern/CMP_nodes/CMP_channelMatte.c | 30 ++- .../nodes/intern/CMP_nodes/CMP_chromaMatte.c | 30 ++- .../nodes/intern/CMP_nodes/CMP_colorMatte.c | 30 ++- .../nodes/intern/CMP_nodes/CMP_colorSpill.c | 29 +-- .../nodes/intern/CMP_nodes/CMP_colorbalance.c | 30 ++- .../blender/nodes/intern/CMP_nodes/CMP_composite.c | 28 +-- source/blender/nodes/intern/CMP_nodes/CMP_crop.c | 30 ++- source/blender/nodes/intern/CMP_nodes/CMP_curves.c | 91 ++++--- .../blender/nodes/intern/CMP_nodes/CMP_defocus.c | 30 ++- .../blender/nodes/intern/CMP_nodes/CMP_diffMatte.c | 30 ++- source/blender/nodes/intern/CMP_nodes/CMP_dilate.c | 27 +- .../nodes/intern/CMP_nodes/CMP_directionalblur.c | 30 ++- .../blender/nodes/intern/CMP_nodes/CMP_displace.c | 28 +-- .../nodes/intern/CMP_nodes/CMP_distanceMatte.c | 30 ++- source/blender/nodes/intern/CMP_nodes/CMP_filter.c | 29 +-- source/blender/nodes/intern/CMP_nodes/CMP_flip.c | 28 +-- source/blender/nodes/intern/CMP_nodes/CMP_gamma.c | 29 +-- source/blender/nodes/intern/CMP_nodes/CMP_glare.c | 30 ++- .../blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c | 31 ++- .../nodes/intern/CMP_nodes/CMP_huecorrect.c | 30 ++- source/blender/nodes/intern/CMP_nodes/CMP_idMask.c | 28 +-- source/blender/nodes/intern/CMP_nodes/CMP_image.c | 57 ++--- source/blender/nodes/intern/CMP_nodes/CMP_invert.c | 30 +-- .../blender/nodes/intern/CMP_nodes/CMP_lensdist.c | 30 ++- source/blender/nodes/intern/CMP_nodes/CMP_levels.c | 31 ++- .../nodes/intern/CMP_nodes/CMP_lummaMatte.c | 30 ++- source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c | 28 +-- .../blender/nodes/intern/CMP_nodes/CMP_mapValue.c | 31 ++- source/blender/nodes/intern/CMP_nodes/CMP_math.c | 28 +-- source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c | 29 +-- source/blender/nodes/intern/CMP_nodes/CMP_normal.c | 29 +-- .../blender/nodes/intern/CMP_nodes/CMP_normalize.c | 28 +-- .../nodes/intern/CMP_nodes/CMP_outputFile.c | 31 ++- .../blender/nodes/intern/CMP_nodes/CMP_premulkey.c | 28 +-- source/blender/nodes/intern/CMP_nodes/CMP_rgb.c | 29 +-- source/blender/nodes/intern/CMP_nodes/CMP_rotate.c | 29 +-- source/blender/nodes/intern/CMP_nodes/CMP_scale.c | 28 +-- .../nodes/intern/CMP_nodes/CMP_sepcombHSVA.c | 57 ++--- .../nodes/intern/CMP_nodes/CMP_sepcombRGBA.c | 58 ++--- .../nodes/intern/CMP_nodes/CMP_sepcombYCCA.c | 56 ++--- .../nodes/intern/CMP_nodes/CMP_sepcombYUVA.c | 56 ++--- .../blender/nodes/intern/CMP_nodes/CMP_setalpha.c | 29 +-- .../nodes/intern/CMP_nodes/CMP_splitViewer.c | 30 ++- .../blender/nodes/intern/CMP_nodes/CMP_texture.c | 29 +-- .../blender/nodes/intern/CMP_nodes/CMP_tonemap.c | 30 ++- .../blender/nodes/intern/CMP_nodes/CMP_translate.c | 28 +-- .../blender/nodes/intern/CMP_nodes/CMP_valToRgb.c | 58 ++--- source/blender/nodes/intern/CMP_nodes/CMP_value.c | 28 +-- .../blender/nodes/intern/CMP_nodes/CMP_vecBlur.c | 30 ++- source/blender/nodes/intern/CMP_nodes/CMP_viewer.c | 31 ++- .../blender/nodes/intern/CMP_nodes/CMP_zcombine.c | 29 +-- source/blender/nodes/intern/CMP_util.h | 1 + source/blender/nodes/intern/SHD_nodes/SHD_camera.c | 31 ++- source/blender/nodes/intern/SHD_nodes/SHD_curves.c | 64 +++-- .../blender/nodes/intern/SHD_nodes/SHD_dynamic.c | 37 +-- source/blender/nodes/intern/SHD_nodes/SHD_geom.c | 33 ++- .../blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c | 31 +-- source/blender/nodes/intern/SHD_nodes/SHD_invert.c | 30 +-- .../blender/nodes/intern/SHD_nodes/SHD_mapping.c | 5 +- .../blender/nodes/intern/SHD_nodes/SHD_material.c | 62 +++-- source/blender/nodes/intern/SHD_nodes/SHD_math.c | 31 ++- source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c | 31 +-- source/blender/nodes/intern/SHD_nodes/SHD_normal.c | 2 +- source/blender/nodes/intern/SHD_nodes/SHD_output.c | 31 +-- source/blender/nodes/intern/SHD_nodes/SHD_rgb.c | 31 +-- .../nodes/intern/SHD_nodes/SHD_sepcombRGB.c | 62 ++--- .../blender/nodes/intern/SHD_nodes/SHD_squeeze.c | 31 ++- .../blender/nodes/intern/SHD_nodes/SHD_texture.c | 31 +-- .../blender/nodes/intern/SHD_nodes/SHD_valToRgb.c | 62 ++--- source/blender/nodes/intern/SHD_nodes/SHD_value.c | 31 +-- .../blender/nodes/intern/SHD_nodes/SHD_vectMath.c | 31 ++- source/blender/nodes/intern/TEX_nodes/TEX_at.c | 26 +- source/blender/nodes/intern/TEX_nodes/TEX_bricks.c | 27 +- .../blender/nodes/intern/TEX_nodes/TEX_checker.c | 26 +- .../blender/nodes/intern/TEX_nodes/TEX_compose.c | 26 +- source/blender/nodes/intern/TEX_nodes/TEX_coord.c | 29 +-- source/blender/nodes/intern/TEX_nodes/TEX_curves.c | 58 ++--- .../blender/nodes/intern/TEX_nodes/TEX_decompose.c | 26 +- .../blender/nodes/intern/TEX_nodes/TEX_distance.c | 30 +-- .../blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c | 28 +-- source/blender/nodes/intern/TEX_nodes/TEX_image.c | 30 +-- source/blender/nodes/intern/TEX_nodes/TEX_invert.c | 27 +- source/blender/nodes/intern/TEX_nodes/TEX_math.c | 28 +-- source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c | 26 +- source/blender/nodes/intern/TEX_nodes/TEX_output.c | 30 +-- source/blender/nodes/intern/TEX_nodes/TEX_proc.c | 36 +-- source/blender/nodes/intern/TEX_nodes/TEX_rotate.c | 28 +-- source/blender/nodes/intern/TEX_nodes/TEX_scale.c | 28 +-- .../blender/nodes/intern/TEX_nodes/TEX_texture.c | 27 +- .../blender/nodes/intern/TEX_nodes/TEX_translate.c | 28 +-- .../blender/nodes/intern/TEX_nodes/TEX_valToNor.c | 28 +-- .../blender/nodes/intern/TEX_nodes/TEX_valToRgb.c | 56 ++--- source/blender/nodes/intern/TEX_nodes/TEX_viewer.c | 26 +- source/blender/nodes/intern/TEX_util.h | 1 + 103 files changed, 1650 insertions(+), 2052 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 455e1739b98..ad16480bdb8 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -208,12 +208,12 @@ void nodeCopyGroup(struct bNode *gnode); /* ************** COMMON NODES *************** */ /* Init a new node type struct with default values and callbacks */ -void node_type_init(struct bNodeType *ntype, int type, const char *name, short nclass, short flag, +void node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag, struct bNodeSocketType *inputs, struct bNodeSocketType *outputs); void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth); +void node_type_init(struct bNodeType *ntype, void (*initfunc)(struct bNode *)); void node_type_storage(struct bNodeType *ntype, const char *storagename, - void (*initfunc)(struct bNode *), void (*freestoragefunc)(struct bNode *), void (*copystoragefunc)(struct bNode *, struct bNode *)); void node_type_exec(struct bNodeType *ntype, void (*execfunc)(void *data, struct bNode *, struct bNodeStack **, struct bNodeStack **)); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 69f01633192..cbb0ef7b854 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3245,7 +3245,7 @@ int ntreeTexTagAnimated(bNodeTree *ntree) /* ************* node definition init ********** */ -void node_type_init(bNodeType *ntype, int type, const char *name, short nclass, short flag, +void node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag, struct bNodeSocketType *inputs, struct bNodeSocketType *outputs) { memset(ntype, 0, sizeof(bNodeType)); @@ -3264,6 +3264,11 @@ void node_type_init(bNodeType *ntype, int type, const char *name, short nclass, ntype->maxwidth = 320; } +void node_type_init(bNodeType *ntype, void (*initfunc)(struct bNode *)) +{ + ntype->initfunc = initfunc; +} + void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth) { ntype->width = width; @@ -3271,10 +3276,12 @@ void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwid ntype->maxwidth = maxwidth; } -void node_type_storage(bNodeType *ntype, const char *storagename, void (*initfunc)(struct bNode *), void (*freestoragefunc)(struct bNode *), void (*copystoragefunc)(struct bNode *, struct bNode *)) +void node_type_storage(bNodeType *ntype, const char *storagename, void (*freestoragefunc)(struct bNode *), void (*copystoragefunc)(struct bNode *, struct bNode *)) { - strncpy(ntype->storagename, storagename, sizeof(ntype->storagename)); - ntype->initfunc = initfunc; + if (storagename) + strncpy(ntype->storagename, storagename, sizeof(ntype->storagename)); + else + ntype->storagename[0] = '\0'; ntype->copystoragefunc = copystoragefunc; ntype->freestoragefunc = freestoragefunc; } @@ -3316,146 +3323,146 @@ void nodeRegisterType(ListBase *typelist, const bNodeType *ntype) static void registerCompositNodes(ListBase *ntypelist) { nodeRegisterType(ntypelist, &node_group_typeinfo); - nodeRegisterType(ntypelist, &cmp_node_rlayers); - nodeRegisterType(ntypelist, &cmp_node_image); - nodeRegisterType(ntypelist, &cmp_node_texture); - nodeRegisterType(ntypelist, &cmp_node_value); - nodeRegisterType(ntypelist, &cmp_node_rgb); - nodeRegisterType(ntypelist, &cmp_node_curve_time); - - nodeRegisterType(ntypelist, &cmp_node_composite); - nodeRegisterType(ntypelist, &cmp_node_viewer); - nodeRegisterType(ntypelist, &cmp_node_splitviewer); - nodeRegisterType(ntypelist, &cmp_node_output_file); - nodeRegisterType(ntypelist, &cmp_node_view_levels); - - nodeRegisterType(ntypelist, &cmp_node_curve_rgb); - nodeRegisterType(ntypelist, &cmp_node_mix_rgb); - nodeRegisterType(ntypelist, &cmp_node_hue_sat); - nodeRegisterType(ntypelist, &cmp_node_brightcontrast); - nodeRegisterType(ntypelist, &cmp_node_gamma); - nodeRegisterType(ntypelist, &cmp_node_invert); - nodeRegisterType(ntypelist, &cmp_node_alphaover); - nodeRegisterType(ntypelist, &cmp_node_zcombine); - nodeRegisterType(ntypelist, &cmp_node_colorbalance); - nodeRegisterType(ntypelist, &cmp_node_huecorrect); - - nodeRegisterType(ntypelist, &cmp_node_normal); - nodeRegisterType(ntypelist, &cmp_node_curve_vec); - nodeRegisterType(ntypelist, &cmp_node_map_value); - nodeRegisterType(ntypelist, &cmp_node_normalize); - - nodeRegisterType(ntypelist, &cmp_node_filter); - nodeRegisterType(ntypelist, &cmp_node_blur); - nodeRegisterType(ntypelist, &cmp_node_dblur); - nodeRegisterType(ntypelist, &cmp_node_bilateralblur); - nodeRegisterType(ntypelist, &cmp_node_vecblur); - nodeRegisterType(ntypelist, &cmp_node_dilateerode); - nodeRegisterType(ntypelist, &cmp_node_defocus); - - nodeRegisterType(ntypelist, &cmp_node_valtorgb); - nodeRegisterType(ntypelist, &cmp_node_rgbtobw); - nodeRegisterType(ntypelist, &cmp_node_setalpha); - nodeRegisterType(ntypelist, &cmp_node_idmask); - nodeRegisterType(ntypelist, &cmp_node_math); - nodeRegisterType(ntypelist, &cmp_node_seprgba); - nodeRegisterType(ntypelist, &cmp_node_combrgba); - nodeRegisterType(ntypelist, &cmp_node_sephsva); - nodeRegisterType(ntypelist, &cmp_node_combhsva); - nodeRegisterType(ntypelist, &cmp_node_sepyuva); - nodeRegisterType(ntypelist, &cmp_node_combyuva); - nodeRegisterType(ntypelist, &cmp_node_sepycca); - nodeRegisterType(ntypelist, &cmp_node_combycca); - nodeRegisterType(ntypelist, &cmp_node_premulkey); - - nodeRegisterType(ntypelist, &cmp_node_diff_matte); - nodeRegisterType(ntypelist, &cmp_node_distance_matte); - nodeRegisterType(ntypelist, &cmp_node_chroma_matte); - nodeRegisterType(ntypelist, &cmp_node_color_matte); - nodeRegisterType(ntypelist, &cmp_node_channel_matte); - nodeRegisterType(ntypelist, &cmp_node_color_spill); - nodeRegisterType(ntypelist, &cmp_node_luma_matte); - - nodeRegisterType(ntypelist, &cmp_node_translate); - nodeRegisterType(ntypelist, &cmp_node_rotate); - nodeRegisterType(ntypelist, &cmp_node_scale); - nodeRegisterType(ntypelist, &cmp_node_flip); - nodeRegisterType(ntypelist, &cmp_node_crop); - nodeRegisterType(ntypelist, &cmp_node_displace); - nodeRegisterType(ntypelist, &cmp_node_mapuv); - nodeRegisterType(ntypelist, &cmp_node_glare); - nodeRegisterType(ntypelist, &cmp_node_tonemap); - nodeRegisterType(ntypelist, &cmp_node_lensdist); + register_node_type_cmp_rlayers(ntypelist); + register_node_type_cmp_image(ntypelist); + register_node_type_cmp_texture(ntypelist); + register_node_type_cmp_value(ntypelist); + register_node_type_cmp_rgb(ntypelist); + register_node_type_cmp_curve_time(ntypelist); + + register_node_type_cmp_composite(ntypelist); + register_node_type_cmp_viewer(ntypelist); + register_node_type_cmp_splitviewer(ntypelist); + register_node_type_cmp_output_file(ntypelist); + register_node_type_cmp_view_levels(ntypelist); + + register_node_type_cmp_curve_rgb(ntypelist); + register_node_type_cmp_mix_rgb(ntypelist); + register_node_type_cmp_hue_sat(ntypelist); + register_node_type_cmp_brightcontrast(ntypelist); + register_node_type_cmp_gamma(ntypelist); + register_node_type_cmp_invert(ntypelist); + register_node_type_cmp_alphaover(ntypelist); + register_node_type_cmp_zcombine(ntypelist); + register_node_type_cmp_colorbalance(ntypelist); + register_node_type_cmp_huecorrect(ntypelist); + + register_node_type_cmp_normal(ntypelist); + register_node_type_cmp_curve_vec(ntypelist); + register_node_type_cmp_map_value(ntypelist); + register_node_type_cmp_normalize(ntypelist); + + register_node_type_cmp_filter(ntypelist); + register_node_type_cmp_blur(ntypelist); + register_node_type_cmp_dblur(ntypelist); + register_node_type_cmp_bilateralblur(ntypelist); + register_node_type_cmp_vecblur(ntypelist); + register_node_type_cmp_dilateerode(ntypelist); + register_node_type_cmp_defocus(ntypelist); + + register_node_type_cmp_valtorgb(ntypelist); + register_node_type_cmp_rgbtobw(ntypelist); + register_node_type_cmp_setalpha(ntypelist); + register_node_type_cmp_idmask(ntypelist); + register_node_type_cmp_math(ntypelist); + register_node_type_cmp_seprgba(ntypelist); + register_node_type_cmp_combrgba(ntypelist); + register_node_type_cmp_sephsva(ntypelist); + register_node_type_cmp_combhsva(ntypelist); + register_node_type_cmp_sepyuva(ntypelist); + register_node_type_cmp_combyuva(ntypelist); + register_node_type_cmp_sepycca(ntypelist); + register_node_type_cmp_combycca(ntypelist); + register_node_type_cmp_premulkey(ntypelist); + + register_node_type_cmp_diff_matte(ntypelist); + register_node_type_cmp_distance_matte(ntypelist); + register_node_type_cmp_chroma_matte(ntypelist); + register_node_type_cmp_color_matte(ntypelist); + register_node_type_cmp_channel_matte(ntypelist); + register_node_type_cmp_color_spill(ntypelist); + register_node_type_cmp_luma_matte(ntypelist); + + register_node_type_cmp_translate(ntypelist); + register_node_type_cmp_rotate(ntypelist); + register_node_type_cmp_scale(ntypelist); + register_node_type_cmp_flip(ntypelist); + register_node_type_cmp_crop(ntypelist); + register_node_type_cmp_displace(ntypelist); + register_node_type_cmp_mapuv(ntypelist); + register_node_type_cmp_glare(ntypelist); + register_node_type_cmp_tonemap(ntypelist); + register_node_type_cmp_lensdist(ntypelist); } static void registerShaderNodes(ListBase *ntypelist) { nodeRegisterType(ntypelist, &node_group_typeinfo); - nodeRegisterType(ntypelist, &sh_node_output); - nodeRegisterType(ntypelist, &sh_node_mix_rgb); - nodeRegisterType(ntypelist, &sh_node_valtorgb); - nodeRegisterType(ntypelist, &sh_node_rgbtobw); + register_node_type_sh_output(ntypelist); + register_node_type_sh_mix_rgb(ntypelist); + register_node_type_sh_valtorgb(ntypelist); + register_node_type_sh_rgbtobw(ntypelist); register_node_type_sh_normal(ntypelist); - nodeRegisterType(ntypelist, &sh_node_geom); + register_node_type_sh_geom(ntypelist); register_node_type_sh_mapping(ntypelist); - nodeRegisterType(ntypelist, &sh_node_curve_vec); - nodeRegisterType(ntypelist, &sh_node_curve_rgb); - nodeRegisterType(ntypelist, &sh_node_math); - nodeRegisterType(ntypelist, &sh_node_vect_math); - nodeRegisterType(ntypelist, &sh_node_squeeze); - nodeRegisterType(ntypelist, &sh_node_camera); - nodeRegisterType(ntypelist, &sh_node_material); - nodeRegisterType(ntypelist, &sh_node_material_ext); - nodeRegisterType(ntypelist, &sh_node_value); - nodeRegisterType(ntypelist, &sh_node_rgb); - nodeRegisterType(ntypelist, &sh_node_texture); - nodeRegisterType(ntypelist, &node_dynamic_typeinfo); - nodeRegisterType(ntypelist, &sh_node_invert); - nodeRegisterType(ntypelist, &sh_node_seprgb); - nodeRegisterType(ntypelist, &sh_node_combrgb); - nodeRegisterType(ntypelist, &sh_node_hue_sat); + register_node_type_sh_curve_vec(ntypelist); + register_node_type_sh_curve_rgb(ntypelist); + register_node_type_sh_math(ntypelist); + register_node_type_sh_vect_math(ntypelist); + register_node_type_sh_squeeze(ntypelist); + register_node_type_sh_camera(ntypelist); + register_node_type_sh_material(ntypelist); + register_node_type_sh_material_ext(ntypelist); + register_node_type_sh_value(ntypelist); + register_node_type_sh_rgb(ntypelist); + register_node_type_sh_texture(ntypelist); + register_node_type_sh_dynamic(ntypelist); + register_node_type_sh_invert(ntypelist); + register_node_type_sh_seprgb(ntypelist); + register_node_type_sh_combrgb(ntypelist); + register_node_type_sh_hue_sat(ntypelist); } static void registerTextureNodes(ListBase *ntypelist) { nodeRegisterType(ntypelist, &node_group_typeinfo); - nodeRegisterType(ntypelist, &tex_node_math); - nodeRegisterType(ntypelist, &tex_node_mix_rgb); - nodeRegisterType(ntypelist, &tex_node_valtorgb); - nodeRegisterType(ntypelist, &tex_node_rgbtobw); - nodeRegisterType(ntypelist, &tex_node_valtonor); - nodeRegisterType(ntypelist, &tex_node_curve_rgb); - nodeRegisterType(ntypelist, &tex_node_curve_time); - nodeRegisterType(ntypelist, &tex_node_invert); - nodeRegisterType(ntypelist, &tex_node_hue_sat); - nodeRegisterType(ntypelist, &tex_node_coord); - nodeRegisterType(ntypelist, &tex_node_distance); - nodeRegisterType(ntypelist, &tex_node_compose); - nodeRegisterType(ntypelist, &tex_node_decompose); - - nodeRegisterType(ntypelist, &tex_node_output); - nodeRegisterType(ntypelist, &tex_node_viewer); - - nodeRegisterType(ntypelist, &tex_node_checker); - nodeRegisterType(ntypelist, &tex_node_texture); - nodeRegisterType(ntypelist, &tex_node_bricks); - nodeRegisterType(ntypelist, &tex_node_image); - - nodeRegisterType(ntypelist, &tex_node_rotate); - nodeRegisterType(ntypelist, &tex_node_translate); - nodeRegisterType(ntypelist, &tex_node_scale); - nodeRegisterType(ntypelist, &tex_node_at); - - nodeRegisterType(ntypelist, &tex_node_proc_voronoi); - nodeRegisterType(ntypelist, &tex_node_proc_blend); - nodeRegisterType(ntypelist, &tex_node_proc_magic); - nodeRegisterType(ntypelist, &tex_node_proc_marble); - nodeRegisterType(ntypelist, &tex_node_proc_clouds); - nodeRegisterType(ntypelist, &tex_node_proc_wood); - nodeRegisterType(ntypelist, &tex_node_proc_musgrave); - nodeRegisterType(ntypelist, &tex_node_proc_noise); - nodeRegisterType(ntypelist, &tex_node_proc_stucci); - nodeRegisterType(ntypelist, &tex_node_proc_distnoise); + register_node_type_tex_math(ntypelist); + register_node_type_tex_mix_rgb(ntypelist); + register_node_type_tex_valtorgb(ntypelist); + register_node_type_tex_rgbtobw(ntypelist); + register_node_type_tex_valtonor(ntypelist); + register_node_type_tex_curve_rgb(ntypelist); + register_node_type_tex_curve_time(ntypelist); + register_node_type_tex_invert(ntypelist); + register_node_type_tex_hue_sat(ntypelist); + register_node_type_tex_coord(ntypelist); + register_node_type_tex_distance(ntypelist); + register_node_type_tex_compose(ntypelist); + register_node_type_tex_decompose(ntypelist); + + register_node_type_tex_output(ntypelist); + register_node_type_tex_viewer(ntypelist); + + register_node_type_tex_checker(ntypelist); + register_node_type_tex_texture(ntypelist); + register_node_type_tex_bricks(ntypelist); + register_node_type_tex_image(ntypelist); + + register_node_type_tex_rotate(ntypelist); + register_node_type_tex_translate(ntypelist); + register_node_type_tex_scale(ntypelist); + register_node_type_tex_at(ntypelist); + + register_node_type_tex_proc_voronoi(ntypelist); + register_node_type_tex_proc_blend(ntypelist); + register_node_type_tex_proc_magic(ntypelist); + register_node_type_tex_proc_marble(ntypelist); + register_node_type_tex_proc_clouds(ntypelist); + register_node_type_tex_proc_wood(ntypelist); + register_node_type_tex_proc_musgrave(ntypelist); + register_node_type_tex_proc_noise(ntypelist); + register_node_type_tex_proc_stucci(ntypelist); + register_node_type_tex_proc_distnoise(ntypelist); } static void remove_dynamic_typeinfos(ListBase *list) diff --git a/source/blender/nodes/CMP_node.h b/source/blender/nodes/CMP_node.h index c2bc4d026ef..4cbb5599797 100644 --- a/source/blender/nodes/CMP_node.h +++ b/source/blender/nodes/CMP_node.h @@ -3,21 +3,21 @@ * * ***** BEGIN GPL LICENSE BLOCK ***** * - * This program is free software; you can redistribute it and/or + * This program is free software(ListBase *lb); you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 + * as published by the Free Software Foundation(ListBase *lb); either version 2 * of the License, or (at your option) any later version. The Blender * Foundation also sells licenses for use in proprietary software under * the Blender License. See http://www.blender.org/BL/ for information * about this. * * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * but WITHOUT ANY WARRANTY(ListBase *lb); without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, + * along with this program(ListBase *lb); if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2005 Blender Foundation. @@ -38,76 +38,76 @@ /* ****************** types array for all composite nodes ****************** */ -extern bNodeType cmp_node_rlayers; -extern bNodeType cmp_node_image; -extern bNodeType cmp_node_texture; -extern bNodeType cmp_node_value; -extern bNodeType cmp_node_rgb; -extern bNodeType cmp_node_curve_time; +void register_node_type_cmp_rlayers(ListBase *lb); +void register_node_type_cmp_image(ListBase *lb); +void register_node_type_cmp_texture(ListBase *lb); +void register_node_type_cmp_value(ListBase *lb); +void register_node_type_cmp_rgb(ListBase *lb); +void register_node_type_cmp_curve_time(ListBase *lb); -extern bNodeType cmp_node_composite; -extern bNodeType cmp_node_viewer; -extern bNodeType cmp_node_splitviewer; -extern bNodeType cmp_node_output_file; -extern bNodeType cmp_node_view_levels; +void register_node_type_cmp_composite(ListBase *lb); +void register_node_type_cmp_viewer(ListBase *lb); +void register_node_type_cmp_splitviewer(ListBase *lb); +void register_node_type_cmp_output_file(ListBase *lb); +void register_node_type_cmp_view_levels(ListBase *lb); -extern bNodeType cmp_node_curve_rgb; -extern bNodeType cmp_node_mix_rgb; -extern bNodeType cmp_node_hue_sat; -extern bNodeType cmp_node_brightcontrast; -extern bNodeType cmp_node_gamma; -extern bNodeType cmp_node_invert; -extern bNodeType cmp_node_alphaover; -extern bNodeType cmp_node_zcombine; -extern bNodeType cmp_node_colorbalance; -extern bNodeType cmp_node_huecorrect; +void register_node_type_cmp_curve_rgb(ListBase *lb); +void register_node_type_cmp_mix_rgb(ListBase *lb); +void register_node_type_cmp_hue_sat(ListBase *lb); +void register_node_type_cmp_brightcontrast(ListBase *lb); +void register_node_type_cmp_gamma(ListBase *lb); +void register_node_type_cmp_invert(ListBase *lb); +void register_node_type_cmp_alphaover(ListBase *lb); +void register_node_type_cmp_zcombine(ListBase *lb); +void register_node_type_cmp_colorbalance(ListBase *lb); +void register_node_type_cmp_huecorrect(ListBase *lb); -extern bNodeType cmp_node_normal; -extern bNodeType cmp_node_curve_vec; -extern bNodeType cmp_node_map_value; -extern bNodeType cmp_node_normalize; +void register_node_type_cmp_normal(ListBase *lb); +void register_node_type_cmp_curve_vec(ListBase *lb); +void register_node_type_cmp_map_value(ListBase *lb); +void register_node_type_cmp_normalize(ListBase *lb); -extern bNodeType cmp_node_filter; -extern bNodeType cmp_node_blur; -extern bNodeType cmp_node_dblur; -extern bNodeType cmp_node_bilateralblur; -extern bNodeType cmp_node_vecblur; -extern bNodeType cmp_node_dilateerode; -extern bNodeType cmp_node_defocus; +void register_node_type_cmp_filter(ListBase *lb); +void register_node_type_cmp_blur(ListBase *lb); +void register_node_type_cmp_dblur(ListBase *lb); +void register_node_type_cmp_bilateralblur(ListBase *lb); +void register_node_type_cmp_vecblur(ListBase *lb); +void register_node_type_cmp_dilateerode(ListBase *lb); +void register_node_type_cmp_defocus(ListBase *lb); -extern bNodeType cmp_node_valtorgb; -extern bNodeType cmp_node_rgbtobw; -extern bNodeType cmp_node_setalpha; -extern bNodeType cmp_node_idmask; -extern bNodeType cmp_node_math; -extern bNodeType cmp_node_seprgba; -extern bNodeType cmp_node_combrgba; -extern bNodeType cmp_node_sephsva; -extern bNodeType cmp_node_combhsva; -extern bNodeType cmp_node_sepyuva; -extern bNodeType cmp_node_combyuva; -extern bNodeType cmp_node_sepycca; -extern bNodeType cmp_node_combycca; -extern bNodeType cmp_node_premulkey; +void register_node_type_cmp_valtorgb(ListBase *lb); +void register_node_type_cmp_rgbtobw(ListBase *lb); +void register_node_type_cmp_setalpha(ListBase *lb); +void register_node_type_cmp_idmask(ListBase *lb); +void register_node_type_cmp_math(ListBase *lb); +void register_node_type_cmp_seprgba(ListBase *lb); +void register_node_type_cmp_combrgba(ListBase *lb); +void register_node_type_cmp_sephsva(ListBase *lb); +void register_node_type_cmp_combhsva(ListBase *lb); +void register_node_type_cmp_sepyuva(ListBase *lb); +void register_node_type_cmp_combyuva(ListBase *lb); +void register_node_type_cmp_sepycca(ListBase *lb); +void register_node_type_cmp_combycca(ListBase *lb); +void register_node_type_cmp_premulkey(ListBase *lb); -extern bNodeType cmp_node_diff_matte; -extern bNodeType cmp_node_distance_matte; -extern bNodeType cmp_node_chroma_matte; -extern bNodeType cmp_node_color_matte; -extern bNodeType cmp_node_channel_matte; -extern bNodeType cmp_node_color_spill; -extern bNodeType cmp_node_luma_matte; +void register_node_type_cmp_diff_matte(ListBase *lb); +void register_node_type_cmp_distance_matte(ListBase *lb); +void register_node_type_cmp_chroma_matte(ListBase *lb); +void register_node_type_cmp_color_matte(ListBase *lb); +void register_node_type_cmp_channel_matte(ListBase *lb); +void register_node_type_cmp_color_spill(ListBase *lb); +void register_node_type_cmp_luma_matte(ListBase *lb); -extern bNodeType cmp_node_translate; -extern bNodeType cmp_node_rotate; -extern bNodeType cmp_node_scale; -extern bNodeType cmp_node_flip; -extern bNodeType cmp_node_crop; -extern bNodeType cmp_node_displace; -extern bNodeType cmp_node_mapuv; +void register_node_type_cmp_translate(ListBase *lb); +void register_node_type_cmp_rotate(ListBase *lb); +void register_node_type_cmp_scale(ListBase *lb); +void register_node_type_cmp_flip(ListBase *lb); +void register_node_type_cmp_crop(ListBase *lb); +void register_node_type_cmp_displace(ListBase *lb); +void register_node_type_cmp_mapuv(ListBase *lb); -extern bNodeType cmp_node_glare; -extern bNodeType cmp_node_tonemap; -extern bNodeType cmp_node_lensdist; +void register_node_type_cmp_glare(ListBase *lb); +void register_node_type_cmp_tonemap(ListBase *lb); +void register_node_type_cmp_lensdist(ListBase *lb); #endif diff --git a/source/blender/nodes/SHD_node.h b/source/blender/nodes/SHD_node.h index 99a016c5009..20a7aa083ec 100644 --- a/source/blender/nodes/SHD_node.h +++ b/source/blender/nodes/SHD_node.h @@ -39,29 +39,29 @@ /* the type definitions array */ /* ****************** types array for all shaders ****************** */ -extern bNodeType sh_node_output; -extern bNodeType sh_node_material; -extern bNodeType sh_node_camera; -extern bNodeType sh_node_value; -extern bNodeType sh_node_rgb; -extern bNodeType sh_node_mix_rgb; -extern bNodeType sh_node_valtorgb; -extern bNodeType sh_node_rgbtobw; -extern bNodeType sh_node_texture; +void register_node_type_sh_output(ListBase *lb); +void register_node_type_sh_material(ListBase *lb); +void register_node_type_sh_camera(ListBase *lb); +void register_node_type_sh_value(ListBase *lb); +void register_node_type_sh_rgb(ListBase *lb); +void register_node_type_sh_mix_rgb(ListBase *lb); +void register_node_type_sh_valtorgb(ListBase *lb); +void register_node_type_sh_rgbtobw(ListBase *lb); +void register_node_type_sh_texture(ListBase *lb); void register_node_type_sh_normal(ListBase *lb); -extern bNodeType sh_node_geom; +void register_node_type_sh_geom(ListBase *lb); void register_node_type_sh_mapping(ListBase *lb); -extern bNodeType sh_node_curve_vec; -extern bNodeType sh_node_curve_rgb; -extern bNodeType sh_node_math; -extern bNodeType sh_node_vect_math; -extern bNodeType sh_node_squeeze; -extern bNodeType node_dynamic_typeinfo; -extern bNodeType sh_node_material_ext; -extern bNodeType sh_node_invert; -extern bNodeType sh_node_seprgb; -extern bNodeType sh_node_combrgb; -extern bNodeType sh_node_hue_sat; +void register_node_type_sh_curve_vec(ListBase *lb); +void register_node_type_sh_curve_rgb(ListBase *lb); +void register_node_type_sh_math(ListBase *lb); +void register_node_type_sh_vect_math(ListBase *lb); +void register_node_type_sh_squeeze(ListBase *lb); +void register_node_type_sh_dynamic(ListBase *lb); +void register_node_type_sh_material_ext(ListBase *lb); +void register_node_type_sh_invert(ListBase *lb); +void register_node_type_sh_seprgb(ListBase *lb); +void register_node_type_sh_combrgb(ListBase *lb); +void register_node_type_sh_hue_sat(ListBase *lb); #endif diff --git a/source/blender/nodes/TEX_node.h b/source/blender/nodes/TEX_node.h index 1bbca09ac8f..b741c654b15 100644 --- a/source/blender/nodes/TEX_node.h +++ b/source/blender/nodes/TEX_node.h @@ -38,41 +38,41 @@ /* ****************** types array for all texture nodes ****************** */ -extern bNodeType tex_node_math; -extern bNodeType tex_node_mix_rgb; -extern bNodeType tex_node_valtorgb; -extern bNodeType tex_node_valtonor; -extern bNodeType tex_node_rgbtobw; -extern bNodeType tex_node_output; -extern bNodeType tex_node_viewer; -extern bNodeType tex_node_checker; -extern bNodeType tex_node_texture; -extern bNodeType tex_node_bricks; -extern bNodeType tex_node_image; -extern bNodeType tex_node_curve_rgb; -extern bNodeType tex_node_curve_time; -extern bNodeType tex_node_invert; -extern bNodeType tex_node_hue_sat; -extern bNodeType tex_node_coord; -extern bNodeType tex_node_distance; +void register_node_type_tex_math(ListBase *lb); +void register_node_type_tex_mix_rgb(ListBase *lb); +void register_node_type_tex_valtorgb(ListBase *lb); +void register_node_type_tex_valtonor(ListBase *lb); +void register_node_type_tex_rgbtobw(ListBase *lb); +void register_node_type_tex_output(ListBase *lb); +void register_node_type_tex_viewer(ListBase *lb); +void register_node_type_tex_checker(ListBase *lb); +void register_node_type_tex_texture(ListBase *lb); +void register_node_type_tex_bricks(ListBase *lb); +void register_node_type_tex_image(ListBase *lb); +void register_node_type_tex_curve_rgb(ListBase *lb); +void register_node_type_tex_curve_time(ListBase *lb); +void register_node_type_tex_invert(ListBase *lb); +void register_node_type_tex_hue_sat(ListBase *lb); +void register_node_type_tex_coord(ListBase *lb); +void register_node_type_tex_distance(ListBase *lb); -extern bNodeType tex_node_rotate; -extern bNodeType tex_node_translate; -extern bNodeType tex_node_scale; -extern bNodeType tex_node_at; +void register_node_type_tex_rotate(ListBase *lb); +void register_node_type_tex_translate(ListBase *lb); +void register_node_type_tex_scale(ListBase *lb); +void register_node_type_tex_at(ListBase *lb); -extern bNodeType tex_node_compose; -extern bNodeType tex_node_decompose; +void register_node_type_tex_compose(ListBase *lb); +void register_node_type_tex_decompose(ListBase *lb); -extern bNodeType tex_node_proc_voronoi; -extern bNodeType tex_node_proc_blend; -extern bNodeType tex_node_proc_magic; -extern bNodeType tex_node_proc_marble; -extern bNodeType tex_node_proc_clouds; -extern bNodeType tex_node_proc_wood; -extern bNodeType tex_node_proc_musgrave; -extern bNodeType tex_node_proc_noise; -extern bNodeType tex_node_proc_stucci; -extern bNodeType tex_node_proc_distnoise; +void register_node_type_tex_proc_voronoi(ListBase *lb); +void register_node_type_tex_proc_blend(ListBase *lb); +void register_node_type_tex_proc_magic(ListBase *lb); +void register_node_type_tex_proc_marble(ListBase *lb); +void register_node_type_tex_proc_clouds(ListBase *lb); +void register_node_type_tex_proc_wood(ListBase *lb); +void register_node_type_tex_proc_musgrave(ListBase *lb); +void register_node_type_tex_proc_noise(ListBase *lb); +void register_node_type_tex_proc_stucci(ListBase *lb); +void register_node_type_tex_proc_distnoise(ListBase *lb); #endif diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c b/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c index 3f6bd989477..e8cfc8533d1 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c @@ -140,22 +140,19 @@ static void node_alphaover_init(bNode* node) node->storage= MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats"); } -bNodeType cmp_node_alphaover= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_ALPHAOVER, - /* name */ "AlphaOver", - /* width+range */ 80, 40, 120, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_alphaover_in, - /* output sock */ cmp_node_alphaover_out, - /* storage */ "NodeTwoFloats", - /* execfunc */ node_composit_exec_alphaover, - /* butfunc */ NULL, - /* initfunc */ node_alphaover_init, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL - -}; +void register_node_type_cmp_alphaover(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_ALPHAOVER, "AlphaOver", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_alphaover_in, cmp_node_alphaover_out); + node_type_size(&ntype, 80, 40, 120); + node_type_init(&ntype, node_alphaover_init); + node_type_storage(&ntype, "NodeTwoFloats", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_alphaover); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c b/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c index 404f0aefb3c..efa044158a2 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c @@ -250,20 +250,17 @@ static void node_composit_init_bilateralblur(bNode* node) nbbd->sigma_space= 5.0; } -bNodeType cmp_node_bilateralblur= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_BILATERALBLUR, - /* name */ "Bilateral Blur", - /* width+range */ 150, 120, 200, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS, - /* input sock */ cmp_node_bilateralblur_in, - /* output sock */ cmp_node_bilateralblur_out, - /* storage */ "NodeBilateralBlurData", - /* execfunc */ node_composit_exec_bilateralblur, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_bilateralblur, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL - -}; +void register_node_type_cmp_bilateralblur(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_BILATERALBLUR, "Bilateral Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS, + cmp_node_bilateralblur_in, cmp_node_bilateralblur_out); + node_type_size(&ntype, 150, 120, 200); + node_type_init(&ntype, node_composit_init_bilateralblur); + node_type_storage(&ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_bilateralblur); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c index f367e7b473d..78a27bc5b16 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c @@ -704,21 +704,19 @@ static void node_composit_init_blur(bNode* node) node->storage= MEM_callocN(sizeof(NodeBlurData), "node blur data"); } -bNodeType cmp_node_blur= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_BLUR, - /* name */ "Blur", - /* width+range */ 120, 80, 200, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_blur_in, - /* output sock */ cmp_node_blur_out, - /* storage */ "NodeBlurData", - /* execfunc */ node_composit_exec_blur, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_blur, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_blur(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_BLUR, "Blur", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_blur_in, cmp_node_blur_out); + node_type_size(&ntype, 120, 80, 200); + node_type_init(&ntype, node_composit_init_blur); + node_type_storage(&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_blur); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c index 6b0d6ff45a0..f2f7636e96b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c @@ -91,20 +91,15 @@ static void node_composit_exec_brightcontrast(void *UNUSED(data), bNode *node, b } } -bNodeType cmp_node_brightcontrast= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_BRIGHTCONTRAST, - /* name */ "Bright/Contrast", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_brightcontrast_in, - /* output sock */ cmp_node_brightcontrast_out, - /* storage */ "", - /* execfunc */ node_composit_exec_brightcontrast, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copysotragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_brightcontrast(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_brightcontrast_in, cmp_node_brightcontrast_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_brightcontrast); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c index 182c339132e..044ed6d069b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c @@ -197,19 +197,17 @@ static void node_composit_init_channel_matte(bNode *node) node->custom2= 2; /* Green Channel */ } -bNodeType cmp_node_channel_matte={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_CHANNEL_MATTE, - /* name */ "Channel Key", - /* width+range */ 200, 80, 250, - /* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_channel_matte_in, - /* output sock */ cmp_node_channel_matte_out, - /* storage */ "NodeChroma", - /* execfunc */ node_composit_exec_channel_matte, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_channel_matte, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_channel_matte(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_CHANNEL_MATTE, "Channel Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_channel_matte_in, cmp_node_channel_matte_out); + node_type_size(&ntype, 200, 80, 250); + node_type_init(&ntype, node_composit_init_channel_matte); + node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_channel_matte); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c index d102afbbd16..eba2d55187e 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c @@ -184,21 +184,19 @@ static void node_composit_init_chroma_matte(bNode *node) c->fstrength= 1.0f; }; -bNodeType cmp_node_chroma_matte={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_CHROMA_MATTE, - /* name */ "Chroma Key", - /* width+range */ 200, 80, 300, - /* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_chroma_in, - /* output sock */ cmp_node_chroma_out, - /* storage */ "NodeChroma", - /* execfunc */ node_composit_exec_chroma_matte, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_chroma_matte, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_chroma_matte(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_CHROMA_MATTE, "Chroma Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_chroma_in, cmp_node_chroma_out); + node_type_size(&ntype, 200, 80, 300); + node_type_init(&ntype, node_composit_init_chroma_matte); + node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_chroma_matte); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c index 8d5f4688657..57063465ac2 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c @@ -112,21 +112,19 @@ static void node_composit_init_color_matte(bNode *node) c->fstrength= 1.0f; }; -bNodeType cmp_node_color_matte={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COLOR_MATTE, - /* name */ "Color Key", - /* width+range */ 200, 80, 300, - /* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_color_in, - /* output sock */ cmp_node_color_out, - /* storage */ "NodeChroma", - /* execfunc */ node_composit_exec_color_matte, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_color_matte, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_color_matte(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COLOR_MATTE, "Color Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_color_in, cmp_node_color_out); + node_type_size(&ntype, 200, 80, 300); + node_type_init(&ntype, node_composit_init_color_matte); + node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_color_matte); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c index 408bda02ee4..e4b9ead504b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c @@ -322,19 +322,16 @@ static void node_composit_init_color_spill(bNode *node) ncs->unspill=0; /* do not use unspill */ } -bNodeType cmp_node_color_spill={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COLOR_SPILL, - /* name */ "Color Spill", - /* width+range */ 140, 80, 200, - /* class+opts */ NODE_CLASS_MATTE, NODE_OPTIONS, - /* input sock */ cmp_node_color_spill_in, - /* output sock */ cmp_node_color_spill_out, - /* storage */ "NodeColorspill", - /* execfunc */ node_composit_exec_color_spill, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_color_spill, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, -}; - +void register_node_type_cmp_color_spill(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE, NODE_OPTIONS, + cmp_node_color_spill_in, cmp_node_color_spill_out); + node_type_size(&ntype, 140, 80, 200); + node_type_init(&ntype, node_composit_init_color_spill); + node_type_storage(&ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_color_spill); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c index c8e0108a5c8..2596037065f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c @@ -179,20 +179,18 @@ static void node_composit_init_colorbalance(bNode *node) n->gain[0] = n->gain[1] = n->gain[2] = 1.0f; } -bNodeType cmp_node_colorbalance={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COLORBALANCE, - /* name */ "Color Balance", - /* width+range */ 400, 200, 400, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_colorbalance_in, - /* output sock */ cmp_node_colorbalance_out, - /* storage */ "NodeColorBalance", - /* execfunc */ node_composit_exec_colorbalance, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_colorbalance, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_colorbalance(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COLORBALANCE, "Color Balance", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_colorbalance_in, cmp_node_colorbalance_out); + node_type_size(&ntype, 400, 200, 400); + node_type_init(&ntype, node_composit_init_colorbalance); + node_type_storage(&ntype, "NodeColorBalance", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_colorbalance); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c index ffb090f3a94..1bbcb0f7527 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c @@ -94,19 +94,15 @@ static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **i generate_preview(data, node, in[0]->data); } -bNodeType cmp_node_composite= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COMPOSITE, - /* name */ "Composite", - /* width+range */ 80, 60, 200, - /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW, - /* input sock */ cmp_node_composite_in, - /* output sock */ NULL, - /* storage */ "", - /* execfunc */ node_composit_exec_composite, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_composite(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COMPOSITE, "Composite", NODE_CLASS_OUTPUT, NODE_PREVIEW, + cmp_node_composite_in, NULL); + node_type_size(&ntype, 80, 60, 200); + node_type_exec(&ntype, node_composit_exec_composite); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c index 7ecfe40f739..b8d24fc1b14 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c @@ -108,19 +108,17 @@ static void node_composit_init_crop(bNode* node) nxy->y2= 0; } -bNodeType cmp_node_crop= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_CROP, - /* name */ "Crop", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_crop_in, - /* output sock */ cmp_node_crop_out, - /* storage */ "NodeTwoXYs", - /* execfunc */ node_composit_exec_crop, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_crop, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_crop(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_CROP, "Crop", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_crop_in, cmp_node_crop_out); + node_type_size(&ntype, 140, 100, 320); + node_type_init(&ntype, node_composit_init_crop); + node_type_storage(&ntype, "NodeTwoXYs", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_crop); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c index 1a88e9541c6..2252bc2d181 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c @@ -59,22 +59,20 @@ static void node_composit_init_curves_time(bNode* node) node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } -bNodeType cmp_node_curve_time= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_TIME, - /* name */ "Time", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ cmp_node_time_out, - /* storage */ "CurveMapping", - /* execfunc */ node_composit_exec_curves_time, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_curves_time, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL -}; +void register_node_type_cmp_curve_time(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_TIME, "Time", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, cmp_node_time_out); + node_type_size(&ntype, 140, 100, 320); + node_type_init(&ntype, node_composit_init_curves_time); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, node_composit_exec_curves_time); + + nodeRegisterType(lb, &ntype); +} + @@ -102,23 +100,20 @@ static void node_composit_init_curve_vec(bNode* node) node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); }; -bNodeType cmp_node_curve_vec= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_CURVE_VEC, - /* name */ "Vector Curves", - /* width+range */ 200, 140, 320, - /* class+opts */ NODE_CLASS_OP_VECTOR, NODE_OPTIONS, - /* input sock */ cmp_node_curve_vec_in, - /* output sock */ cmp_node_curve_vec_out, - /* storage */ "CurveMapping", - /* execfunc */ node_composit_exec_curve_vec, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_curve_vec, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL - -}; +void register_node_type_cmp_curve_vec(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, + cmp_node_curve_vec_in, cmp_node_curve_vec_out); + node_type_size(&ntype, 200, 140, 320); + node_type_init(&ntype, node_composit_init_curve_vec); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, node_composit_exec_curve_vec); + + nodeRegisterType(lb, &ntype); +} + /* **************** CURVE RGB ******************** */ static bNodeSocketType cmp_node_curve_rgb_in[]= { @@ -192,20 +187,18 @@ static void node_composit_init_curve_rgb(bNode* node) node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); }; -bNodeType cmp_node_curve_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_CURVE_RGB, - /* name */ "RGB Curves", - /* width+range */ 200, 140, 320, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_curve_rgb_in, - /* output sock */ cmp_node_curve_rgb_out, - /* storage */ "CurveMapping", - /* execfunc */ node_composit_exec_curve_rgb, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_curve_rgb, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL -}; +void register_node_type_cmp_curve_rgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_curve_rgb_in, cmp_node_curve_rgb_out); + node_type_size(&ntype, 200, 140, 320); + node_type_init(&ntype, node_composit_init_curve_rgb); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, node_composit_exec_curve_rgb); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c index d3fd7c8bcad..7f5d5df9d6f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c @@ -869,21 +869,19 @@ static void node_composit_init_defocus(bNode* node) node->storage = nbd; } -bNodeType cmp_node_defocus = { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_DEFOCUS, - /* name */ "Defocus", - /* width+range */ 150, 120, 200, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS, - /* input sock */ cmp_node_defocus_in, - /* output sock */ cmp_node_defocus_out, - /* storage */ "NodeDefocus", - /* execfunc */ node_composit_exec_defocus, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_defocus, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_defocus(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_DEFOCUS, "Defocus", NODE_CLASS_OP_FILTER, NODE_OPTIONS, + cmp_node_defocus_in, cmp_node_defocus_out); + node_type_size(&ntype, 150, 120, 200); + node_type_init(&ntype, node_composit_init_defocus); + node_type_storage(&ntype, "NodeDefocus", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_defocus); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c index 0735a369d12..73046d70011 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c @@ -128,21 +128,19 @@ static void node_composit_init_diff_matte(bNode *node) c->t2= 0.1f; } -bNodeType cmp_node_diff_matte={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_DIFF_MATTE, - /* name */ "Difference Key", - /* width+range */ 200, 80, 250, - /* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_diff_matte_in, - /* output sock */ cmp_node_diff_matte_out, - /* storage */ "NodeChroma", - /* execfunc */ node_composit_exec_diff_matte, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_diff_matte, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_diff_matte(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_DIFF_MATTE, "Difference Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_diff_matte_in, cmp_node_diff_matte_out); + node_type_size(&ntype, 200, 80, 250); + node_type_init(&ntype, node_composit_init_diff_matte); + node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_diff_matte); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c b/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c index 71990b7403a..3ceaecfed43 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c @@ -143,21 +143,16 @@ static void node_composit_exec_dilateerode(void *UNUSED(data), bNode *node, bNod } } -bNodeType cmp_node_dilateerode= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_DILATEERODE, - /* name */ "Dilate/Erode", - /* width+range */ 130, 100, 320, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS, - /* input sock */ cmp_node_dilateerode_in, - /* output sock */ cmp_node_dilateerode_out, - /* storage */ "", - /* execfunc */ node_composit_exec_dilateerode, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_dilateerode(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_DILATEERODE, "Dilate/Erode", NODE_CLASS_OP_FILTER, NODE_OPTIONS, + cmp_node_dilateerode_in, cmp_node_dilateerode_out); + node_type_size(&ntype, 130, 100, 320); + node_type_exec(&ntype, node_composit_exec_dilateerode); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c b/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c index 42bf48b9128..533a8b1324b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c @@ -125,19 +125,17 @@ static void node_composit_init_dblur(bNode* node) ndbd->center_y= 0.5; } -bNodeType cmp_node_dblur = { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_DBLUR, - /* name */ "Directional Blur", - /* width+range */ 150, 120, 200, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS, - /* input sock */ cmp_node_dblur_in, - /* output sock */ cmp_node_dblur_out, - /* storage */ "NodeDBlurData", - /* execfunc */ node_composit_exec_dblur, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_dblur, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_dblur(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_DBLUR, "Directional Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS, + cmp_node_dblur_in, cmp_node_dblur_out); + node_type_size(&ntype, 150, 120, 200); + node_type_init(&ntype, node_composit_init_dblur); + node_type_storage(&ntype, "NodeDBlurData", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_dblur); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_displace.c b/source/blender/nodes/intern/CMP_nodes/CMP_displace.c index 1ce545e2ca8..7871efc30b7 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_displace.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_displace.c @@ -171,20 +171,16 @@ static void node_composit_exec_displace(void *UNUSED(data), bNode *UNUSED(node), } } -bNodeType cmp_node_displace= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_DISPLACE, - /* name */ "Displace", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_displace_in, - /* output sock */ cmp_node_displace_out, - /* storage */ "", - /* execfunc */ node_composit_exec_displace, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_displace(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_DISPLACE, "Displace", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_displace_in, cmp_node_displace_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_displace); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c index e0e595fc8f6..406f9e829c1 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c @@ -125,21 +125,19 @@ static void node_composit_init_distance_matte(bNode *node) c->t2= 0.1f; } -bNodeType cmp_node_distance_matte={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_DIST_MATTE, - /* name */ "Distance Key", - /* width+range */ 200, 80, 250, - /* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_distance_matte_in, - /* output sock */ cmp_node_distance_matte_out, - /* storage */ "NodeChroma", - /* execfunc */ node_composit_exec_distance_matte, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_distance_matte, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_distance_matte(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_DIST_MATTE, "Distance Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_distance_matte_in, cmp_node_distance_matte_out); + node_type_size(&ntype, 200, 80, 250); + node_type_init(&ntype, node_composit_init_distance_matte); + node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_distance_matte); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_filter.c b/source/blender/nodes/intern/CMP_nodes/CMP_filter.c index 8f9a988c4c2..f960f44d64d 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_filter.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_filter.c @@ -217,22 +217,17 @@ static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in, } -bNodeType cmp_node_filter= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_FILTER, - /* name */ "Filter", - /* width+range */ 80, 40, 120, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_filter_in, - /* output sock */ cmp_node_filter_out, - /* storage */ "", - /* execfunc */ node_composit_exec_filter, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_filter(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_FILTER, "Filter", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_filter_in, cmp_node_filter_out); + node_type_size(&ntype, 80, 40, 120); + node_type_exec(&ntype, node_composit_exec_filter); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_flip.c b/source/blender/nodes/intern/CMP_nodes/CMP_flip.c index 33a17f890d8..b0058765136 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_flip.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_flip.c @@ -85,21 +85,17 @@ static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack } } -bNodeType cmp_node_flip= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_FLIP, - /* name */ "Flip", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_flip_in, - /* output sock */ cmp_node_flip_out, - /* storage */ "", - /* execfunc */ node_composit_exec_flip, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_flip(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_FLIP, "Flip", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_flip_in, cmp_node_flip_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_flip); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c index 2e3162b0c30..98af5bff2ec 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c @@ -72,21 +72,14 @@ static void node_composit_exec_gamma(void *UNUSED(data), bNode *node, bNodeStack } } -bNodeType cmp_node_gamma= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_GAMMA, - /* name */ "Gamma", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_gamma_in, - /* output sock */ cmp_node_gamma_out, - /* storage */ "", - /* execfunc */ node_composit_exec_gamma, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copysotragefunc */ NULL, - /* id */ NULL -}; - - +void register_node_type_cmp_gamma(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_gamma_in, cmp_node_gamma_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_gamma); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c index d4968caee0f..1d7471680d0 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c @@ -484,19 +484,17 @@ static void node_composit_init_glare(bNode* node) node->storage = ndg; } -bNodeType cmp_node_glare = { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_GLARE, - /* name */ "Glare", - /* width+range */ 150, 120, 200, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS, - /* input sock */ cmp_node_glare_in, - /* output sock */ cmp_node_glare_out, - /* storage */ "NodeGlare", - /* execfunc */ node_composit_exec_glare, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_glare, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_glare(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_GLARE, "Glare", NODE_CLASS_OP_FILTER, NODE_OPTIONS, + cmp_node_glare_in, cmp_node_glare_out); + node_type_size(&ntype, 150, 120, 200); + node_type_init(&ntype, node_composit_init_glare); + node_type_storage(&ntype, "NodeGlare", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_glare); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c b/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c index e8ce3e20f11..412ed5e6fa5 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c @@ -99,22 +99,19 @@ static void node_composit_init_hue_sat(bNode* node) nhs->val= 1.0f; } -bNodeType cmp_node_hue_sat= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_HUE_SAT, - /* name */ "Hue Saturation Value", - /* width+range */ 150, 80, 250, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_hue_sat_in, - /* output sock */ cmp_node_hue_sat_out, - /* storage */ "NodeHueSat", - /* execfunc */ node_composit_exec_hue_sat, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_hue_sat, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL - -}; +void register_node_type_cmp_hue_sat(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_hue_sat_in, cmp_node_hue_sat_out); + node_type_size(&ntype, 150, 80, 250); + node_type_init(&ntype, node_composit_init_hue_sat); + node_type_storage(&ntype, "NodeHueSat", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_hue_sat); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c b/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c index ac009ccb69d..54503d23550 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c @@ -148,20 +148,18 @@ static void node_composit_init_huecorrect(bNode* node) cumapping->cur = 1; } -bNodeType cmp_node_huecorrect= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_HUECORRECT, - /* name */ "Hue Correct", - /* width+range */ 320, 140, 400, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_huecorrect_in, - /* output sock */ cmp_node_huecorrect_out, - /* storage */ "CurveMapping", - /* execfunc */ node_composit_exec_huecorrect, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_huecorrect, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL -}; +void register_node_type_cmp_huecorrect(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_HUECORRECT, "Hue Correct", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_huecorrect_in, cmp_node_huecorrect_out); + node_type_size(&ntype, 320, 140, 400); + node_type_init(&ntype, node_composit_init_huecorrect); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, node_composit_exec_huecorrect); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c b/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c index 9b088cb3f55..8b422012cec 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c @@ -104,21 +104,17 @@ static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in, } -bNodeType cmp_node_idmask= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_ID_MASK, - /* name */ "ID Mask", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_idmask_in, - /* output sock */ cmp_node_idmask_out, - /* storage */ "", - /* execfunc */ node_composit_exec_idmask, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_idmask(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_ID_MASK, "ID Mask", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_idmask_in, cmp_node_idmask_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_idmask); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index dcf9a059c83..a0ac8d90bfa 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -297,22 +297,20 @@ static void node_composit_init_image(bNode* node) iuser->ok= 1; } -bNodeType cmp_node_image= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_IMAGE, - /* name */ "Image", - /* width+range */ 120, 80, 300, - /* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ cmp_node_rlayers_out, - /* storage */ "ImageUser", - /* execfunc */ node_composit_exec_image, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_image, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_image(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS, + NULL, cmp_node_rlayers_out); + node_type_size(&ntype, 120, 80, 300); + node_type_init(&ntype, node_composit_init_image); + node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_image); + + nodeRegisterType(lb, &ntype); +} + /* **************** RENDER RESULT ******************** */ @@ -428,22 +426,17 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNU }; -bNodeType cmp_node_rlayers= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_R_LAYERS, - /* name */ "Render Layers", - /* width+range */ 150, 100, 300, - /* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ cmp_node_rlayers_out, - /* storage */ "", - /* execfunc */ node_composit_exec_rlayers, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_cmp_rlayers(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_R_LAYERS, "Render Layers", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS, + NULL, cmp_node_rlayers_out); + node_type_size(&ntype, 150, 100, 300); + node_type_exec(&ntype, node_composit_exec_rlayers); + + nodeRegisterType(lb, &ntype); +} -}; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c index 7ea146c7d4d..a60edd5ac7d 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c @@ -115,20 +115,16 @@ static void node_composit_init_invert(bNode *node) } /* custom1 = mix type */ -bNodeType cmp_node_invert= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_INVERT, - /* name */ "Invert", - /* width+range */ 120, 120, 140, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_invert_in, - /* output sock */ cmp_node_invert_out, - /* storage */ "", - /* execfunc */ node_composit_exec_invert, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_invert, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_invert(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_invert_in, cmp_node_invert_out); + node_type_size(&ntype, 120, 120, 140); + node_type_init(&ntype, node_composit_init_invert); + node_type_exec(&ntype, node_composit_exec_invert); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c b/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c index b6e1fffcce8..159bc859450 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c @@ -174,19 +174,17 @@ static void node_composit_init_lensdist(bNode* node) } -bNodeType cmp_node_lensdist = { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_LENSDIST, - /* name */ "Lens Distortion", - /* width+range */ 150, 120, 200, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_lensdist_in, - /* output sock */ cmp_node_lensdist_out, - /* storage */ "NodeLensDist", - /* execfunc */ node_composit_exec_lensdist, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_lensdist, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_lensdist(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_LENSDIST, "Lens Distortion", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_lensdist_in, cmp_node_lensdist_out); + node_type_size(&ntype, 150, 120, 200); + node_type_init(&ntype, node_composit_init_lensdist); + node_type_storage(&ntype, "NodeLensDist", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_lensdist); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_levels.c b/source/blender/nodes/intern/CMP_nodes/CMP_levels.c index f4934b4b57b..71170d1633e 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_levels.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_levels.c @@ -328,21 +328,18 @@ static void node_composit_init_view_levels(bNode* node) node->custom1=1; /*All channels*/ } -bNodeType cmp_node_view_levels= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_VIEW_LEVELS, - /* name */ "Levels", - /* widthrange */ 140, 100, 320, - /* classopts */ NODE_CLASS_OUTPUT, NODE_OPTIONS|NODE_PREVIEW, - /* input sock */ cmp_node_view_levels_in, - /* output sock */ cmp_node_view_levels_out, - /* storage */ "ImageUser", - /* execfunc */ node_composit_exec_view_levels, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_view_levels, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_view_levels(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_VIEW_LEVELS, "Levels", NODE_CLASS_OUTPUT, NODE_OPTIONS|NODE_PREVIEW, + cmp_node_view_levels_in, cmp_node_view_levels_out); + node_type_size(&ntype, 140, 100, 320); + node_type_init(&ntype, node_composit_init_view_levels); + node_type_storage(&ntype, "ImageUser", NULL, NULL); + node_type_exec(&ntype, node_composit_exec_view_levels); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c index af198fba699..91edb48415b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c @@ -103,20 +103,18 @@ static void node_composit_init_luma_matte(bNode *node) c->t2= 0.0f; }; -bNodeType cmp_node_luma_matte={ - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_LUMA_MATTE, - /* name */ "Luminance Key", - /* width+range */ 200, 80, 250, - /* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_luma_matte_in, - /* output sock */ cmp_node_luma_matte_out, - /* storage */ "NodeChroma", - /* execfunc */ node_composit_exec_luma_matte, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_luma_matte, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_luma_matte(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_LUMA_MATTE, "Luminance Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_luma_matte_in, cmp_node_luma_matte_out); + node_type_size(&ntype, 200, 80, 250); + node_type_init(&ntype, node_composit_init_luma_matte); + node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_luma_matte); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c b/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c index c605a661556..f0e0aec37b9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c @@ -159,21 +159,17 @@ static void node_composit_exec_mapuv(void *UNUSED(data), bNode *node, bNodeStack } } -bNodeType cmp_node_mapuv= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_MAP_UV, - /* name */ "Map UV", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_mapuv_in, - /* output sock */ cmp_node_mapuv_out, - /* storage */ "", - /* execfunc */ node_composit_exec_mapuv, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_mapuv(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_MAP_UV, "Map UV", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_mapuv_in, cmp_node_mapuv_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_mapuv); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c b/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c index 92709025a84..550e4a2e870 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c @@ -79,23 +79,20 @@ static void node_composit_init_map_value(bNode* node) node->storage= add_mapping(); } -bNodeType cmp_node_map_value= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_MAP_VALUE, - /* name */ "Map Value", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_OP_VECTOR, NODE_OPTIONS, - /* input sock */ cmp_node_map_value_in, - /* output sock */ cmp_node_map_value_out, - /* storage */ "TexMapping", - /* execfunc */ node_composit_exec_map_value, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_map_value, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL - -}; +void register_node_type_cmp_map_value(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, + cmp_node_map_value_in, cmp_node_map_value_out); + node_type_size(&ntype, 100, 60, 150); + node_type_init(&ntype, node_composit_init_map_value); + node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_map_value); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c index 98bbbf6c752..54ece02582d 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c @@ -181,22 +181,18 @@ static void node_composit_exec_math(void *UNUSED(data), bNode *node, bNodeStack out[0]->data= stackbuf; } -bNodeType cmp_node_math= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_MATH, - /* name */ "Math", - /* width+range */ 120, 110, 160, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_math_in, - /* output sock */ cmp_node_math_out, - /* storage */ "", - /* execfunc */ node_composit_exec_math, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_math(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_math_in, cmp_node_math_out); + node_type_size(&ntype, 120, 110, 160); + node_type_exec(&ntype, node_composit_exec_math); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c index 34d6713d9e3..b65296ffe10 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c @@ -79,20 +79,15 @@ static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in, } /* custom1 = mix type */ -bNodeType cmp_node_mix_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_MIX_RGB, - /* name */ "Mix", - /* width+range */ 110, 60, 120, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_mix_rgb_in, - /* output sock */ cmp_node_mix_rgb_out, - /* storage */ "", - /* execfunc */ node_composit_exec_mix_rgb, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_mix_rgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_mix_rgb_in, cmp_node_mix_rgb_out); + node_type_size(&ntype, 110, 60, 120); + node_type_exec(&ntype, node_composit_exec_mix_rgb); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_normal.c b/source/blender/nodes/intern/CMP_nodes/CMP_normal.c index 04162956ac3..5b218f4d486 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_normal.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_normal.c @@ -77,21 +77,16 @@ static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStac } -bNodeType cmp_node_normal= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_NORMAL, - /* name */ "Normal", - /* width+range */ 100, 60, 200, - /* class+opts */ NODE_CLASS_OP_VECTOR, NODE_OPTIONS, - /* input sock */ cmp_node_normal_in, - /* output sock */ cmp_node_normal_out, - /* storage */ "", - /* execfunc */ node_composit_exec_normal, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_normal(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, + cmp_node_normal_in, cmp_node_normal_out); + node_type_size(&ntype, 100, 60, 200); + node_type_exec(&ntype, node_composit_exec_normal); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c index 07a11cdc997..1c92eb6519e 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c @@ -98,19 +98,15 @@ static void node_composit_exec_normalize(void *UNUSED(data), bNode *node, bNodeS } } -bNodeType cmp_node_normalize= { - /* *next, *prev*/ NULL, NULL, - /* type code */ CMP_NODE_NORMALIZE, - /* name */ "Normalize", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_OP_VECTOR, NODE_OPTIONS, - /* input sock */ cmp_node_normalize_in, - /* output sock */ cmp_node_normalize_out, - /* storage */ "TexMapping", - /* execfunc */ node_composit_exec_normalize, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_normalize(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_NORMALIZE, "Normalize", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, + cmp_node_normalize_in, cmp_node_normalize_out); + node_type_size(&ntype, 100, 60, 150); + node_type_exec(&ntype, node_composit_exec_normalize); + node_type_storage(&ntype, "TexMapping", NULL, NULL); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c index 0129c1bb03d..701a3910be9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c @@ -104,22 +104,19 @@ static void node_composit_init_output_file(bNode *node) } } -bNodeType cmp_node_output_file= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_OUTPUT_FILE, - /* name */ "File Output", - /* width+range */ 140, 80, 300, - /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_output_file_in, - /* output sock */ NULL, - /* storage */ "NodeImageFile", - /* execfunc */ node_composit_exec_output_file, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_output_file, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL - -}; +void register_node_type_cmp_output_file(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_output_file_in, NULL); + node_type_size(&ntype, 140, 80, 300); + node_type_init(&ntype, node_composit_init_output_file); + node_type_storage(&ntype, "NodeImageFile", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_output_file); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c b/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c index 1aa2e338f94..d64a2cee453 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c @@ -58,20 +58,16 @@ static void node_composit_exec_premulkey(void *UNUSED(data), bNode *node, bNodeS } } -bNodeType cmp_node_premulkey= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_PREMULKEY, - /* name */ "Alpha Convert", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_premulkey_in, - /* output sock */ cmp_node_premulkey_out, - /* storage */ "", - /* execfunc */ node_composit_exec_premulkey, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copysotragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_premulkey(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_PREMULKEY, "Alpha Convert", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_premulkey_in, cmp_node_premulkey_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_premulkey); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c index 5fbed05ac8d..975d9cae219 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c @@ -43,22 +43,17 @@ static void node_composit_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack * VECCOPY(out[0]->vec, sock->ns.vec); } -bNodeType cmp_node_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_RGB, - /* name */ "RGB", - /* width+range */ 140, 80, 140, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ cmp_node_rgb_out, - /* storage */ "", - /* execfunc */ node_composit_exec_rgb, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_rgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_RGB, "RGB", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, cmp_node_rgb_out); + node_type_size(&ntype, 140, 80, 140); + node_type_exec(&ntype, node_composit_exec_rgb); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c index 8fed6972c20..ff8a2460efc 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c @@ -120,19 +120,16 @@ static void node_composit_init_rotate(bNode *node) node->custom1= 1; /* Bilinear Filter*/ } -bNodeType cmp_node_rotate= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_ROTATE, - /* name */ "Rotate", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_rotate_in, - /* output sock */ cmp_node_rotate_out, - /* storage */ "", - /* execfunc */ node_composit_exec_rotate, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_rotate, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_rotate(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_rotate_in, cmp_node_rotate_out); + node_type_size(&ntype, 140, 100, 320); + node_type_init(&ntype, node_composit_init_rotate); + node_type_exec(&ntype, node_composit_exec_rotate); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c index 40785f3bc77..a524f4cb29b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c @@ -109,22 +109,18 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b } }; -bNodeType cmp_node_scale= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_SCALE, - /* name */ "Scale", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_scale_in, - /* output sock */ cmp_node_scale_out, - /* storage */ "", - /* execfunc */ node_composit_exec_scale, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_scale(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_scale_in, cmp_node_scale_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_scale); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c index ef8723fd4e9..040a88bc37b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c @@ -96,23 +96,18 @@ static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeSta } } -bNodeType cmp_node_sephsva= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_SEPHSVA, - /* name */ "Separate HSVA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, 0, - /* input sock */ cmp_node_sephsva_in, - /* output sock */ cmp_node_sephsva_out, - /* storage */ "", - /* execfunc */ node_composit_exec_sephsva, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_sephsva(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_SEPHSVA, "Separate HSVA", NODE_CLASS_CONVERTOR, 0, + cmp_node_sephsva_in, cmp_node_sephsva_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_sephsva); + + nodeRegisterType(lb, &ntype); +} + /* **************** COMBINE HSVA ******************** */ static bNodeSocketType cmp_node_combhsva_in[]= { @@ -171,21 +166,17 @@ static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeSt } } -bNodeType cmp_node_combhsva= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COMBHSVA, - /* name */ "Combine HSVA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_combhsva_in, - /* output sock */ cmp_node_combhsva_out, - /* storage */ "", - /* execfunc */ node_composit_exec_combhsva, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_combhsva(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COMBHSVA, "Combine HSVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_combhsva_in, cmp_node_combhsva_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_combhsva); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c index 36603785bb3..1062344db39 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c @@ -74,23 +74,18 @@ static void node_composit_exec_seprgba(void *UNUSED(data), bNode *UNUSED(node), } } -bNodeType cmp_node_seprgba= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_SEPRGBA, - /* name */ "Separate RGBA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, 0, - /* input sock */ cmp_node_seprgba_in, - /* output sock */ cmp_node_seprgba_out, - /* storage */ "", - /* execfunc */ node_composit_exec_seprgba, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_seprgba(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_SEPRGBA, "Separate RGBA", NODE_CLASS_CONVERTOR, 0, + cmp_node_seprgba_in, cmp_node_seprgba_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_seprgba); + + nodeRegisterType(lb, &ntype); +} + /* **************** COMBINE RGBA ******************** */ @@ -147,21 +142,16 @@ static void node_composit_exec_combrgba(void *UNUSED(data), bNode *node, bNodeSt } } -bNodeType cmp_node_combrgba= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COMBRGBA, - /* name */ "Combine RGBA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_combrgba_in, - /* output sock */ cmp_node_combrgba_out, - /* storage */ "", - /* execfunc */ node_composit_exec_combrgba, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_combrgba(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COMBRGBA, "Combine RGBA", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_combrgba_in, cmp_node_combrgba_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_combrgba); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c index 895d7799796..364457fc5fa 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c @@ -145,22 +145,18 @@ static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeSta } } -bNodeType cmp_node_sepycca= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_SEPYCCA, - /* name */ "Separate YCbCrA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_sepycca_in, - /* output sock */ cmp_node_sepycca_out, - /* storage */ "", - /* execfunc */ node_composit_exec_sepycca, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_sepycca(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_SEPYCCA, "Separate YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_sepycca_in, cmp_node_sepycca_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_sepycca); + + nodeRegisterType(lb, &ntype); +} + /* **************** COMBINE YCCA ******************** */ @@ -296,21 +292,17 @@ static void node_composit_exec_combycca(void *UNUSED(data), bNode *node, bNodeSt } } -bNodeType cmp_node_combycca= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COMBYCCA, - /* name */ "Combine YCbCrA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_combycca_in, - /* output sock */ cmp_node_combycca_out, - /* storage */ "", - /* execfunc */ node_composit_exec_combycca, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_combycca(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COMBYCCA, "Combine YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_combycca_in, cmp_node_combycca_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_combycca); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c index 333a4a2596e..99a625042df 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c @@ -96,22 +96,18 @@ static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeSta } } -bNodeType cmp_node_sepyuva= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_SEPYUVA, - /* name */ "Separate YUVA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, 0, - /* input sock */ cmp_node_sepyuva_in, - /* output sock */ cmp_node_sepyuva_out, - /* storage */ "", - /* execfunc */ node_composit_exec_sepyuva, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_sepyuva(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_SEPYUVA, "Separate YUVA", NODE_CLASS_CONVERTOR, 0, + cmp_node_sepyuva_in, cmp_node_sepyuva_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_sepyuva); + + nodeRegisterType(lb, &ntype); +} + /* **************** COMBINE YUVA ******************** */ @@ -171,20 +167,16 @@ static void node_composit_exec_combyuva(void *UNUSED(data), bNode *node, bNodeSt } } -bNodeType cmp_node_combyuva= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_COMBYUVA, - /* name */ "Combine YUVA", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_combyuva_in, - /* output sock */ cmp_node_combyuva_out, - /* storage */ "", - /* execfunc */ node_composit_exec_combyuva, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_combyuva(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_COMBYUVA, "Combine YUVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_combyuva_in, cmp_node_combyuva_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_composit_exec_combyuva); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c b/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c index f4c5603ce49..106203ded7a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c @@ -70,20 +70,15 @@ static void node_composit_exec_setalpha(void *UNUSED(data), bNode *node, bNodeSt } } -bNodeType cmp_node_setalpha= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_SETALPHA, - /* name */ "Set Alpha", - /* width+range */ 120, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_setalpha_in, - /* output sock */ cmp_node_setalpha_out, - /* storage */ "", - /* execfunc */ node_composit_exec_setalpha, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_setalpha(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_SETALPHA, "Set Alpha", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_setalpha_in, cmp_node_setalpha_out); + node_type_size(&ntype, 120, 40, 140); + node_type_exec(&ntype, node_composit_exec_setalpha); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c b/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c index efb8c12fa84..1bb0cdfcd10 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c @@ -146,22 +146,20 @@ static void node_composit_init_splitviewer(bNode* node) node->custom1= 50; /* default 50% split */ } -bNodeType cmp_node_splitviewer= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_SPLITVIEWER, - /* name */ "SplitViewer", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ cmp_node_splitviewer_in, - /* output sock */ NULL, - /* storage */ "ImageUser", - /* execfunc */ node_composit_exec_splitviewer, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_splitviewer, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_splitviewer(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_SPLITVIEWER, "SplitViewer", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS, + cmp_node_splitviewer_in, NULL); + node_type_size(&ntype, 140, 100, 320); + node_type_init(&ntype, node_composit_init_splitviewer); + node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_splitviewer); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c index b2510917ba1..63a43352b2a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c @@ -139,22 +139,17 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, } } -bNodeType cmp_node_texture= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_TEXTURE, - /* name */ "Texture", - /* width+range */ 120, 80, 240, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, - /* input sock */ cmp_node_texture_in, - /* output sock */ cmp_node_texture_out, - /* storage */ "", - /* execfunc */ node_composit_exec_texture, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_texture(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, + cmp_node_texture_in, cmp_node_texture_out); + node_type_size(&ntype, 120, 80, 240); + node_type_exec(&ntype, node_composit_exec_texture); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c b/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c index 49031e1625a..d58f0e827c2 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c @@ -158,19 +158,17 @@ static void node_composit_init_tonemap(bNode* node) node->storage = ntm; } -bNodeType cmp_node_tonemap = { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_TONEMAP, - /* name */ "Tonemap", - /* width+range */ 150, 120, 200, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_tonemap_in, - /* output sock */ cmp_node_tonemap_out, - /* storage */ "NodeTonemap", - /* execfunc */ node_composit_exec_tonemap, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_tonemap, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_tonemap(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_TONEMAP, "Tonemap", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_tonemap_in, cmp_node_tonemap_out); + node_type_size(&ntype, 150, 120, 200); + node_type_init(&ntype, node_composit_init_tonemap); + node_type_storage(&ntype, "NodeTonemap", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_tonemap); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_translate.c b/source/blender/nodes/intern/CMP_nodes/CMP_translate.c index 0d8ad41d2dd..cad4d79b75c 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_translate.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_translate.c @@ -56,20 +56,16 @@ static void node_composit_exec_translate(void *UNUSED(data), bNode *UNUSED(node) } } -bNodeType cmp_node_translate= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_TRANSLATE, - /* name */ "Translate", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ cmp_node_translate_in, - /* output sock */ cmp_node_translate_out, - /* storage */ "", - /* execfunc */ node_composit_exec_translate, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_translate(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS, + cmp_node_translate_in, cmp_node_translate_out); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, node_composit_exec_translate); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c index 7e0ecbcb888..2000e411f8c 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c @@ -80,23 +80,20 @@ static void node_composit_init_valtorgb(bNode* node) node->storage= add_colorband(1); } -bNodeType cmp_node_valtorgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_VALTORGB, - /* name */ "ColorRamp", - /* width+range */ 240, 200, 300, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ cmp_node_valtorgb_in, - /* output sock */ cmp_node_valtorgb_out, - /* storage */ "ColorBand", - /* execfunc */ node_composit_exec_valtorgb, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_valtorgb, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL - -}; +void register_node_type_cmp_valtorgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + cmp_node_valtorgb_in, cmp_node_valtorgb_out); + node_type_size(&ntype, 240, 200, 300); + node_type_init(&ntype, node_composit_init_valtorgb); + node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_valtorgb); + + nodeRegisterType(lb, &ntype); +} + /* **************** RGBTOBW ******************** */ @@ -137,21 +134,14 @@ static void node_composit_exec_rgbtobw(void *UNUSED(data), bNode *node, bNodeSta } } -bNodeType cmp_node_rgbtobw= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_RGBTOBW, - /* name */ "RGB to BW", - /* width+range */ 80, 40, 120, - /* class+opts */ NODE_CLASS_CONVERTOR, 0, - /* input sock */ cmp_node_rgbtobw_in, - /* output sock */ cmp_node_rgbtobw_out, - /* storage */ "", - /* execfunc */ node_composit_exec_rgbtobw, - /* butfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_cmp_rgbtobw(ListBase *lb) +{ + static bNodeType ntype; -}; - - + node_type_base(&ntype, CMP_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0, + cmp_node_rgbtobw_in, cmp_node_rgbtobw_out); + node_type_size(&ntype, 80, 40, 120); + node_type_exec(&ntype, node_composit_exec_rgbtobw); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_value.c b/source/blender/nodes/intern/CMP_nodes/CMP_value.c index a37742c77e9..787c9135898 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_value.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_value.c @@ -42,20 +42,16 @@ static void node_composit_exec_value(void *UNUSED(data), bNode *node, bNodeStack out[0]->vec[0]= sock->ns.vec[0]; } -bNodeType cmp_node_value= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_VALUE, - /* name */ "Value", - /* width+range */ 80, 40, 120, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ cmp_node_value_out, - /* storage */ "", - /* execfunc */ node_composit_exec_value, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_cmp_value(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, cmp_node_value_out); + node_type_size(&ntype, 80, 40, 120); + node_type_exec(&ntype, node_composit_exec_value); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c b/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c index 9ea626e39d6..71c8c48db7a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c @@ -91,20 +91,18 @@ static void node_composit_init_vecblur(bNode* node) }; /* custom1: itterations, custom2: maxspeed (0 = nolimit) */ -bNodeType cmp_node_vecblur= { - /* next, prev */ NULL, NULL, - /* type code */ CMP_NODE_VECBLUR, - /* name */ "Vector Blur", - /* width+range */ 120, 80, 200, - /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS, - /* input sock */ cmp_node_vecblur_in, - /* output sock */ cmp_node_vecblur_out, - /* storage */ "NodeBlurData", - /* execfunc */ node_composit_exec_vecblur, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_vecblur, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; +void register_node_type_cmp_vecblur(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_VECBLUR, "Vector Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS, + cmp_node_vecblur_in, cmp_node_vecblur_out); + node_type_size(&ntype, 120, 80, 200); + node_type_init(&ntype, node_composit_init_vecblur); + node_type_storage(&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_vecblur); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c index 24d8a9eb09e..f23a82e1dc2 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c @@ -128,21 +128,18 @@ static void node_composit_init_viewer(bNode* node) iuser->ok= 1; } -bNodeType cmp_node_viewer= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_VIEWER, - /* name */ "Viewer", - /* width+range */ 80, 60, 200, - /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW, - /* input sock */ cmp_node_viewer_in, - /* output sock */ NULL, - /* storage */ "ImageUser", - /* execfunc */ node_composit_exec_viewer, - /* butfunc */ NULL, - /* initfunc */ node_composit_init_viewer, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL - -}; +void register_node_type_cmp_viewer(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW, + cmp_node_viewer_in, NULL); + node_type_size(&ntype, 80, 60, 200); + node_type_init(&ntype, node_composit_init_viewer); + node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_viewer); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c index 17d88543698..675eae74a53 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c @@ -219,20 +219,15 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in } -bNodeType cmp_node_zcombine= { - /* *next,*prev */ NULL, NULL, - /* type code */ CMP_NODE_ZCOMBINE, - /* name */ "Z Combine", - /* width+range */ 80, 40, 120, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ cmp_node_zcombine_in, - /* output sock */ cmp_node_zcombine_out, - /* storage */ "", - /* execfunc */ node_composit_exec_zcombine, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_cmp_zcombine(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, CMP_NODE_ZCOMBINE, "Z Combine", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + cmp_node_zcombine_in, cmp_node_zcombine_out); + node_type_size(&ntype, 80, 40, 120); + node_type_exec(&ntype, node_composit_exec_zcombine); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/CMP_util.h b/source/blender/nodes/intern/CMP_util.h index df583767f76..efb711ab416 100644 --- a/source/blender/nodes/intern/CMP_util.h +++ b/source/blender/nodes/intern/CMP_util.h @@ -59,6 +59,7 @@ #include "BKE_image.h" #include "BKE_main.h" #include "BKE_material.h" +#include "BKE_node.h" #include "BKE_texture.h" #include "BKE_library.h" diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_camera.c b/source/blender/nodes/intern/SHD_nodes/SHD_camera.c index 869b1d1e54c..82c060ed1d6 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_camera.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_camera.c @@ -54,21 +54,18 @@ static int gpu_shader_camera(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack return GPU_stack_link(mat, "camera", in, out, GPU_builtin(GPU_VIEW_POSITION)); } -bNodeType sh_node_camera= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_CAMERA, - /* name */ "Camera Data", - /* width+range */ 95, 95, 120, - /* class+opts */ NODE_CLASS_INPUT, 0, - /* input sock */ NULL, - /* output sock */ sh_node_camera_out, - /* storage */ "node_camera", - /* execfunc */ node_shader_exec_camera, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_camera -}; +void register_node_type_sh_camera(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT, 0, + NULL, sh_node_camera_out); + node_type_size(&ntype, 95, 95, 120); + node_type_storage(&ntype, "node_camera", NULL, NULL); + node_type_exec(&ntype, node_shader_exec_camera); + node_type_gpu(&ntype, gpu_shader_camera); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c index 56aaa4fe8a7..405c455501c 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c @@ -66,24 +66,21 @@ static int gpu_shader_curve_vec(GPUMaterial *mat, bNode *node, GPUNodeStack *in, return GPU_stack_link(mat, "curves_vec", in, out, GPU_texture(size, array)); } -bNodeType sh_node_curve_vec= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_CURVE_VEC, - /* name */ "Vector Curves", - /* width+range */ 200, 140, 320, - /* class+opts */ NODE_CLASS_OP_VECTOR, NODE_OPTIONS, - /* input sock */ sh_node_curve_vec_in, - /* output sock */ sh_node_curve_vec_out, - /* storage */ "CurveMapping", - /* execfunc */ node_shader_exec_curve_vec, - /* butfunc */ NULL, - /* initfunc */ node_shader_init_curve_vec, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_curve_vec - -}; +void register_node_type_sh_curve_vec(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, + sh_node_curve_vec_in, sh_node_curve_vec_out); + node_type_size(&ntype, 200, 140, 320); + node_type_init(&ntype, node_shader_init_curve_vec); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, node_shader_exec_curve_vec); + node_type_gpu(&ntype, gpu_shader_curve_vec); + + nodeRegisterType(lb, &ntype); +} + /* **************** CURVE RGB ******************** */ static bNodeSocketType sh_node_curve_rgb_in[]= { @@ -123,21 +120,18 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, return GPU_stack_link(mat, "curves_rgb", in, out, GPU_texture(size, array)); } -bNodeType sh_node_curve_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_CURVE_RGB, - /* name */ "RGB Curves", - /* width+range */ 200, 140, 320, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ sh_node_curve_rgb_in, - /* output sock */ sh_node_curve_rgb_out, - /* storage */ "CurveMapping", - /* execfunc */ node_shader_exec_curve_rgb, - /* butfunc */ NULL, - /* initfunc */ node_shader_init_curve_rgb, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_curve_rgb -}; +void register_node_type_sh_curve_rgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + sh_node_curve_rgb_in, sh_node_curve_rgb_out); + node_type_size(&ntype, 200, 140, 320); + node_type_init(&ntype, node_shader_init_curve_rgb); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, node_shader_exec_curve_rgb); + node_type_gpu(&ntype, gpu_shader_curve_rgb); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c index 7975c081880..315655d68bf 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c @@ -758,26 +758,29 @@ static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNode #endif } -bNodeType node_dynamic_typeinfo = { - /* next, prev */ NULL, NULL, - /* type code */ NODE_DYNAMIC, - /* name */ "Dynamic", - /* width+range */ 150, 60, 300, - /* class+opts */ NODE_CLASS_OP_DYNAMIC, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ NULL, - /* storage */ "NodeScriptDict", - /* execfunc */ node_dynamic_exec_cb, - /* butfunc */ NULL, - /* initfunc */ node_dynamic_init_cb, - /* freefunc */ node_dynamic_free_storage_cb, - /* copyfunc */ node_dynamic_copy_cb, - /* id */ NULL -}; +void register_node_type_sh_dynamic(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, NODE_OPTIONS, NULL, NULL); + node_type_size(&ntype, 150, 60, 300); + node_type_init(&ntype, node_dynamic_init_cb); + node_type_storage(&ntype, "NodeScriptDict", node_dynamic_free_storage_cb, node_dynamic_copy_cb); + node_type_exec(&ntype, node_dynamic_exec_cb); + + nodeRegisterType(lb, &ntype); +} #else -bNodeType node_dynamic_typeinfo = {NULL}; +void register_node_type_sh_dynamic(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, 0, "", 0, 0, NULL, NULL); + + nodeRegisterType(lb, &ntype); +} #endif diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c index a27918df275..32fe457c2d8 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c @@ -131,21 +131,18 @@ static int gpu_shader_geom(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUN } /* node type definition */ -bNodeType sh_node_geom= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_GEOMETRY, - /* name */ "Geometry", - /* width+range */ 120, 80, 160, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ sh_node_geom_out, - /* storage */ "NodeGeometry", - /* execfunc */ node_shader_exec_geom, - /* butfunc */ NULL, - /* initfunc */ node_shader_init_geometry, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_geom - -}; +void register_node_type_sh_geom(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_GEOMETRY, "Geometry", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, sh_node_geom_out); + node_type_size(&ntype, 120, 80, 160); + node_type_init(&ntype, node_shader_init_geometry); + node_type_storage(&ntype, "NodeGeometry", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_shader_exec_geom); + node_type_gpu(&ntype, gpu_shader_geom); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c index 5c95577e32d..6fd8ece8ec9 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c @@ -77,23 +77,18 @@ static int gpu_shader_hue_sat(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac return GPU_stack_link(mat, "hue_sat", in, out); } -bNodeType sh_node_hue_sat= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_HUE_SAT, - /* name */ "Hue Saturation Value", - /* width+range */ 150, 80, 250, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ sh_node_hue_sat_in, - /* output sock */ sh_node_hue_sat_out, - /* storage */ "", - /* execfunc */ node_shader_exec_hue_sat, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_hue_sat - -}; +void register_node_type_sh_hue_sat(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + sh_node_hue_sat_in, sh_node_hue_sat_out); + node_type_size(&ntype, 150, 80, 250); + node_type_exec(&ntype, node_shader_exec_hue_sat); + node_type_gpu(&ntype, gpu_shader_hue_sat); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c index 73fccf7cd0b..9929afd0bc1 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c @@ -69,21 +69,17 @@ static int gpu_shader_invert(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack return GPU_stack_link(mat, "invert", in, out); } -bNodeType sh_node_invert= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_INVERT, - /* name */ "Invert", - /* width+range */ 90, 80, 100, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ sh_node_invert_in, - /* output sock */ sh_node_invert_out, - /* storage */ "", - /* execfunc */ node_shader_exec_invert, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_invert -}; +void register_node_type_sh_invert(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + sh_node_invert_in, sh_node_invert_out); + node_type_size(&ntype, 90, 80, 100); + node_type_exec(&ntype, node_shader_exec_invert); + node_type_gpu(&ntype, gpu_shader_invert); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c index dce8d1962c7..f11200cfc7e 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c @@ -87,10 +87,11 @@ void register_node_type_sh_mapping(ListBase *lb) { static bNodeType ntype; - node_type_init(&ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, + node_type_base(&ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, sh_node_mapping_in, sh_node_mapping_out); node_type_size(&ntype, 240, 160, 320); - node_type_storage(&ntype, "TexMapping", node_shader_init_mapping, node_free_standard_storage, node_copy_standard_storage); + node_type_init(&ntype, node_shader_init_mapping); + node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage); node_type_exec(&ntype, node_shader_exec_mapping); node_type_gpu(&ntype, gpu_shader_mapping); diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_material.c b/source/blender/nodes/intern/SHD_nodes/SHD_material.c index 3481e7d793e..4984a1ca821 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_material.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_material.c @@ -267,39 +267,33 @@ static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in, return 0; } -bNodeType sh_node_material= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_MATERIAL, - /* name */ "Material", - /* width+range */ 120, 80, 240, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, - /* input sock */ sh_node_material_in, - /* output sock */ sh_node_material_out, - /* storage */ "", - /* execfunc */ node_shader_exec_material, - /* butfunc */ NULL, - /* initfunc */ node_shader_init_material, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_material -}; +void register_node_type_sh_material(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_MATERIAL, "Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, + sh_node_material_in, sh_node_material_out); + node_type_size(&ntype, 120, 80, 240); + node_type_init(&ntype, node_shader_init_material); + node_type_exec(&ntype, node_shader_exec_material); + node_type_gpu(&ntype, gpu_shader_material); + + nodeRegisterType(lb, &ntype); +} + + +void register_node_type_sh_material_ext(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_MATERIAL_EXT, "Extended Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, + sh_node_material_ext_in, sh_node_material_ext_out); + node_type_size(&ntype, 120, 80, 240); + node_type_init(&ntype, node_shader_init_material); + node_type_exec(&ntype, node_shader_exec_material); + node_type_gpu(&ntype, gpu_shader_material); + + nodeRegisterType(lb, &ntype); +} -bNodeType sh_node_material_ext= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_MATERIAL_EXT, - /* name */ "Extended Material", - /* width+range */ 120, 80, 240, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, - /* input sock */ sh_node_material_ext_in, - /* output sock */ sh_node_material_ext_out, - /* storage */ "", - /* execfunc */ node_shader_exec_material, - /* butfunc */ NULL, - /* initfunc */ node_shader_init_material, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_material -}; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_math.c b/source/blender/nodes/intern/SHD_nodes/SHD_math.c index 4ca11fb29e3..98f345a1677 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_math.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_math.c @@ -234,21 +234,18 @@ static int gpu_shader_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUN return 1; } -bNodeType sh_node_math= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_MATH, - /* name */ "Math", - /* width+range */ 120, 110, 160, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ sh_node_math_in, - /* output sock */ sh_node_math_out, - /* storage */ "node_math", - /* execfunc */ node_shader_exec_math, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_math -}; +void register_node_type_sh_math(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + sh_node_math_in, sh_node_math_out); + node_type_size(&ntype, 120, 110, 160); + node_type_storage(&ntype, "node_math", NULL, NULL); + node_type_exec(&ntype, node_shader_exec_math); + node_type_gpu(&ntype, gpu_shader_math); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c index 4975c6b9b59..a8dcf684400 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c @@ -71,21 +71,16 @@ static int gpu_shader_mix_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G } -bNodeType sh_node_mix_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_MIX_RGB, - /* name */ "Mix", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ sh_node_mix_rgb_in, - /* output sock */ sh_node_mix_rgb_out, - /* storage */ "", - /* execfunc */ node_shader_exec_mix_rgb, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_mix_rgb - -}; +void register_node_type_sh_mix_rgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + sh_node_mix_rgb_in, sh_node_mix_rgb_out); + node_type_size(&ntype, 100, 60, 150); + node_type_exec(&ntype, node_shader_exec_mix_rgb); + node_type_gpu(&ntype, gpu_shader_mix_rgb); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c index 35c8f44c706..ccbf80edeb7 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c @@ -69,7 +69,7 @@ void register_node_type_sh_normal(ListBase *lb) { static bNodeType ntype; - node_type_init(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, + node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS, sh_node_normal_in, sh_node_normal_out); node_type_exec(&ntype, node_shader_exec_normal); node_type_gpu(&ntype, gpu_shader_normal); diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_output.c b/source/blender/nodes/intern/SHD_nodes/SHD_output.c index 4395716e599..d61e9def144 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_output.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_output.c @@ -75,22 +75,17 @@ static int gpu_shader_output(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack return 1; } -bNodeType sh_node_output= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_OUTPUT, - /* name */ "Output", - /* width+range */ 80, 60, 200, - /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW, - /* input sock */ sh_node_output_in, - /* output sock */ NULL, - /* storage */ "", - /* execfunc */ node_shader_exec_output, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_output - -}; +void register_node_type_sh_output(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW, + sh_node_output_in, NULL); + node_type_size(&ntype, 80, 60, 200); + node_type_exec(&ntype, node_shader_exec_output); + node_type_gpu(&ntype, gpu_shader_output); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c index 600518962ab..109147c7d45 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c @@ -50,21 +50,16 @@ static int gpu_shader_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNo return GPU_stack_link(mat, "set_rgba", in, out, vec); } -bNodeType sh_node_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_RGB, - /* name */ "RGB", - /* width+range */ 140, 80, 140, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ sh_node_rgb_out, - /* storage */ "", - /* execfunc */ node_shader_exec_rgb, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_rgb - -}; +void register_node_type_sh_rgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, sh_node_rgb_out); + node_type_size(&ntype, 140, 80, 140); + node_type_exec(&ntype, node_shader_exec_rgb); + node_type_gpu(&ntype, gpu_shader_rgb); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c b/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c index 1de200c7b1c..da4c7f70022 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c @@ -53,24 +53,19 @@ static int gpu_shader_seprgb(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack return GPU_stack_link(mat, "separate_rgb", in, out); } -bNodeType sh_node_seprgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_SEPRGB, - /* name */ "Separate RGB", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, 0, - /* input sock */ sh_node_seprgb_in, - /* output sock */ sh_node_seprgb_out, - /* storage */ "", - /* execfunc */ node_shader_exec_seprgb, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_seprgb - -}; +void register_node_type_sh_seprgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0, + sh_node_seprgb_in, sh_node_seprgb_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_shader_exec_seprgb); + node_type_gpu(&ntype, gpu_shader_seprgb); + + nodeRegisterType(lb, &ntype); +} + /* **************** COMBINE RGB ******************** */ @@ -97,21 +92,16 @@ static int gpu_shader_combrgb(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac return GPU_stack_link(mat, "combine_rgb", in, out); } -bNodeType sh_node_combrgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_COMBRGB, - /* name */ "Combine RGB", - /* width+range */ 80, 40, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ sh_node_combrgb_in, - /* output sock */ sh_node_combrgb_out, - /* storage */ "", - /* execfunc */ node_shader_exec_combrgb, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_combrgb - -}; +void register_node_type_sh_combrgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + sh_node_combrgb_in, sh_node_combrgb_out); + node_type_size(&ntype, 80, 40, 140); + node_type_exec(&ntype, node_shader_exec_combrgb); + node_type_gpu(&ntype, gpu_shader_combrgb); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c index 06b06affaa0..ff6e3913d19 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c @@ -59,21 +59,18 @@ static int gpu_shader_squeeze(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac return GPU_stack_link(mat, "squeeze", in, out); } -bNodeType sh_node_squeeze= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_SQUEEZE, - /* name */ "Squeeze Value", - /* width+range */ 120, 110, 160, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ sh_node_squeeze_in, - /* output sock */ sh_node_squeeze_out, - /* storage */ "node_squeeze", - /* execfunc */ node_shader_exec_squeeze, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_squeeze -}; +void register_node_type_sh_squeeze(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + sh_node_squeeze_in, sh_node_squeeze_out); + node_type_size(&ntype, 120, 110, 160); + node_type_storage(&ntype, "node_squeeze", NULL, NULL); + node_type_exec(&ntype, node_shader_exec_squeeze); + node_type_gpu(&ntype, gpu_shader_squeeze); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_texture.c b/source/blender/nodes/intern/SHD_nodes/SHD_texture.c index ee73fac4c7e..ec36dd8043e 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_texture.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_texture.c @@ -128,22 +128,17 @@ static int gpu_shader_texture(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G return 0; } -bNodeType sh_node_texture= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_TEXTURE, - /* name */ "Texture", - /* width+range */ 120, 80, 240, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, - /* input sock */ sh_node_texture_in, - /* output sock */ sh_node_texture_out, - /* storage */ "", - /* execfunc */ node_shader_exec_texture, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_texture - -}; +void register_node_type_sh_texture(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, + sh_node_texture_in, sh_node_texture_out); + node_type_size(&ntype, 120, 80, 240); + node_type_exec(&ntype, node_shader_exec_texture); + node_type_gpu(&ntype, gpu_shader_texture); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c index 1e5b9cf935e..8603ec018d6 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c @@ -68,24 +68,21 @@ static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, return GPU_stack_link(mat, "valtorgb", in, out, GPU_texture(size, array)); } -bNodeType sh_node_valtorgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_VALTORGB, - /* name */ "ColorRamp", - /* width+range */ 240, 200, 300, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ sh_node_valtorgb_in, - /* output sock */ sh_node_valtorgb_out, - /* storage */ "ColorBand", - /* execfunc */ node_shader_exec_valtorgb, - /* butfunc */ NULL, - /* initfunc */ node_shader_init_valtorgb, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_valtorgb - -}; +void register_node_type_sh_valtorgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + sh_node_valtorgb_in, sh_node_valtorgb_out); + node_type_size(&ntype, 240, 200, 300); + node_type_init(&ntype, node_shader_init_valtorgb); + node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_shader_exec_valtorgb); + node_type_gpu(&ntype, gpu_shader_valtorgb); + + nodeRegisterType(lb, &ntype); +} + /* **************** RGBTOBW ******************** */ static bNodeSocketType sh_node_rgbtobw_in[]= { @@ -111,22 +108,17 @@ static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac return GPU_stack_link(mat, "rgbtobw", in, out); } -bNodeType sh_node_rgbtobw= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_RGBTOBW, - /* name */ "RGB to BW", - /* width+range */ 80, 40, 120, - /* class+opts */ NODE_CLASS_CONVERTOR, 0, - /* input sock */ sh_node_rgbtobw_in, - /* output sock */ sh_node_rgbtobw_out, - /* storage */ "", - /* execfunc */ node_shader_exec_rgbtobw, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_rgbtobw +void register_node_type_sh_rgbtobw(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0, + sh_node_rgbtobw_in, sh_node_rgbtobw_out); + node_type_size(&ntype, 80, 40, 120); + node_type_exec(&ntype, node_shader_exec_rgbtobw); + node_type_gpu(&ntype, gpu_shader_rgbtobw); + + nodeRegisterType(lb, &ntype); +} -}; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_value.c b/source/blender/nodes/intern/SHD_nodes/SHD_value.c index f78480bd794..21c58419d9b 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_value.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_value.c @@ -50,22 +50,17 @@ static int gpu_shader_value(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPU return GPU_stack_link(mat, "set_value", in, out, vec); } -bNodeType sh_node_value= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_VALUE, - /* name */ "Value", - /* width+range */ 80, 50, 120, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ sh_node_value_out, - /* storage */ "", - /* execfunc */ node_shader_exec_value, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_value - -}; +void register_node_type_sh_value(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, sh_node_value_out); + node_type_size(&ntype, 80, 50, 120); + node_type_exec(&ntype, node_shader_exec_value); + node_type_gpu(&ntype, gpu_shader_value); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c index 602cd3fe65a..43092d06630 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c @@ -127,21 +127,18 @@ static int gpu_shader_vect_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, return 1; } -bNodeType sh_node_vect_math= { - /* *next,*prev */ NULL, NULL, - /* type code */ SH_NODE_VECT_MATH, - /* name */ "Vector Math", - /* width+range */ 80, 75, 140, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ sh_node_vect_math_in, - /* output sock */ sh_node_vect_math_out, - /* storage */ "node_vect_math", - /* execfunc */ node_shader_exec_vect_math, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL, NULL, NULL, - /* gpufunc */ gpu_shader_vect_math -}; +void register_node_type_sh_vect_math(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, SH_NODE_VECT_MATH, "Vector Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + sh_node_vect_math_in, sh_node_vect_math_out); + node_type_size(&ntype, 80, 75, 140); + node_type_storage(&ntype, "node_vect_math", NULL, NULL); + node_type_exec(&ntype, node_shader_exec_vect_math); + node_type_gpu(&ntype, gpu_shader_vect_math); + + nodeRegisterType(lb, &ntype); +} + diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_at.c b/source/blender/nodes/intern/TEX_nodes/TEX_at.c index 1ca293acb5b..75fa1e4378d 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_at.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_at.c @@ -53,20 +53,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_at = { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_AT, - /* name */ "At", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_DISTORT, 0, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_at(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_AT, "At", NODE_CLASS_DISTORT, 0, + inputs, outputs); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c index 9d26621e08c..7a32b6342aa 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c @@ -112,20 +112,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_bricks= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_BRICKS, - /* name */ "Bricks", - /* width+range */ 150, 60, 150, - /* class+opts */ NODE_CLASS_PATTERN, NODE_OPTIONS | NODE_PREVIEW, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ init, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_bricks(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_BRICKS, "Bricks", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 150, 60, 150); + node_type_init(&ntype, init); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c index 64b70455a19..25cfd4412f5 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c @@ -64,20 +64,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_checker= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_CHECKER, - /* name */ "Checker", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_PATTERN, NODE_OPTIONS | NODE_PREVIEW, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_checker(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_CHECKER, "Checker", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 100, 60, 150); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c index f05e1e987da..3b933927c5e 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c @@ -52,20 +52,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_compose= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_COMPOSE, - /* name */ "Compose RGBA", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_OP_COLOR, 0, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_compose(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_COMPOSE, "Compose RGBA", NODE_CLASS_OP_COLOR, 0, + inputs, outputs); + node_type_size(&ntype, 100, 60, 150); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c index 4ad32bc872e..5311dbc2360 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c @@ -45,20 +45,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &vectorfn, data); } -bNodeType tex_node_coord= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_COORD, - /* name */ "Coordinates", - /* width+range */ 120, 110, 160, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ outputs, - /* storage */ "node_coord", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; - +void register_node_type_tex_coord(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_COORD, "Coordinates", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, outputs); + node_type_size(&ntype, 120, 110, 160); + node_type_storage(&ntype, "node_coord", NULL, NULL); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c index 0fca0aa30ad..e4ea39b8591 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c @@ -61,22 +61,19 @@ static void time_init(bNode* node) node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } -bNodeType tex_node_curve_time= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_CURVE_TIME, - /* name */ "Time", - /* width+range */ 140, 100, 320, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ time_outputs, - /* storage */ "CurveMapping", - /* execfunc */ time_exec, - /* butfunc */ NULL, - /* initfunc */ time_init, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL -}; +void register_node_type_tex_curve_time(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_CURVE_TIME, "Time", NODE_CLASS_INPUT, NODE_OPTIONS, + NULL, time_outputs); + node_type_size(&ntype, 140, 100, 320); + node_type_init(&ntype, time_init); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, time_exec); + + nodeRegisterType(lb, &ntype); +} /* **************** CURVE RGB ******************** */ static bNodeSocketType rgb_inputs[]= { @@ -108,20 +105,17 @@ static void rgb_init(bNode *node) node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); } -bNodeType tex_node_curve_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_CURVE_RGB, - /* name */ "RGB Curves", - /* width+range */ 200, 140, 320, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ rgb_inputs, - /* output sock */ rgb_outputs, - /* storage */ "CurveMapping", - /* execfunc */ rgb_exec, - /* butfunc */ NULL, - /* initfunc */ rgb_init, - /* freestoragefunc */ node_free_curves, - /* copystoragefunc */ node_copy_curves, - /* id */ NULL -}; +void register_node_type_tex_curve_rgb(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + rgb_inputs, rgb_outputs); + node_type_size(&ntype, 200, 140, 320); + node_type_init(&ntype, rgb_init); + node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); + node_type_exec(&ntype, rgb_exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c index 13768aaa868..c66e26321b6 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c @@ -73,20 +73,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[3], &valuefn_a, data); } -bNodeType tex_node_decompose= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_DECOMPOSE, - /* name */ "Decompose RGBA", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_OP_COLOR, 0, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_decompose(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_DECOMPOSE, "Decompose RGBA", NODE_CLASS_OP_COLOR, 0, + inputs, outputs); + node_type_size(&ntype, 100, 60, 150); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c index 5d624205f43..887fbd1be90 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c @@ -56,21 +56,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &valuefn, data); } -bNodeType tex_node_distance= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_DISTANCE, - /* name */ "Distance", - /* width+range */ 120, 110, 160, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "node_distance", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; - - +void register_node_type_tex_distance(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_DISTANCE, "Distance", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 120, 110, 160); + node_type_storage(&ntype, "node_distance", NULL, NULL); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c index 2ccde083823..66a98b70fd4 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c @@ -87,22 +87,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_hue_sat= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_HUE_SAT, - /* name */ "Hue Saturation Value", - /* width+range */ 150, 80, 250, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_hue_sat(ListBase *lb) +{ + static bNodeType ntype; -}; - - + node_type_base(&ntype, TEX_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 150, 80, 250); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c index 7c680b4c25a..a870d1d31fe 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c @@ -91,20 +91,16 @@ static void init(bNode* node) iuser->ok= 1; } -bNodeType tex_node_image= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_IMAGE, - /* name */ "Image", - /* width+range */ 120, 80, 300, - /* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS, - /* input sock */ NULL, - /* output sock */ outputs, - /* storage */ "ImageUser", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ init, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL -}; - +void register_node_type_tex_image(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS, + NULL, outputs); + node_type_size(&ntype, 120, 80, 300); + node_type_init(&ntype, init); + node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c index 421082aeb34..d6d66abd863 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c @@ -58,20 +58,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_invert= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_INVERT, - /* name */ "Invert", - /* width+range */ 90, 80, 100, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_tex_invert(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 90, 80, 100); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_math.c b/source/blender/nodes/intern/TEX_nodes/TEX_math.c index a17c295eb7f..aee6fb663e5 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_math.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_math.c @@ -174,20 +174,16 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &valuefn, data); } -bNodeType tex_node_math= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_MATH, - /* name */ "Math", - /* width+range */ 120, 110, 160, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "node_math", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; +void register_node_type_tex_math(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 120, 110, 160); + node_type_storage(&ntype, "node_math", NULL, NULL); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c index c709d58b8ba..565ac68c5b7 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c @@ -60,20 +60,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_mix_rgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_MIX_RGB, - /* name */ "Mix", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_mix_rgb(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 100, 60, 150); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c index 1be2e8f1c56..b10cfa543a1 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c @@ -152,20 +152,16 @@ static void copy(bNode *orig, bNode *new) assign_index(new); } -bNodeType tex_node_output= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_OUTPUT, - /* name */ "Output", - /* width+range */ 150, 60, 200, - /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW | NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ NULL, - /* storage */ "TexNodeOutput", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ init, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ copy, - /* id */ NULL -}; - +void register_node_type_tex_output(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS, + inputs, NULL); + node_type_size(&ntype, 150, 60, 200); + node_type_init(&ntype, init); + node_type_storage(&ntype, "TexNodeOutput", node_free_standard_storage, copy); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c index a4a608e777c..bba25ea7bd2 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c @@ -290,21 +290,29 @@ static void init(bNode *node) /* Node type definitions */ #define TexDef(TEXTYPE, outputs, name, Name) \ - { NULL, NULL, TEX_NODE_PROC+TEXTYPE, Name, 140,80,140, NODE_CLASS_TEXTURE, \ - NODE_OPTIONS | NODE_PREVIEW, name##_inputs, outputs, "Tex", name##_exec, NULL, init, \ - node_free_standard_storage, node_copy_standard_storage, NULL } +void register_node_type_tex_proc_##name(ListBase *lb) \ +{ \ + static bNodeType ntype; \ + \ + node_type_base(&ntype, TEX_NODE_PROC+TEXTYPE, Name, NODE_CLASS_TEXTURE, NODE_PREVIEW|NODE_OPTIONS, name##_inputs, outputs); \ + node_type_size(&ntype, 140, 80, 140); \ + node_type_init(&ntype, init); \ + node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \ + node_type_exec(&ntype, name##_exec); \ + \ + nodeRegisterType(lb, &ntype); \ +} #define C outputs_color_only #define CV outputs_both -bNodeType tex_node_proc_voronoi = TexDef(TEX_VORONOI, CV, voronoi, "Voronoi" ); -bNodeType tex_node_proc_blend = TexDef(TEX_BLEND, C, blend, "Blend" ); -bNodeType tex_node_proc_magic = TexDef(TEX_MAGIC, C, magic, "Magic" ); -bNodeType tex_node_proc_marble = TexDef(TEX_MARBLE, CV, marble, "Marble" ); -bNodeType tex_node_proc_clouds = TexDef(TEX_CLOUDS, CV, clouds, "Clouds" ); -bNodeType tex_node_proc_wood = TexDef(TEX_WOOD, CV, wood, "Wood" ); -bNodeType tex_node_proc_musgrave = TexDef(TEX_MUSGRAVE, CV, musgrave, "Musgrave" ); -bNodeType tex_node_proc_noise = TexDef(TEX_NOISE, C, noise, "Noise" ); -bNodeType tex_node_proc_stucci = TexDef(TEX_STUCCI, CV, stucci, "Stucci" ); -bNodeType tex_node_proc_distnoise = TexDef(TEX_DISTNOISE, CV, distnoise, "Distorted Noise" ); - +TexDef(TEX_VORONOI, CV, voronoi, "Voronoi" ); +TexDef(TEX_BLEND, C, blend, "Blend" ); +TexDef(TEX_MAGIC, C, magic, "Magic" ); +TexDef(TEX_MARBLE, CV, marble, "Marble" ); +TexDef(TEX_CLOUDS, CV, clouds, "Clouds" ); +TexDef(TEX_WOOD, CV, wood, "Wood" ); +TexDef(TEX_MUSGRAVE, CV, musgrave, "Musgrave" ); +TexDef(TEX_NOISE, C, noise, "Noise" ); +TexDef(TEX_STUCCI, CV, stucci, "Stucci" ); +TexDef(TEX_DISTNOISE, CV, distnoise, "Distorted Noise" ); diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c index 88ed5382a6a..92a9fa26311 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c @@ -90,20 +90,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_rotate= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_ROTATE, - /* name */ "Rotate", - /* width+range */ 90, 80, 100, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; - +void register_node_type_tex_rotate(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 140, 100, 320); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c index 8045c1ca07a..65ae744531b 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c @@ -64,20 +64,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_scale = { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_SCALE, - /* name */ "Scale", - /* width+range */ 90, 80, 100, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; - +void register_node_type_tex_scale(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 90, 80, 100); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c index c01caa022e5..2bbd08a4c1f 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c @@ -83,21 +83,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_texture= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_TEXTURE, - /* name */ "Texture", - /* width+range */ 120, 80, 240, - /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_texture(ListBase *lb) +{ + static bNodeType ntype; -}; - + node_type_base(&ntype, TEX_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 120, 80, 240); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c index a9d7fbcf3da..a570386bcda 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c @@ -59,20 +59,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &colorfn, data); } -bNodeType tex_node_translate = { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_TRANSLATE, - /* name */ "Translate", - /* width+range */ 90, 80, 100, - /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; - +void register_node_type_tex_translate(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 90, 80, 100); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c index c71d442cef3..67fb068870c 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c @@ -75,20 +75,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) tex_output(node, in, out[0], &normalfn, data); } -bNodeType tex_node_valtonor = { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_VALTONOR, - /* name */ "Value to Normal", - /* width+range */ 90, 80, 100, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL -}; - +void register_node_type_tex_valtonor(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_VALTONOR, "Value to Normal", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + inputs, outputs); + node_type_size(&ntype, 90, 80, 100); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c index fcaa9550efa..f23baffb0ee 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c @@ -58,23 +58,19 @@ static void valtorgb_init(bNode *node) node->storage = add_colorband(1); } -bNodeType tex_node_valtorgb= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_VALTORGB, - /* name */ "ColorRamp", - /* width+range */ 240, 200, 300, - /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS, - /* input sock */ valtorgb_in, - /* output sock */ valtorgb_out, - /* storage */ "ColorBand", - /* execfunc */ valtorgb_exec, - /* butfunc */ NULL, - /* initfunc */ valtorgb_init, - /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, - /* id */ NULL +void register_node_type_tex_valtorgb(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS, + valtorgb_in, valtorgb_out); + node_type_size(&ntype, 240, 200, 300); + node_type_init(&ntype, valtorgb_init); + node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, valtorgb_exec); + + nodeRegisterType(lb, &ntype); +} /* **************** RGBTOBW ******************** */ static bNodeSocketType rgbtobw_in[]= { @@ -100,21 +96,15 @@ static void rgbtobw_exec(void *data, bNode *node, bNodeStack **in, bNodeStack ** tex_output(node, in, out[0], &rgbtobw_valuefn, data); } -bNodeType tex_node_rgbtobw= { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_RGBTOBW, - /* name */ "RGB to BW", - /* width+range */ 80, 40, 120, - /* class+opts */ NODE_CLASS_CONVERTOR, 0, - /* input sock */ rgbtobw_in, - /* output sock */ rgbtobw_out, - /* storage */ "", - /* execfunc */ rgbtobw_exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL - -}; +void register_node_type_tex_rgbtobw(ListBase *lb) +{ + static bNodeType ntype; + + node_type_base(&ntype, TEX_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0, + rgbtobw_in, rgbtobw_out); + node_type_size(&ntype, 80, 40, 120); + node_type_exec(&ntype, rgbtobw_exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c index 75fe6945261..5dbfc2561b5 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c @@ -51,20 +51,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o } } -bNodeType tex_node_viewer = { - /* *next,*prev */ NULL, NULL, - /* type code */ TEX_NODE_VIEWER, - /* name */ "Viewer", - /* width+range */ 100, 60, 150, - /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW, - /* input sock */ inputs, - /* output sock */ outputs, - /* storage */ "", - /* execfunc */ exec, - /* butfunc */ NULL, - /* initfunc */ NULL, - /* freestoragefunc */ NULL, - /* copystoragefunc */ NULL, - /* id */ NULL +void register_node_type_tex_viewer(ListBase *lb) +{ + static bNodeType ntype; -}; + node_type_base(&ntype, TEX_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW, + inputs, outputs); + node_type_size(&ntype, 100, 60, 150); + node_type_exec(&ntype, exec); + + nodeRegisterType(lb, &ntype); +} diff --git a/source/blender/nodes/intern/TEX_util.h b/source/blender/nodes/intern/TEX_util.h index 38edfabd346..4caee223a1e 100644 --- a/source/blender/nodes/intern/TEX_util.h +++ b/source/blender/nodes/intern/TEX_util.h @@ -50,6 +50,7 @@ #include "BKE_image.h" #include "BKE_main.h" #include "BKE_material.h" +#include "BKE_node.h" #include "BKE_texture.h" #include "BKE_library.h" -- cgit v1.2.3