1 # SPDX-FileCopyrightText: 2011-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 "name": "Scalable Vector Graphics (SVG) 1.1 format",
7 "author": "JM Soler, Sergey Sharybin",
9 "location": "File > Import > Scalable Vector Graphics (.svg)",
10 "description": "Import SVG as curves",
12 "doc_url": "{BLENDER_MANUAL_URL}/addons/import_export/curve_svg.html",
13 "support": 'OFFICIAL',
14 "category": "Import-Export",
18 # To support reload properly, try to access a package var,
19 # if it's there, reload everything
22 if "import_svg" in locals():
23 importlib
.reload(import_svg
)
27 from bpy
.props
import StringProperty
28 from bpy_extras
.io_utils
import ImportHelper
31 class ImportSVG(bpy
.types
.Operator
, ImportHelper
):
33 bl_idname
= "import_curve.svg"
34 bl_label
= "Import SVG"
38 filter_glob
: StringProperty(default
="*.svg", options
={'HIDDEN'})
40 def execute(self
, context
):
41 from . import import_svg
43 return import_svg
.load(self
, context
, filepath
=self
.filepath
)
46 def menu_func_import(self
, context
):
47 self
.layout
.operator(ImportSVG
.bl_idname
,
48 text
="Scalable Vector Graphics (.svg)")
52 bpy
.utils
.register_class(ImportSVG
)
54 bpy
.types
.TOPBAR_MT_file_import
.append(menu_func_import
)
58 bpy
.utils
.unregister_class(ImportSVG
)
60 bpy
.types
.TOPBAR_MT_file_import
.remove(menu_func_import
)
63 # - blender version is hardcoded
65 if __name__
== "__main__":