[addon] Utilities

Oh, I forgot to remove a “shortcut” I had for developing. When you’ve clicked on the top bar (the one with the coords, Share button, undo, etc.) it behave the same as if a new cell was claimed. I did it, so I could test, if the script works without the needing to complete and claim a new cell everytime, I’ve changed something.
Sorry about that.
New version (v. 0.7.1) should fix it (if it was the source of the problem).

2 Likes

is it possible for right click on segment in tools (attached pic) to also center on segment in addition to jumping to it?
Screenshot 2022-07-13 013126

1 Like

Unfortunately, there’s no way to do it (as far as I know). It was hard to get any points, let alone find a central one. It would probably required downloading whole mesh of a fragment, do some math on the size of the fragment, to find it’s centre, then another portion of math to find a point in the segment nearest to the centre point. For now, it’s way above me :D. But will think about it.

1 Like

aaaah ok lol, but thnx regardless :smiley:

1 Like

v 0.8

Added a feature, that if you right-click on a segment, it will “copy” it to a new tab. Basically, it will open a new tab with only that segment (there might be all segments visible for a moment just after opening the tab, but they should be removed soon after). Feature was proposed by one of the players, but I forgot, who it was, sorry! :sweat_smile:

Also added here the one-time clean up, that I did in the Permanent Colors, just in case.

Fixed non-working right-click to jump to segment in some cases (still won’t work in some other cases).

4 Likes

the right click on segment id = jump to segment id looks to not be working for me

Ok, I’ll check it out.

Works for me.
Keep in mind, because of the way, the coordinates are gathered, this functionality works only for segments added in a certain way. Namely: claimed cells, segments added via double click in the left panel, segments after a split or a merge.
If you open a link with someone else’s segments, this feature will not work. Also, if you clear your localStorage or open your own cell in an incognito window, other browser or other profile in current browser, it won’t work.
If I had a way to get coords by segmentId, that wouldn’t be an issue, however, I wasn’t able to find any API that would fullfill this need, so the numbers are gathered during user’s own actions (claiming, adding, merging, splitting) based on the location of their cursor, previous coords of a segment or location of splitting points.
If I find any way to work around it, I’ll definitely implement it.

do you clear local storage by reloading the page? if that is the case i understand why it is not working

No. You’d have to go to the console, switch to the Application tab and clear it from there.
The purpose of the local storage is to store the data between reloads and multiple sessions (log in/out) or closing and reopening a browser.

v 0.8.1

Fixed a few errors, that were reasons, why multicut points and path points weren’t deleted, when user claimed a new cell, while not having the graph layer active.

sometimes when i right click on a segment, i get these (or some of these) errors:

when this happens it refuses to jump to segment. Might be the same reason why annkri cant make it work, idk.

This particular segment was an outdated one (black lightbulb) and i wanted to jump to it to double click it out and in again to get the latest ‘version’, but ive had it happen with yellow and/or green lightbulb(s).

I believe, you’re using an older version of the script; at most 0.7.1, while the current one is 0.8.1. Some changes with regard to the problem were done since then. It’s still possible, that similar errors can happen in that version. (Un)fortunately, they didn’t happen to me (I’m trying the check my console regularly), so I’m unable to reproduce it. I will try to test it with outdated segments or find another method completely for the jumping.
However, you’re completedy right, that if an error happens in a script, that particular script will stop working until the next refresh.

1 Like

im updating through monkey thingy but im guessing its not updating? I have version 0.1 lol

Yes, I don’t know, why that happens, but somehow, updating via TamperMonkey doesn’t work. Currently the best way to udpate is just clicking the link in the first comment in this topic (link is always the same).

1 Like

v. 0.9

Fixed opening a single segment in a new tab. The previous version worked correctly only during testing on my local environment. The new one should work everywhere.

Fixed jumping to segments. The new version should work for any segments, not only those claimed or made by splitting or merging. So you can now open any link and right-click on any segment and you will be moved to the correct location. The exact location in the segment is quite random. It’s just the coordinates of the first vertex in the mesh.

I have to say, it was quite a challenge to do the second thing. I had to dig deep for the data (hopefully, no Balrogs were awaken :wink: ), but finally found it.

6 Likes

is there any possibility you could make it as a conditional jumping, if you added the segment yourself in will jump to the segment you clicked when adding. and if that is not working it go to a random segment? quite useful to get to the segment where you added it, since that is useually a merge point?

4 Likes

I think, it should be doable.
Do you want it to work that way only for segments added manually or also segments created by splitting and merging (so the point to jump to would be around the place, where the merge/split has taken place)?

2 Likes

a good question,
if possible the best would be if it could be on the orginal point added even if the segment is split/merged later, but from what i understand that might not be possible since it is given new ID?

Not sure if there is any reason we would need to jump to the split/merge point later on, but i am not seeing anything wrong with doing it either compared to a random spot.

2 Likes

OK, so I’ll try to do it this way:

  • if segment is claimed - jump to the starting point
  • if segment is manually added - jump to the point, where it was added
  • if segment was splitted:
    – if splitted part contains the old jumping point - jump to that point
    – if splitted part doesn’t contain the old jump point - jump to one of the splitting points
  • if segment was merged:
    – if any of the merged parts had a jumping point - jump to that point
    – if none have a jumping point - jump to the place of the merge
  • any other case - jump to random point

Not sure, if I will be able to do all these cases. The reason is, that some of them require contacting with the server and I would have to make it work synchronously - step-by-step, so jumping might take too long (several contacts with the server in series). But might not. I will try it and then decide, if any changes are needed.

3 Likes