Addons
Contents |
Introduction
The Lightforge API allows you to create new tools, new input and output methods, automate complex operations, and much more.
Lightforge addons are written in IronPython. IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. It allows you to use both .Net and Python libraries and allows very tight integration between Lightforge and addons. For more information on IronPython you can visit [1]. For more information on Python in general you can visit [2].
Your First Addon
To create an addon go to Addon Menu and click Addon Settings. You will find a button labeled Addon Folder. Clicking this will open up the Lightforge addon folder.
In this folder create a new folder named "Hello World".
Open the Hello World folder and create a new file named base.py. Open this file with your preferred Python editor, or Notepad if you have none.
Type the code:
onExecute(): print("Hello World!")
Save the script, and return to Lightforge.
In the Addon Settings dialog click "Reload Addons", and if all went well, your addon will appear.
Click the check box next to the Hello World addon to enable it, then close the Addon Settings Dialog.
In the Addon menu the Hello World addon should be visible. Clicking on it will run the addon.
Now In the window
Structure
The file structure of a Lightforge addon is very simple. It consists of a folder with at least one required script file named base.py, and optionally a xml file named addonInfo.xml.
base.py
This is the entry point for your addon. It's the script file that Lightforge interacts with directly.
addonInfo.xml
This xml file gives Lightforge additional information about your addon. This info will appear in the Addon Settings panel.
The addonInfo.xml file can contain the following information:
Author
The author of the addon.
Version
The current version number.
Website
A website associated with this addon.
Support
An email address or website for providing addon support.
XML Structure
<addonInfo> <author>Visual Sorcery</author> <version>1.0.0</version> <website>http://www.visualsorcery.com/</website> <support>support@visualsorcery.com</support> </addonInfo>
Classes
API
This class contains all access for working with Lightforge. API
Addon
This class gives you access to information about your addon. Addon