[Script] WME MagicWand

Unfortunately, updating namespace will break automatic upgrades for all those users who has Magic Wand installed, as far as I can see.

Now that’s strange… What options do you use, what layers do you have enabled and in which country are you trying to use the Magic Wand? Please, try these parameters:

  • Color match algorithm: Color Distance
  • Tolerance: 8
  • Sampling mask size: 3

In regards of “Human Eye” algo, it is very complex and slow, maybe it would be better to remove it for the best in one of the future versions.

New version posted: 2.1

Some more Information:

  • Parameters used as described.
  • Editing in Germany
  • Tried it with the Sat Image Layer only and even with Map Overlays, still no success.

Cannot reproduce the case, everything works perfectly for me in Germany too.

I’ve updated the script to log some debug information to the console. Could you:

  • update the script to 2.1.1,
  • open the Developer Console,
  • reload the Editor page,
  • write “window.wme_magic_wand_debug = true”,
  • press Enter to set the variable,
  • and try to use Magic Wand, please?

The script should log something like:

WME MagicWand algorithm: LAB WME MagicWand sensitivity: 6 WME MagicWand simplification: 3 WME MagicWand landmark type: PROFESSIONAL_AND_PUBLIC WME MagicWand sampling mask size: 4 WME MagicWand concave hull detailing: 40 WME MagicWand: clicked pixel data [104, 101, 84, 255] WME MagicWand: iterations done (should be way less than 1,000,000) 1167344 WME MagicWand: non-processed pixels left (should be 0) 0 WME MagicWand: pixels processed 171714 WME MagicWand: Found pixels (should be way more than 3) 5101

Can you post it here along with the link to the area you are trying to edit, please?

I guess here comes the interesting Part for you:

WME MagicWand: clicked pixel data
Array[4]
0: undefined
1: undefined
2: undefined
3: undefined
length: 4
proto: Array[0]

Whatever I click, the pixed data shows undefined.

Here’s the link to the area.

I tried the darker area to have a maximum contrast.

Aaah… great to see the rotation tool is working again.
your work is very very very much appreciated.
bol’shoye spasibo!
:slight_smile:

Just spent close to an hour doing a ‘binary search’ to figure out which extension was killing ctrl-c, keeping me from using it to copy text from various windows in WME.

I see that is is a known characteristic of magic-wand. Documented in
https://www.waze.com/forum/search.php?keywords=ctrl-c&t=118064&sf=msgonly

Might I suggest that it may be a good idea to change that default takeover of shortcut keys so that the common windows ‘copy’ shortcut is no longer preempted by Magic-Wand when it is installed?
Perhaps alt-c or ctrl-shift-c would be less ‘intrusive’ !

I strongly suggest that all script writers avoid preempting the most commonly used editing keystroke shortcuts (ctrl-c,ctrl-v, ctrl-x and ctrl-s … and perhaps some others that slip my mind at this moment.)

I see that the ‘code’ // Hotkeys registerKeyShortcut("WMEMagicWand_CloneLandmark", "Clone Landmark", cloneLandmark, {"C+c": "WMEMagicWand_CloneLandmark"}); registerKeyShortcut("WMEMagicWand_OrthogonalizeLandmark", "Orthogonalize Landmark", Orthogonalize, {"C+x": "WMEMagicWand_OrthogonalizeLandmark"}); registerKeyShortcut("WMEMagicWand_SimplifyLandmark", "Simplify Landmark", simplifySelectedLandmark, {"C+j": "WMEMagicWand_SimplifyLandmark"}); registerKeyShortcut("WMEMagicWand_HighlightLandmark", "Highlight Landmarks", highlightLandmarks, {"C+k": "WMEMagicWand_HighlightLandmark"});
in the script seems to preempt ctrl-c and ctrl-x.

I do appreciate all the work that went into writing the script. I haven’t had a chance to play with it, just installed it a few days ago with the intention of testing it, when time and opportunity presented itself and part of ‘time’ has been spent fighting and cursing the broken ctrl-c :slight_smile:

Additional hint to anyone else having the problem: I just modified those lines by adding “//” at the beginning of them (effectively commenting out the registration of those shortcuts) and that ‘fixed’ the problem I have been fighting for days. :slight_smile:
I can also now state that it takes close to an hour to do a binary search to narrow down the culprit when you have over 80 scripts installed. :slight_smile:

PS: tried MagicWand a couple of times, After several times of being unable to find anything, something locks up WME and I have to kill the tab and restart. Maybe I broke something by adding the “//” to comment out those line. I’ll give it another try when I have some spare time. For now, it is disabled in Tampermonkey.

You should have said something in chat, I already went through the pain to find the script that does this and kill the keybinding.

Agreed - no script should bind to ctrl-c/x/z/y

I made a few tweaks to this script. Hopefully the author will come back and consider implementing them :slight_smile:

https://pastebin.com/EA7PsA3n

Fixes the label names when a Place is selected
Changing the checkbox options in the sidebar with a select Place now immediately updates the Place geometry rather than necessitating deselecting and reselecting the Place.

Hello, I am using this script mainly to geometrically edit places - simplify, ortogonize and rotate places.

It seems that the rotation tool doesn’t work any more. Also I noticed that when the script is enabled it disables Toolbox feature “Select in area place or map comment”.

should be because of the wme update

+1 :wink:

Hey everyone, the script has been updated to v2.1.3 that supports a current version of the editor. Rotation, resize and cloning tools work as intended again.

Also, I’ve changed the license to MIT and created a Github project (https://github.com/WASD42/WME-MagicWand) so that everyone could participate in the plugin development. Please, feel free to report bugs and create pull requests.

Could you please provide more details about your OS and browser as I cannot reproduce the issue on Mac/Windows Chrome/Firefox. Ctrl+C and Ctrl+X shortcuts work perfectly for me across with MagicWand installed. Do anyone else have this problem?

Thanks for your efforts! Not sure what “Fixes the label names when a Place is selected” is though, could you please clarify?

When a Place is selected you show two checkboxes in the left panel of the place - one to enable rotation and one to enable resizing. Previously they both said “Enable Rotate”. My changes, and the latest version, fix this so they are now correctly shown as “Enable Rotate” and “Enable Resize (no reshape)”.

Thanks for updating :slight_smile:

Not sure if you get a notification or anything, but I sent you a pull request.

Thanks for the pull request, works like a charm! Merged to master and re-uploaded to Greasyfork.

I’ve noticed a small problem caused with the MagicWand. If I enter HN mode, then exit it and select some place, Delete button on the upper toolbar is disabled. If then I select another place, the button is already enabled.

Checked in Chrome on Win 10. All other add-ons were disabled. The problem doesn’t happen if the MagicWand is disabled.

I have noticed that when I have MagicWand enabled in TamperMonkey, the geometry nodes on Area Places randomly disappear. This especially happens after moving one node, all the others disappear. Sometimes a page reload will bring them back, but most of the time I have to turn off MagicWand and then reload.

This depends on the MagicWand options you have enabled. If you have Resize enabled you are not able to change the geometry of the selected Place - it says this in the checkbox name: “Enable Resize (no reshape)”

Was this report noticed? Am I the only one with the problem?