API structuring improvements according to design guidelines by Brecht,
[blender-staging.git] / source / blender / makesrna / intern / mesh_api.c
1 #include <stdlib.h>
2
3 #include "DNA_mesh_types.h"
4 #include "DNA_scene_types.h"
5 #include "DNA_object_types.h"
6
7 #include "BLI_blenlib.h"
8
9 #include "BKE_DerivedMesh.h"
10 #include "BKE_mesh.h"
11
12
13 /*
14 void RNA_api_mesh_copy(Mesh *me, Mesh *from)
15 {
16         copy_mesh_data(me, from);
17 }
18
19 void RNA_api_mesh_copy_applied(Mesh *me, Scene *sce, Object *ob)
20 {
21         DerivedMesh *dm= mesh_create_derived_view(sce, ob, CD_MASK_MESH);
22         DM_to_mesh(dm, me);
23         dm->release(dm);
24 }
25 */
26
27 /* copied from init_render_mesh (render code) */
28 void RNA_api_mesh_make_rendermesh(Mesh *me, Scene *sce, Object *ob)
29 {
30         CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL;
31         DerivedMesh *dm= mesh_create_derived_render(sce, ob, mask);
32
33         /* XXX report reason */
34         if(dm==NULL) return;
35         
36         DM_to_mesh(dm, me);
37         dm->release(dm);
38 }
39
40 void RNA_api_mesh_transform(Mesh *me, float **mat)
41 {
42 }