"flip -> pen_flip" missing rename on particle edit mode
[blender.git] / source / blender / editors / physics / particle_edit.c
index f463da3f6a426fdb429f7f43702e0693dcee5ca4..132533fc12314c34918ada4e51de1a3f6114c3ae 100644 (file)
@@ -3336,7 +3336,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
        RNA_float_get_array(itemptr, "mouse", mousef);
        mouse[0] = mousef[0];
        mouse[1] = mousef[1];
-       flip= RNA_boolean_get(itemptr, "flip");
+       flip= RNA_boolean_get(itemptr, "pen_flip");
 
        if(bedit->first) {
                bedit->lastmouse[0]= mouse[0];
@@ -3573,7 +3573,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event)
        RNA_collection_add(op->ptr, "stroke", &itemptr);
 
        RNA_float_set_array(&itemptr, "mouse", mouse);
-       RNA_boolean_set(&itemptr, "flip", event->shift != 0); // XXX hardcoded
+       RNA_boolean_set(&itemptr, "pen_flip", event->shift != 0); // XXX hardcoded
 
        /* apply */
        brush_edit_apply(C, op, &itemptr);
@@ -4151,6 +4151,13 @@ static int clear_edited_exec(bContext *C, wmOperator *op)
                        DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
                }
        }
+       else { /* some operation might have protected hair from editing so let's clear the flag */
+               psys->recalc |= PSYS_RECALC_RESET;
+               psys->flag &= ~PSYS_GLOBAL_HAIR;
+               psys->flag &= ~PSYS_EDITED;
+               WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
+               DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+       }
 
        return OPERATOR_FINISHED;
 }