chsh2 / nijiGPen

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

SVG Import from File? #2

Closed enzyme69 closed 1 year ago

enzyme69 commented 1 year ago

Is there a plan to have the SVG import from file, maybe even multiple SVG files?

Paste from Clipboard does not seem to work nicely in my cases.

Python: Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.4/scripts/addons/nijigp/operator_io_paste.py", line 50, in execute
    svg_file = open(svg_path, "w")
OSError: [Errno 30] Read-only file system: 'clipboard.svg'
chsh2 commented 1 year ago

Blender itself can import SVG files as new GPencil objects: https://docs.blender.org/manual/en/latest/files/import_export/grease_pencil_svg.html And multiple-file support is just added in 3.4: https://wiki.blender.org/wiki/Reference/Release_Notes/3.4/Grease_Pencil

This change is also a reason why the add-on does not work well with 3.4. I may wait for a stable version to decide how to modify the add-on correspondingly.

chsh2 commented 1 year ago

Blender has adopted the new API for SVG import in its stable releases since 3.3.1, which is able to import multiple files. I also changed the add-on codes to be consistent with it. I think this API is not likely to change again in short term, so this task is basically finished. I will observe it for some more time before closing the issue.