Hi I am writing an addon popup that shows all the current shortcuts this is context sensitive and I have it mostly done. However I am not able to get much information from the other python addons.
Below is some of CoDEManX’s code that collects a lot of the info I need however
It does not seem to collect anything for Python addons
Is there a way to collect the same info that the tooltips do from within python.
It does work as long as it’s defined.
I got tripped up by the Node Wrangler and the modal key maps.
Node wrangler defines his own way around it and the modal ones don’t even have a name (I’m still working out how to handle them). I did however get a bit of a handle on dealing with the 1600 or so keymaps and the addon’s a context sensitive popup now.
I cross posted this :no: on stack exchange and pink vertex and sambler put me onto doc which didn’t seam to do much more.
I finally ran grep in the scripts directory as I should have when pink vertex first sugessted it. Duh.
Line 340 in bl_extract_messages.py gives it up
It looks to me that if it doesn’t have a bl_rna.description then it uses the doc part and if neither are defined then your stuffed.
In the process I realised that the bulk of what I need is directly in the keymaps themselves as .name attribute of the individual keymap. As you probably know, this is derived from the bl_label that is in the op that is called by the new keymap definition line and is required so it’s a bit more reliable.
All I really need to do is deal with thing like Shift F2…12 gives Context Set Enum for all but at least the code below based on yours gives a bit of a clue to what the description means.
Thanks heaps for your help. Without it I would have been crying a lot more pealing this Blender/Python onion.
if idtype.bl_rna.properties[prop].description and attr: #str(attr).strip() !="":
if idtype.bl_rna.properties[prop].type == 'BOOLEAN':
description += " {:}".format(idtype.bl_rna.properties[prop].description)
else:
description += " Where, '{:}', is {:}".format(idtype.bl_rna.properties[prop].description.lower(),str(attr).replace('_'," ").lower().title())
I know I marked this as solved but we are sort of on a new track so…
Yeah thats what I did in a sort of generic way in
" Where, '{:}', is {:}".format(idtype.bl_rna.properties[prop].description.lower(),str(attr).replace('_'," ").lower().title())
which handles the enum’s ok it gets tricker when the attributes are pointers, vectors and the like.
I am probably over doing this but it’s all good knowledge in the end.
I am not blending at the moment but when I get back to it I should be able to do things with way more understanding.
This is a pretty consuming hobby good thing I have a dumb job that requires minimal thought and my partner is not around at the moment.
By the way I noticed your comment
“otherwise refrain from creating a popup, it’s against Blender’s UI concept.”
Does this mean my context sensitive help popup is a bad idea.
My current thinking is a menu item in each header which gives the keys available for that area. This could then be called with call_menu or not as the guidelines suggest.