Open schroef opened 6 years ago
Hi, my github repository is a complete mess at the moment, so unfortunately you got a very old version of the addon. For now, please download this: Advanced_UI_Menus_v1_5b.zip and see if it works for you. If you still get errors on the new version, I'll look into this more.
Okay cool! i found this link and because it was for 2.79 it looked like quite a new addon Seems very powerful. I like how you add all those keys, seems very quick and you can keep the keys per py file. Though it seems like complicated code. Also im not sure i like it turns others off though.
We can change that ofcourse. What i saw in Hardops is very nice method, user doesnt need to search in the keys section but can change them directly in the addon section. Works perfect!
seems v1_5b has something missing in the wm call. Not sure if it matters, but im still on 2.78c
Sorry, i made an mistake. I had blender still open when i deleted old version and added the new one. Works fine :)
I do see that some of your menu are missing or have less options then the regular functions. For instance your delete menu is smaller in actions? This is your menu
This is normal delete menu
Excellent! :) I love problems that fix themselves. Hotkeys in addon preferences are planned, I just haven't gotten to them yet. The delete menu is context sensitive, so it will show you options based on what you have selected. (If you have a face selected it will show you everything, while if you only have a vertex selected, you'll only have vertex related stuff showing.)
Ahhh thas nice, so its a clever as well ;) COOL!
Hahaha yes errors by dumb users is nice ;)
Those hptkeys are super great, took me a while to get it working properly. I didnt understand how the add step worked with this one. After a lot error checking and print log i found the method.
Right sorry, have a look at this link for up to date instructions https://blenderartists.org/t/addon-advanced-ui-menus/592865
Hey i like to help, this is what i got so far. I took my some time and had issues getting all keys properly. Also i had issues cause some have the same shortcut in multiple mode but do have the same short cut. Ive chosen not to show all the shortcuts per menu or do you think that would be a proper option. That would make the list quite long. Users can add different kets for the same function in other modes, i just thought its to much.
Shall i make a fork and do a pull request when done? Its a bit sloppy perhap show i added the menu name above it. BUt because most of them are called call menu. I thought it was better to add a label above it. Perhaps making this a boolean. So when clicked it opens and then shows the shortcut key. What do you think?
Give me a few minutes, I've almost got git back into some semblance of order. Let me push that to github, and then you can make a fork and send me a pull request. That looks really good, and I completely agree that the hotkeys need the name above them.
Ok, you can fork now. Base your changes off master and stay away from development and release-1.5. (development still needs major updating & release-1.5 is getting deleted soon)
Pfff took me a while, first tried adding booleans, but using a list it was a big mess to get them to work properly and show the key items. I now added a label to the column.
Makes more sense and is better readable for the user.
This is how the complete list show. I haven touch or added the custom menu. Not sure how i could do that part. Seems complicated :)
Looks good :) I'm really looking forward to your pull request. The custom menu is complicated, very complicated and needs refactoring, but it's called from a hotkey the same as any other menu. If you don't want to add it to the preferences now I can probably add it easily later :)
I just noticed an issue with keys which have special space_types. Argh i get keys shown now for wrong items.
EDIT I need to add some stringproperties to the operators in order to get those working. I got them all properly showing except the custom ones.
ai... i just notice all your comments. somehow i did not see them posting each update i made. My pull is based on that 1.5b you send me.
I would not need to adjust that much, i just need to add a 3 lines of code to the operators which dont use a wm.call_menu.
Do i need to adjust that or do you think you can manage that. My add is seperate py file, named preferences.py
I had a look at your pull request and found a couple of things.
First of all, whitespace, throughout the whole project I use 4 spaces to indent.
Second, I think rather than adding a name property to operators (which could end up being a pain to maintain) you should structure your get_hotkey_entry_item function like this:
def get_hotkey_entry_item(km, kmi_name, properties):
for km_item in km.keymap_items:
if km_item.idname == "wm.call_menu":
if km_item.properties.name == properties:
return km_item
elif km_item.idname == kmi_name:
return km_item
return None
This way it works for both operators and wm.call_menus without needing a try except block or an extra property in the operators.
And finally, each menu defines multiple keymap items. Currently your code only deals with one. I can think of two ways to handle this (but let me know if you think of another): One, don't specify the keymap, e.g. "Object Non-modal", and loop through them all, so every keymap_item is displayed to the user.
Or two, display one keymap_item for each menu and auto update the others when the visible one is changed (I actually roughed out code for this and it works). The only problem with this method is that if the user changes a keymap_item in blender's Input tab, the preference keymap_item will get out of sync (we could potentially update it again, but that could be confusing for the user).
PS sorry for the change of the white spaces, i use tab size :) ill change them all, on save my adjust all spaces to tabs (beautify) Yes that indeed a better method, then the py files all stay nice a nd clean.
I did show alll the items per menu at first, but that showed a huge list. Then i though i take just one and the other would be updated as well, i though it would i guess. But thinking about that is a mistake ofcourse.
Making those other not visible keys update when one them is being updated would need some extra code of course.
PS when you update the key, that updates the preferences keymap as well, aren't those the same?
yes, showing one key and updating the rest does require extra code. I have experimented with that and, while it works (here is the code if you want http://pasteall.org/962719/python), because only one key is shown, if the user goes to the input tab and changes a hotkey chances are it won't be reflected in our addon preferences.
I think it might be better to list all of them, but have the name at the top and then show the keymap for each entry, something like this:
Brush Options
Sculpt > [</] Call Menu Keyboard |V| X
Vertex Paint > [</] Call Menu Keyboard |V| X
Weight Paint > [</] Call Menu Keyboard |V| X
Image Paint > [</] Call Menu Keyboard |V| X
Particle > [</] Call Menu Keyboard |V| X
Curve Menu
Sculpt > [</] Call Menu Keyboard |W| X
Vertex Paint > [</] Call Menu Keyboard |W| X
Weight Paint > [</] Call Menu Keyboard |W| X
Image Paint > [</] Call Menu Keyboard |W| X
...
Here is a screenshot to better illustrate my idea.
I tried to avoid that big list, i found it a bit to much. When i update a key in the input list, it is reflected in the addon pref panel by the way.
PS why are you looping over all the extra buttons in your version? I only needed to check for the name/property and than i would be added.
I believe, this is that part row.context_pointer_set("keymap", km)
Perhaps its an idea to just show one, when this one is changed it will be applied to all others.
I get that no one wants to scroll through a big list; however, if it's clearly presented and labelled, I don't think it would present too much of a problem. Hopefully no one will need to set hotkeys very often, and there is the possibility of people wanting to set different hotkeys for the same menu depending on mode; e.g. set the Custom Menu hotkey to right-click for all modes except Weight Paint Mode, because in Weight Paint Mode right-click is used to select bones.
My problem with just showing one and then auto-updating the others is that it could lead to unexpected behaviour; e.g. the user sets a hotkey with our preferences, then decides that they want to change a hotkey for some of the modes, but not the others (like in my previous example), then goes back to the preferences, now the preferences don't accurately display the state of the hotkeys. We could pop up a warning about this, or we could force update the hotkeys (very bad idea in my opinion, especially for power users), but it seems to me that a well organized big list is easier and more flexible/powerful for everyone.
If you have any ideas that don't involve a long list, but accommodate both power users and regular users, and don't cause any unexpected behaviour, I'm happy to hear them.
PS The code I wrote was just a quick mock-up, if it's looping over extra stuff then that can probably be optimized out.
PPS If you're creating any new branches you should ignore my previous instructions and base them on the development branch.
I had some errors using that code, i simply added it to my altered version. Thats why i gave some errors i guess. So i went on and did 2 "quick", no really, mockups.
First idead was to use enum menu expanded. But that would take 3 rows, i was thinking about adding 3 rows and align them. But i dont think that is possible, by align i mean like the layers section in the footer of 2dview.
My other idea is to use booleans. This way you can open and close them, makes the GUI a bit smaller then a huge list.
There are 18 items if i counted correct, a lot of them have more than 1 key. So leaving them like they are now would mean a super long list. Thats why i had the idea to stuff them in sort of menu's, making the GUI a bit compacter and less chaotic to look at.
Yeah or Nay?
Boolean Example
Enum menu Example
PS i got a question, hope you can help me. I made this half working addon which is quick screen switcher. I use keys commands to quick switch between screen layouts in stead of the ctrl + arrows. On OSX this is buggin me, that code is used for the system. I can make a different one ofcourse. But if you want to skip a step or directly want to go to certain scene i find this quicker and easier. A different user made PIE menu version of it, also very nice. What he has done is that in the addon prefs you can set the screen to different pie sections (quite cleaver)
My version, i didnt new much about python then, needs the user to add the screen.set_layout in the input tab and add them manually. I was thinking off adding these in the addon prefs aswell.
The issue i have is that it doesnt seem to load the screens at startup i think. It loads the first basic ine i added, which is also the user prefs. But then spits out error that the other doesnt excist.
The other guy uses user prefrences as the base for all at the initial install. Then the user can preset them like he/she wishes.
Here is his version, perhaps you like to see it and understand my question better. If you got time though http://github.com/kilbee/kbPIEs
Those ideas are great! So, a definite Yeah to one of them, I just haven't figured out which one yet. I actually managed to get the Enum to work, and made a mockup that shows both (fully working) and adds underlines to rows. Do me a favour and backup your current preferences.py and then replace it with this one http://pasteall.org/969793/python. Try it, have a look at the code, and make sure everything works. The Enum is more compact, but if this addon somehow ends up with 50 hotkeys one day it could become a little unwieldy; also with the Enum you can't have more than one hotkey open at a time. The Boolean is longer, but allows you to see multiple hotkeys at once, will be basically as effective no matter how many hotkeys it gets, and maybe would be a little more familiar to users?
Thoughts?
I had a bit of a look at your PS question, but I'm a little confused as to what you're trying to do. Do you want to be able to create a separate hotkey for each screen layout or have a menu pop up with a list of all screen layouts that allows you to switch to them, or something else? If you're having trouble loading screens on startup try this:
@bpy.app.handlers.persistent
def scene_update_post_reg(scene):
# remove handler
bpy.app.handlers.scene_update_post.remove(scene_update_post_reg)
for x in bpy.data.screens:
print(x)
def register():
# add a handler so blender executes whatever after everything has loaded
bpy.app.handlers.scene_update_post.append(scene_update_post_reg)
And if that doesn't help let me know and we'll try to sort something out.
Oh and there are actually 19 items (there are 2 for proportional, the operator and a call menu).
Thanks for update, ill test it right away
As for the PS question, i think i very wasn't clear what i needed :) But i got it working like i wanted. I would be easier if the user only sees a dropdown menu. But i could not get that to work properly.
I had already made this addon a while back, but user needed to manually add the operator in the input items. Ive now added the hotkeys to the addon prefs so they can be setup much easier. Also the the key items are added automatically now when addon is activated.
You can check it out here
Perhaps ill add a wm dialog to make it visual. This other user Kilbee had made a pie menu version. Perhaps we can combine them eventually.
I tried the piece of code you send, but i get a huge list of errors. Ill try it with a original version of the addon. I still have mu edits in some of the files.
This is the error log i got
search for unknown operator 'BPY_OT_OPS_OT_wm.read_homefile()', 'BPY_OT_ops.wm.read_homefile()'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'UVLB_OT_io', 'UVLB_OT_io'
search for unknown operator 'UVLB_OT_io', 'UVLB_OT_io'
search for unknown operator 'UVLB_OT_io', 'UVLB_OT_io'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
Warning: property 'name' not found in keymap item 'OperatorProperties'
search for unknown operator 'BPY_OT_OPS_OT_wm.read_homefile()', 'BPY_OT_ops.wm.read_homefile()'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_snap_menu_operator', 'VIEW3D_OT_snap_menu_operator'
search for unknown operator 'VIEW3D_OT_shading_menu_operator', 'VIEW3D_OT_shading_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_editor_mode_operator', 'VIEW3D_OT_editor_mode_operator'
search for unknown operator 'VIEW3D_OT_manipulator_operator', 'VIEW3D_OT_manipulator_operator'
search for unknown operator 'UVLB_OT_io', 'UVLB_OT_io'
search for unknown operator 'UVLB_OT_io', 'UVLB_OT_io'
search for unknown operator 'UVLB_OT_io', 'UVLB_OT_io'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_extrude_menu_operator', 'VIEW3D_OT_extrude_menu_operator'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
search for unknown operator 'VIEW3D_OT_aui_help_menu', 'VIEW3D_OT_aui_help_menu'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
search for unknown operator 'VIEW3D_OT_proportional_menu_operator', 'VIEW3D_OT_proportional_menu_operator'
search for unknown operator 'VIEW3D_OT_layers_window', 'VIEW3D_OT_layers_window'
DEBUG:TheaForBlender:setConfig
DEBUG:TheaForBlender:setConfig
RESTORE 0
Traceback (most recent call last):
File "/Applications/Blender 2.78c/blender.app/Contents/Resources/2.78/scripts/startup/bl_operators/wm.py", line 1809, in execute
info_ver))
TypeError: not enough arguments for format string
location: <unknown location>:-1
location: <unknown location>:-1
Its me again :)
Im still so glad i found this addon. I had one issue and that was the modal menu delay time. I found 0.3 ms a bit long. So i added a setting for this. Now the user is able to set the delay speed. I got at 0.13 which is much faster but i prefer it this way.
Its much nice actually when the delay is shorter. I set the minimum at 0.1 at max at 1. So users cant go overboard with it. 0 isnt possible because that would conflict with regular shift + tab press.
I havent noticed any issues yet shortening the delay time.
Sorry about the late reply, I got really busy. Delay time is another thing that definitely should be set-able from the preferences, so thanks for that. :) I guess I should mention that I have been creating properties with the set_prop function from Utils/core.py because that allows me to delete them all with a single call to del_props when I unregister the addon.
I don't know why the code I sent you caused that big list of errors, but here is a zip with the code as a separate addon so you can compare them side by side. Just put it in your addons folder, activate it (it's called Advanced UI Menus Pref Test), and see if that works. Note make sure to deactivate any other versions of my addon first. Advanced_UI_Menus_Pref_Test.zip
I had a really quick look in that utils folder. Looks very complicated :) ill try to test the new version ASAP.
I got busy again, but I'm back now. I think we should go with an Enum embedded in a UIList: That way we get the speed of the Enum and no matter how many hotkeys there are it should stay almost as efficient as it is now. So now the question is, providing you agree with the Enum UIList, do you want to add this to your delay setting and create a new pull request, or do you want me to add a delay setting to the code I've written and commit everything on my end and credit you for ideas and initial code in the commit? I've probably meddled with this a lot more than I should have, so sorry about that, but I really like the ideas you've had and your interest in the addon.
Hi sorry for the absense. Wow that new setup looks a bit overwhelming dont you think? Isnt this a bit overkill? Have all separate keys for each paint method for instance, thats are quite some options.
Concerning the delay method, i think i need to make an adjustment. The current setup uses a scene prop, so its saved per scene. Thats so each and everytime you open a old or different scene i needs to be adjusted again. Perhaps i can make some config setup which either reads an json or txt file and simple loads that.
No problem, we all get busy :)
As I understand it, if you want to constrain a hotkey to certain modes you have to make separate keymaps for each of those modes. I don't want to have just one global hotkey for the 3D View because it could conflict with hotkeys in sub-modes; however, we could have a button at the top that says "set all keymaps for this menu to key..." so that people can change them all at once, or something like that.
For the delay method I think you can just assign a FloatProperty to a class variable in the preference class and access it like this:
context.user_preferences.addons['Advanced_UI_Menus'].preferences.delay
Oh, and just FYI, in your screenshot you have the delay listed as being in milliseconds, not seconds.
Perhaps that is better indeed, that looks like a much simpler option i thought. My idea was to make some log file in json or ini which is loaded. But you say linking directly to that float which is saved ofcourse. That would mean way less code wouldnt it?
Will those enum menu properly update when you adjust them. Ive noticed some weird stuff with dynamic enum menus. When i add some values in a txt file and the enum needs to read those, somehow when a value is added and length is changeed i cant set to the last value unless i either reload the addons or close and reopen blender.
Yes, going the class variable route should result in way less code, and I can confirm that it works great on my system.
I think I've noticed some weird things with enums before too, but in this case the actual EnumProperty itself is static, so the only time it will get updated is on a new release of the addon. The hotkey list that is displayed under the enum is fully dynamic and seems to update fine if the user adds a new keymap in the main blender hotkey preferences. If you want, I'll push my (very hacky) hotkey preference testing branch to GitHub and you can try it out for yourself.
But this enum is not static, at least when you change the hotkeys. Thats is dynamic or am i missing something. The number of input or data for the keys is the same, but the keys themselves can change.
PS how do you write that float btw for the delay? I mean kind of type are you using for that? Do you use scene, but give a standard setting, because that is what i did. So each time its different. When you open a scene which had this set, the time can be different from the default.
Thats why i wanted to go with the load json or ini system. This way there is one method, which is not written to scene but to a file. Each time blender or a file is opened this setting is read.
or do write the delay just in the header of the add like this
delay = bpy.prop.FloatProperty(...)
So you dont write it to scene or nothing else?
I have 19 items in an EnumProperty that represent my 19 menus; this will not change unless the addon is updated. The enum is displayed on multiple rows in Blender's scrollable ui list widget. Underneath the enum I have all the keymaps for the selected enum item drawn; this updates every time the preference window is redrawn, so each time you select a new enum item, e.g. you switch from viewing the hotkeys for the Brush Options menu to viewing the hotkeys for the Snapping menu, the keymaps get redrawn for the selected enum item.
I have the delay float assigned as a class variable for the preference class like this:
class AdvancedUIPreferences(bpy.types.AddonPreferences): bl_idname = os.path.basename(os.path.dirname(os.path.realpath(__file__))) delay = bpy.props.FloatProperty("sec", default=0.3, min=0.1, max=1.0) def draw(self, context): ...
Aha indeed how i thought you would do it, much easier than loading some file and store the prefs.
Curious how you align the unfolded enum now :)
Here is my layout code for displaying an unfolded enum in both the regular layout and in a UIList Regular:
class AdvancedUIPreferences(bpy.types.AddonPreferences):
bl_idname = os.path.basename(os.path.dirname(os.path.realpath(__file__)))
def draw(self, context):
layout = self.layout
box = layout.box()
col = box.column()
scene = context.scene
rowwidth = 6
# create a list with the number of rows needed to display the enum based on rowwidth,
# results in [0, 1, 2, 3];
numrows = [x for x in range(-(-len(bpy.types.Scene.TestPref[1]["items"]) // rowwidth))]
# the calculation in the range function is used to round up if enum does not divide evenly:
# -(-x // y),
# python's integer division always rounds down, so if the result ends up being -3.1 it will round
# down to -4 and then all that's needed is to convert the result to positive with -(result)
for x, item in enumerate(bpy.types.Scene.TestPref[1]["items"]):
# check if a new row needs to be created and initialize count for that row
if x / rowwidth in numrows:
count = rowwidth
enumrow = col.row(True)
# add an enum button to the row and decrement count
enumrow.prop_enum(scene, "TestPref", item[0])
count = count -1
# if an enum row has less than rowwidth number of items
# add remaining ones as blank labels so everything lines up
if count:
for x in range(count):
enumrow.label("")
UIList:
rowwidth = 6
class HotkeyCollectionProperty(bpy.types.PropertyGroup):
row = bpy.props.IntProperty()
class AdvancedUIPreferences(bpy.types.AddonPreferences):
bl_idname = os.path.basename(os.path.dirname(os.path.realpath(__file__)))
list_data = bpy.props.CollectionProperty(type=HotkeyCollectionProperty)
list_index = bpy.props.IntProperty()
def draw(self, context):
global rowwidth
if len(self.list_data) == 0:
# add items to the CollectionProperty and assign row index;
# based on the number of items in the enum integer divided by rowwidth and then rounded up
for n in range(-(-len(bpy.types.Scene.TestPref[1]["items"]) // rowwidth)):
row = self.list_data.add()
row.row = n
layout = self.layout
box = layout.box()
col = box.column()
col.template_list("EnumPreferenceHotkeyList", "", self, "list_data", self, "list_index", rows=4)
class EnumPreferenceHotkeyList(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
global rowwidth
count = rowwidth
enumrow = layout.row(True)
# iterate through the enum items for the row being drawn;
# item.row is the index for the row being drawn
for x in range(item.row * rowwidth, item.row * rowwidth + rowwidth):
if x == len(bpy.types.Scene.TestPref[1]["items"]):
break
# add an enum button to the row and decrement count
enumrow.prop_enum(context.scene, "TestPref", bpy.types.Scene.TestPref[1]["items"][x][0])
count = count -1
# if an enum row has less than rowwidth number of items
# add remaining ones as blank labels so everything lines up
if count:
for x in range(count):
enumrow.label("")
Now, the EnumProperty probably shouldn't be stored in Scene and the initialization of the CollectionProperty probably shouldn't be done in the draw method of the AdvancedUIPreferences class, but I hope this gives you an idea of how I display an enum across multiple rows in both the regular layout and a UIList.
P.S. I extracted this from the preference layout code that I'm testing, so if there are any mistakes I apologize, but the gist of it should be there.
Wow that looks complicated, to much for me... what does // do actually ive seen it before, cant remember it correct.
// is used for integer division in python, so if you divide 19 by 6 you will get 3 instead of 3.166.... Integer division in python always rounds down, so if the result ends up as a negative number, say -19 divided by 6 equals -3.166..., it will be rounded down to -4.
I really like the Enum in a UIList for the preferences that I showed you, and unless you have any major objections to it, I think we should go with that.
So, do you want to make a new pull request or do you want me to commit it and credit you in the commit?
I still think its a bit overwhelming, but i dont see a different method i think. I was thinking about dividing them perhaps into categories, so you could have a couple main categories and these would get sub-categories. I cant think of proper method though.
I thought something like Edit, Viewport, Painting as main and than put each one under one of these. This would breakup the list quite well. But im not sure its clear enough that paint would have all the paint options, vertex, weight and perhaps dynotopo.
Dont have all options icons? Perhaps use these instead of text, perhaps that makes it look less intimidating?
I'm not sure about categories, I think they would end up making things more confusing, but if you want make a mockup and I'll take a look at it. As to icons, none of my menus have icons themselves, but if you're talking about the actual keymap categories I think they all have icons so we could add an icon-only label on the same row in front of each of them.
Whatever is decided, as long as the end result is well structured I don't think anyone will have any trouble, and I think that either one of the methods we came up with here (Boolian list or Enum/UIList) will serve very well.
I don't really care whether there are icons or not, but I do want to proceed with this and get something committed; after we have a solid base we can tweak things to improve the user experience, but this is already a gigantic step forward in usability and I would like to get this out to the users.
yes yes i get it. Was just think perhaps find an idea to make less menu visible. Thats why i though categories. I though perhaps we can order them by
That would already mean way less menu all at once.
I think having categories will end up being more confusing to users, and the more complex the code the more chance of bugs, but I haven't tested out categories so I could be wrong. If you think having categories would improve the user experience then code a working example with categories and either the Boolian or Enum/UIList with the hotkeys; post it here as a zip or send it to me as a pull request, and I'll look it over.
osx 10.10.2 bl 2.78c
I didnt get the 2.79 warning which i ometimes see with other addons. Im using 2.78c and i see this error;