THANKS !Yesterday I try to add it to the preference class but it can only draw the tile box. Now it makes !
ow thats a nice one! Much easier then the current i use which loops of keymap items and checks for custom props ive added.
Im trying to figure out a method to be able to save preset for addon keyitems. This is quite a difficult one. I dont want the main keymaps to be saved, i only want the items from the addon. So i can be loaded and saved. Been looking in the core code which saved keymaps… this is going to be tough one
Any one have ideas or perhaps tips?
So basically what i want is that only the keymap items which are preset in the addon, being stored as custom keymap for addon, nothing else. I guess i need to alter the excisting operators and add those to custom files
Wow! very useful!
I have a question. Do you know how I can hide the “X” button, in order to avoid to remove the shortcut accidentally.
This display the keymap display menu(rna_keymap_ui.draw_kmi) provided by Blender.
Therefore, unless such an hide option is provided from the start, it would be impossible to edit this keymap menu itself.
Wel since its importing it using an helper. I guess if you alter it, perhaps it is possible.
I did something like that for add_preset and than I am able to make preset for items like curves and color ramps, which normally is not possible default preset system
Edit
Had a quick look at that rna_keymap_ui.draw_kmi
If you remove or comment out the circle part from else: till the icon is defined and save that as custom draw_kmi file and add this with your addon, you should see it without the x
Than in you addon change the import of the file to your addon, same as you import other modules
Hope its clear
Niiice! Sounds good.
Could you share me the method that are you using to overwrite the original draw_kmi in your addon? Because I tried but for some reason doesn’t work for me.
Maybe I’m doing something wrong when importing, etc.
Thank you!
Could you perhaps look at the console and see if you have an error?
when you made the custom version, did you save the file in your addon folder and than adjusted the import path?
I just tested it on my computer, does work.
before
after
Add # to comment out this section
Save the file in the same folder as your add-on, if its a single file. than either add it to your file or make it a multi file add-on
If you have multi-file setup, use this method to import
from . import rna_keymap_ui
But if you only want to show them as a label, then it would need some more work. Since now, we can still edit them
It’s very strange… but I did exactly the same thing other day (I think…)…
But now works well!
Maybe I had a problem with .pyc cachés… idk…
Many thanks!!
…ah, wait a minute… I have another question. I supposed that in this case Blender is not affected by this new file, right?
I mean, Is the “rna_keymap_ui” file being used only by the plugin?
Because I think for example… what happens if blender changes this file in a new version?
Thanks a lot!!
Well that depends. If you said you wanted it for your addon. So that why I showed you, that you need to save it in your addon folder or inside your addon file.
If you save the original file at the same sport, now all you add-ons are effe tes by this. But also the part where you actually adjust the kepmaps.
If you download a new version and you have saved over the original you need to do it again. But again, as you want this only to affe tyour addon, save the rna_keymap to your addon file and import into you addon. That way it will be the same in the newer blender version
That’s crystal clear, thanks!