Repository navigation
Export plugins - #1289
Export plugins#1289
Conversation
|
This pull request introduces 3 alerts when merging 714f228 into f806eb5 - view on LGTM.com new alerts:
|
|
@mbasaglia seems like great work! Did you test this locally? The travis build is failing with some errors. |
|
I tried building your PR locally and it worked. Don't know why is it failing on travis. |
|
ah sorry about pdb, I was using that when I was making my telegram exporter and forgot about it -_- |
It should already work on this branch, I've modified run_plugin with an argument that disables reloading the canvas. I've also extracted the code that actually runs the plugin into a different function, which doesn't save a temp file, so it might be used in the future for things import plugins (that wouldn't require a canvas) |
|
By the way, I was also considering adding support for a single plugin directory to define multiple plugins. In the case of export, it might be helpful to define multiple exporters based on a single codebase. Something like if the root element of the plugin xml file is |
|
Looks like the build errors on travis are about |
|
@ice0 could you review this please. ^__^ |
|
Also @mbasaglia, as mentioned in #1218, could you change the menu item name from |
This is more general than just Lottie though, it can be used for any exporter. Main reason I made this is that I want to make my own exporters. I already have a Telegram sticker exporter, and I might also add a SVG exporter. |
|
I've added an extra commit just to make the XML parsing a bit simpler / more readable. I've also changed the |
ice0
left a comment
There was a problem hiding this comment.
@mbasaglia Awesome work, Mattia!
@morevnaproject can you take a look too?
| bool | ||
| studio::Instance::run_plugin_with_arguments(std::string plugin_path, const std::vector<std::string>& args) |
There was a problem hiding this comment.
I'd split up this function in two:
- One detects a valid python binary filepath - and maybe build the full command line
- Other runs the script (open pipe and everything)
There was a problem hiding this comment.
I wanted to keep this merge request small so I haven't refactored much of the plugin code.
But I think it would also be a good idea to move most of the code in run_plugin into the plugin manager (or maybe even have plugin struct become a proper class and have it there).
run_plugin_with_arguments is really just extracting part of the code that used to be in run_plugin.
|
@mbasaglia Thank you for the great addition! I like how it works. ^__^ Just one request: But that request can be a separate issue, I think this PR is ready to merge. ^__^ |
Yeah I'd like to add the ability to do something like that, maybe having some way of defining multiple plugins in the same directory. It could be implemented by having multiple exporters in a single plugin but I think allowing multiple plugins in the same directory (sharing the same codebase) is more future-proof. As I was also considering adding support for "import" plugins, so you could have a single installed plugin, that defines various functionality like both import and export in some format or the like. The way inkscape handles this is by searching for files with a specific extension in the plugin directory (instead of just plugin.xml like synfig does). An alternative could be to add support different root element in plugin.xml that defines multiple I can work on this but I think the decision on how this is handled should be made by someone with more experience in this project. |
|
@mbasaglia Can you please rebase your branch on top of the latest master, so I can make a clean merge? ^__^ |
970cbc5 to
6e6eee5
Compare
|
@morevnaproject pushed rebased commits |
|
@mbasaglia I have created new issue to continue discussion - #1309 |
|
@ice0 @morevnaproject maybe backport this and #1313 to v1.4.2? Maybe t fixes the problems wih AppImage/Flatpak #993 (comment) |
Adds more metadata to the plugins to support a proper export system.
I've also updated the lottie exporter to use this system.
This is said plugin description as an example:
if the
typeattribute is present and its value is "exporter", the plugin will be added to a list of exporters. The<extension>and<description>elements are used by the new "Export" dialog to set up the file filters.Such plugins no longer show in the Plugins menu, they are only accessible through File > Export...