Fix #133326: Material preview for Grease Pencil
Material preview panel for grease pencil was accidentally removed in e10b0b3449 because it had EEVEE engine listed as `COMPAT_ENGINES`, which also seemed accidental. After adding panel back I noticed that .blend file for generating previews was also faulty. It was updated 2 years ago when GPv3 was experimental feature, and file wasn't up to date to current state.
This PR also adds new .blend file for generating material previews that is mostly the same as one in Blender 4.2, except:
- I organized it, removed unnecessary stuff.
- For Flat preview it was using flat checkerboard background, for other modes 3D room, which seemed unnecessary and not useful for Grease Pencil, so now every mode uses flat background.
- "Cloth", "Liquid", and "Shaderball" modes in 4.2 didn't render at all and resulted in all white screen. Now they render default Circle, which is not correct, but at least better than nothing. In future we can add custom drawings to those modes for previewing materials on more complex objects.
Pull Request: https://projects.blender.org/blender/blender/pulls/133372
This commit is contained in:
committed by
Falk David
parent
97d981a167
commit
693f8f37d0
Binary file not shown.
@@ -212,6 +212,15 @@ class MATERIAL_PT_gpencil_animation(GPMaterialButtonsPanel, PropertiesAnimationM
|
||||
_animated_id_context_property = "material"
|
||||
|
||||
|
||||
class MATERIAL_PT_gpencil_preview(GPMaterialButtonsPanel, Panel):
|
||||
bl_label = "Preview"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
ma = context.material
|
||||
self.layout.template_preview(ma)
|
||||
|
||||
|
||||
class MATERIAL_PT_gpencil_custom_props(GPMaterialButtonsPanel, PropertyPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_WORKBENCH'}
|
||||
_context_path = "object.active_material"
|
||||
@@ -243,6 +252,7 @@ classes = (
|
||||
GPENCIL_UL_matslots,
|
||||
GPENCIL_MT_material_context_menu,
|
||||
MATERIAL_PT_gpencil_slots,
|
||||
MATERIAL_PT_gpencil_preview,
|
||||
MATERIAL_PT_gpencil_material_presets,
|
||||
MATERIAL_PT_gpencil_surface,
|
||||
MATERIAL_PT_gpencil_strokecolor,
|
||||
|
||||
Reference in New Issue
Block a user