Plugins are not run correctly when running musescore in converter mode.
Running musescore with both plugins (-p
) and conversion (-o
) at the command line will ignore the plugin listed, and convert without running plugins.
To reproduce this issue, simply launch musescore with a plugin such as transpose_0.qml
, and a musescore file, i.e.:
mscore -p transpose_0.qml -o Music.pdf Music.mscx
This is due to two small error in musescore.cpp
:
- in the overloaded function
convert(QString&, QString&)
, the conversion routine is called, but without a plugin name. This will cause the plugin name to be ignored at the command line. - In the overloaded function
convert(QString&, QJsonArray&, QString&)
, the current loaded score is not appended to the list of scores.
The former error means that no user-specified plugins will be run when in "conversion" mode, the latter means that if they are run, they will encounter errors when they try and modify the current score, as there is no current score available.
These errors are due to a wider issue with brittle command-line behaviour that should be addressed in a future release.
Details on my debugging (along with a small patch that will fix this issue) can be found at this forum node: https://musescore.org/en/node/299531
I plan to open a PR with a cleaned up version of the patch that will fix this issue.
Comments
PR is now open: https://github.com/musescore/MuseScore/pull/5609
Fixed in branch master, commit 1cdc669439
_Fix #299539 (Plugins are not run correctly when running musescore in converter mode.)
Resolves: Issue #299539
This PR fixes a set of related logical bugs in the command line interface
handling logic. Essentially, in master as it stands right now, two options
are somewhat intertwined, but break each other in subtle ways, which leads
to plugins being entirely broken when run in command line mode:
to a score, simply discards them.
files, discarding changes made by the plugin mode.
doesn't run the plugin specified by the user - said plugin name is
replaced with the empty string, so no plugins are actually run.
The overall effect is that plugins (when specified at the command line)
either a) do something, and then discard their work, or b) are ignored.
This PR fixes this issue in the following way:
with plugin mode.
in order to allow plugins to run correctly.
specified._
Fixed in branch master, commit 8529a29e9f
_Merge pull request #5609 from AdamHarries/issue-299639
Fix #299539 (Plugins are not run correctly when running musescore in converter mode.)_
Automatically closed -- issue fixed for 2 weeks with no activity.