Unleash the power of 3D
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24084 Likes: 0
    kurtf
    Participant
    • Posts 4

    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.

    #24094 Likes: 0
    BFA-Reiner
    Keymaster
    • Posts 719

    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

    #24109 Likes: 1
    kurtf
    Participant
    • Posts 4

    Interesting. Thank you for this. I’ll investigate further.

    I knew there was something I was missing.

    This post has received 1 Likes.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.