[Bf-blender-cvs] [09f5dff2] master: Fixes to previous sculpting tweaks
Sergey Sharybin
noreply at git.blender.org
Tue May 6 16:27:50 CEST 2014
Commit: 09f5dff244ede0a4797b2949217032aac2b8f564
Author: Sergey Sharybin
Date: Tue May 6 16:26:52 2014 +0200
https://developer.blender.org/rB09f5dff244ede0a4797b2949217032aac2b8f564
Fixes to previous sculpting tweaks
undo didn't work, layer and smooth crashed..
===================================================================
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b75387d..4a1a658 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4250,7 +4250,7 @@ static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob)
{
SculptSession *ss = ob->sculpt;
- if (ss->modifiers_active) {
+ if (ss->kb || ss->modifiers_active) {
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint);
@@ -4573,13 +4573,16 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *UNUSED(st
*
* Could be optimized later, but currently don't think it's so
* much common scenario.
- **
- ** Same applies to the DAG_id_tag_update() invoked from
+ *
+ * Same applies to the DAG_id_tag_update() invoked from
* sculpt_flush_update().
*/
- if (ss->kb || ss->modifiers_active) {
+ if (ss->modifiers_active) {
sculpt_flush_stroke_deform(sd, ob);
}
+ else if (ss->kb) {
+ sculpt_update_keyblock(ob);
+ }
ss->cache->first_time = false;
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 0560801..961a525 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -462,7 +462,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
}
if (update || rebuild) {
- int tag_update = 0;
+ bool tag_update = false;
/* we update all nodes still, should be more clever, but also
* needs to work correct when exiting/entering sculpt mode and
* the nodes get recreated, though in that case it could do all */
@@ -476,15 +476,15 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
multires_mark_as_modified(ob, MULTIRES_COORDS_MODIFIED);
}
- tag_update = ((Mesh *)ob->data)->id.us > 1;
+ tag_update |= ((Mesh *)ob->data)->id.us > 1;
- if (ss->modifiers_active) {
+ if (ss->kb || ss->modifiers_active) {
Mesh *mesh = ob->data;
BKE_mesh_calc_normals_tessface(mesh->mvert, mesh->totvert,
mesh->mface, mesh->totface, NULL);
free_sculptsession_deformMats(ss);
- tag_update |= 1;
+ tag_update |= true;
}
if (tag_update) {
More information about the Bf-blender-cvs
mailing list