Page MenuHome

GPencil: Use default material when slot material is empty
ClosedPublic

Authored by Antonio Vazquez (antoniov) on Aug 29 2019, 1:59 PM.

Details

Summary

When a material slot is empty, the default material is used.

The default color used is Gray to get a good contrast in dense scenes.

Examples:

Diff Detail

Repository
rB Blender

Event Timeline

  • Cleanup: Rename function

I haven't tried, but overall the code seems fine.

This revision is now accepted and ready to land.Aug 29 2019, 2:18 PM
Matias Mendiola (mendio) requested changes to this revision.EditedAug 29 2019, 2:58 PM

My main concern with this solution is that when you add a Blank Grease Pencil object, you are drawing with a pink material by default
In my opinion the default material should be Black for Grease Pencil.

If you want to see exactly what material is missing you can use the material list.

This revision now requires changes to proceed.Aug 29 2019, 2:58 PM
Brecht Van Lommel (brecht) requested changes to this revision.Aug 29 2019, 3:04 PM

I don't understand why this is making all kinds of changes outside of the drawing code. Why isn't this more similar to the previous patch, and using the default material for drawing only?

source/blender/editors/gpencil/gpencil_data.c
540โ€“542

You can't assign a default material to a mesh.

540โ€“542

*to an object.

1531

You can't do depsgraph updates for a default material.

  • GPencil: Fix revision errors and change default color to Black

I have fixed the review comment and set the default color to black.

About default color in black I have a totally opposite opinion. When you are drawing with GPencil, the more logic color to use is black, so if you add more colors(materials) to your drawing and you delete one of them and the "wrong" strokes get black, you cannot see it in the viewport. The second reason is the list of materials in meshes are usually shorter than GPencil list of materials, so it's easy to don't see the wrong material in the list. My understanding is Blender 2.80 tries to focus all work in the viewport and here we are forcing the user to look at the material panel (not visible in full screen drawing mode).

About default color pink when you add a blank grease pencil, really drawing without adding a material is a mistake and the system "would" warning about that. In mesh the material is used for rendering, but in GPencil, the material is used to manage the scene with a lot of operator that don't exist in meshes... if we leave the users to make drawings without materials, we encourage them to do the things in the wrong way. IMHO, the logic would be to show pink as a notice of "you are missing something important".

Of course, when I talk of pink color, this could be changed to anything with high contrast in drawings, but for me Black is the worst of the options.

Same example with default material in Pink and Black... not too hard to choose where you see better the problems in your file...

I have fixed the review comment and set the default color to black.

About default color in black I have a totally opposite opinion. When you are drawing with GPencil, the more logic color to use is black, so if you add more colors(materials) to your drawing and you delete one of them and the "wrong" strokes get black, you cannot see it in the viewport. The second reason is the list of materials in meshes are usually shorter than GPencil list of materials, so it's easy to don't see the wrong material in the list. My understanding is Blender 2.80 tries to focus all work in the viewport and here we are forcing the user to look at the material panel (not visible in full screen drawing mode).

About default color pink when you add a blank grease pencil, really drawing without adding a material is a mistake and the system "would" warning about that. In mesh the material is used for rendering, but in GPencil, the material is used to manage the scene with a lot of operator that don't exist in meshes... if we leave the users to make drawings without materials, we encourage them to do the things in the wrong way. IMHO, the logic would be to show pink as a notice of "you are missing something important".

Of course, when I talk of pink color, this could be changed to anything with high contrast in drawings, but for me Black is the worst of the options.

Each solution has its pros and cons, I'd love to hear @Daniel Martinez Lara (pepeland) opinion to this point

Two more things:

  1. when you create a new Grease Pencil object there is no materials in the list and all the strokes are using the default material, if you create a new material all the strokes using the default material should be linked with this new first created material.
  1. When you delete an empty slot material, all the strokes that are currently using this material should be relinked to the default material.
  • GPencil: Fix error coping default material strokes
  1. when you create a new Grease Pencil object there is no materials in the list and all the strokes are using the default material, if you create a new material all the strokes using the default material should be linked with this new first created material.
  2. When you delete an empty slot material, all the strokes that are currently using this material should be relinked to the default material.

This already works in this way.

  1. when you create a new Grease Pencil object there is no materials in the list and all the strokes are using the default material, if you create a new material all the strokes using the default material should be linked with this new first created material.

Starting with the default scene (not using 2D animation template), right now after create the first new material all the already drawn strokes keep using the default material. Could you check?

  1. When you delete an empty slot material, all the strokes that are currently using this material should be relinked to the default material.

Right now when an empty slot is deleted, the stroke using that missing material are relinked to the previous material in the list, not the deafult one

  • GPencil: Fix problems in Primitives and Fill
  • GPencil: Fix more problems with default material
  • GPencil: Fix python error when material list is empty
  • GPencil: Don't create a material when reassign slots

I think that with a Grey default material color will be enough and is coherent with the rest of Blender

  • Change default color for default material

There is one little missing feature still. If you have a slot empty and you remove the slot, the strokes of this slot are assigned to previous material as is done with other materials (filled slots). This change would require a complete redo of how the materials are assigned to strokes and really is not a big problem, so we keep it as today. If we have time in the future we could think on that, but nothing really important.

The default color seems to work well for both, dark and light backgrounds.

And it is also noticeable on colorful drawings with missing materials, its ok for me now

This revision was not accepted when it landed; it landed in state Needs Review.Aug 30 2019, 2:27 PM
This revision was automatically updated to reflect the committed changes.