Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-08-10 10:27:05 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-08-10 12:37:03 +0300
commit182edd4c35c24f809c80674a0dbb9e6a5e3574bc (patch)
tree2254b668f01846ce81a0b72b6d0000e76d31b2a2 /release
parent76d52cbcb42381d2ceb71f6aacbf6753906e01d0 (diff)
Fix T89284: Greasepencil top bar draw tool settings missing
Caused by {rBe3faef686d38}. Error was getting the preview [which wasnt there yet] These only appeared once the material tab in the Properties Editor was used (since this ensured a valid preview icon). Above commit changed behavior for RNA icon getter (this does not create data anymore), so ensure the preview by hand here. Maniphest Tasks: T89284 Differential Revision: https://developer.blender.org/D12178
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index ad963396022..c038f5f906a 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1141,14 +1141,15 @@ def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props)
if not gp_settings.use_material_pin:
ma = context.object.active_material
icon_id = 0
- if ma and ma.id_data.preview:
- icon_id = ma.id_data.preview.icon_id
- txt_ma = ma.name
- maxw = 25
- if len(txt_ma) > maxw:
- txt_ma = txt_ma[:maxw - 5] + '..' + txt_ma[-3:]
- else:
- txt_ma = ""
+ txt_ma = ""
+ if ma:
+ ma.id_data.preview_ensure()
+ if ma.id_data.preview:
+ icon_id = ma.id_data.preview.icon_id
+ txt_ma = ma.name
+ maxw = 25
+ if len(txt_ma) > maxw:
+ txt_ma = txt_ma[:maxw - 5] + '..' + txt_ma[-3:]
sub = row.row()
sub.ui_units_x = 8