Keymap import issue

In earlier version of Blender 2.80 (around March), I have created a custom keymap with entries like following:

    ("wm.tool_set_by_name",
     {"type": 'A', "value": 'PRESS'},
     {"properties":
      [("name", 'Select Box'),
       ],
      },
     ),

However, when importing to latest Blender 2.80 (April 24), these keymaps are no longer recognized.

Exporting them again result in this:

("wm.tool_set_by_name", {"type": 'A', "value": 'PRESS'}, None),

Questions:

  • Was the export from earlier version broken?
  • Or is this a bug introduced by latest Blender, due to new industry compat keymap?

I have tried “Load Factory Settings” and clean up Blender config/presets folders, nothing seems to help.

oh god, is wm.tool_set_by_name just gone? I can only find wm.tool_set_by_id in latest api doc now.

https://docs.blender.org/api/blender2.8/bpy.ops.wm.html?highlight=wm#bpy.ops.wm.tool_set_by_id

I feel Blender should convert this internally to avoid breaking exported keymaps?

yes, tool_set_by_name is now tool_set_by_id.

Why would they have custom migration code for something that is clearly in flux due to it being an unfinished beta feature? If they did something like that for every little API change they’ve made in the past couple of months it would be a full time job just writing migration. just find/replace in your keymap, this is the risk of using something that is beta.

Another question is does upgrading Blender breaks existing keymap (not importing, just keymap currently installed)

  • If so, and that’s life with Blender 2.80, sure.
  • If not, then I wonder why the same isn’t done to importing keymaps.

By the way, not just the API has changed, but the name for each button has also changed.

So unless something is done internally, I expect all keymap assignment relates to Tool menu are lost (as they were wm.tool_set_by_name)

Yes, blender upgrades can potentially break keymaps. As part of the update process, all of the official keymaps get maintained by the devs doing the breaking- any custom keymaps you have built are up to you.