Revision: 20594
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20594
Author:   kakbarnf
Date:     2009-06-03 02:40:38 +0200 (Wed, 03 Jun 2009)

Log Message:
-----------
RNA: more compositor nodes wrapped

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c
    
branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree_types.h

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c   
2009-06-03 00:17:35 UTC (rev 20593)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c   
2009-06-03 00:40:38 UTC (rev 20594)
@@ -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 @@
 }
 
 
-/* -- 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,21 +389,39 @@
        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;
+       
        static EnumPropertyItem filter_type_items[] ={
                {R_FILTER_BOX,        "FLAT",       "Flat",          ""},
                {R_FILTER_TENT,       "TENT",       "Tent",          ""},
@@ -434,12 +433,10 @@
                {R_FILTER_MITCH,      "MITCH",      "Mitch",         ""},
                {0, NULL, NULL, NULL}
        };
+
+       srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage");
        
-       srna = RNA_def_struct(brna, "NodeBlurData", NULL);
-       RNA_def_struct_ui_text(srna, "Node Blur Data", "");
-       
-       /**/
-       
        prop = RNA_def_property(srna, "sizex", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "sizex");
        RNA_def_property_ui_text(prop, "Size X", "");
@@ -448,14 +445,10 @@
        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 @@
        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 @@
        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 @@
        RNA_def_property_ui_text(prop, "Gamma", "");
        
        /*
-               Also:
+               TODO:
                        curved
                        image_in_width
                        image_in_height
@@ -513,77 +497,530 @@
        
 }
 
+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");
+}
 
-       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_image(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
        
-       /* TODO: uses NodeTwoFloats storage */
+       srna = def_node(brna, id);
+       RNA_def_struct_sdna_from(srna, "ImageUser", "storage");
+       
+       /* TODO. uses storage and id. */
+       
 }
 
-static void def_cmp_blur(BlenderRNA *brna, int id)
+static void def_cmp_render_layers(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
        PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+       /* TODO. users customx and id. */
+       
+}
 
+static void def_cmp_output_file(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_texture(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
        PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+       
+       /* TODO. */
+       
+}
 
-       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_dilate_erode(BlenderRNA *brna, int id)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+       
+       srna = def_node(brna, id);
+               

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to