diff options
author | Joseph Eagar <joeedh@gmail.com> | 2011-04-15 05:19:13 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2011-04-15 05:19:13 +0400 |
commit | c98148a963d37fc2f25e125afeb4cf21df6fbf14 (patch) | |
tree | 691a051e27f08e35bf09d35b6fb9c88e4c37b8d2 /source/blender/editors/mesh | |
parent | 0bba684d08952d0be822f3906ffb2a03b2674cc2 (diff) | |
parent | fa63c297753636c149fbb1a3877d9b3d93601357 (diff) |
=bmesh= merge from trunk at r36153
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/mesh/editface.c | 15 | ||||
-rwxr-xr-x | source/blender/editors/mesh/knifetool.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/loopcut.c | 5 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 19 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_intern.h | 7 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 7 | ||||
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 5 |
8 files changed, 47 insertions, 14 deletions
diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index 2295cca29a9..1581c91ab04 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -32,6 +32,7 @@ set(INC ../../windowmanager ../../render/extern/include ../../../../intern/guardedalloc + ${GLEW_INCLUDE_PATH} ) set(SRC diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index c692466a1ef..ed09eb9c4c4 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -25,6 +25,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/mesh/editface.c + * \ingroup edmesh + */ + + #include <math.h> #include <string.h> @@ -169,7 +174,7 @@ void paintface_hide(Object *ob, const int unselected) int a; me= get_mesh(ob); - if(me==0 || me->totpoly==0) return; + if(me==NULL || me->totpoly==0) return; mface= me->mpoly; a= me->totpoly; @@ -198,7 +203,7 @@ void paintface_reveal(Object *ob) int a; me= get_mesh(ob); - if(me==0 || me->totpoly==0) return; + if(me==NULL || me->totpoly==0) return; mface= me->mpoly; a= me->totpoly; @@ -329,7 +334,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, short UNUSED(mval[ unsigned int index=0; me = get_mesh(ob); - if(me==0 || me->totpoly==0) return; + if(me==NULL || me->totpoly==0) return; if (mode==0 || mode==1) { // XXX - Causes glitches, not sure why @@ -352,7 +357,7 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags) int a; me= get_mesh(ob); - if(me==0) return; + if(me==NULL) return; if(action == SEL_INVERT) { mface= me->mpoly; @@ -457,7 +462,7 @@ static float edgetag_cut_cost(BMEditMesh *em, int e1, int e2, int vert) sub_v3_v3v3(d1, v->co, v1->co); sub_v3_v3v3(d2, v2->co, v->co); - cost = cost + 0.5f*cost*(2.0f - fabs(d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2])); + cost = cost + 0.5f*cost*(2.0f - fabsf(d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2])); return cost; } diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c index abb22f56cbb..5c36d548bff 100755 --- a/source/blender/editors/mesh/knifetool.c +++ b/source/blender/editors/mesh/knifetool.c @@ -406,6 +406,7 @@ static void knife_edge_append_face(knifetool_opdata *kcd, KnifeEdge *kfe, BMFace BLI_addtail(&kfe->faces, ref); } +#if 0 static void knife_copy_edge_facelist(knifetool_opdata *kcd, KnifeEdge *dest, KnifeEdge *source) { Ref *ref, *ref2; @@ -424,6 +425,7 @@ static void knife_copy_edge_facelist(knifetool_opdata *kcd, KnifeEdge *dest, Kni BLI_addtail(&dest->faces, ref); } } +#endif static void knife_add_single_cut(knifetool_opdata *kcd) { diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 3304fdd87a0..bc6480e26d0 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/mesh/loopcut.c + * \ingroup edmesh + */ + + #include <float.h> #define _USE_MATH_DEFINES #include <math.h> diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 0ae3076170c..640fcd55d3a 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/mesh/mesh_data.c + * \ingroup edmesh + */ + + #include <math.h> #include <stdlib.h> #include <string.h> @@ -584,7 +589,7 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges) if(calc_edges || (mesh->totface && mesh->totedge == 0)) BKE_mesh_calc_edges(mesh, calc_edges); - mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL); + mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly, NULL, NULL, 0, NULL, NULL); DAG_id_tag_update(&mesh->id, 0); WM_event_add_notifier(C, NC_GEOM|ND_DATA, mesh); @@ -620,15 +625,15 @@ static void mesh_add_verts(Mesh *mesh, int len) mesh->totvert= totvert; } -void ED_mesh_transform(Mesh *me, float *mat) +void ED_mesh_transform(Mesh *mesh, float *mat) { int i; - MVert *mvert= me->mvert; + MVert *mvert= mesh->mvert; - for(i= 0; i < me->totvert; i++, mvert++) + for(i= 0; i < mesh->totvert; i++, mvert++) mul_m4_v3((float (*)[4])mat, mvert->co); - mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); + mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly, NULL, NULL, 0, NULL, NULL); } static void mesh_add_edges(Mesh *mesh, int len) @@ -737,8 +742,8 @@ void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count) mesh_add_verts(mesh, count); } -void ED_mesh_calc_normals(Mesh *me) +void ED_mesh_calc_normals(Mesh *mesh) { - mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); + mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly, NULL, NULL, 0, NULL, NULL); } diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 14ddd235a4b..3af641c222d 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/mesh/mesh_intern.h + * \ingroup edmesh + */ + + /* Internal for editmesh_xxxx.c functions */ #ifndef MESH_INTERN_H @@ -98,7 +103,7 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge * extern void free_editvert(EditMesh *em, EditVert *eve); extern void free_editedge(EditMesh *em, EditEdge *eed); -extern void free_editface(EditMesh *em, EditFace *efa);; +extern void free_editface(EditMesh *em, EditFace *efa); /*frees dst mesh, then copies the contents of *src (the struct) to dst. */ diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index d0ee4f78fd8..bb6169eab72 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/mesh/mesh_ops.c + * \ingroup edmesh + */ + + #include <stdlib.h> #include <math.h> @@ -280,7 +285,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); - //WM_keymap_add_item(keymap, "MESH_OT_sort_faces", FKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); + WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index d84507267a8..9d83e956c0c 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/mesh/meshtools.c + * \ingroup edmesh + */ + + /* meshtools.c: no editmode (violated already :), tools operating on meshes */ |