1 # SPDX-License-Identifier: GPL-2.0-or-later
4 "name": "Scalable Vector Graphics (SVG) 1.1 format",
5 "author": "JM Soler, Sergey Sharybin",
7 "location": "File > Import > Scalable Vector Graphics (.svg)",
8 "description": "Import SVG as curves",
10 "doc_url": "{BLENDER_MANUAL_URL}/addons/import_export/curve_svg.html",
11 "support": 'OFFICIAL',
12 "category": "Import-Export",
16 # To support reload properly, try to access a package var,
17 # if it's there, reload everything
20 if "import_svg" in locals():
21 importlib
.reload(import_svg
)
25 from bpy
.props
import StringProperty
26 from bpy_extras
.io_utils
import ImportHelper
29 class ImportSVG(bpy
.types
.Operator
, ImportHelper
):
31 bl_idname
= "import_curve.svg"
32 bl_label
= "Import SVG"
36 filter_glob
: StringProperty(default
="*.svg", options
={'HIDDEN'})
38 def execute(self
, context
):
39 from . import import_svg
41 return import_svg
.load(self
, context
, filepath
=self
.filepath
)
44 def menu_func_import(self
, context
):
45 self
.layout
.operator(ImportSVG
.bl_idname
,
46 text
="Scalable Vector Graphics (.svg)")
50 bpy
.utils
.register_class(ImportSVG
)
52 bpy
.types
.TOPBAR_MT_file_import
.append(menu_func_import
)
56 bpy
.utils
.unregister_class(ImportSVG
)
58 bpy
.types
.TOPBAR_MT_file_import
.remove(menu_func_import
)
61 # - blender version is hardcoded
63 if __name__
== "__main__":