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-01-05 01:30:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-05 01:30:09 +0300
commite90b6eefb191693b0ffe1d5a0b1bc399fc5b0aef (patch)
tree7e8823cb3a14c16b183b66b860569acf86727dcf /source/blender/makesrna/intern/rna_mesh_api.c
parent7f03297fc8f3625bbad8ecc18d44b916536ca71f (diff)
patch from Benoit Bolsee (ben2610) for 4 bugs in report [#20527] Several bugs in RNA
from the report... # bug 1. UV properties are not raw editable but are reported # as RAW_TYPE_INT by RNA causing wrong conversion # internally (bpy_rna.c line 2205) # bug 2. raw update of UV coordinates crash blender (rna_access.c line 252) mtfaces.foreach_set("uv", rawuvs) # workaround: #for i in range(int(len(faces)/4)): # mtfaces[i].uv = uvs[i] # bug 3. raw update of non-array property fails (rna_access.c line 2270) mfaces.foreach_set("material_index", mats) # workaround: # for i in range(int(len(mfaces))): # mfaces[i].material_index = mats[i] # bug 4. It is not possible to add a vertex color layer using mesh API. me.add_vertex_color() # no workaround...
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index 52ff98f66f0..4fba65b4db8 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -43,6 +43,11 @@ static void rna_Mesh_uv_texture_add(struct Mesh *me, struct bContext *C)
ED_mesh_uv_texture_add(C, NULL, NULL, me);
}
+static void rna_Mesh_vertex_color_add(struct Mesh *me, struct bContext *C)
+{
+ ED_mesh_color_add(C, NULL, NULL, me);
+}
+
#else
void RNA_api_mesh(StructRNA *srna)
@@ -68,6 +73,10 @@ void RNA_api_mesh(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh.");
+ func= RNA_def_function(srna, "add_vertex_color", "rna_Mesh_vertex_color_add");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh.");
+
func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
RNA_def_function_ui_description(func, "Calculate vertex normals.");
@@ -79,6 +88,8 @@ void RNA_api_mesh(StructRNA *srna)
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);
+
+
}
#endif