Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2007-05-03 23:39:23 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2007-05-03 23:39:23 +0400
commit4ec6f1b4e4c5fd379559691307ff776bcda8e10f (patch)
treee8a061a67722896448ec265cec6da6075cab7621 /source/blender/src/sculptmode.c
parent674f23c5361f249e28d6cf60daec6b213b0bf20b (diff)
== Sculpt Mode ==
Fixed bug #6631, Sculpt Tool don't works correctly on a mesh with Armature modifier * Modified the calculation of projected (2D) vertex locations to use deformed vertex locations when appropriate
Diffstat (limited to 'source/blender/src/sculptmode.c')
-rw-r--r--source/blender/src/sculptmode.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c
index 7c3b8b69e24..0497460ac2a 100644
--- a/source/blender/src/sculptmode.c
+++ b/source/blender/src/sculptmode.c
@@ -1497,7 +1497,7 @@ void sculptmode_selectbrush_menu(void)
}
}
-void sculptmode_update_all_projverts()
+void sculptmode_update_all_projverts(float *vertcosnos)
{
Mesh *me= get_mesh(OBACT);
unsigned i;
@@ -1505,7 +1505,7 @@ void sculptmode_update_all_projverts()
if(projverts) MEM_freeN(projverts);
projverts= MEM_mallocN(sizeof(ProjVert)*me->totvert,"ProjVerts");
for(i=0; i<me->totvert; ++i) {
- project(me->mvert[i].co, projverts[i].co);
+ project(vertcosnos ? &vertcosnos[i * 6] : me->mvert[i].co, projverts[i].co);
projverts[i].inside= 0;
}
}
@@ -1676,7 +1676,9 @@ void sculpt(void)
init_sculptmatrices();
- sculptmode_update_all_projverts();
+ if(modifier_calculations)
+ vertexcosnos= mesh_get_mapped_verts_nors(ob);
+ sculptmode_update_all_projverts(vertexcosnos);
e.grabdata= NULL;
e.layer_disps= NULL;
@@ -1699,7 +1701,7 @@ void sculpt(void)
spacing+= sqrt(pow(mvalo[0]-mouse[0],2)+pow(mvalo[1]-mouse[1],2));
- if(modifier_calculations)
+ if(modifier_calculations && !vertexcosnos)
vertexcosnos= mesh_get_mapped_verts_nors(ob);
if(G.scene->sculptdata.brush_type != GRAB_BRUSH && (sd->spacing==0 || spacing>sd->spacing)) {
@@ -1792,8 +1794,11 @@ void sculpt(void)
mvalo[0]= mouse[0];
mvalo[1]= mouse[1];
- if(modifier_calculations)
+ if(vertexcosnos) {
MEM_freeN(vertexcosnos);
+ vertexcosnos= NULL;
+ }
+
}
else BIF_wait_for_statechange();
}