Cosmigo Pro Motion NG plugins interfaces in PureBasic.
Copyright © 2019-2021 Tristano Ajmone, MIT License.
Table of Contents
The goal of this project is to provide PureBasic boilerplates for creating Pro Motion NG plugins, starting with the file I/O interfaces and, later on, also cover the image manipulation interface (aka DDE plugin).
/PoC/
— proof of concept plugins:/tests/
— misc. modules tests.pmotion_file-io.pb
— file I/O plugin boilerplate.pmotion_file-io_barebones.pb
— file I/O plugin boilerplate, bare-bones version.mod_logger.pbi
— a developers' module that adds a log window to plugins.LICENSE
— MIT License.validate.sh
— validate code styles.
pmotion_file-io.pb
— standard boilerplate v0.0.3pmotion_file-io_barebones.pb
— bare-bones boilerplate v0.0.3
The boilerplate is a code template on top of which you can develop your custom file I/O. Although you can successfully compile the boilerplate into a DLL, it won't do anything useful unless you add to it some meaningful code (and most likely PMNG will complain about it when trying to register it, and fail to do so).
There are two versions of the boilerplate: the standard boilerplate and the bare-bones version. The former contains useful comments and macros to facilitate newbies creating their first plugins, whereas the latter is a stripped down version for those who already know their way through plugins development.
Even though the standard boilerplate source code contains some useful comments, you'll still need to study the File I/O Plugin Interface documentation in order to create a plugin. Providing such documentation is currently beyond the scope of this project — but in the future we might add to this project a plugins documentation specifically written for PureBasic.
mod_logger.pbi
— v0.0.5mod_logger.md
— module documentation.
This module provides file I/O plugins with a logger window that can be used to debug internal states and events during plugin development. The module exposes a few simple procedure to control the logger and print text to it.
For a practical example of its usage, see the "FAKE" plugin:
Currently there's only the "FAKE" plugin example, mainly intended as a proof of concept demo and a reference for developers.
Currently the project is in Alpha stage for the file I/O boilerplate hasn't been yet fully tested (although some working proof of concept plugins have already been created with it). Also, PMNG plugin interface and its documentation are undergoing some improvements. Until some demo plugins will be ready, and the whole boilerplate has been put to test, the project will remain in Alpha stage. This doesn't mean that the boilerplate is not usable, but it might still need fixes — it still provides a solid base to start from.
Right now, the difficult part is working on a boilerplate which, by itself doesn't do anything, and at the same time work on some demo plugins to test its code — which requires updating the code on all sides as the works proceeds.
For the whole duration of the Alpha development stage all commits will be in the alpha
branch, which will ultimately be squashed into master
when the first stable release is reached.
Furthermore, the Alpha branch will contain the binary DLLs of the compiled demo plugins, to compensate the lack of releases (which on GitHub allow attaching archives with precompiled binaries).
Before squashing into master
all binaries will be deleted and the project will ignore them from thereon.
To create PMNG plugins with these boilerplates you'll need the 32-bit edition of PureBasic for Windows, which is a commercial product by Fantaisie Software.
File I/O plugins must be compiled with the following settings in the PureBasic IDE (or the command line):
- Windows x86 (32 bit)
- DLL executable, non thread-safe.
Once you've compiled your plugin DLL, you only need to copy it into the plugins
subfolder in the installation directory of Pro Motion.
Depending on the bitness of your Windows operating system, the path of the plugins
folder will be either:
- 32 bit OS:
%ProgramFiles%\cosmigo\Pro Motion NG\plugins\
- 64 bit OS:
%ProgramFiles(x86)%\cosmigo\Pro Motion NG\plugins\
Any plugins inside that folder will be automatically detected when Pro Motion is launched, and made available in the file load/save and import/export dialogs according to where the plugin functionality fits in PMNG context. This means that during development, whenever you updated/recompile your DLL you'll have to close and restart PM.
Since PM is a 32 bit application, the plugin DLL must also be compiled as 32 bit.
This project is released under the MIT License.
MIT License
Copyright (C) 2019-2021 Tristano Ajmone <tajmone@gmail.com>
https://github.com/tajmone
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
For a discussion regarding PMNG plugin development, see the following threads on Cosmigo community forum:
- Developer Interface — full documentation by Jan Zimmerman.
- File I/O Plugin Interface — a language agnostic presentation.