forked from bartvdbraak/blender
Fixes to previous sculpting tweaks
undo didn't work, layer and smooth crashed..
This commit is contained in:
parent
d9a72be86e
commit
09f5dff244
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user