[Bf-taskforce25] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20536] branches/blender2.5/blender/source /blender/makesrna/intern: RNA: Wrapped texture nodes, made a start on compo nodes.
joe
joeedh at gmail.com
Sun May 31 18:57:06 CEST 2009
For animating node parameters to work properly, I think we should make
it so nodes are assigned unique IDs, which can be used for resolving
RNA paths. I imagine this shouldn't be too hard.
Joe
On Sun, May 31, 2009 at 10:45 AM, Robin Allen <roblovski at gmail.com> wrote:
> Revision: 20536
> http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20536
> Author: kakbarnf
> Date: 2009-05-31 18:45:30 +0200 (Sun, 31 May 2009)
>
> Log Message:
> -----------
> RNA: Wrapped texture nodes, made a start on compo nodes.
>
> Difficult to test, because outliner no longer shows nodetree? (Just a bullet icon)
>
> 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-05-31 16:40:28 UTC (rev 20535)
> +++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c 2009-05-31 16:45:30 UTC (rev 20536)
> @@ -31,13 +31,14 @@
> #include "rna_internal.h"
>
> #include "DNA_node_types.h"
> +#include "DNA_scene_types.h"
> #include "BKE_node.h"
>
> #ifdef RNA_RUNTIME
>
> StructRNA *rna_Node_refine(struct PointerRNA *ptr)
> {
> - bNode *node= (bNode*)ptr->data;
> + bNode *node = (bNode*)ptr->data;
>
> switch(node->type) {
>
> @@ -118,7 +119,7 @@
> StructRNA *srna;
> NodeInfo *node = nodes + node_id;
>
> - srna= RNA_def_struct(brna, node->struct_name, node->base_name);
> + srna = RNA_def_struct(brna, node->struct_name, node->base_name);
> RNA_def_struct_ui_text(srna, node->ui_name, node->ui_desc);
> RNA_def_struct_sdna(srna, "bNode");
>
> @@ -191,9 +192,9 @@
> {0, NULL, NULL, NULL}
> };
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
> + 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", "");
> @@ -215,9 +216,9 @@
> {0, NULL, NULL, NULL}
> };
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
> + 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", "");
> @@ -228,9 +229,9 @@
> StructRNA *srna;
> PropertyRNA *prop;
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
> + 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", "");
> @@ -241,23 +242,44 @@
> StructRNA *srna;
> PropertyRNA *prop;
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
> + 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)
> +{
> + 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");
> + RNA_def_property_ui_text(prop, "Curve", "");
> +
> + prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
> + RNA_def_property_int_sdna(prop, NULL, "custom1");
> + 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, "custom2");
> + RNA_def_property_ui_text(prop, "End Frame", "");
> +}
> +
> static void def_val_to_rgb(BlenderRNA *brna, int id)
> {
> StructRNA *srna;
> // PropertyRNA *prop;
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> /* TODO: uncomment when ColorBand is wrapped */
> - /*prop= RNA_def_property(srna, "color_band", PROP_POINTER, PROP_NONE);
> + /*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", "");*/
> @@ -288,19 +310,37 @@
> {0, NULL, NULL, NULL}
> };
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
> + 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);
> RNA_def_property_ui_text(prop, "Blend Type", "");
>
> - prop= RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
> + prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
> RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
> RNA_def_property_ui_text(prop, "Diffuse", "Include alpha of second input in this operation");
> }
>
> +static void def_texture(BlenderRNA *brna, int id)
> +{
> + 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");
> + RNA_def_property_flag(prop, PROP_EDITABLE);
> + RNA_def_property_ui_text(prop, "Texture", "");
> +
> + prop = RNA_def_property(srna, "node_output", PROP_INT, PROP_NONE);
> + RNA_def_property_int_sdna(prop, NULL, "custom1");
> + RNA_def_property_ui_text(prop, "Node Output", "For node-based textures, which output node to use");
> +}
>
> +
> /* -- Shader Node Storage Types --------------------------------------------- */
>
> static void rna_def_storage_node_geometry(BlenderRNA *brna)
> @@ -308,14 +348,14 @@
> StructRNA *srna;
> PropertyRNA *prop;
>
> - srna= RNA_def_struct(brna, "NodeGeometry", NULL);
> + 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);
> + 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);
> + 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", "");
> }
> @@ -323,46 +363,28 @@
>
> /* -- Shader Nodes ---------------------------------------------------------- */
>
> -static void def_sh_texture(BlenderRNA *brna, int id)
> -{
> - 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");
> - RNA_def_property_flag(prop, PROP_EDITABLE);
> - RNA_def_property_ui_text(prop, "Texture", "");
> -
> - prop= RNA_def_property(srna, "node_output", PROP_INT, PROP_NONE);
> - RNA_def_property_int_sdna(prop, NULL, "custom1");
> - RNA_def_property_ui_text(prop, "Node Output", "For node-based textures, which output node to use");
> -}
> -
> static void def_sh_material(BlenderRNA *brna, int id)
> {
> StructRNA *srna;
> PropertyRNA *prop;
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
> + 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");
> RNA_def_property_flag(prop, PROP_EDITABLE);
> RNA_def_property_ui_text(prop, "Material", "");
>
> - prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
> + prop = RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
> RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_DIFF);
> RNA_def_property_ui_text(prop, "Diffuse", "Material Node outputs Diffuse");
>
> - prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
> + prop = RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
> RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_SPEC);
> RNA_def_property_ui_text(prop, "Specular", "Material Node outputs Specular");
>
> - prop= RNA_def_property(srna, "invert_normal", PROP_BOOLEAN, PROP_NONE);
> + prop = RNA_def_property(srna, "invert_normal", PROP_BOOLEAN, PROP_NONE);
> RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_NEG);
> RNA_def_property_ui_text(prop, "Invert Normal", "Material Node uses inverted normal");
> }
> @@ -372,9 +394,9 @@
> StructRNA *srna;
> PropertyRNA *prop;
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
> + 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", "");
> @@ -385,18 +407,235 @@
> StructRNA *srna;
> PropertyRNA *prop;
>
> - srna= def_node(brna, id);
> + srna = def_node(brna, id);
>
> - prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
> + 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", "");
> }
>
> +
> +/* -- Compositor Node Storage Types ----------------------------------------- */
> +
> +static void rna_def_storage_node_blur_data(BlenderRNA *brna)
> +{
> + StructRNA *srna;
> + PropertyRNA *prop;
> +
> + static EnumPropertyItem filter_type_items[] ={
> + {R_FILTER_BOX, "FLAT", "Flat", ""},
> + {R_FILTER_TENT, "TENT", "Tent", ""},
> + {R_FILTER_QUAD, "QUAD", "Quadratic", ""},
> + {R_FILTER_CUBIC, "CUBIC", "Cubic", ""},
> + {R_FILTER_GAUSS, "GAUSS", "Gaussian", ""},
> + {R_FILTER_FAST_GAUSS, "FAST_GAUSS", "Fast Gaussian", ""},
> + {R_FILTER_CATROM, "CATROM", "Catrom", ""},
> + {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", "");
> +
> + /**/
> +
> + 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", "");
> +
> + prop = RNA_def_property(srna, "sizey", PROP_INT, PROP_NONE);
> + 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);
>
> @@ Diff output truncated at 10240 characters. @@
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
More information about the Bf-taskforce25
mailing list