RNA: more compositor nodes wrapped
authorRobin Allen <roblovski@gmail.com>
Wed, 3 Jun 2009 00:40:38 +0000 (00:40 +0000)
committerRobin Allen <roblovski@gmail.com>
Wed, 3 Jun 2009 00:40:38 +0000 (00:40 +0000)
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h

index 9594a1a4a05be6bc540e1f0920e23e73825419ac..ff7984ff1b1d5ef7a353c399f69ebf5b6e10ae52 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "DNA_node_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_texture_types.h"
 #include "BKE_node.h"
 
 #ifdef RNA_RUNTIME
@@ -341,26 +342,6 @@ static void def_texture(BlenderRNA *brna, int id)
 }
 
 
-/* -- Shader Node Storage Types --------------------------------------------- */
-
-static void rna_def_storage_node_geometry(BlenderRNA *brna)
-{
-       StructRNA *srna;
-       PropertyRNA *prop;
-       
-       srna = RNA_def_struct(brna, "NodeGeometry", NULL);
-       RNA_def_struct_ui_text(srna, "Node Geometry", "");
-       
-       prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
-       RNA_def_property_string_sdna(prop, NULL, "uvname");
-       RNA_def_property_ui_text(prop, "UV Layer", "");
-       
-       prop = RNA_def_property(srna, "color_layer", PROP_STRING, PROP_NONE);
-       RNA_def_property_string_sdna(prop, NULL, "colname");
-       RNA_def_property_ui_text(prop, "Vertex Color Layer", "");
-}
-
-
 /* -- Shader Nodes ---------------------------------------------------------- */
 
 static void def_sh_material(BlenderRNA *brna, int id)
@@ -408,17 +389,35 @@ static void def_sh_geometry(BlenderRNA *brna, int id)
        PropertyRNA *prop;
        
        srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "NodeGeometry", "storage");
        
-       prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
-       RNA_def_property_pointer_sdna(prop, NULL, "storage");
-       RNA_def_property_struct_type(prop, "NodeGeometry");
-       RNA_def_property_ui_text(prop, "Settings", "");
+       prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "uvname");
+       RNA_def_property_ui_text(prop, "UV Layer", "");
+       
+       prop = RNA_def_property(srna, "color_layer", PROP_STRING, PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "colname");
+       RNA_def_property_ui_text(prop, "Vertex Color Layer", "");
 }
 
 
-/* -- Compositor Node Storage Types ----------------------------------------- */
+/* -- Compositor Nodes ------------------------------------------------------ */
 
-static void rna_def_storage_node_blur_data(BlenderRNA *brna)
+static void def_cmp_alpha_over(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+
+       srna = def_node(brna, id);
+
+       prop = RNA_def_property(srna, "convert_premul", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
+       RNA_def_property_ui_text(prop, "convert_premul", "TODO: don't know what this is");
+       
+       /* TODO: uses NodeTwoFloats storage */
+}
+
+static void def_cmp_blur(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
        PropertyRNA *prop;
@@ -434,11 +433,9 @@ static void rna_def_storage_node_blur_data(BlenderRNA *brna)
                {R_FILTER_MITCH,      "MITCH",      "Mitch",         ""},
                {0, NULL, NULL, NULL}
        };
-       
-       srna = RNA_def_struct(brna, "NodeBlurData", NULL);
-       RNA_def_struct_ui_text(srna, "Node Blur Data", "");
-       
-       /**/
+
+       srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage");
        
        prop = RNA_def_property(srna, "sizex", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "sizex");
@@ -448,14 +445,10 @@ static void rna_def_storage_node_blur_data(BlenderRNA *brna)
        RNA_def_property_int_sdna(prop, NULL, "sizey");
        RNA_def_property_ui_text(prop, "Size Y", "");
        
-       /**/
-       
        prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "samples");
        RNA_def_property_ui_text(prop, "Samples", "");
        
-       /**/
-       
        prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "maxspeed");
        RNA_def_property_ui_text(prop, "Max Speed", "");
@@ -464,19 +457,14 @@ static void rna_def_storage_node_blur_data(BlenderRNA *brna)
        RNA_def_property_int_sdna(prop, NULL, "minspeed");
        RNA_def_property_ui_text(prop, "Min Speed", "");
        
-       /**/
-       
        prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
        RNA_def_property_ui_text(prop, "Relative", "");
        
-       /**/
-       
        prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "fac");
        RNA_def_property_ui_text(prop, "Factor", "");
        
-       /* These aren't percentages */
        prop = RNA_def_property(srna, "factor_x", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "percentx");
        RNA_def_property_ui_text(prop, "Relative Size X", "");
@@ -485,15 +473,11 @@ static void rna_def_storage_node_blur_data(BlenderRNA *brna)
        RNA_def_property_float_sdna(prop, NULL, "percenty");
        RNA_def_property_ui_text(prop, "Relative Size Y", "");
        
-       /**/
-       
        prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "filtertype");
        RNA_def_property_enum_items(prop, filter_type_items);
        RNA_def_property_ui_text(prop, "Filter Type", "");
        
-       /**/
-       
        prop = RNA_def_property(srna, "bokeh", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1);
        RNA_def_property_ui_text(prop, "Bokeh", "");
@@ -503,7 +487,7 @@ static void rna_def_storage_node_blur_data(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Gamma", "");
        
        /*
-               Also:
+               TODO:
                        curved
                        image_in_width
                        image_in_height
@@ -513,76 +497,529 @@ static void rna_def_storage_node_blur_data(BlenderRNA *brna)
        
 }
 
+static void def_cmp_filter(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
 
-/* -- Compositor Nodes ------------------------------------------------------ */
+       static EnumPropertyItem type_items[] ={
+               {0, "SOFTEN",  "Soften",  ""},
+               {1, "SHARPEN", "Sharpen", ""},
+               {2, "LAPLACE", "Laplace", ""},
+               {3, "SOBEL",   "Sobel",   ""},
+               {4, "PREWITT", "Prewitt", ""},
+               {5, "KIRSCH",  "Kirsch",  ""},
+               {6, "SHADOW",  "Shadow",  ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "custom1");
+       RNA_def_property_enum_items(prop, type_items);
+       RNA_def_property_ui_text(prop, "Type", "");
+}
 
-static void def_cmp_alpha_over(BlenderRNA *brna, int id)
+static void def_cmp_map_value(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
        PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "TexMapping", "storage");
+       
+       prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "loc");
+       RNA_def_property_ui_text(prop, "Offset", "");
+       
+       prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "size");
+       RNA_def_property_ui_text(prop, "Size", "");
+       
+       prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
+       RNA_def_property_ui_text(prop, "Use Minimum", "");
+       
+       prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
+       RNA_def_property_ui_text(prop, "Use Maximum", "");
+       
+       prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "min");
+       RNA_def_property_ui_text(prop, "Minimum", "");
+       
+       prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "max");
+       RNA_def_property_ui_text(prop, "Maximum", "");
+}
+
+static void def_cmp_vector_blur(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage");
+       
+       prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "samples");
+       RNA_def_property_ui_text(prop, "Samples", "");
+       
+       prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "minspeed");
+       RNA_def_property_ui_text(prop, "Min Speed", "Minimum speed for a pixel to be blurred; used to separate background from foreground");
+               
+       prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "maxspeed");
+       RNA_def_property_ui_text(prop, "Min Speed", "Maximum speed, or zero for none");
+       
+       prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fac");
+       RNA_def_property_ui_text(prop, "Blur Factor", "Scaling factor for motion vectors; actually 'shutter speed' in frames");
+       
+       prop = RNA_def_property(srna, "curved", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "curved", 1);
+       RNA_def_property_ui_text(prop, "Curved", "Interpolate between frames in a bezier curve, rather than linearly");
+}
 
+static void def_cmp_image(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
        srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "ImageUser", "storage");
+       
+       /* TODO. uses storage and id. */
+       
+}
 
-       prop = RNA_def_property(srna, "convert_premul", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
-       RNA_def_property_ui_text(prop, "convert_premul", "TODO: don't know what this is");
+static void def_cmp_render_layers(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+       /* TODO. users customx and id. */
        
-       /* TODO: uses NodeTwoFloats storage */
 }
 
-static void def_cmp_blur(BlenderRNA *brna, int id)
+static void def_cmp_output_file(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
        PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+       /* TODO. */
+       
+}
 
+static void def_cmp_texture(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
        srna = def_node(brna, id);
        
-       prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
-       RNA_def_property_pointer_sdna(prop, NULL, "storage");
-       RNA_def_property_struct_type(prop, "NodeBlurData");
-       RNA_def_property_ui_text(prop, "Settings", "");
+       /* TODO. */
+       
 }
 
-static void def_cmp_filter(BlenderRNA *brna, int id)
+static void def_cmp_dilate_erode(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
        PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+               
+       prop = RNA_def_property(srna, "distance", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "custom2");
+       RNA_def_property_ui_text(prop, "Distance", "Distance to grow/shrink (number of iterations)");
+}
 
-       static EnumPropertyItem type_items[] ={
-               {0, "SOFTEN",  "Soften",  ""},
-               {1, "SHARPEN", "Sharpen", ""},
-               {2, "LAPLACE", "Laplace", ""},
-               {3, "SOBEL",   "Sobel",   ""},
-               {4, "PREWITT", "Prewitt", ""},
-               {5, "KIRSCH",  "Kirsch",  ""},
-               {6, "SHADOW",  "Shadow",  ""},
+static void def_cmp_scale(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       static EnumPropertyItem space_items[] ={
+               {0, "RELATIVE",   "Relative",   ""},
+               {1, "ABSOLUTE",   "Absolute",   ""},
+               {2, "SCENE_SIZE", "Scene Size", ""},
                {0, NULL, NULL, NULL}
        };
        
        srna = def_node(brna, id);
        
-       prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+       prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "custom1");
-       RNA_def_property_enum_items(prop, type_items);
-       RNA_def_property_ui_text(prop, "Type", "");
+       RNA_def_property_enum_items(prop, space_items);
+       RNA_def_property_ui_text(prop, "Space", "Coordinate space to scale relative to");
 }
 
+static void def_cmp_diff_matte(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       static EnumPropertyItem color_space_items[] ={
+               {1, "RGB", "RGB",   ""},
+               {2, "HSV", "HSV",   ""},
+               {3, "YUV", "YUV",   ""},
+               {4, "YCC", "YCbCr", ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "custom1");
+       RNA_def_property_enum_items(prop, color_space_items);
+       RNA_def_property_ui_text(prop, "Color Space", "");
+       
+       RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
+       
+       /* TODO: nicer wrapping for tolerances */
+       
+       prop = RNA_def_property(srna, "tolerance1", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t1");
+       RNA_def_property_ui_text(prop, "Channel 1 Tolerance", "");
+       
+       prop = RNA_def_property(srna, "tolerance2", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t2");
+       RNA_def_property_ui_text(prop, "Channel 2 Tolerance", "");
+       
+       prop = RNA_def_property(srna, "tolerance3", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t3");
+       RNA_def_property_ui_text(prop, "Channel 3 Tolerance", "");
+       
+       
+       prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fstrength");
+       RNA_def_property_ui_text(prop, "Falloff", "");
+}
 
-/* -- Texture Node Storage Types --------------------------------------------- */
+static void def_cmp_color_spill(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       static EnumPropertyItem channel_items[] ={
+               {1, "R", "Red",   ""},
+               {2, "G", "Green", ""},
+               {3, "B", "Blue",  ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "channel", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "custom1");
+       RNA_def_property_enum_items(prop, channel_items);
+       RNA_def_property_ui_text(prop, "Channel", "");
+       
+       RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
+       
+       prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t1");
+       RNA_def_property_ui_text(prop, "Amount", "How much the selected channel is affected by");
+}
 
-static void rna_def_storage_tex_node_output(BlenderRNA *brna)
+static void def_cmp_chroma(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
        PropertyRNA *prop;
        
-       srna = RNA_def_struct(brna, "TexNodeOutput", NULL);
-       RNA_def_struct_ui_text(srna, "Texture Node Output", "");
+       srna = def_node(brna, id);
+       
+       RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
        
-       prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
-       RNA_def_property_string_sdna(prop, NULL, "name");
-       RNA_def_property_ui_text(prop, "Name", "");
+       prop = RNA_def_property(srna, "acceptance", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t1");
+       RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color");
+       
+       prop = RNA_def_property(srna, "cutoff", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t2");
+       RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches");
+
+       prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fsize");
+       RNA_def_property_ui_text(prop, "Lift", "Alpha lift");
+       
+       prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fstrength");
+       RNA_def_property_ui_text(prop, "Gain", "Alpha gain");
+       
+       prop = RNA_def_property(srna, "shadow_adjust", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t3");
+       RNA_def_property_ui_text(prop, "Shadow Adjust", "Adjusts the brightness of any shadows captured");
+       
+       /* TODO: 
+               if(c->t2 > c->t1)
+                       c->t2=c->t1;
+       */
 }
 
+static void def_cmp_channel_matte(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       static EnumPropertyItem color_space_items[] ={
+               {1, "RGB", "RGB",   ""},
+               {2, "HSV", "HSV",   ""},
+               {3, "YUV", "YUV",   ""},
+               {4, "YCC", "YCbCr", ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "custom1");
+       RNA_def_property_enum_items(prop, color_space_items);
+       RNA_def_property_ui_text(prop, "Color Space", "");
+       
+       /* TODO: channel must be 1, 2 or 3 */
+       prop = RNA_def_property(srna, "channel", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "custom2");
+       RNA_def_property_ui_text(prop, "Channel", "");
+       
+       RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
+       
+       prop = RNA_def_property(srna, "high", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t1");
+       RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
+       
+       prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "t2");
+       RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
+       
+       /* TODO:
+               if(c->t2 > c->t1)
+                       c->t2=c->t1;
+       */
+}
+
+static void def_cmp_flip(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       static EnumPropertyItem axis_items[] ={
+               {0, "X",  "X",     ""},
+               {1, "Y",  "Y",     ""},
+               {2, "XY", "X & Y", ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "custom1");
+       RNA_def_property_enum_items(prop, axis_items);
+       RNA_def_property_ui_text(prop, "Axis", "");
+}
+
+static void def_cmp_splitviewer(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       static EnumPropertyItem axis_items[] ={
+               {0, "X",  "X",     ""},
+               {1, "Y",  "Y",     ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "custom2");
+       RNA_def_property_enum_items(prop, axis_items);
+       RNA_def_property_ui_text(prop, "Axis", "");
+       
+       /* TODO: percentage */
+       prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "custom1");
+       RNA_def_property_ui_text(prop, "Factor", "");
+}
+
+static void def_cmp_id_mask(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "custom1");
+       RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha");
+}
+
+static void def_cmp_map_uv(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+       /* TODO: percentage */
+       prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "custom1");
+       RNA_def_property_ui_text(prop, "Alpha", "");
+}
+
+static void def_cmp_defocus(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       static EnumPropertyItem bokeh_items[] ={
+               {8, "Octagon",  "OCTAGON",  "8 sides"},
+               {7, "Heptagon", "HEPTAGON", "7 sides"},
+               {6, "Hexagon",  "HEXAGON",  "6 sides"},
+               {5, "Pentagon", "PENTAGON", "5 sides"},
+               {4, "Square",   "SQUARE",   "4 sides"},
+               {3, "Triangle", "TRIANGLE", "3 sides"},
+               {0, "Circle",   "CIRCLE",   ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       srna = def_node(brna, id);
+       
+       RNA_def_struct_sdna_from(srna, "NodeDefocus", "storage");
+       
+       prop = RNA_def_property(srna, "bokeh", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "bktype");
+       RNA_def_property_enum_items(prop, bokeh_items);
+       RNA_def_property_ui_text(prop, "Bokeh Type", "");
+
+       /* TODO: angle in degrees */            
+       prop = RNA_def_property(srna, "angle", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "rotation");
+       RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees");
+       
+       prop = RNA_def_property(srna, "gamma_correction", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "gamco", 1);
+       RNA_def_property_ui_text(prop, "Gamma Correction", "Enable gamma correction before and after main process");
+
+       /* TODO */
+       prop = RNA_def_property(srna, "f_stop", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fstop");
+       RNA_def_property_ui_text(prop, "fStop", "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius");
+       
+       prop = RNA_def_property(srna, "max_blur", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "maxblur");
+       RNA_def_property_ui_text(prop, "Max Blur", "blur limit, maximum CoC radius, 0=no limit");
+       
+       prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "bthresh");
+       RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
+       
+       prop = RNA_def_property(srna, "preview", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "preview", 1);
+       RNA_def_property_ui_text(prop, "Preview", "Enable sampling mode, useful for preview when using low samplecounts");
+       
+       prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "samples");
+       RNA_def_property_ui_text(prop, "Samples", "Number of samples (16=grainy, higher=less noise)");
+       
+       prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "no_zbuf", 1);
+       RNA_def_property_ui_text(prop, "Use Z-Buffer", "Disable when using an image as input instead of actual zbuffer (auto enabled if node not image based, eg. time node)");
+       
+       prop = RNA_def_property(srna, "z_scale", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "scale");
+       RNA_def_property_ui_text(prop, "Z-Scale", "Scales the Z input when not using a zbuffer, controls maximum blur designated by the color white or input value 1");
+       
+}
+
+static void def_cmp_luma_matte(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_invert(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_crop(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_dblur(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_bilateral_blur(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_premul_key(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_glare(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_tonemap(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+
+static void def_cmp_lensdist(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+}
+       
+
 
 /* -- Texture Nodes --------------------------------------------------------- */
 
@@ -592,11 +1029,11 @@ static void def_tex_output(BlenderRNA *brna, int id)
        PropertyRNA *prop;
 
        srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "TexNodeOutput", "storage");
        
-       prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
-       RNA_def_property_pointer_sdna(prop, NULL, "storage");
-       RNA_def_property_struct_type(prop, "TexNodeOutput");
-       RNA_def_property_ui_text(prop, "Settings", "");
+       prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "name");
+       RNA_def_property_ui_text(prop, "Name", "");
 }
 
 static void def_tex_image(BlenderRNA *brna, int id)
@@ -654,9 +1091,6 @@ static void rna_def_shader_node(BlenderRNA *brna)
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_enum_items(prop, node_type_items);
        RNA_def_property_ui_text(prop, "Type", "");
-
-       /* Shader storage types */
-       rna_def_storage_node_geometry(brna);
 }
 
 static void rna_def_compositor_node(BlenderRNA *brna)
@@ -675,9 +1109,6 @@ static void rna_def_compositor_node(BlenderRNA *brna)
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_enum_items(prop, node_type_items);
        RNA_def_property_ui_text(prop, "Type", "");
-       
-       /* Compositor storage types */
-       rna_def_storage_node_blur_data(brna);
 }
 
 static void rna_def_texture_node(BlenderRNA *brna)
@@ -696,9 +1127,6 @@ static void rna_def_texture_node(BlenderRNA *brna)
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_enum_items(prop, node_type_items);
        RNA_def_property_ui_text(prop, "Type", "");
-       
-       /* Texture storage types */
-       rna_def_storage_tex_node_output(brna);
 }
 
 /* -------------------------------------------------------------------------- */
index 0c333dfef567566c770fe9ffb50516d9cf47a3e7..6f934a83e5467fb7244afb7573d376d2fdb08cea 100644 (file)
  
 #define TODO 0
 
-/*       Tree type       Node ID                  RNA def function     Enum name         Struct name       UI Name              UI Description */
-DefNode( ShaderNode,     SH_NODE_OUTPUT,          0,                   "OUTPUT",         Output,           "Output",            ""              )
-DefNode( ShaderNode,     SH_NODE_MATERIAL,        def_sh_material,     "MATERIAL",       Material,         "Material",          ""              )
-DefNode( ShaderNode,     SH_NODE_RGB,             0,                   "RGB",            RGB,              "RGB",               ""              )
-DefNode( ShaderNode,     SH_NODE_VALUE,           0,                   "VALUE",          Value,            "Value",             ""              )
-DefNode( ShaderNode,     SH_NODE_MIX_RGB,         def_mix_rgb,         "MIX_RGB",        MixRGB,           "MixRGB",            ""              )
-DefNode( ShaderNode,     SH_NODE_VALTORGB,        def_val_to_rgb,      "VALTORGB",       ValToRGB,         "Value to RGB",      ""              )
-DefNode( ShaderNode,     SH_NODE_RGBTOBW,         0,                   "RGBTOBW",        RGBToBW,          "RGB to BW",         ""              )
-DefNode( ShaderNode,     SH_NODE_TEXTURE,         def_texture,         "TEXTURE",        Texture,          "Texture",           ""              )
-DefNode( ShaderNode,     SH_NODE_NORMAL,          0,                   "NORMAL",         Normal,           "Normal",            ""              )
-DefNode( ShaderNode,     SH_NODE_GEOMETRY,        def_sh_geometry,     "GEOMETRY",       Geometry,         "Geometry",          ""              )
-DefNode( ShaderNode,     SH_NODE_MAPPING,         def_sh_mapping,      "MAPPING",        Mapping,          "Mapping",           ""              )
-DefNode( ShaderNode,     SH_NODE_CURVE_VEC,       def_vector_curve,    "CURVE_VEC",      VectorCurve,      "Vector Curve",      ""              )
-DefNode( ShaderNode,     SH_NODE_CURVE_RGB,       def_rgb_curve,       "CURVE_RGB",      RGBCurve,         "RGB Curve",         ""              )
-DefNode( ShaderNode,     SH_NODE_CAMERA,          0,                   "CAMERA",         CameraData,       "Camera Data",       ""              )
-DefNode( ShaderNode,     SH_NODE_MATH,            def_math,            "MATH",           Math,             "Math",              ""              )
-DefNode( ShaderNode,     SH_NODE_VECT_MATH,       def_vector_math,     "VECT_MATH",      VectorMath,       "Vector Math",       ""              )
-DefNode( ShaderNode,     SH_NODE_SQUEEZE,         0,                   "SQUEEZE",        Squeeze,          "Squeeze",           ""              )
-DefNode( ShaderNode,     SH_NODE_MATERIAL_EXT,    def_sh_material,     "MATERIAL_EXT",   ExtendedMaterial, "Extended Material", ""              )
-DefNode( ShaderNode,     SH_NODE_INVERT,          0,                   "INVERT",         Invert,           "Invert",            ""              )
-DefNode( ShaderNode,     SH_NODE_SEPRGB,          0,                   "SEPRGB",         SeparateRGB,      "Separate RGB",      ""              )
-DefNode( ShaderNode,     SH_NODE_COMBRGB,         0,                   "COMBRGB",        CombineRGB,       "Combine RGB",       ""              )
-DefNode( ShaderNode,     SH_NODE_HUE_SAT,         0,                   "HUE_SAT",        HueSaturation,    "Hue/Saturation",    ""              )
-                                                                                                                                                
-DefNode( CompositorNode, CMP_NODE_VIEWER,         0,                   "VIEWER",         Viewer,           "Viewer",            ""              )
-DefNode( CompositorNode, CMP_NODE_RGB,            0,                   "RGB",            RGB,              "RGB",               ""              )
-DefNode( CompositorNode, CMP_NODE_VALUE,          0,                   "VALUE",          Value,            "Value",             ""              )
-DefNode( CompositorNode, CMP_NODE_MIX_RGB,        def_mix_rgb,         "MIX_RGB",        MixRGB,           "Mix RGB",           ""              )
-DefNode( CompositorNode, CMP_NODE_VALTORGB,       def_val_to_rgb,      "VALTORGB",       ValToRGB,         "Val to RGB",        ""              )
-DefNode( CompositorNode, CMP_NODE_RGBTOBW,        0,                   "RGBTOBW",        RGBToBW,          "RGB to BW",         ""              )
-DefNode( CompositorNode, CMP_NODE_NORMAL,         0,                   "NORMAL",         Normal,           "Normal",            ""              )
-DefNode( CompositorNode, CMP_NODE_CURVE_VEC,      def_vector_curve,    "CURVE_VEC",      CurveVec,         "Vector Curve",      ""              )
-DefNode( CompositorNode, CMP_NODE_CURVE_RGB,      def_rgb_curve,       "CURVE_RGB",      CurveRGB,         "RGB Curve",         ""              )
-DefNode( CompositorNode, CMP_NODE_ALPHAOVER,      def_cmp_alpha_over,  "ALPHAOVER",      AlphaOver,        "Alpha Over",        ""              )
-DefNode( CompositorNode, CMP_NODE_BLUR,           def_cmp_blur,        "BLUR",           Blur,             "Blur",              ""              )
-DefNode( CompositorNode, CMP_NODE_FILTER,         def_cmp_filter,      "FILTER",         Filter,           "Filter",            ""              )
-DefNode( CompositorNode, CMP_NODE_MAP_VALUE,      TODO,                "MAP_VALUE",      MapValue,         "Map Value",         ""              )
-DefNode( CompositorNode, CMP_NODE_TIME,           def_time,            "TIME",           Time,             "Time",              ""              )
-DefNode( CompositorNode, CMP_NODE_VECBLUR,        TODO,                "VECBLUR",        VecBlur,          "Vector Blur",       ""              )
-DefNode( CompositorNode, CMP_NODE_SEPRGBA,        0,                   "SEPRGBA",        SepRGBA,          "Separate RGBA",     ""              )
-DefNode( CompositorNode, CMP_NODE_SEPHSVA,        0,                   "SEPHSVA",        SepHSVA,          "Separate HSVA",     ""              )
-DefNode( CompositorNode, CMP_NODE_SETALPHA,       0,                   "SETALPHA",       SetAlpha,         "Set Alpha",         ""              )
-DefNode( CompositorNode, CMP_NODE_HUE_SAT,        0,                   "HUE_SAT",        HueSat,           "Hue/Saturation",    ""              )
-DefNode( CompositorNode, CMP_NODE_IMAGE,          TODO,                "IMAGE",          Image,            "Image",             ""              )
-DefNode( CompositorNode, CMP_NODE_R_LAYERS,       TODO,                "R_LAYERS",       RLayers,          "Render Layers",     ""              )
-DefNode( CompositorNode, CMP_NODE_COMPOSITE,      0,                   "COMPOSITE",      Composite,        "Composite",         ""              )
-DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE,    TODO,                "OUTPUT_FILE",    OutputFile,       "Output File",       ""              )
-DefNode( CompositorNode, CMP_NODE_TEXTURE,        TODO,                "TEXTURE",        Texture,          "Texture",           ""              )
-DefNode( CompositorNode, CMP_NODE_TRANSLATE,      0,                   "TRANSLATE",      Translate,        "Translate",         ""              )
-DefNode( CompositorNode, CMP_NODE_ZCOMBINE,       0,                   "ZCOMBINE",       Zcombine,         "Z Combine",         ""              )
-DefNode( CompositorNode, CMP_NODE_COMBRGBA,       0,                   "COMBRGBA",       CombRGBA,         "Combine RGBA",      ""              )
-DefNode( CompositorNode, CMP_NODE_DILATEERODE,    TODO,                "DILATEERODE",    DilateErode,      "Dilate/Erode",      ""              )
-DefNode( CompositorNode, CMP_NODE_ROTATE,         0,                   "ROTATE",         Rotate,           "Rotate",            ""              )
-DefNode( CompositorNode, CMP_NODE_SCALE,          TODO,                "SCALE",          Scale,            "Scale",             ""              )
-DefNode( CompositorNode, CMP_NODE_SEPYCCA,        0,                   "SEPYCCA",        SepYCCA,          "Separate YCCA",     ""              )
-DefNode( CompositorNode, CMP_NODE_COMBYCCA,       0,                   "COMBYCCA",       CombYCCA,         "Combine YCCA",      ""              )
-DefNode( CompositorNode, CMP_NODE_SEPYUVA,        0,                   "SEPYUVA",        SepYUVA,          "Separate YUVA",     ""              )
-DefNode( CompositorNode, CMP_NODE_COMBYUVA,       0,                   "COMBYUVA",       CombYUVA,         "Combine YUVA",      ""              )
-DefNode( CompositorNode, CMP_NODE_DIFF_MATTE,     TODO,                "DIFF_MATTE",     DiffMatte,        "Diff Matte",        ""              )
-DefNode( CompositorNode, CMP_NODE_COLOR_SPILL,    TODO,                "COLOR_SPILL",    ColorSpill,       "Color Spill",       ""              )
-DefNode( CompositorNode, CMP_NODE_CHROMA,         TODO,                "CHROMA",         Chroma,           "Chroma",            ""              )
-DefNode( CompositorNode, CMP_NODE_CHANNEL_MATTE,  TODO,                "CHANNEL_MATTE",  ChannelMatte,     "Channel Matte",     ""              )
-DefNode( CompositorNode, CMP_NODE_FLIP,           TODO,                "FLIP",           Flip,             "Flip",              ""              )
-DefNode( CompositorNode, CMP_NODE_SPLITVIEWER,    TODO,                "SPLITVIEWER",    SplitViewer,      "Split Viewer",      ""              )
-DefNode( CompositorNode, CMP_NODE_INDEX_MASK,     TODO,                "INDEX_MASK",     IndexMask,        "Index Mask",        ""              )
-DefNode( CompositorNode, CMP_NODE_MAP_UV,         TODO,                "MAP_UV",         MapUV,            "Map UV",            ""              )
-DefNode( CompositorNode, CMP_NODE_ID_MASK,        TODO,                "ID_MASK",        IDMask,           "ID Mask",           ""              )
-DefNode( CompositorNode, CMP_NODE_DEFOCUS,        TODO,                "DEFOCUS",        Defocus,          "Defocus",           ""              )
-DefNode( CompositorNode, CMP_NODE_DISPLACE,       0,                   "DISPLACE",       Displace,         "Displace",          ""              )
-DefNode( CompositorNode, CMP_NODE_COMBHSVA,       0,                   "COMBHSVA",       CombHSVA,         "Combine HSVA",      ""              )
-DefNode( CompositorNode, CMP_NODE_MATH,           def_math,            "MATH",           Math,             "Math",              ""              )
-DefNode( CompositorNode, CMP_NODE_LUMA_MATTE,     TODO,                "LUMA_MATTE",     LumaMatte,        "Luma Matte",        ""              )
-DefNode( CompositorNode, CMP_NODE_BRIGHTCONTRAST, 0,                   "BRIGHTCONTRAST", BrightContrast,   "Bright Contrast",   ""              )
-DefNode( CompositorNode, CMP_NODE_GAMMA,          0,                   "GAMMA",          Gamma,            "Gamma",             ""              )
-DefNode( CompositorNode, CMP_NODE_INVERT,         TODO,                "INVERT",         Invert,           "Invert",            ""              )
-DefNode( CompositorNode, CMP_NODE_NORMALIZE,      0,                   "NORMALIZE",      Normalize,        "Normalize",         ""              )
-DefNode( CompositorNode, CMP_NODE_CROP,           TODO,                "CROP",           Crop,             "Crop",              ""              )
-DefNode( CompositorNode, CMP_NODE_DBLUR,          TODO,                "DBLUR",          DBlur,            "DBlur",             ""              )
-DefNode( CompositorNode, CMP_NODE_BILATERALBLUR,  TODO,                "BILATERALBLUR",  Bilateralblur,    "Bilateral Blur",    ""              )
-DefNode( CompositorNode, CMP_NODE_PREMULKEY,      TODO,                "PREMULKEY",      PremulKey,        "Premul Key",        ""              )
-DefNode( CompositorNode, CMP_NODE_GLARE,          TODO,                "GLARE",          Glare,            "Glare",             ""              )
-DefNode( CompositorNode, CMP_NODE_TONEMAP,        TODO,                "TONEMAP",        Tonemap,          "Tonemap",           ""              )
-DefNode( CompositorNode, CMP_NODE_LENSDIST,       TODO,                "LENSDIST",       Lensdist,         "Lensdist",          ""              )
-                                                                                                                                                
-DefNode( TextureNode,    TEX_NODE_OUTPUT,         def_tex_output,      "OUTPUT",         Output,           "Output",            ""              )
-DefNode( TextureNode,    TEX_NODE_CHECKER,        0,                   "CHECKER",        Checker,          "Checker",           ""              )
-DefNode( TextureNode,    TEX_NODE_TEXTURE,        def_texture,         "TEXTURE",        Texture,          "Texture",           ""              )
-DefNode( TextureNode,    TEX_NODE_BRICKS,         def_tex_bricks,      "BRICKS",         Bricks,           "Bricks",            ""              )
-DefNode( TextureNode,    TEX_NODE_MATH,           def_math,            "MATH",           Math,             "Math",              ""              )
-DefNode( TextureNode,    TEX_NODE_MIX_RGB,        def_mix_rgb,         "MIX_RGB",        MixRGB,           "Mix RGB",           ""              )
-DefNode( TextureNode,    TEX_NODE_RGBTOBW,        0,                   "RGBTOBW",        RGBToBW,          "RGB To BW",         ""              )
-DefNode( TextureNode,    TEX_NODE_VALTORGB,       def_val_to_rgb,      "VALTORGB",       ValToRGB,         "Val To RGB",        ""              )
-DefNode( TextureNode,    TEX_NODE_IMAGE,          def_tex_image,       "IMAGE",          Image,            "Image",             ""              )
-DefNode( TextureNode,    TEX_NODE_CURVE_RGB,      def_rgb_curve,       "CURVE_RGB",      CurveRGB,         "RGB Curve",         ""              )
-DefNode( TextureNode,    TEX_NODE_INVERT,         0,                   "INVERT",         Invert,           "Invert",            ""              )
-DefNode( TextureNode,    TEX_NODE_HUE_SAT,        0,                   "HUE_SAT",        HueSaturation,    "Hue/Saturation",    ""              )
-DefNode( TextureNode,    TEX_NODE_CURVE_TIME,     def_time,            "CURVE_TIME",     CurveTime,        "Curve Time",        ""              )
-DefNode( TextureNode,    TEX_NODE_ROTATE,         0,                   "ROTATE",         Rotate,           "Rotate",            ""              )
-DefNode( TextureNode,    TEX_NODE_VIEWER,         0,                   "VIEWER",         Viewer,           "Viewer",            ""              )
-DefNode( TextureNode,    TEX_NODE_TRANSLATE,      0,                   "TRANSLATE",      Translate,        "Translate",         ""              )
-DefNode( TextureNode,    TEX_NODE_COORD,          0,                   "COORD",          Coordinates,      "Coordinates",       ""              )
-DefNode( TextureNode,    TEX_NODE_DISTANCE,       0,                   "DISTANCE",       Distance,         "Distance",          ""              )
-DefNode( TextureNode,    TEX_NODE_COMPOSE,        0,                   "COMPOSE",        Compose,          "Compose",           ""              )
-DefNode( TextureNode,    TEX_NODE_DECOMPOSE,      0,                   "DECOMPOSE",      Decompose,        "Decompose",         ""              )
-DefNode( TextureNode,    TEX_NODE_VALTONOR,       0,                   "VALTONOR",       ValToNor,         "Val to Nor",        ""              )
-DefNode( TextureNode,    TEX_NODE_SCALE,          0,                   "SCALE",          Scale,            "Scale",             ""              )
-                                                                 
+/*       Tree type       Node ID                  RNA def function        Enum name         Struct name       UI Name              UI Description */
+DefNode( ShaderNode,     SH_NODE_OUTPUT,          0,                      "OUTPUT",         Output,           "Output",            ""              )
+DefNode( ShaderNode,     SH_NODE_MATERIAL,        def_sh_material,        "MATERIAL",       Material,         "Material",          ""              )
+DefNode( ShaderNode,     SH_NODE_RGB,             0,                      "RGB",            RGB,              "RGB",               ""              )
+DefNode( ShaderNode,     SH_NODE_VALUE,           0,                      "VALUE",          Value,            "Value",             ""              )
+DefNode( ShaderNode,     SH_NODE_MIX_RGB,         def_mix_rgb,            "MIX_RGB",        MixRGB,           "MixRGB",            ""              )
+DefNode( ShaderNode,     SH_NODE_VALTORGB,        def_val_to_rgb,         "VALTORGB",       ValToRGB,         "Value to RGB",      ""              )
+DefNode( ShaderNode,     SH_NODE_RGBTOBW,         0,                      "RGBTOBW",        RGBToBW,          "RGB to BW",         ""              )
+DefNode( ShaderNode,     SH_NODE_TEXTURE,         def_texture,            "TEXTURE",        Texture,          "Texture",           ""              )
+DefNode( ShaderNode,     SH_NODE_NORMAL,          0,                      "NORMAL",         Normal,           "Normal",            ""              )
+DefNode( ShaderNode,     SH_NODE_GEOMETRY,        def_sh_geometry,        "GEOMETRY",       Geometry,         "Geometry",          ""              )
+DefNode( ShaderNode,     SH_NODE_MAPPING,         def_sh_mapping,         "MAPPING",        Mapping,          "Mapping",           ""              )
+DefNode( ShaderNode,     SH_NODE_CURVE_VEC,       def_vector_curve,       "CURVE_VEC",      VectorCurve,      "Vector Curve",      ""              )
+DefNode( ShaderNode,     SH_NODE_CURVE_RGB,       def_rgb_curve,          "CURVE_RGB",      RGBCurve,         "RGB Curve",         ""              )
+DefNode( ShaderNode,     SH_NODE_CAMERA,          0,                      "CAMERA",         CameraData,       "Camera Data",       ""              )
+DefNode( ShaderNode,     SH_NODE_MATH,            def_math,               "MATH",           Math,             "Math",              ""              )
+DefNode( ShaderNode,     SH_NODE_VECT_MATH,       def_vector_math,        "VECT_MATH",      VectorMath,       "Vector Math",       ""              )
+DefNode( ShaderNode,     SH_NODE_SQUEEZE,         0,                      "SQUEEZE",        Squeeze,          "Squeeze",           ""              )
+DefNode( ShaderNode,     SH_NODE_MATERIAL_EXT,    def_sh_material,        "MATERIAL_EXT",   ExtendedMaterial, "Extended Material", ""              )
+DefNode( ShaderNode,     SH_NODE_INVERT,          0,                      "INVERT",         Invert,           "Invert",            ""              )
+DefNode( ShaderNode,     SH_NODE_SEPRGB,          0,                      "SEPRGB",         SeparateRGB,      "Separate RGB",      ""              )
+DefNode( ShaderNode,     SH_NODE_COMBRGB,         0,                      "COMBRGB",        CombineRGB,       "Combine RGB",       ""              )
+DefNode( ShaderNode,     SH_NODE_HUE_SAT,         0,                      "HUE_SAT",        HueSaturation,    "Hue/Saturation",    ""              )
+                                                                                                                                                   
+DefNode( CompositorNode, CMP_NODE_VIEWER,         0,                      "VIEWER",         Viewer,           "Viewer",            ""              )
+DefNode( CompositorNode, CMP_NODE_RGB,            0,                      "RGB",            RGB,              "RGB",               ""              )
+DefNode( CompositorNode, CMP_NODE_VALUE,          0,                      "VALUE",          Value,            "Value",             ""              )
+DefNode( CompositorNode, CMP_NODE_MIX_RGB,        def_mix_rgb,            "MIX_RGB",        MixRGB,           "Mix RGB",           ""              )
+DefNode( CompositorNode, CMP_NODE_VALTORGB,       def_val_to_rgb,         "VALTORGB",       ValToRGB,         "Val to RGB",        ""              )
+DefNode( CompositorNode, CMP_NODE_RGBTOBW,        0,                      "RGBTOBW",        RGBToBW,          "RGB to BW",         ""              )
+DefNode( CompositorNode, CMP_NODE_NORMAL,         0,                      "NORMAL",         Normal,           "Normal",            ""              )
+DefNode( CompositorNode, CMP_NODE_CURVE_VEC,      def_vector_curve,       "CURVE_VEC",      CurveVec,         "Vector Curve",      ""              )
+DefNode( CompositorNode, CMP_NODE_CURVE_RGB,      def_rgb_curve,          "CURVE_RGB",      CurveRGB,         "RGB Curve",         ""              )
+DefNode( CompositorNode, CMP_NODE_ALPHAOVER,      def_cmp_alpha_over,     "ALPHAOVER",      AlphaOver,        "Alpha Over",        ""              )
+DefNode( CompositorNode, CMP_NODE_BLUR,           def_cmp_blur,           "BLUR",           Blur,             "Blur",              ""              )
+DefNode( CompositorNode, CMP_NODE_FILTER,         def_cmp_filter,         "FILTER",         Filter,           "Filter",            ""              )
+DefNode( CompositorNode, CMP_NODE_MAP_VALUE,      def_cmp_map_value,      "MAP_VALUE",      MapValue,         "Map Value",         ""              )
+DefNode( CompositorNode, CMP_NODE_TIME,           def_time,               "TIME",           Time,             "Time",              ""              )
+DefNode( CompositorNode, CMP_NODE_VECBLUR,        def_cmp_vector_blur,    "VECBLUR",        VecBlur,          "Vector Blur",       ""              )
+DefNode( CompositorNode, CMP_NODE_SEPRGBA,        0,                      "SEPRGBA",        SepRGBA,          "Separate RGBA",     ""              )
+DefNode( CompositorNode, CMP_NODE_SEPHSVA,        0,                      "SEPHSVA",        SepHSVA,          "Separate HSVA",     ""              )
+DefNode( CompositorNode, CMP_NODE_SETALPHA,       0,                      "SETALPHA",       SetAlpha,         "Set Alpha",         ""              )
+DefNode( CompositorNode, CMP_NODE_HUE_SAT,        0,                      "HUE_SAT",        HueSat,           "Hue/Saturation",    ""              )
+DefNode( CompositorNode, CMP_NODE_IMAGE,          def_cmp_image,          "IMAGE",          Image,            "Image",             ""              )
+DefNode( CompositorNode, CMP_NODE_R_LAYERS,       def_cmp_render_layers,  "R_LAYERS",       RLayers,          "Render Layers",     ""              )
+DefNode( CompositorNode, CMP_NODE_COMPOSITE,      0,                      "COMPOSITE",      Composite,        "Composite",         ""              )
+DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE,    def_cmp_output_file,    "OUTPUT_FILE",    OutputFile,       "Output File",       ""              )
+DefNode( CompositorNode, CMP_NODE_TEXTURE,        def_cmp_texture,        "TEXTURE",        Texture,          "Texture",           ""              )
+DefNode( CompositorNode, CMP_NODE_TRANSLATE,      0,                      "TRANSLATE",      Translate,        "Translate",         ""              )
+DefNode( CompositorNode, CMP_NODE_ZCOMBINE,       0,                      "ZCOMBINE",       Zcombine,         "Z Combine",         ""              )
+DefNode( CompositorNode, CMP_NODE_COMBRGBA,       0,                      "COMBRGBA",       CombRGBA,         "Combine RGBA",      ""              )
+DefNode( CompositorNode, CMP_NODE_DILATEERODE,    def_cmp_dilate_erode,   "DILATEERODE",    DilateErode,      "Dilate/Erode",      ""              )
+DefNode( CompositorNode, CMP_NODE_ROTATE,         0,                      "ROTATE",         Rotate,           "Rotate",            ""              )
+DefNode( CompositorNode, CMP_NODE_SCALE,          def_cmp_scale,          "SCALE",          Scale,            "Scale",             ""              )
+DefNode( CompositorNode, CMP_NODE_SEPYCCA,        0,                      "SEPYCCA",        SepYCCA,          "Separate YCCA",     ""              )
+DefNode( CompositorNode, CMP_NODE_COMBYCCA,       0,                      "COMBYCCA",       CombYCCA,         "Combine YCCA",      ""              )
+DefNode( CompositorNode, CMP_NODE_SEPYUVA,        0,                      "SEPYUVA",        SepYUVA,          "Separate YUVA",     ""              )
+DefNode( CompositorNode, CMP_NODE_COMBYUVA,       0,                      "COMBYUVA",       CombYUVA,         "Combine YUVA",      ""              )
+DefNode( CompositorNode, CMP_NODE_DIFF_MATTE,     def_cmp_diff_matte,     "DIFF_MATTE",     DiffMatte,        "Difference Key",    ""              )
+DefNode( CompositorNode, CMP_NODE_COLOR_SPILL,    def_cmp_color_spill,    "COLOR_SPILL",    ColorSpill,       "Color Spill",       ""              )
+DefNode( CompositorNode, CMP_NODE_CHROMA,         def_cmp_chroma,         "CHROMA",         Chroma,           "Chroma Key",        ""              )
+DefNode( CompositorNode, CMP_NODE_CHANNEL_MATTE,  def_cmp_channel_matte,  "CHANNEL_MATTE",  ChannelMatte,     "Channel Key",       ""              )
+DefNode( CompositorNode, CMP_NODE_FLIP,           def_cmp_flip,           "FLIP",           Flip,             "Flip",              ""              )
+DefNode( CompositorNode, CMP_NODE_SPLITVIEWER,    def_cmp_splitviewer,    "SPLITVIEWER",    SplitViewer,      "Split Viewer",      ""              )
+DefNode( CompositorNode, CMP_NODE_MAP_UV,         def_cmp_map_uv,         "MAP_UV",         MapUV,            "Map UV",            ""              )
+DefNode( CompositorNode, CMP_NODE_ID_MASK,        def_cmp_id_mask,        "ID_MASK",        IDMask,           "ID Mask",           ""              )
+DefNode( CompositorNode, CMP_NODE_DEFOCUS,        def_cmp_defocus,        "DEFOCUS",        Defocus,          "Defocus",           ""              )
+DefNode( CompositorNode, CMP_NODE_DISPLACE,       0,                      "DISPLACE",       Displace,         "Displace",          ""              )
+DefNode( CompositorNode, CMP_NODE_COMBHSVA,       0,                      "COMBHSVA",       CombHSVA,         "Combine HSVA",      ""              )
+DefNode( CompositorNode, CMP_NODE_MATH,           def_math,               "MATH",           Math,             "Math",              ""              )
+DefNode( CompositorNode, CMP_NODE_LUMA_MATTE,     def_cmp_luma_matte,     "LUMA_MATTE",     LumaMatte,        "Luma Matte",        ""              )
+DefNode( CompositorNode, CMP_NODE_BRIGHTCONTRAST, 0,                      "BRIGHTCONTRAST", BrightContrast,   "Bright Contrast",   ""              )
+DefNode( CompositorNode, CMP_NODE_GAMMA,          0,                      "GAMMA",          Gamma,            "Gamma",             ""              )
+DefNode( CompositorNode, CMP_NODE_INVERT,         def_cmp_invert,         "INVERT",         Invert,           "Invert",            ""              )
+DefNode( CompositorNode, CMP_NODE_NORMALIZE,      0,                      "NORMALIZE",      Normalize,        "Normalize",         ""              )
+DefNode( CompositorNode, CMP_NODE_CROP,           def_cmp_crop,           "CROP",           Crop,             "Crop",              ""              )
+DefNode( CompositorNode, CMP_NODE_DBLUR,          def_cmp_dblur,          "DBLUR",          DBlur,            "DBlur",             ""              )
+DefNode( CompositorNode, CMP_NODE_BILATERALBLUR,  def_cmp_bilateral_blur, "BILATERALBLUR",  Bilateralblur,    "Bilateral Blur",    ""              )
+DefNode( CompositorNode, CMP_NODE_PREMULKEY,      def_cmp_premul_key,     "PREMULKEY",      PremulKey,        "Premul Key",        ""              )
+DefNode( CompositorNode, CMP_NODE_GLARE,          def_cmp_glare,          "GLARE",          Glare,            "Glare",             ""              )
+DefNode( CompositorNode, CMP_NODE_TONEMAP,        def_cmp_tonemap,        "TONEMAP",        Tonemap,          "Tonemap",           ""              )
+DefNode( CompositorNode, CMP_NODE_LENSDIST,       def_cmp_lensdist,       "LENSDIST",       Lensdist,         "Lensdist",          ""              )
+                                                                                                                                                   
+DefNode( TextureNode,    TEX_NODE_OUTPUT,         def_tex_output,         "OUTPUT",         Output,           "Output",            ""              )
+DefNode( TextureNode,    TEX_NODE_CHECKER,        0,                      "CHECKER",        Checker,          "Checker",           ""              )
+DefNode( TextureNode,    TEX_NODE_TEXTURE,        def_texture,            "TEXTURE",        Texture,          "Texture",           ""              )
+DefNode( TextureNode,    TEX_NODE_BRICKS,         def_tex_bricks,         "BRICKS",         Bricks,           "Bricks",            ""              )
+DefNode( TextureNode,    TEX_NODE_MATH,           def_math,               "MATH",           Math,             "Math",              ""              )
+DefNode( TextureNode,    TEX_NODE_MIX_RGB,        def_mix_rgb,            "MIX_RGB",        MixRGB,           "Mix RGB",           ""              )
+DefNode( TextureNode,    TEX_NODE_RGBTOBW,        0,                      "RGBTOBW",        RGBToBW,          "RGB To BW",         ""              )
+DefNode( TextureNode,    TEX_NODE_VALTORGB,       def_val_to_rgb,         "VALTORGB",       ValToRGB,         "Val To RGB",        ""              )
+DefNode( TextureNode,    TEX_NODE_IMAGE,          def_tex_image,          "IMAGE",          Image,            "Image",             ""              )
+DefNode( TextureNode,    TEX_NODE_CURVE_RGB,      def_rgb_curve,          "CURVE_RGB",      CurveRGB,         "RGB Curve",         ""              )
+DefNode( TextureNode,    TEX_NODE_INVERT,         0,                      "INVERT",         Invert,           "Invert",            ""              )
+DefNode( TextureNode,    TEX_NODE_HUE_SAT,        0,                      "HUE_SAT",        HueSaturation,    "Hue/Saturation",    ""              )
+DefNode( TextureNode,    TEX_NODE_CURVE_TIME,     def_time,               "CURVE_TIME",     CurveTime,        "Curve Time",        ""              )
+DefNode( TextureNode,    TEX_NODE_ROTATE,         0,                      "ROTATE",         Rotate,           "Rotate",            ""              )
+DefNode( TextureNode,    TEX_NODE_VIEWER,         0,                      "VIEWER",         Viewer,           "Viewer",            ""              )
+DefNode( TextureNode,    TEX_NODE_TRANSLATE,      0,                      "TRANSLATE",      Translate,        "Translate",         ""              )
+DefNode( TextureNode,    TEX_NODE_COORD,          0,                      "COORD",          Coordinates,      "Coordinates",       ""              )
+DefNode( TextureNode,    TEX_NODE_DISTANCE,       0,                      "DISTANCE",       Distance,         "Distance",          ""              )
+DefNode( TextureNode,    TEX_NODE_COMPOSE,        0,                      "COMPOSE",        Compose,          "Compose",           ""              )
+DefNode( TextureNode,    TEX_NODE_DECOMPOSE,      0,                      "DECOMPOSE",      Decompose,        "Decompose",         ""              )
+DefNode( TextureNode,    TEX_NODE_VALTONOR,       0,                      "VALTONOR",       ValToNor,         "Val to Nor",        ""              )
+DefNode( TextureNode,    TEX_NODE_SCALE,          0,                      "SCALE",          Scale,            "Scale",             ""              )
+    
+#undef TODO