chsh2 / nijiGPen

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

Import SVG error #33

Closed b4zz4 closed 8 months ago

b4zz4 commented 8 months ago

Blender 3.6.5 (linux)

Python: Traceback (most recent call last):
... /.config/blender/3.6/scripts/addons/nijigp/operators/operator_io_paste.py", line 51, in execute
    t_mat, inv_mat = get_transformation_mat(mode=context.scene.nijigp_working_plane, gp_obj=current_gp_obj)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
... /.config/blender/3.6/scripts/addons/nijigp/utils.py", line 217, in get_transformation_mat
    layer_rotation = gp_obj.data.layers.active.matrix_layer.to_3x3().normalized()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'matrix_layer'
chsh2 commented 8 months ago

I hope that your problem has been solved. I think I need to catch the exceptions and print some hint messages when the import goes wrong. Currently, failing to parse a file will simply make the add-on crash.