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
- 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
- __init__.py
- from . import Pluginname
- def getMetaData():
- return {}
- def register(app):
- return {"extension": Pluginname.Pluginname()}
- plugin.json
- {
- "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
| Artikel Info | |
|---|---|
| Stand | In Arbeit |
| Version | 22.0102 |
| Kategorien | , , |
| Programmiersprache | |
|---|---|
| Programmiersprache | Python |
| Version | 3.8 |
Diskussion