forked from bartvdbraak/blender
Fix T42311, too many paint slots added.
Don't allow the add paint slot operator to redo. Also guard better against excessive slot addition
This commit is contained in:
parent
50cb62a3a0
commit
abb266973d
@ -5086,10 +5086,9 @@ static bool proj_paint_add_slot(bContext *C, wmOperator *op)
|
|||||||
ima = mtex->tex->ima = proj_paint_image_create(op, bmain);
|
ima = mtex->tex->ima = proj_paint_image_create(op, bmain);
|
||||||
}
|
}
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
|
|
||||||
}
|
|
||||||
WM_event_add_notifier(C, NC_TEXTURE | NA_ADDED, mtex->tex);
|
WM_event_add_notifier(C, NC_TEXTURE | NA_ADDED, mtex->tex);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ima) {
|
if (ima) {
|
||||||
BKE_texpaint_slot_refresh_cache(scene, ma);
|
BKE_texpaint_slot_refresh_cache(scene, ma);
|
||||||
@ -5160,7 +5159,7 @@ void PAINT_OT_add_texture_paint_slot(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_region_view3d_active;
|
ot->poll = ED_operator_region_view3d_active;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_UNDO;
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
prop = RNA_def_enum(ot->srna, "type", layer_type_items, 0, "Type", "Merge method to use");
|
prop = RNA_def_enum(ot->srna, "type", layer_type_items, 0, "Type", "Merge method to use");
|
||||||
|
Loading…
Reference in New Issue
Block a user