- This topic has 2 replies, 2 voices, and was last updated 2 years, 11 months ago by kurtf.
- AuthorPosts
Having a bit of frustration. I would like to be able to run short blocks of python code, basic commands harvested from the python console, via a hotkey. Ideally I would like to press a hotkey and invoke –
bpy.ops.object.mode_set_with_submode(mode=’EDIT’, toggle=False, mesh_select_mode={‘VERT’})
Unfortunately there doesn’t seem to be an easy way to do this. I’ve seen various web posts about putting this code into the Preferences – Key Map panel, but that doesn’t seem to work. Even the shorter version –
bpy.ops.object.mode_set(mode=’EDIT’)
which actually fits into the space, fails to launch with a hotkey.
Someone else said that you need to code up an addon, which I’ve done following some youtube videos. But I still can’t seem to bind a hotkey to launch the addon.
Seems some prerequisite information is missing.
Anyone have any hints as to how to get this working? In Maya you can drag snippets of code to the tool panel and the software converts it to a button automatically. It would be nice to get this functionality in BforArtists. Still, there must be a way to run a macro from a hotkey.
Thanks.
Hey kurtf,
You need to add the hotkey in your register class. Have a look here:
https://www.youtube.com/watch?v=0xBhh47Tblc
Another easy way would simply to create a button with the corresponding class by script. Then right click at it. And then you can assing a shortcut too.
Kind regards
Reiner
This is my signature. You can change your signature in the profile
Interesting. Thank you for this. I’ll investigate further.
I knew there was something I was missing.
This post has received 1 Likes.- AuthorPosts
- You must be logged in to reply to this topic.