diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-22 21:50:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-22 21:50:29 +0400 |
commit | b4ef0c7d8d9b4197d209193743e76099cf042ec7 (patch) | |
tree | 4f2951f73c5e6744ce8dba9fe8b5bee81e6dbecf /source | |
parent | abb49829ef6bdc7385e51a00a3e2d5402dc09155 (diff) |
minor fixes for merge of soc-2009-kazanbas, rev23422
- Use CTX_data_main(C) over G.main
- no need to define object_type_items inline.
- rna_mesh.c - dynamic length array was commented out, not sure why this was needed. Povray and PLY scripts rely on faces having 3/4 verts rather then checking the 4th index is 0 (ok in C, not nice in py).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 5 |
4 files changed, 7 insertions, 19 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 2c20e4a147c..26bee09c925 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4679,6 +4679,7 @@ int EdgeLoopDelete(EditMesh *em, wmOperator *op) // DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return 1; #endif + return 0; } diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 9d42c473f50..379cf75d450 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -31,6 +31,7 @@ #include "RNA_define.h" #include "RNA_types.h" +#include "RNA_enum_types.h" #include "DNA_object_types.h" #include "DNA_material_types.h" @@ -135,21 +136,6 @@ void RNA_api_main(StructRNA *srna) FunctionRNA *func; PropertyRNA *parm; - /* copied from rna_def_object */ - static EnumPropertyItem object_type_items[] = { - {OB_EMPTY, "EMPTY", 0, "Empty", ""}, - {OB_MESH, "MESH", 0, "Mesh", ""}, - {OB_CURVE, "CURVE", 0, "Curve", ""}, - {OB_SURF, "SURFACE", 0, "Surface", ""}, - {OB_FONT, "TEXT", 0, "Text", ""}, - {OB_MBALL, "META", 0, "Meta", ""}, - {OB_LAMP, "LAMP", 0, "Lamp", ""}, - {OB_CAMERA, "CAMERA", 0, "Camera", ""}, - {OB_WAVE, "WAVE", 0, "Wave", ""}, - {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, - {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, - {0, NULL, 0, NULL, NULL}}; - func= RNA_def_function(srna, "add_object", "rna_Main_add_object"); RNA_def_function_ui_description(func, "Add a new object."); parm= RNA_def_enum(func, "type", object_type_items, 0, "", "Type of Object."); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index cfc1e017f3c..ecfe59a0142 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -978,13 +978,11 @@ static void rna_def_mface(BlenderRNA *brna) // XXX allows creating invalid meshes prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_sdna(prop, NULL, "v1"); RNA_def_property_array(prop, 4); - /* RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length"); RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL); - */ + RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index f809868c130..af6254a99b0 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -114,7 +114,7 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports /* nurbs_to_mesh changes the type to a mesh, check it worked */ if (tmpobj->type != OB_MESH) { - free_libblock_us( &G.main->object, tmpobj ); + free_libblock_us( &(CTX_data_main(C)->object), tmpobj ); BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?"); return NULL; } @@ -125,6 +125,9 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports case OB_MBALL: /* metaballs don't have modifiers, so just convert to mesh */ ob = find_basis_mball( sce, ob ); + /* todo, re-generatre for render-res */ + /* metaball_polygonize(scene, ob) */ + tmpmesh = add_mesh("Mesh"); mball_to_mesh( &ob->disp, tmpmesh ); break; |