-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A Bit of Feedback #1
Comments
Thank you for the feedback.
I know that button label should be titled, but I often forget to do it. Tx for the reminder, I'll do that.
Agree
I will think about that. But I have to admit that I prefer doing operation of renaming/deleting/moving snippets direclty with the texts files. In the same spirit I'll let "Open Folder" in the UI. I use it really often so I dont want to push it back to the prefs .
Yeah its not the best one. But could not find a better one and I'm used to it now ^^
If you mean on the right side of the ui_list it's sounds good, I'll see what I can do.
I totally agree with you about this. Thats why I try to make the titles of my own snips as explicit as I can, so I can use the built-in UI list search bar efficiently. One thing I want to implement first is the ability to filter by specific categories/types/user-defined-filter with a tag system. Another thing I would really like to achieve is to make it easier to share ! Like having an online shared snippet repository where the addon can read/write so it can be fed realtime by the dev community ! Once I go back from holidays I'll see to all of this. (when times allow that is.) ;) |
I played around with the idea of a text preview of the template header, maybe you'll find that interesting? For me the biggest problem with using templates is that the titles doesn't describe what I need to know. Ex. if I'm looking for a UI solution, a template(the build in ones) might actually use it, but is actually showcasing something else, and therefore I'll not be able to find it by looking at their names. Also with the removal of the left tools sidebar most template UIs are not easy to find for newcomers, so having a text preview, the location could be exposed. |
Interesting indeed. Thats a nice way to do it ! Feel free to pull request some change if you already did the code. |
Ok there is a new version for you to try ! Mostly cosmetic change but that's a big improvement on the UI side thanks to your feedback. 👍 For the header preview can you send me your testing code so I can save some time ? |
Currently it doesn't seem to install properly(it doesn't show up among the installed add ons?). It was just a mock up with a label pr. line(copy + pasted) and a .box added to the column. |
Ok ! sorry for that, I commited the wrong file. I just started using vscode's blender dev plugin from Jacque. L. I understand how it works now. Ok for the preview, I didn't understand that it was a mockup. thx |
Yes, now it opens. I had to refresh the list to get entries in the list on first run, maybe it should do this automatic? Maybe you could consider making a new text block when adding a snippet to the Text Editor, and call it the name of the snippet. Currently it is overwriting whatever is in the text block called 'Text'. Users may loose work this way. I asked for adding a checkmark to the Blender icon set, if this is added, it might be a better icon than the arrow. I really like the search function, if possible maybe to could be open on default? |
Ah, next update there will be a checkmark included: https://devtalk.blender.org/t/new-icons-for-blender-2-8x/4651/716 |
I tried to do this just now. I added a call of the reload function in the register. But the problem is that when you hit the checkbox to enable the addon it's in the context of the preferences (I can't access bpy.context.scene). So it give an error...
It supposed to work the way you say. It's the case for me... Since the last two published version, if no text block is loaded, it will create a new one with the name of the snippet (just as you just asked ) ! This is the only moment when the script is really "creating" a text datablock.
Cool ! Do you know if in the code I can check if an icon exists ? (to avoid error and replacing with old icon for people who haven't update blender)
Totally agree, I use this search all the time. looking a bit on the web it's possible with |
Ok preview is live ! \o/ But the spacing gap between line label is too big. I dont know how setup something better (not so good in UI tweaking code...)
@tin2tin Tell me If you know a better way |
Maybe placing something like this before the loop will do the trick: Maybe using box also may add additional spacing? Not at computer right now, so I can't check. |
This is as tight as possible(without box):
But that's without the box. Do you know about this snippet collection? The build in templates are called like this: |
Maybe there should be two insert functions one in a new document and one pasting into the current document(paste icon)? On the new icon, maybe a try and catch could be used? |
I think I'll let the box for now and see later how can I do better (at least the UI is nice that way).
I'm not sure about having two buttons. it's fairly simple to make a new block with a clic or
Yeah right, I wondered if existed som specific 'get' method but a good'old try block will be fine.
I thought of integrating the build-in template (just to be able to reach them with the search really) but I in the end it would be redundant to have them at both location. It's kind of good to have your own snippets (or community) separated from the shipped ones.
I knew of zeffi x_templates and once a sort of tag/category filters is up I might add these. Before adding snippets that aren't mine I need to find a good way to sort all of this and mixing everything is difficult. But be wary, I'm sort of a slow developer... This might take a while. Thanks for all the proposals. Keeped me motivated. |
The Templates implementation is pretty bad as it is now(that mega long menu), so maybe your add-on could replace it? Or be included in Blender as a much more comprehensive snippet lib.? |
You think it can go in ? |
The next I wanted to do is modify the snippets themselves by adding versions/tag/description/stuff with a dic at the header of each one. This header would be evaluated in python during the scan, and generated with the add popup when you create a new one.
(Do you have comment about this btw) BUT, replacing the current Template system or going alongside it means I'll certainly will have to stick with plain snippets (like it is now) since template_py are also plain. Here goes the dilemmas |
To be able to search the contents and functions of the snippets could be very useful, but it'll complicate things and may be a lot of work. The preview idea was mainly for reading a commented text block at the start of a script(which would have to be added to each snippet), but if you add info headers maybe the preview is not needed, because the exposing the info would be sufficient preview? The build in templates could also be updated to comply to whatever styles you find right, but of course the Blender Devs would have to be convinced first. I think the optimal snippet solution would be to connect the API docs with snippets showcasing all the functions, so if you want to add info, maybe the api functions could be harvested from the snippet and added to the info, so snippets somehow could be linked to the api documentation. I don't know how to do that, but I this it could be a great way for people learn coding Blender Python. |
I see a rather simple way to make it, but it will be a somewhat slow search (but not too slow either) that will rely on scanning every snippets at each search call.
After thinking hard (5 long minutes 😲 ) I decided to stay with plain snippets, if only for the sake of
About this, it might be better to stick with plain text too, I dont think the devs will be convinced by a script that evaluate string to python execution from an external file for security reason (but maybe I'm wrong)
Sound too complex for me to handle 😅 By the way there was a new version yesterday evening. I think you'll like the new feature. The preview now display the definition/classes (if any) in another box below. I wanted also to scan the build-in snippet (as you proposed) while adding a checkbox on preferences to disable this source. BUT it's incompatible with my current design that is made for specifically targetting one library folder only. If I make the library multi-folder it add a level of complexity (and not only on the code level). For exemple when you add a new snippets you will have to choose where to send it. Same when you open lib folder, does-it open all folder ?(a bit messy) or again a choice popup ?... + certainly other problems I didnt think about (like handling file conflict for example). So again it kind of break the simplicity of the plugin that I like... Since it can be really usefull to have multiple source anyway, I just put the idea on standby for later. |
Cool with the classes/defs extracts. If the snippets are always pasted into the current document, maybe the paste icon should be used instead of the arrow? |
Big new update. You will certainly like it ! Here is the changelog of this v0.2.0 (always updated on the readme btw):
|
Wow that's super cool! A couple of small things I noticed: Insert in new document, maybe use the New File icon eg. document with +? Maybe the new search function could suggest selected text in the search field when opening the popup? I'm not sure about this, but maybe it is easier for users to navigate the snippets if ex. bpy_ is added to the end of the filenames instead of the beginning - so you could still use them for searching, but the actual function would be the first you'll read? Maybe you could ask on https://blender.chat/channel/python if there is a solution which will load the files in the list at start up? |
Done. I didn't know of this new
Done. Didn't realised it was weird ahah (the
Wow ! I super like this idea 👍 ! Done. (only if the selection does not go over one line)
About that, I dont really want to change it since it's just sort of a naming rule I made for myself.
Since this is not super important, this is where my lazyness come in ! 😸 |
Cool! I can't come up with anything more, except you could run a pep8 check. If vscode doesn't have it, maybe you could use this one: http://pep8online.com/ |
Looking at it again. You're right, it is better to left align the preferences. Maybe the list widget should have a default height which fits the height of the icons? Having the Preview button selected, it is pretty dominant, maybe it could just be an icon button below the folder open button? Maybe double clicking a list item should paste it into the current text? Renaming, by double clicking snippet name, makes the file unreachable. |
Ahah ! I knew you were going to go back with some other changes in mind.
All right, I take your word for it, dont mind it being left or right.
True, but I dont know how to do that ^^. Will see if its possible
Though I agree it may be currently a bit too big, I like the way it serve as a clear separator/indicator.
I want that too. Not sure if it's possible to trigger it with a double clic (I think the rename action is part of the UIlist core design). I'll check this anyway but my hope aren't that high... Already tried something towards this idea of quick insert. At some point I got it working so just single clic on it would paste (but it wasn't relying on clicking event, and it's not something we want now with the preview).
Yeah, if you want to rename you need to go in the folder library and rename the file itself then hit the reload. In the end the double clic to insert would definitely be a good thing, it will be a new cool feature that fix a bad UX in one shot ! I wasn't sleepy while you were blending stuff and gathering toughts ! There is a new feature prepared over the weekend, Check the changelog ;) One sad thing though : after a lot of trial and sweat yesterday, I failed miserably trying to implement a TabTrigger system in Blender when inserting snippet. Placing/moving the cursor with the API is just an absolute pain ! I'm not sure to add this feature in the end... Already lost way too much time just for this that I consider a bonus. |
I'm not using any external editor(only Notepad++ once in a while). I know I should, but I'm mostly doing Blender UI work, and it is so much faster to do this from within Blender Text Editor. (I know some people using Emacs and Vim for coding Blender add-ons too) Generally I just think that the Text Editor has been falling far behind, and do need a lot of love to reach the level of the rest of Blender and therefore I did this thread on Blenderartists to gain some traction for the Text Editor: https://blenderartists.org/t/how-would-you-show-some-love-for-the-blender-text-editor/ The better and more friendly the Text Editor seems, the more add-on devs will start coding for Blender(and eventually they'll move to other IDEs), which is a good thing imo. And therefore I think a good snippets/templates system is crucial. |
Here is the new version. I made all the change except for the double-click-insert on item, did not found a way to do it... But as a fix I disabled the rename on double click (just had to make items labels instead of props) The UI is better now than ever before ;) Also added a 'Todo' and 'ideas considered' in the readme. v0.2.3 2019-09-05:
|
Excellent! Maybe it deserves a tab with the "Snippets" name, now it uses the full tab? Maybe you can make a post about it here(so people will know that there still are good things going on with the Text Editor)? https://blenderartists.org/t/how-would-you-show-some-love-for-the-blender-text-editor/1163857/89 I can post about it on Twitter, if you're not on Twitter? |
Since it's for coding purpose the About sharing it, I had planned to post it on the BA thread you mentionned (and eventually on my twitter). But before I want to do 2 things :
There is more to it on this second todo. I dont know if I completely drop the idea of a prefix and use instead the name of the folder there are being stored in. The other way is keeping things as they are. Which does not rely on folder structure. I think there is a choice to make bout this (I'm not so good with choices ... doubt being a dear friend of mine ^^) In any cases I think about going with more detailed name. For exemple I used sometimes My current categories are : I won't go too detailed either. Because with trigger words in IDE you'll have to remenber as many keywords as there are category... Maybe something relative to the areas (or scope of action) like : This might already be to much category to memorize triggers. Maybe grouping all viewport related stuff under bpy is still good... I think a lot with the converter in mind because I see a lot of potential with this. Sadly you can have only one keyword trigger in those IDEs and only vscode let you "elastic search" in the result after tapping the trigger (that is super cool btw). I want your opinion. What do you think of all this ? what organisation would you prefer to use ? folder or name prefix like now ? Of course the user can decide himself for his own method of sorting and will add more category anyway (still more flexible for him if folder are not used as tag). Also maybe I'm overthinking things... that will not be a first 😄. Will think about it while fixing the clipboard. |
On your first thing on the to-do, didn't dfilinto give you a get selection operator, which can be used instead of the clipboard? On the 2. I do not use sublime or vscode, so I don't know that much about how snippets would work within them, but for me is your search-within-files function that powerful, that it could replace the file name search, and thereby not use the filenames to categorise, but the used or tagged(in commented lines(ex. #gp #mesh) words inside the snippets. Maybe there could be presets search for your catagories, like a drop down, when selecting the category is the auto inserted in the search field, and a search is executed. A way to think of the categories is maybe as bookmarks. I think the main thing is that this way finding the right snippets aren't dependant on how the files are named, but the contents of the files. But I do not know how that would work, and maybe you have already found a better way to solve it? |
For the clipboard stuff, It's ok for the text get but not for the text insertion. But should totally be doable, I'll implement it soon. About organisation, those are very interesting thoughts. 👍 I'll think about this idea of bookmark tagsearch ! As for now I really dont have any better idea since I decided to stay with a plain file not adding a dic on top like I mentionned before. But I'm just mentionning this so you know his addon exists ^^ I made up my mind to stay with plain-text snippets. Back to the snippet Lib folder structure, with what you just brought up I'm starting to feel that the prefix is effectively not that important. Simply sorting things in the folder can be best for the user and more logical... and I can still display the parent folder name as a prefix in the UIlist if I still want to use the file-name-search ! |
New big version. took me the whole day ! 😅 I chose to rely on folder to stay simple, no prefix anymore. Here are the changes
|
I'm close to sharing it now. But need to make some slight adjust here and there. Another thing. I will surely define
But it's overkill since it absolutely does not change the use of the lib and the purpose of this lib it to handle python snippets anyway. at least when you open the snippet with an IDE you have syntax color right away. Some stuff I may try in the future : |
We're having birthday parties all weekend. My son is turning 6, so I don't have much time, but I noticed after uninstalling and installing the new version the preview was on, but didn't change when changing snippet, until I ran a refresh. Overall this has now a really cool pro feeling. Great job! I don't know if it is possible to add a drop down to the search area in the 'Search inside snippets' so you can both enter a new entry or select between pre-defined ones like your categories? If you want to add some more templates, there is a very nice UI template here: https://gist.github.com/AzureDVBB/0b3d941a719e88574533da45d4970492 Is is strange that adding labels to a box that the line distance goes up, so I think I'll try to ask Harleya if he can help us with that. |
It can be a simple and elegant way to filter folders, but just an enum has the drawback of letting the user only choose one tag or all. No multiple category possible at once. But maybe a filter by tag is not necessary at all. Btw I continued working on the addon this week as I have way more free time than usual. |
Here it is ! I let you check the changelog. Next I'll try to focus on UIlist's search options (currently its case sensitive only) and filter option (for example alphabetical re-order is broken so I removed the button). That said, I'm pretty happy about how it is now already. |
Fixed the tab display in preview. There is no way to filter by file extension. I'll see what I can do for these filtering ideas. Later end of next week though, work has caught up on me. |
If you want to ease the readability maybe you can use Titel Case for the entries in the list? It's very nice that you can add you own path, so you can add your scripts folder, and search in the contents in all of your scripts, if there is something you know you coded at one time, but forgot in what script it is. :-) |
If you add the column with align=True after adding a box() to layout, the text inside the box will have an aligned leading(line distance), which may allow for more visible lines in your add-on. Demonstration:
|
Nice ! I remember we talked about this "too wide line spacing problem". |
Now I finally got around to test your add-on. Scrolling through all your snippets, I'm really impressed with all the work you put into this.
I just have a few comments:
In Blender UI the frist letter of each word is in caps, like this: Open Library Folder
Save snippet could be a + icon.
(should there also be a remove function(- icon)?
Insert could be a paste icon, or a check mark, but I couldn't find any.
Maybe all of the icons is that self explanatory that you could add all of the icons to the right with the arrows?
Maybe Open Folder could go into the add-on properties? (If you got + and - you properly wouldn't have to open the folder?)
One really useful function would be to search inside the snippets by the name of a function and all the files containing that string would be visible among the snippets. That's properly very hard to implement, I guess? The hard part with an add on like this is to find what you're looking for. And a function-search operator would help.
The text was updated successfully, but these errors were encountered: