[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20625] branches/blender2.5/blender/source /blender/makesrna/intern/rna_nodetree.c: Cleaned up the node wrapping code

Robin Allen roblovski at gmail.com
Thu Jun 4 16:11:39 CEST 2009


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

Log Message:
-----------
Cleaned up the node wrapping code

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

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:55:02 UTC (rev 20624)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c	2009-06-04 14:11:39 UTC (rev 20625)
@@ -168,9 +168,8 @@
 
 /* -- Common nodes ---------------------------------------------------------- */
 
-static void def_math(BlenderRNA *brna, int id)
+static void def_math(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem items[] = {
@@ -195,17 +194,14 @@
 		{0, NULL, NULL, NULL}
 	};
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "custom1");
 	RNA_def_property_enum_items(prop, items);
 	RNA_def_property_ui_text(prop, "Operation", "");
 }
 
-static void def_vector_math(BlenderRNA *brna, int id)
+static void def_vector_math(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem items[] = {
@@ -219,47 +215,36 @@
 		{0, NULL, NULL, NULL}
 	};
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "custom1");
 	RNA_def_property_enum_items(prop, items);
 	RNA_def_property_ui_text(prop, "Operation", "");
 }
 
-static void def_rgb_curve(BlenderRNA *brna, int id)
+static void def_rgb_curve(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "storage");
 	RNA_def_property_struct_type(prop, "CurveMapping");
 	RNA_def_property_ui_text(prop, "Mapping", "");
 }
 
-static void def_vector_curve(BlenderRNA *brna, int id)
+static void def_vector_curve(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "storage");
 	RNA_def_property_struct_type(prop, "CurveMapping");
 	RNA_def_property_ui_text(prop, "Mapping", "");
 }
 
-static void def_time(BlenderRNA *brna, int id)
+static void def_time(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "storage");
 	RNA_def_property_struct_type(prop, "CurveMapping");
@@ -274,13 +259,10 @@
 	RNA_def_property_ui_text(prop, "End Frame", "");
 }
 
-static void def_val_to_rgb(BlenderRNA *brna, int id)
+static void def_val_to_rgb(StructRNA *srna)
 {
-	StructRNA *srna;
 	/*PropertyRNA *prop;*/
 	
-	srna = def_node(brna, id);
-	
 	/* 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");
@@ -288,9 +270,8 @@
 	RNA_def_property_ui_text(prop, "Color Band", "");*/
 }
 
-static void def_mix_rgb(BlenderRNA *brna, int id)
+static void def_mix_rgb(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem blend_type_items[] = {
@@ -313,8 +294,6 @@
 		{0, NULL, NULL, NULL}
 	};
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "custom1");
 	RNA_def_property_enum_items(prop, blend_type_items);
@@ -325,13 +304,10 @@
 	RNA_def_property_ui_text(prop, "Diffuse", "Include alpha of second input in this operation");
 }
 
-static void def_texture(BlenderRNA *brna, int id)
+static void def_texture(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "id");
 	RNA_def_property_struct_type(prop, "Texture");
@@ -346,13 +322,10 @@
 
 /* -- Shader Nodes ---------------------------------------------------------- */
 
-static void def_sh_material(BlenderRNA *brna, int id)
+static void def_sh_material(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 
-	srna = def_node(brna, id);
-
 	prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "id");
 	RNA_def_property_struct_type(prop, "Material");
@@ -372,25 +345,20 @@
 	RNA_def_property_ui_text(prop, "Invert Normal", "Material Node uses inverted normal");
 }
 
-static void def_sh_mapping(BlenderRNA *brna, int id)
+static void def_sh_mapping(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "storage");
 	RNA_def_property_struct_type(prop, "TexMapping");
 	RNA_def_property_ui_text(prop, "Mapping", "");
 }
 
-static void def_sh_geometry(BlenderRNA *brna, int id)
+static void def_sh_geometry(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
-	srna = def_node(brna, id);
 	RNA_def_struct_sdna_from(srna, "NodeGeometry", "storage");
 	
 	prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
@@ -405,13 +373,10 @@
 
 /* -- Compositor Nodes ------------------------------------------------------ */
 
-static void def_cmp_alpha_over(BlenderRNA *brna, int id)
+static void def_cmp_alpha_over(StructRNA *srna)
 {
-	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");
@@ -423,9 +388,8 @@
 	RNA_def_property_ui_text(prop, "Premul", "Mix Factor");
 }
 
-static void def_cmp_blur(BlenderRNA *brna, int id)
+static void def_cmp_blur(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem filter_type_items[] = {
@@ -440,7 +404,6 @@
 		{0, NULL, NULL, NULL}
 	};
 
-	srna = def_node(brna, id);
 	RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage");
 	
 	prop = RNA_def_property(srna, "sizex", PROP_INT, PROP_NONE);
@@ -503,9 +466,8 @@
 	
 }
 
-static void def_cmp_filter(BlenderRNA *brna, int id)
+static void def_cmp_filter(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 
 	static EnumPropertyItem type_items[] = {
@@ -519,20 +481,16 @@
 		{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_map_value(BlenderRNA *brna, int id)
+static void def_cmp_map_value(StructRNA *srna)
 {
-	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);
@@ -560,12 +518,10 @@
 	RNA_def_property_ui_text(prop, "Maximum", "");
 }
 
-static void def_cmp_vector_blur(BlenderRNA *brna, int id)
+static void def_cmp_vector_blur(StructRNA *srna)
 {
-	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);
@@ -589,9 +545,8 @@
 	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)
+static void def_cmp_image(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem type_items[] = {
@@ -602,8 +557,6 @@
 		{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");
@@ -648,13 +601,10 @@
 	
 }
 
-static void def_cmp_render_layers(BlenderRNA *brna, int id)
+static void def_cmp_render_layers(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
-	srna = def_node(brna, 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");
@@ -670,12 +620,10 @@
 	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)
+static void def_cmp_output_file(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem type_items[] = {
@@ -701,8 +649,6 @@
 		{0, NULL, NULL, NULL}
 	};
 	
-	srna = def_node(brna, id);
-	
 	RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage");
 	
 	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
@@ -740,24 +686,19 @@
 	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)
+static void def_cmp_dilate_erode(StructRNA *srna)
 {
-	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 void def_cmp_scale(BlenderRNA *brna, int id)
+static void def_cmp_scale(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem space_items[] = {
@@ -767,17 +708,14 @@
 		{0, NULL, NULL, NULL}
 	};
 	
-	srna = def_node(brna, id);
-	
 	prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "custom1");
 	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)
+static void def_cmp_diff_matte(StructRNA *srna)
 {
-	StructRNA *srna;
 	PropertyRNA *prop;
 	
 	static EnumPropertyItem color_space_items[] = {
@@ -788,8 +726,6 @@
 		{0, NULL, NULL, NULL}
 	};
 	
-	srna = def_node(brna, id);
-	

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list