From a79b06e5773eb1aef9c3cd126ddab02bec1cd37d Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Sat, 18 Apr 2020 11:37:47 +0200 Subject: [PATCH] additional changes --- __init__.py | 34 +++++++++++++++++++++++----------- import_gds.py | 5 +---- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/__init__.py b/__init__.py index 6854c55..eb5eb7b 100644 --- a/__init__.py +++ b/__init__.py @@ -26,15 +26,14 @@ from bpy.props import ( from bpy_extras.io_utils import ( ImportHelper, - ExportHelper, orientation_helper_factory, path_reference_mode, axis_conversion, ) -IOOBJOrientationHelper = orientation_helper_factory("IOOBJOrientationHelper", axis_forward='-Z', axis_up='Y') +IGDSOrientationHelper = orientation_helper_factory("IGDSOrientationHelper", axis_forward='-Z', axis_up='Y') -class ImportGDS(bpy.types.Operator, ImportHelper, IOOBJOrientationHelper): +class ImportGDS(bpy.types.Operator, ImportHelper, IGDSOrientationHelper): """Load a GDSII File""" bl_idname = "import_scene.gds" bl_label = "Import GDSII" @@ -96,16 +95,27 @@ class ImportGDS(bpy.types.Operator, ImportHelper, IOOBJOrientationHelper): # default=0.0, # ) - top_cell_name = StringProperty( - name="Top Cell Name", - #descriptionn="When set, only import the structure with that name", - default="", + gds_file = StringProperty( + name="gds file", + subtype="FILE_PATH" ) - + + top_cell_name = StringProperty( + name="Top Cell Name", + #descriptionn="When set, only import the structure with that name", + default="", + ) + + layer_definition = StringProperty( + name="Layer Def", + #descriptionn="When set, only import the structure with that name", + subtype="FILE_PATH" + ) + def execute(self, context): # print("Selected: " + context.active_object.name) from . import import_gds - from . import gds + from . import pygds as gds # ignore axis helper arguments keywords = self.as_keywords(ignore=("axis_forward", @@ -138,10 +148,12 @@ class ImportGDS(bpy.types.Operator, ImportHelper, IOOBJOrientationHelper): def draw(self, context): layout = self.layout + box = layout.box() + box.row().prop(self, "gds_file") + box.row().prop(self, "top_cell_name") row = layout.row() - row.prop(self, "top_cell_name") - + row.prop(self, "layer_definition") # row = layout.row(align=True) # row.prop(self, "use_smooth_groups") diff --git a/import_gds.py b/import_gds.py index 0e120cc..b56bfdf 100644 --- a/import_gds.py +++ b/import_gds.py @@ -1,10 +1,7 @@ -from . import gds +from . import pygds as gds from concurrent.futures import ThreadPoolExecutor import importlib -if "gds" in locals(): - gds = importlib.reload(gds) - import pathlib import bpy from bpy_extras.wm_utils.progress_report import ProgressReport