Fix #130998: Crash changing Color Palette in Object/Edit/Pose modes
Caused by7b0ea0f1b4By default, Color Palettes are only drawn in the UI in the context of **painting**. UI button code then tries to update an appropriate brush from edits to the palette. In the report though, a palette was created and displayed via python, making changes in Object/Edit/Pose would then crash. So a valid `Paint` and `Brush` were assumed. `Paint` was already checked for ina324a19f1b, but since7b0ea0f1b4, `Paint`(if we actually have it, e.g.from `ImagePaintSettings` [seea324a19f1b]) only has its `brush` set once we enter texturepaint once. Solved by checking we have a valid Brush in corresponding UI code to begin with. Pull Request: https://projects.blender.org/blender/blender/pulls/131031
This commit is contained in:
committed by
Philipp Oeser
parent
953c4f1599
commit
5aa95941d1
@@ -6503,7 +6503,10 @@ static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, co
|
||||
if (paint != nullptr) {
|
||||
Brush *brush = BKE_paint_brush(paint);
|
||||
|
||||
if (brush->flag & BRUSH_USE_GRADIENT) {
|
||||
if (brush == nullptr) {
|
||||
/* Pass. */
|
||||
}
|
||||
else if (brush->flag & BRUSH_USE_GRADIENT) {
|
||||
float *target = &brush->gradient->data[brush->gradient->cur].r;
|
||||
|
||||
if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
|
||||
|
||||
Reference in New Issue
Block a user