MuseScore 3 Plugin Creator line number bug and breaking changes in qml code for v3 plugins. v3 plugin qml is not backwards compatible.
Downloaded MuseScore 3 this morning and started looking at writing plugins. I'm new to qml but found the plugin source files at https://github.com/musescore/MuseScore/tree/v3.0/share/plugins. In attempting to run https://github.com/musescore/MuseScore/blob/v3.0/share/plugins/colornot… in the Plugin Creator for a score, I encountered errors in the code. So to validate that older versions worked and this code was not experimental, I repeated steps using v2.3.2 of MuseScore. Here are repro steps and my findings. It looks like plugins in v3.0 are currently not backwards compatible and there are still some bugs to fix.
Repro steps MuseScore v220.127.116.1185
- MuseScore v18.104.22.16885 on Windows 10
- Open a score
- Open Plugin Creator and paste in qml code from this source code version:
- CTRL + A in the score to select all measures
- Run the plugin code using Plugin Creator
- See the following errors:
Warning: QMetaProperty::read: Unable to handle unregistered datatype 'Ms::Segment*' for property 'Ms::MasterScore::lastSegment'
61:-1: TypeError: Cannot read property 'tick' of undefined
- Also note the Plugin Creator line numbers are not incremented correctly after line 99. They start back at 00.
- Repeat steps above but select all measure except the last measure.
- Find that the v3 code does not check for undefined on length property access for graceNotes or notes.
- Find that the v3 code plugin is not working, cannot find any notes.
Repro steps MuseScore v2.3.2
- MuseScore v2.3.2 on Windows 10
- Open a score
- Open Plugin Creator and paste in qml code from this older source code version:
- Run the code
- Note that notes are colored and no errors occurred