Revision: 20624
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20624
Author:   kakbarnf
Date:     2009-06-04 15:55:02 +0200 (Thu, 04 Jun 2009)

Log Message:
-----------
All nodes are now wrapped! Some still need limits and extra logic though.

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-04 13:02:07 UTC (rev 20623)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c   
2009-06-04 13:55:02 UTC (rev 20624)
@@ -33,7 +33,9 @@
 #include "DNA_node_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_texture_types.h"
+
 #include "BKE_node.h"
+#include "BKE_image.h"
 
 #ifdef RNA_RUNTIME
 
@@ -171,7 +173,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem items[] ={
+       static EnumPropertyItem items[] = {
                { 0, "ADD",          "Add",          ""},
                { 1, "SUBTRACT",     "Subtract",     ""},
                { 2, "MULTIPLY",     "Multiply",     ""},
@@ -206,7 +208,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem items[] ={
+       static EnumPropertyItem items[] = {
                {0, "ADD",           "Add",           ""},
                {1, "SUBTRACT",      "Subtract",      ""},
                {2, "AVERAGE",       "Average",       ""},
@@ -275,12 +277,12 @@
 static void def_val_to_rgb(BlenderRNA *brna, int id)
 {
        StructRNA *srna;
-//     PropertyRNA *prop;
+       /*PropertyRNA *prop;*/
        
        srna = def_node(brna, id);
        
-       /* TODO: uncomment when ColorBand is wrapped */
-       /*prop = RNA_def_property(srna, "color_band", PROP_POINTER, PROP_NONE);
+       /* TODO: uncomment when ColorBand is wrapped *//*
+       prop = RNA_def_property(srna, "color_band", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "storage");
        RNA_def_property_struct_type(prop, "ColorBand");
        RNA_def_property_ui_text(prop, "Color Band", "");*/
@@ -291,7 +293,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem blend_type_items[] ={
+       static EnumPropertyItem blend_type_items[] = {
                { 0, "MIX",        "Mix",         ""},
                { 1, "ADD",        "Add",         ""},
                { 3, "SUBTRACT",   "Subtract",    ""},
@@ -414,7 +416,11 @@
        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 */
+       RNA_def_struct_sdna_from(srna, "NodeTwoFloats", "storage");
+       
+       prop = RNA_def_property(srna, "premul", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "x");
+       RNA_def_property_ui_text(prop, "Premul", "Mix Factor");
 }
 
 static void def_cmp_blur(BlenderRNA *brna, int id)
@@ -422,7 +428,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem filter_type_items[] ={
+       static EnumPropertyItem filter_type_items[] = {
                {R_FILTER_BOX,        "FLAT",       "Flat",          ""},
                {R_FILTER_TENT,       "TENT",       "Tent",          ""},
                {R_FILTER_QUAD,       "QUAD",       "Quadratic",     ""},
@@ -492,7 +498,7 @@
                        image_in_width
                        image_in_height
                        
-               Don't know if these need wrapping
+               Don't know if these need wrapping, can't find them in interface
        */
        
 }
@@ -502,7 +508,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
 
-       static EnumPropertyItem type_items[] ={
+       static EnumPropertyItem type_items[] = {
                {0, "SOFTEN",  "Soften",  ""},
                {1, "SHARPEN", "Sharpen", ""},
                {2, "LAPLACE", "Laplace", ""},
@@ -588,11 +594,58 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
+       static EnumPropertyItem type_items[] = {
+               {IMA_SRC_FILE,      "IMAGE",     "Image",     ""},
+               {IMA_SRC_MOVIE,     "MOVIE",     "Movie",     ""},
+               {IMA_SRC_SEQUENCE,  "SEQUENCE",  "Sequence",  ""},
+               {IMA_SRC_GENERATED, "GENERATED", "Generated", ""},
+               {0, NULL, NULL, NULL}
+       };
+       
        srna = def_node(brna, id);
+       
+       prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+       RNA_def_property_pointer_sdna(prop, NULL, "id");
+       RNA_def_property_struct_type(prop, "Image");
+       RNA_def_property_flag(prop, PROP_EDITABLE);
+       RNA_def_property_ui_text(prop, "Image", "");
+       
        RNA_def_struct_sdna_from(srna, "ImageUser", "storage");
+
+       /* TODO: if movie or sequence { */
        
-       /* TODO. uses storage and id. */
+       prop = RNA_def_property(srna, "frames", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "frames");
+       RNA_def_property_ui_text(prop, "Frames", "Number of images used in 
animation");
        
+       prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "sfra");
+       RNA_def_property_ui_text(prop, "Start Frame", "");
+       
+       prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "offset");
+       RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the 
frame to use in the animation");
+       
+       prop = RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "cycl", 1);
+       RNA_def_property_ui_text(prop, "Cyclic", "");
+       
+       prop = RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
+       RNA_def_property_ui_text(prop, "Auto-Refresh", "");
+       
+       /* } */
+       
+       /* if type == multilayer { */
+       
+       prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "layer");
+       RNA_def_property_ui_text(prop, "Layer", "");
+       
+       /* } */
+       
+       /* TODO: refresh on change */
+       
 }
 
 static void def_cmp_render_layers(BlenderRNA *brna, int id)
@@ -602,8 +655,22 @@
        
        srna = def_node(brna, id);
        
-       /* TODO. users customx and id. */
+       prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+       RNA_def_property_pointer_sdna(prop, NULL, "id");
+       RNA_def_property_struct_type(prop, "Scene");
+       RNA_def_property_flag(prop, PROP_EDITABLE);
+       RNA_def_property_ui_text(prop, "Scene", "");
        
+       /* TODO: layers in menu */
+       prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "custom1");
+       RNA_def_property_ui_text(prop, "Layer", "");
+       
+       /* TODO: comments indicate this might be a hack */
+       prop = RNA_def_property(srna, "re_render", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
+       RNA_def_property_ui_text(prop, "Re-render", "");
+       
 }
 
 static void def_cmp_output_file(BlenderRNA *brna, int id)
@@ -611,21 +678,69 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
+       static EnumPropertyItem type_items[] = {
+               {R_TARGA,   "TARGA",        "Targa",        ""},
+               {R_RAWTGA,  "RAW_TARGA",    "Targa Raw",    ""},
+               {R_PNG,     "PNG",          "PNG",          ""},
+               {R_BMP,     "BMP",          "BMP",          ""},
+               {R_JPEG90,  "JPEG",         "JPEG",         ""},
+               {R_IRIS,    "IRIS",         "IRIS",         ""},
+               {R_RADHDR,  "RADIANCE_HDR", "Radiance HDR", ""},
+               {R_CINEON,  "CINEON",       "Cineon",       ""},
+               {R_DPX,     "DPX",          "DPX",          ""},
+               {R_OPENEXR, "OPENEXR",      "OpenEXR",      ""},
+               {0, NULL, NULL, NULL}
+       };
+       
+       static EnumPropertyItem openexr_codec_items[] = {
+               {0, "NONE",  "None",           ""},
+               {1, "PXR24", "Pxr24 (lossy)",  ""},
+               {2, "ZIP",   "ZIP (lossless)", ""},
+               {3, "PIZ",   "PIX (lossless)", ""},
+               {4, "RLE",   "RLE (lossless)", ""},
+               {0, NULL, NULL, NULL}
+       };
+       
        srna = def_node(brna, id);
        
-       /* TODO. */
+       RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage");
        
-}
-
-static void def_cmp_texture(BlenderRNA *brna, int id)
-{
-       StructRNA *srna;
-       PropertyRNA *prop;
+       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", "");
        
-       srna = def_node(brna, id);
+       prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "imtype");
+       RNA_def_property_enum_items(prop, type_items);
+       RNA_def_property_ui_text(prop, "Type", "");
        
-       /* TODO. */
+       /* TODO: openexr only { */
        
+       prop = RNA_def_property(srna, "half", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
+       RNA_def_property_ui_text(prop, "Half", "");
+       
+       prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "codec");
+       RNA_def_property_enum_items(prop, openexr_codec_items);
+       RNA_def_property_ui_text(prop, "Codec", "");
+       
+       /* } else { */
+       
+       prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "quality");
+       RNA_def_property_ui_text(prop, "Quality", "");
+       
+       /* } */
+       
+       prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "sfra");
+       RNA_def_property_ui_text(prop, "Start Frame", "");
+       
+       prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "efra");
+       RNA_def_property_ui_text(prop, "End Frame", "");
+       
 }
 
 static void def_cmp_dilate_erode(BlenderRNA *brna, int id)
@@ -645,7 +760,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem space_items[] ={
+       static EnumPropertyItem space_items[] = {
                {0, "RELATIVE",   "Relative",   ""},
                {1, "ABSOLUTE",   "Absolute",   ""},
                {2, "SCENE_SIZE", "Scene Size", ""},
@@ -665,7 +780,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem color_space_items[] ={
+       static EnumPropertyItem color_space_items[] = {
                {1, "RGB", "RGB",   ""},
                {2, "HSV", "HSV",   ""},
                {3, "YUV", "YUV",   ""},
@@ -707,7 +822,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem channel_items[] ={
+       static EnumPropertyItem channel_items[] = {
                {1, "R", "Red",   ""},
                {2, "G", "Green", ""},
                {3, "B", "Blue",  ""},
@@ -768,7 +883,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem color_space_items[] ={
+       static EnumPropertyItem color_space_items[] = {
                {1, "RGB", "RGB",   ""},
                {2, "HSV", "HSV",   ""},
                {3, "YUV", "YUV",   ""},
@@ -809,7 +924,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem axis_items[] ={
+       static EnumPropertyItem axis_items[] = {
                {0, "X",  "X",     ""},
                {1, "Y",  "Y",     ""},
                {2, "XY", "X & Y", ""},
@@ -829,7 +944,7 @@
        StructRNA *srna;
        PropertyRNA *prop;
        
-       static EnumPropertyItem axis_items[] ={
+       static EnumPropertyItem axis_items[] = {
                {0, "X",  "X",     ""},
                {1, "Y",  "Y",     ""},
                {0, NULL, NULL, NULL}
@@ -878,14 +993,14 @@
        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"},

@@ 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