diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-09-03 21:22:29 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-09-03 21:22:29 +0400 |
commit | a77e3482f227ef8dc32b64e3b64dd30dc87cb9b9 (patch) | |
tree | 6c2afb9952cc9e4ff03a559e17373b2e5606010c /source/blender/blenkernel/intern/mesh.c | |
parent | e0c7d270d944878bac16f3d19eba5a162efbbaa7 (diff) |
Saturday morning first cup of coffee hack (yeah, its a late
morning)
- fun for the whole family, boolean mesh modifier... doesn't work
with layered modifiers yet (just uses base mesh), although may
god have mercy on your soul if you want to run boolean on a
subsurf anyway
- added displistmesh_add_edges
This exposes a bug in boolean, apparently the output is somehow
random (hash on alloc'd pointer value perhaps) which is sortof
lame.
It also makes more apparent the desire for some level of control
over dep graph evaluation during editmode (at the moment dep
graph is reevaluated for a mesh object in editmode, but since
mesh changes are on editmesh other objects don't really see
any change, so it is a wasted recalc).
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 3e1e11c6950..fbd15267ead 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -952,22 +952,26 @@ void nurbs_to_mesh(Object *ob) } -void tface_to_mcol(Mesh *me) +MCol *tface_to_mcol_p(TFace *tface, int totface) { - TFace *tface; - unsigned int *mcol; + unsigned int *mcol, *mcoldata; int a; - me->mcol= MEM_mallocN(4*sizeof(int)*me->totface, "nepmcol"); - mcol= (unsigned int *)me->mcol; + mcol= mcoldata= MEM_mallocN(4*sizeof(int)*totface, "nepmcol"); - a= me->totface; - tface= me->tface; + a= totface; while(a--) { memcpy(mcol, tface->col, 16); mcol+= 4; tface++; } + + return (MCol*) mcoldata; +} + +void tface_to_mcol(Mesh *me) +{ + me->mcol = tface_to_mcol_p(me->tface, me->totface); } void mcol_to_tface(Mesh *me, int freedata) |