diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2009-06-28 17:29:03 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2009-06-28 17:29:03 +0400 |
commit | 1557736756b41dfa8fff4d7c887a7d6da2b1f468 (patch) | |
tree | 32da2cded80ffac6cf1623ec7a42bbdbb19f0901 /source/blender/makesrna/intern/rna_mesh_api.c | |
parent | 83a5a585e48ce9abb39e67372bd1ff400877d178 (diff) |
OBJ exporter working (Python 3.0), but needs testing and fixing.
Current issues:
- NURBS - needs API additions
- "all scenes" export - cannot switch scene in bpy
- normal calculation, disabled
- duplis - need testing, only dupliverts tested
- matrix problem
- UI, 18 options currently don't fit into filesel panel, will do manual lay out once it's available
- probably others...
BPY:
- made operator "execute" method required to avoid crash
- added bpy.sys module which replicates old "sys" module
API:
- replaced create_*_mesh with a single create_mesh accepting type parameter
- added Mesh.create_copy to create a copy of a mesh with 0 users
Ran `dos2unix` on source/blender/python/SConscript
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh_api.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 984e6a5d30f..f4bc52bc517 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -36,6 +36,8 @@ #include "BKE_customdata.h" #include "BKE_DerivedMesh.h" +#include "BKE_mesh.h" + #include "BLI_arithb.h" #include "DNA_mesh_types.h" @@ -66,6 +68,14 @@ void rna_Mesh_transform(Mesh *me, float *mat) } } +Mesh *rna_Mesh_create_copy(Mesh *me) +{ + Mesh *ret= copy_mesh(me); + ret->id.us--; + + return ret; +} + #if 0 /* extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example); */ @@ -101,6 +111,11 @@ void RNA_api_mesh(StructRNA *srna) parm= RNA_def_float_matrix(func, "matrix", 16, NULL, 0.0f, 0.0f, "", "Matrix.", 0.0f, 0.0f); RNA_def_property_flag(parm, PROP_REQUIRED); + func= RNA_def_function(srna, "create_copy", "rna_Mesh_create_copy"); + RNA_def_function_ui_description(func, "Create a copy of this Mesh datablock."); + parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh, remove it if it is only used for export."); + RNA_def_function_return(func, parm); + /* func= RNA_def_function(srna, "add_geom", "rna_Mesh_add_geom"); RNA_def_function_ui_description(func, "Add geometry data to mesh."); |