This is a fairly common and troublesome problem when working with grease pencil objects.
The issue is that, at some point while you had the GP objects selected, you entered Vertex Paint
mode. Blender, assuming you were going to paint your grease pencil objects, created vertex paint data for them that now overwrites your material data for in material preview and renders.
Unfortunately (and in many cases problematically), there is no way to undo this with the default Blender interface (at least as of 2.83, and I don't believe recent versions have fixed that.)
You can, however, use a short python script to reset all your grease pencil objects.
Go to the text editor and click the + New
button at the top to create a new Text
datablock.
Use the following script, including a short function remove_vertex_paint()
that removes vertex paint data from a grease pencil object. The two lines at the end will iterate through all grease pencil objects in your blend file and remove vertex paint data from them.
import bpy
def remove_vertex_paint(gpencil: bpy.types.GreasePencil):
for layer in gpencil.layers:
for frame in layer.frames:
for stroke in frame.strokes:
stroke.vertex_color_fill = [0.0, 0.0, 0.0, 0.0]
for point in stroke.points:
point.vertex_color = [0.0, 0.0, 0.0, 0.0]
for gp in bpy.data.grease_pencils:
remove_vertex_paint(gp)
- Press the play button at the top of the text editor to run the script. Afterwards, you should be able to see your grease pencil materials in material preview and rendered mode again.
It's important to note that this will reset all grease pencil objects in your entire blend file, not just the one(s) you have selected, and not just the ones in the current scene. If you want to keep vertex paint data on some of the grease pencil objects, you need to replace the last two lines of the script and only call reset_vertex_paint()
on the objects you want to:
remove_vertex_paint(bpy.data.grease_pencils['GPencil'])
remove_vertex_paint(bpy.data.grease_pencils['GPencil.001'])
And note that the names used here are the names of the grease pencil datablocks, not the names of the objects themselves: