While working on the cathide v1 and v2, i wrote a lot of code using blender builtin text editor. It’s not the best one, but it gives ability to quickly test your code in situation !
But one thing bothered me a lot, no way of jumping from an operator to another, and when your text is long, having to scroll to the wanted part of the text can be a pain !
So i made TextMarker
TextMarker is a simple addon to store per text block markers with line and quickly jump from one to another
Features :
Storing of Markers per text block, the markers are stored in the project
Text marker updating : find new line for existing markers. This feature uses block of 10 lines before and after current marker line. It analyses all possibilities in the text block (if line is redundant) and find the most consistent. This technique could lead to error in finding the line, but very rarely. The update operator also find erased lines, and tag them. You can also choose to ignore indentation while updating
Create automatic markers with search for a particular theme. For example, all lines containing ### would be marked. It allow to add “chapters” by starting specific lines with specific terms
Move quickly from a marker to another, simply by selecting a marker in the list with auto jump function, or manually, without it
Here’s the Github page, download the script from here and install as any blender addons
Here’s a quick video demonstration :
As usual C&C and bug report are more than welcome !
Hi!
Thank you very much, Tonton !!!
I litteraly dreamt of it, and you made it. And in a beautiful way!
So far, it works flawlessly, and I’m really happy about your fantastic addon.
At first, after installation, I did not see your addon on the left panel, it only appears when I load a script.
Maybe, a disclaimer or a text in the panel could help to prevent false reports .
And your panel disappears when a script is closed.
It can seem logical, but new users may say ‘It does not work’ while it’s ok.
Just for info, under the hood of the console , It indicates the following lines each second bookmark , not the first.
Traceback (most recent call last):
File "C:\Users\lo\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons extmarkers v1_0.py", line 61, in draw
list=txt.text_marker_list
AttributeError: 'NoneType' object has no attribute 'text_marker_list'
location: <unknown location>:-1
Hey ethan aeris, thanks for your comment and error report !
not a big error, just a draw problem, i’ll correct it tonight or tomorrow
and about the visibility of the panel, you have to be in a text editor area, with a text block opened to see it
When you say “And your panel disappears when a script is closed.” you mean there’s not script opened in the window ?
I can put a little message about that in Use Pref of the addon, not a bad idea, but the behavior seems alright for me, you don’t want to have extra unuseful panel if there’s no opened text.
and about the visibility of the panel, you have to be in a text editor area, with a text block opened to see it
When you say “And your panel disappears when a script is closed.” you mean there’s not script opened in the window ?
Yes, it’s exactly that, only when no text is created or open.
I guess the message in the Use prefs of the addon should be enough.
I understand your workflow, it makes sense and it’s performance friendly to not display when empty, it’s just surprising at first sight
ethan aeris, been thinking about the panel, and you’re right about the fact that it shouldn’t totally disapear, i just updated the addon (1.1 in the github), now it remains persistent, and displays only an info message when there are no text loaded.
And about the 2nd marker error, i ve been unable to reproduce it, but with the error message, i tried to guess and correct, tell me if it works on your computer !
Thank you Tonton, for taking care of the info message.
About the python errors, I get almost no error since your update, and the rare I get are surely from my side, I got to start from a fresh Blender
A question please, is it possible to save/add and load the meta data of the markers in the text saved file, instead of the .blend like now ?
By example, with special tags in comments of the user saved .py file.
like :
##my code##
##marker 1 - line x - name of the marker##
Hi ethan aeris, glad to hear you don’t have anymore the weird bug you were talking about !
concerning your asking about adding the markers as comments, i don’t really see the point so far :
these markers will work in blender text editor only, and for getting them in another .blend, you just have to append the text block from your previous .blend with the addon enabled, the markers will ship with the text ! Adding the markers as comments will make the text block really messy (a lot of infos are stored per marker to be able to update them even if you change line orders…) and it will be a mess to update correctly when you add markers…
I hope you see my point on this, if you disagree, explain me why !
I see.
The topic of markers in comments was more a question of curiosity, than a feature request.
If the idea adds so much mess and informations in the user text file, then fine, let’s go on with the current implementation which is clean.
Plus, I totally forgot about the “append script from blend”, and being on a different blender file than the script was my main concern, so you solved it already