Metainformationen zur Seite
  •  

Dies ist eine alte Version des Dokuments!


Cura Plugin erstellen

Grundgerüst

Im einem Ordner Pluginname sind mindestens folgende Dateien anzulegen:

  • init.py
  • Pluginname.py
  • plugin.json

Bei Pluginname ist auf Groß-/Klein-schreibung zu achten.

Pluginname.py
  1. from UM.Extension import Extension #The PluginObject we're going to extend.
  2. from UM.Logger import Logger #Adding messages to the log.
  3. from UM.PluginRegistry import PluginRegistry #get location of
  4.  
  5. class Pluginname(Extension):
  6. def __init__(self):
  7. super().__init__()
  8.  
  9. self.setMenuName("Pluginname")
  10.  
  11. self.addMenuItem("Do It", self.doSomething)
  12.  
  13.  
  14. def doSomething(self):
  15.  
  16. # do something
__init__.py
  1. from . import Pluginname
  2.  
  3. def getMetaData():
  4. return {}
  5.  
  6. def register(app):
  7. return {"extension": Pluginname.Pluginname()}
plugin.json
  1. {
  2. "name": "My Cura Plugin", # mandatory, name of the plugin
  3. "author": "me", # mandatory, author name
  4. "version": "1.0.0", # mandatory, version of the plugin
  5. "supported_sdk_versions": ["7.6.0", "7.7.0", "7.8.0"], # mandatory, this is a list of Cura SDK versions this plugin supports.
  6. "description": "My Cura plugin." # mandatory, description of the plugin
  7. "i18n-catalog":"cura"
  8. }

Links

Artikel Info
Stand
Entwurf/Konzept
Version22.0102
Kategorien

Anleitung

,

FDM-Druck

,

Programmieren

Programmiersprache
ProgrammiersprachePython
Version3.8

Diskussion

Geben Sie Ihren Kommentar ein. Wiki-Syntax ist zugelassen: