MuseScore2 to Musescore3 : pagenumber pagepos ?
Hello
I migrate a personal plugins from MuseScore.2 (which works fine), to MusScore.3.
I have an issue to retrieve in MuseScore.3 the properties available in MuseScore.2 : pagenumber ans pagePos
-
pagenumber
I need the pagenumber of a cursor.
In MuseScore.2 it is cursor.measure.parent.parent.pagenumber. It works fine.
In MuseScore.3 , I can't find this property, nor inspect cursor.measure.parent.parent (crash)
function logInspect(o, oname) {
console.log("object " + oname + " <" + o.objectName + ">" );
for(var p in o){
var t=typeof o[p];
console.log(" " + p + " / " + t )
}
cursor.rewind(0);
logInspect(cursor.measure.parent, "cursor.measure.parent"): => OK contains parent
logInspect(cursor.measure.parent.parent, "cursor.measure.parent.parent"): => crash -
pagepos
I need the absolute position of a note in the page.
In MuseScore.2 : mnote= cursor.element.note[0] . mnote.pagePos.x , mnote.pagePos.y , mnote.bbox.width , mnote.bbox.height. It works fine.
In MuseScore.3 , pagePos disappears... -
dolayout
For info : I understand that score.doLayout() is replaced by a score.startCmd() ... score.endCmd() -
purpose of my plugins
Used with MuseScore line command
input : a MusicXML file and my ad-hoc plugins-MuseScore
Output : jpeg pages with score rendering, text file with fraphical positions of the notes
Enclosed a draft of my MuseScore3 plugins, which does not work yet. As soon it will work, I will publish feed-back for other users who need similar functionalities
Thank you for your support
Franck Revolle
www.expresseur.com
Attachment | Size |
---|---|
expresseur_scan.qml | 4.26 KB |
Comments
Can I help to improve this ?
In reply to Can I help to improve this ? by Frank Revolle
I know that a lot of properties have been removed in the transition to the MuseScore 3 api, so they might have been removed.
better ask @dmitrio95
In reply to I know that a lot of… by ecstrema
How to ask the question (or help) to @dmitrio95 ?
In reply to How to ask the question (or… by Frank Revolle
He's just been asked on your behalf in MuseScore Developers Chat. You're welcome to join us there.
Yes, it looks like
pagePos
andpagenumber
properties are indeed missing after transition from MuseScore 2.X. Actually for most elements (with some exceptions like beams) position in page coordinates can be obtained with something like this:I have just submitted a pull request restoring these properties, if this PR gets merged these properties should be available in future versions of MuseScore:
https://github.com/musescore/MuseScore/pull/5986
I want have bigger numbers, but how
In reply to I want have bigger numbers,… by valsbol
I mean pagenumbers
In reply to I want have bigger numbers,… by valsbol
You posted this in the Plugins forum - are you specifically asking about creating a plugin? I'm guessing not, but just want a bigger page number in your score. The font for the header and footer (and other elements) is controlled in Format / Style / Text Styles.
In reply to I want have bigger numbers,… by valsbol
See also https://musescore.org/en/node/6120#comment-1026882
Tested .. Seems OK. Thank you for the upgrade
Sample of the code attached :
pagenr : cursor.measure.parent.parent.pagenumber
posx : mnote.pagePos.x
posy : mnote.pagePos.y
boxwidth : mnote.bbox.width
boxheight : mnote.bbox.height