Finished the node type definition cleanup started in r34682. All static node types...
authorLukas Toenne <lukas.toenne@googlemail.com>
Tue, 8 Feb 2011 09:02:16 +0000 (09:02 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Tue, 8 Feb 2011 09:02:16 +0000 (09:02 +0000)
103 files changed:
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/node.c
source/blender/nodes/CMP_node.h
source/blender/nodes/SHD_node.h
source/blender/nodes/TEX_node.h
source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c
source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c
source/blender/nodes/intern/CMP_nodes/CMP_blur.c
source/blender/nodes/intern/CMP_nodes/CMP_brightness.c
source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
source/blender/nodes/intern/CMP_nodes/CMP_composite.c
source/blender/nodes/intern/CMP_nodes/CMP_crop.c
source/blender/nodes/intern/CMP_nodes/CMP_curves.c
source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_dilate.c
source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c
source/blender/nodes/intern/CMP_nodes/CMP_displace.c
source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_filter.c
source/blender/nodes/intern/CMP_nodes/CMP_flip.c
source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
source/blender/nodes/intern/CMP_nodes/CMP_glare.c
source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c
source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c
source/blender/nodes/intern/CMP_nodes/CMP_idMask.c
source/blender/nodes/intern/CMP_nodes/CMP_image.c
source/blender/nodes/intern/CMP_nodes/CMP_invert.c
source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c
source/blender/nodes/intern/CMP_nodes/CMP_levels.c
source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c
source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c
source/blender/nodes/intern/CMP_nodes/CMP_math.c
source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c
source/blender/nodes/intern/CMP_nodes/CMP_normal.c
source/blender/nodes/intern/CMP_nodes/CMP_normalize.c
source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c
source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c
source/blender/nodes/intern/CMP_nodes/CMP_rgb.c
source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
source/blender/nodes/intern/CMP_nodes/CMP_scale.c
source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c
source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c
source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c
source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c
source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c
source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c
source/blender/nodes/intern/CMP_nodes/CMP_texture.c
source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c
source/blender/nodes/intern/CMP_nodes/CMP_translate.c
source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c
source/blender/nodes/intern/CMP_nodes/CMP_value.c
source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c
source/blender/nodes/intern/CMP_nodes/CMP_viewer.c
source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c
source/blender/nodes/intern/CMP_util.h
source/blender/nodes/intern/SHD_nodes/SHD_camera.c
source/blender/nodes/intern/SHD_nodes/SHD_curves.c
source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
source/blender/nodes/intern/SHD_nodes/SHD_geom.c
source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
source/blender/nodes/intern/SHD_nodes/SHD_invert.c
source/blender/nodes/intern/SHD_nodes/SHD_mapping.c
source/blender/nodes/intern/SHD_nodes/SHD_material.c
source/blender/nodes/intern/SHD_nodes/SHD_math.c
source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c
source/blender/nodes/intern/SHD_nodes/SHD_normal.c
source/blender/nodes/intern/SHD_nodes/SHD_output.c
source/blender/nodes/intern/SHD_nodes/SHD_rgb.c
source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c
source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
source/blender/nodes/intern/SHD_nodes/SHD_texture.c
source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c
source/blender/nodes/intern/SHD_nodes/SHD_value.c
source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
source/blender/nodes/intern/TEX_nodes/TEX_at.c
source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
source/blender/nodes/intern/TEX_nodes/TEX_checker.c
source/blender/nodes/intern/TEX_nodes/TEX_compose.c
source/blender/nodes/intern/TEX_nodes/TEX_coord.c
source/blender/nodes/intern/TEX_nodes/TEX_curves.c
source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
source/blender/nodes/intern/TEX_nodes/TEX_distance.c
source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
source/blender/nodes/intern/TEX_nodes/TEX_image.c
source/blender/nodes/intern/TEX_nodes/TEX_invert.c
source/blender/nodes/intern/TEX_nodes/TEX_math.c
source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
source/blender/nodes/intern/TEX_nodes/TEX_output.c
source/blender/nodes/intern/TEX_nodes/TEX_proc.c
source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
source/blender/nodes/intern/TEX_nodes/TEX_scale.c
source/blender/nodes/intern/TEX_nodes/TEX_texture.c
source/blender/nodes/intern/TEX_nodes/TEX_translate.c
source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
source/blender/nodes/intern/TEX_util.h

index 455e173..ad16480 100644 (file)
@@ -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 **));
index 69f0163..cbb0ef7 100644 (file)
@@ -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)
index c2bc4d0..4cbb559 100644 (file)
@@ -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.
 
 /* ****************** 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
index 99a016c..20a7aa0 100644 (file)
 /* 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
 
index 1bbca09..b741c65 100644 (file)
 
 /* ****************** 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
index 3f6bd98..e8cfc85 100644 (file)
@@ -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);
+}
+
 
 
index 404f0ae..efa0441 100644 (file)
@@ -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);
+}
+
index f367e7b..78a27bc 100644 (file)
@@ -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);
+}
+
 
 
index 6b0d6ff..f2f7636 100644 (file)
@@ -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);
+}
 
index 182c339..044ed6d 100644 (file)
@@ -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);
+}
+
index d102afb..eba2d55 100644 (file)
@@ -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);
+}
+
 
 
index 8d5f468..5706346 100644 (file)
@@ -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);
+}
+
 
 
index 408bda0..e4b9ead 100644 (file)
@@ -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);
+}
index c8e0108..2596037 100644 (file)
@@ -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);
+}
+
 
index ffb090f..1bbcb0f 100644 (file)
@@ -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);
+}
+
index 7ecfe40..b8d24fc 100644 (file)
@@ -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);
+}
+
index 1a88e95..2252bc2 100644 (file)
@@ -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);
+}
+
 
index d3fd7c8..7f5d5df 100644 (file)
@@ -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);
+}
+
 
 
index 0735a36..73046d7 100644 (file)
@@ -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);
+}
+
 
 
index 71990b7..3ceaecf 100644 (file)
@@ -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);
+}
 
 
index 42bf48b..533a8b1 100644 (file)
@@ -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);
+}
+
index 1ce545e..7871efc 100644 (file)
@@ -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);
+}
+
 
index e0e595f..406f9e8 100644 (file)
@@ -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);
+}
+
 
 
index 8f9a988..f960f44 100644 (file)
@@ -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);
+}
+
 
 
index 33a17f8..b005876 100644 (file)
@@ -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);
+}
+
 
 
index 2e3162b..98af5bf 100644 (file)
@@ -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);
+}
index d4968ca..1d74716 100644 (file)
@@ -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);
+}
+
index e8ce3e2..412ed5e 100644 (file)
@@ -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);
+}
+
 
 
index ac009cc..54503d2 100644 (file)
@@ -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);
+}
+
 
index 9b088cb..8b42201 100644 (file)
@@ -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);
+}
+
 
 
index dcf9a05..a0ac8d9 100644 (file)
@@ -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);
+}
 
-};
 
 
index 7ea146c..a60edd5 100644 (file)
@@ -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);
+}
+
index b6e1fff..159bc85 100644 (file)
@@ -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);
+}
+
index f4934b4..71170d1 100644 (file)
@@ -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);
+}
+
 
index af198fb..91edb48 100644 (file)
@@ -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);
+}
+
 
index c605a66..f0e0aec 100644 (file)
@@ -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);
+}
+
 
 
index 9270902..550e4a2 100644 (file)
@@ -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);
+}
+
 
 
 
index 98bbbf6..54ece02 100644 (file)
@@ -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);
+}
+
 
 
 
index 34d6713..b65296f 100644 (file)
@@ -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);
+}
+
index 0416295..5b218f4 100644 (file)
@@ -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);
+}
+
 
index 07a11cd..1c92eb6 100644 (file)
@@ -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);
+}
index 0129c1b..701a391 100644 (file)
@@ -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);
+}
+
 
 
index 1aa2e33..d64a2ce 100644 (file)
@@ -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);
+}
+
 
index 5fbed05..975d9ca 100644 (file)
@@ -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);
+}
+
 
 
index 8fed697..ff8a246 100644 (file)
@@ -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);
+}
+
index 40785f3..a524f4c 100644 (file)
@@ -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);
+}
+
 
 
 
index ef8723f..040a88b 100644 (file)
@@ -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);
+}
+
 
 
index 3660378..1062344 100644 (file)
@@ -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);
+}
+
 
index 895d779..364457f 100644 (file)
@@ -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);
+}
+
 
 
index 333a4a2..99a6250 100644 (file)
@@ -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);
+}
+
 
index f4c5603..106203d 100644 (file)
@@ -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);
+}
+
index efb8c12..1bb0cdf 100644 (file)
@@ -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);
+}
+
 
 
 
index b251091..63a4335 100644 (file)
@@ -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);
+}
+
 
 
index 49031e1..d58f0e8 100644 (file)
@@ -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);
+}
+
index 0d8ad41..cad4d79 100644 (file)
@@ -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);
+}
+
 
index 7e0ecbc..2000e41 100644 (file)
@@ -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);
+}
index a37742c..787c913 100644 (file)
@@ -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);
+}
+
 
index 9ea626e..71c8c48 100644 (file)
@@ -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);
+}
+
 
index 24d8a9e..f23a82e 100644 (file)
@@ -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);
+}
+
 
index 17d8854..675eae7 100644 (file)
@@ -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);
+}
+
index df58376..efb711a 100644 (file)
@@ -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"
index 869b1d1..82c060e 100644 (file)
@@ -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);
+}
+
 
index 56aaa4f..405c455 100644 (file)
@@ -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);
+}
 
index 7975c08..315655d 100644 (file)
@@ -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
 
index a27918d..32fe457 100644 (file)
@@ -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);
+}
+
index 5c95577..6fd8ece 100644 (file)
@@ -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);
+}
+
 
 
index 73fccf7..9929afd 100644 (file)
@@ -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);
+}
+
 
index dce8d19..f11200c 100644 (file)
@@ -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);
        
index 3481e7d..4984a1c 100644 (file)
@@ -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
-};
 
index 4ca11fb..98f345a 100644 (file)
@@ -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);
+}
+
 
index 4975c6b..a8dcf68 100644 (file)
@@ -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);
+}
+
index 35c8f44..ccbf80e 100644 (file)
@@ -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);
index 4395716..d61e9de 100644 (file)
@@ -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);
+}
+
 
index 6005189..109147c 100644 (file)
@@ -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);
+}
+
index 1de200c..da4c7f7 100644 (file)
@@ -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);
+}
+
index 06b06af..ff6e391 100644 (file)
@@ -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);
+}
+
 
index ee73fac..ec36dd8 100644 (file)
@@ -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);
+}
+
 
index 1e5b9cf..8603ec0 100644 (file)
@@ -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);
+}
 
-};
 
index f78480b..21c5841 100644 (file)
@@ -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);
+}
+
 
index 602cd3f..43092d0 100644 (file)
@@ -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);
+}
+
 
index 1ca293a..75fa1e4 100644 (file)
@@ -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);
+}
index 9d26621..7a32b63 100644 (file)
@@ -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);
+}
index 64b7045..25cfd44 100644 (file)
@@ -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);
+}
index f05e1e9..3b93392 100644 (file)
@@ -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);
+}
index 4ad32bc..5311dbc 100644 (file)
@@ -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);
+}
index 0fca0aa..e4ea39b 100644 (file)
@@ -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);
+}
 
index 13768aa..c66e263 100644 (file)
@@ -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);
+}
index 5d62420..887fbd1 100644 (file)
@@ -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);
+}
index 2ccde08..66a98b7 100644 (file)
@@ -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);
+}
index 7c680b4..a870d1d 100644 (file)
@@ -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);
+}
index 421082a..d6d66ab 100644 (file)
@@ -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);
+}
 
index a17c295..aee6fb6 100644 (file)
@@ -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);
+}
 
index c709d58..565ac68 100644 (file)
@@ -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);
+}
index 1be2e8f..b10cfa5 100644 (file)
@@ -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);
+}
index a4a608e..bba25ea 100644 (file)
@@ -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" );
index 88ed538..92a9fa2 100644 (file)
@@ -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);
+}
index 8045c1c..65ae744 100644 (file)
@@ -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);
+}
index c01caa0..2bbd08a 100644 (file)
@@ -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);
+}
index a9d7fbc..a570386 100644 (file)
@@ -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);
+}
index c71d442..67fb068 100644 (file)
@@ -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);
+}
index fcaa955..f23baff 100644 (file)
@@ -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);
+}
 
index 75fe694..5dbfc25 100644 (file)
@@ -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);
+}
index 38edfab..4caee22 100644 (file)
@@ -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"