Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-03 11:25:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-03 11:25:37 +0400
commitd0c54d3d0e77f0ed6b73ed5c3ac100ebd5e58660 (patch)
treee20fc4af058ed1a1dd48f0c8100c32988769b1a4 /source/blender/makesrna/intern/rna_mesh.c
parent870469ec0e49f47b61fe9bda27c4b11fdd955d6b (diff)
use set as a suffix (matches operators)
- set_frame() --> frame_set() - set_context_pointer() --> context_pointer_set() material adding works for curves and metaballs, new function to remove materials. materials.link() didnt well fit how this is used elsewhere - order matters - it can be linked more than once. - remove(material), isnt that useful since you need to manage indicies. ... use list style functions instead. materials.append(mat) / materials.pop(index)
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh.c')
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 741b5cbab81..db5a2062359 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1781,29 +1781,6 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
-/* mesh.materials */
-static void rna_def_mesh_materials(BlenderRNA *brna, PropertyRNA *cprop)
-{
- StructRNA *srna;
- // PropertyRNA *prop;
-
- FunctionRNA *func;
- PropertyRNA *parm;
-
- RNA_def_property_srna(cprop, "MeshMaterials");
- srna= RNA_def_struct(brna, "MeshMaterials", NULL);
- RNA_def_struct_sdna(srna, "Mesh");
- RNA_def_struct_ui_text(srna, "Mesh Materials", "Collection of materials");
-
- func= RNA_def_function(srna, "link", "ED_mesh_material_link");
- RNA_def_function_ui_description(func, "Add a new material to Mesh.");
- parm= RNA_def_pointer(func, "material", "Material", "", "Material to add.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
-
- /* TODO, unlink? */
-}
-
-
static void rna_def_mesh(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1951,7 +1928,7 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "");
- rna_def_mesh_materials(brna, prop);
+ RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
/* Mesh Draw Options for Edit Mode*/