command line : plugins endCmd() not effecitve on export png
With new MuseScore2, the command-line does not use the result of the script before to export png.
Thank tou for your assistance
Franck
Musescore 2.1.0 last version on webste May 2017 871c8ce
The plugins is OK ( cf. code at the end of the post ):
Executing a plugins from the user-interface , to change the beamMode : OK .
The Beams are well changed/displayed on the screen.
The png-export with command-line is NOT OK :
Executing the same plugins from the command-line, to export he result on png images : KO .
The beams are not changed in the export.
This functionality was OK on the previous version of MuseScore 2.
The MuseScore test.mscz is attached.
Command line to run the script and export :
MuseScore.exe -s -m -r 100 -p C:\Users\franc\Documents\MuseScore2\Plugins\test.qml -o C:\Users\franc\Documents\MuseScore2\Images\test.png C:\Users\franc\Documents\MuseScore2\Partitions\test.mscz
Script test.qml
import QtQuick 2.0
import MuseScore 1.0
MuseScore {
menuPath: "Plugins.pluginTest"
onRun: {
console.log("hello world")
var cursor = curScore.newCursor();
cursor.rewind(0);
cursor.voice = 0;
cursor.staffIdx = curScore.nstaves - 1;
curScore.startCmd();
while (cursor.segment) {
if (cursor.element && cursor.element.type == Element.CHORD) {
cursor.element.beamMode = 0 ;
}
cursor.next();
}
curScore.endCmd();
Qt.quit()
}
}
Attachment | Size |
---|---|
test.mscz | 3.19 KB |
Comments
workaround :
do not use the -o option of the command line to export to png image file.
the -o is replaced with thee two lines in the script:
curScore.doLayout();
writeScore(curScore,"C:\\Users\\franc\\Documents\\MuseScore2\\Partitions\\testbeam","png");