update plugins
This commit is contained in:
24
3rdparty/plugins/com_github_30350n_pcb2blender/__init__.py
vendored
Normal file
24
3rdparty/plugins/com_github_30350n_pcb2blender/__init__.py
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pcbnew, wx
|
||||
|
||||
from .export import export_pcb3d, get_boarddefs
|
||||
from .ui import SettingsDialog
|
||||
|
||||
class Pcb2BlenderExporter(pcbnew.ActionPlugin):
|
||||
def defaults(self):
|
||||
self.name = "Export to Blender (.pcb3d)"
|
||||
self.category = "Export"
|
||||
self.show_toolbar_button = True
|
||||
self.icon_file_name = (
|
||||
Path(__file__).parent / "images" / "blender_icon_32x32.png").as_posix()
|
||||
self.description = "Export 3D Model to Blender."
|
||||
|
||||
def Run(self):
|
||||
board = pcbnew.GetBoard()
|
||||
boarddefs, ignored = get_boarddefs(board)
|
||||
with SettingsDialog(None, boarddefs, ignored) as dialog:
|
||||
if dialog.ShowModal() == wx.OK:
|
||||
export_pcb3d(dialog.file_picker.GetPath(), boarddefs)
|
||||
|
||||
Pcb2BlenderExporter().register()
|
Reference in New Issue
Block a user