Revision: 17591 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17591 Author: jesterking Date: 2008-11-27 01:23:22 +0100 (Thu, 27 Nov 2008)
Log Message: ----------- * add beginning of Material RNA and Nodetree+Node RNA Modified Paths: -------------- branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c Added Paths: ----------- branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h =================================================================== --- branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h 2008-11-26 23:57:44 UTC (rev 17590) +++ branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h 2008-11-27 00:23:22 UTC (rev 17591) @@ -41,7 +41,6 @@ struct MTex; struct Ipo; -struct Material; struct ColorBand; struct Group; struct bNodeTree; Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c =================================================================== --- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c 2008-11-26 23:57:44 UTC (rev 17590) +++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c 2008-11-27 00:23:22 UTC (rev 17591) @@ -862,6 +862,8 @@ {"rna_ID.c", RNA_def_ID}, {"rna_main.c", RNA_def_main}, {"rna_mesh.c", RNA_def_mesh}, + {"rna_nodetree.c", RNA_def_nodetree}, + {"rna_material.c", RNA_def_material}, {"rna_object.c", RNA_def_object}, {"rna_rna.c", RNA_def_rna}, {"rna_scene.c", RNA_def_scene}, Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h =================================================================== --- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h 2008-11-26 23:57:44 UTC (rev 17590) +++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h 2008-11-27 00:23:22 UTC (rev 17591) @@ -85,6 +85,8 @@ void RNA_def_main(struct BlenderRNA *brna); void RNA_def_mesh(struct BlenderRNA *brna); void RNA_def_object(struct BlenderRNA *brna); +void RNA_def_nodetree(struct BlenderRNA *brna); +void RNA_def_material(struct BlenderRNA *brna); void RNA_def_rna(struct BlenderRNA *brna); void RNA_def_scene(struct BlenderRNA *brna); void RNA_def_wm(struct BlenderRNA *brna); Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c =================================================================== --- branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c 2008-11-26 23:57:44 UTC (rev 17590) +++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c 2008-11-27 00:23:22 UTC (rev 17591) @@ -79,12 +79,16 @@ rna_iterator_listbase_begin(iter, &bmain->mball, NULL); } +#endif + static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain= (Main*)ptr->data; rna_iterator_listbase_begin(iter, &bmain->mat, NULL); } +#if 0 + static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain= (Main*)ptr->data; @@ -177,12 +181,16 @@ rna_iterator_listbase_begin(iter, &bmain->action, NULL); } +#endif + static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain= (Main*)ptr->data; rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL); } +#if 0 + static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain= (Main*)ptr->data; @@ -211,14 +219,15 @@ const char *lists[][5]= { {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks."}, {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks."}, + {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks."}, + {"nodetrees", "bNodeTree", "rna_Main_nodetree_begin", "Node Trees", "Nodetree datablocks."}, {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks."}, {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks."}, {"windowmanagers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks."}, {NULL, NULL, NULL, NULL, NULL}, {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks."}, {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks."}, - {"metaballs", "MBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks."}, - {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks."}, + {"metaballs", "MBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks."}, {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks."}, {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks."}, {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks."}, @@ -234,7 +243,6 @@ {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks."}, {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks."}, {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks."}, - {"nodegroups", "NodeGroup", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks."}, {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks."}, {"particles", "Particle", "rna_Main_particle_begin", "Particles", "Particle datablocks."}, {NULL, NULL, NULL, NULL, NULL}}; Added: branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c =================================================================== --- branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c (rev 0) +++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c 2008-11-27 00:23:22 UTC (rev 17591) @@ -0,0 +1,76 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Blender Foundation (2008), Nathan Letwory + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <stdlib.h> + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#include "DNA_material_types.h" + +#ifdef RNA_RUNTIME + +#else + +void RNA_def_material(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem prop_type_items[] = { + {MA_RGB, "RGB", "RGB", ""}, + {MA_CMYK, "CMYK", "CMYK", ""}, + {MA_YUV, "YUV", "YUV", ""}, + {MA_HSV, "HSV", "HSV", ""}, + {0, NULL, NULL, NULL}}; + + srna= RNA_def_struct(brna, "Material", "ID", "Material"); + + prop= RNA_def_property(srna, "colormodel", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_type_items); + RNA_def_property_ui_text(prop, "Color Model", "Color model."); + + prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, "Material", "r"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Color", "Diffuse color."); + RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f); + + prop= RNA_def_property(srna, "specular", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "specr"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Specular", "Specular color."); + RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f); + + prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "bNodeTree"); + RNA_def_property_ui_text(prop, "Nodetree", "Nodetree"); + +} + +#endif + + Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c =================================================================== --- branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c 2008-11-26 23:57:44 UTC (rev 17590) +++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c 2008-11-27 00:23:22 UTC (rev 17591) @@ -939,8 +939,8 @@ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); - RNA_def_property_struct_type(prop, "ID"); - RNA_def_property_ui_text(prop, "Materials", ""); + RNA_def_property_struct_type(prop, "Material"); + RNA_def_property_ui_text(prop, "Materials", "Materials"); /*prop= RNA_def_property(srna, "key", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Key", "");*/ Added: branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c =================================================================== --- branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c (rev 0) +++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c 2008-11-27 00:23:22 UTC (rev 17591) @@ -0,0 +1,62 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Blender Foundation (2008), Nathan Letwory + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <stdlib.h> + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#include "DNA_node_types.h" + +#ifdef RNA_RUNTIME + +#else + +void RNA_def_nodetree(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "bNodeTree", "ID", "Node Tree"); + + prop= RNA_def_property(srna, "Nodes", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "nodes", NULL); + RNA_def_property_struct_type(prop, "bNode"); @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs