chsh2 / nijiGPen

An add-on of Blender focusing on Grease Pencil
GNU General Public License v3.0
290 stars 13 forks source link

Fix: 'NoneType' object has no attribute 'grease_pencil' during mesh generation #45

Closed JonasDichelle closed 9 months ago

JonasDichelle commented 9 months ago

Encountered an issue where mesh generation would fail with the error: 'NoneType' object has no attribute 'grease_pencil'. This was caused by attempting to access grease_pencil from a non-existent material.

I added a simple check to ensure the material exists before attempting to access its grease_pencil attribute.

chsh2 commented 9 months ago

Thank you for the fix! I found the same issue recently and added the check of empty material slots in some functions. However, I forgot to update this function.