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.

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

Links

CuraAPI-and-SDK-Versions

Artikel Info
Stand	Aktualisieren
Version	22.0102
Kategorien	, ,
Programmiersprache
Programmiersprache	Python
Version	3.8