Plugin identify objects uniquely
"The MuseScore 3.x plugin QML/Javascript implementation uses wrapper objects to delegate property/method calls to the actual underlying MuseScore C++ objects. The current wrapper strategy creates new wrappers whenever needed which leads to many wrappers possibly pointing to the same internal MuseScore object. This makes it impossible to compare wrappers to see if they point to the same MuseScore object"
This problem was discussed in https://musescore.org/en/node/293837 and the issue was closed, but I encounter exactly the same problem in MuseScore 3.6.2 Plugin API. I attached a plugin that prints the references of system objects for all the bars. Despite several bars being in the same system, the corresponding system reference is always diferent and checking for equality will always return False. I guess this is because each access still creates a new wrapper instance to the same object. This makes it impossible to check weather bars are in the same system, chords have the same beam,...
What is the current status on that matter?
Attachment | Size |
---|---|
referenceTest.qml | 503 bytes |
Comments
pls try
posY of System
curScore.is( ) seems bugged in this case
debugger
https://musescore.org/en/handbook/developers-handbook/plugins-3x#:~:tex…
In reply to pls try posY of System… by msfp
I overlooked the is() function, which actually makes it work. One just has to use it on the object itself (see attached file).
In reply to I did not know the is()… by harmony8
nice