Fix manipulator keymap initialization

Update flag was cleared before being checked
when registering after load.
This commit is contained in:
Campbell Barton
2017-07-31 04:46:35 +10:00
parent c90a3af879
commit 0467443930
2 changed files with 4 additions and 4 deletions

View File

@@ -83,8 +83,6 @@ static wmManipulatorGroupType *wm_manipulatorgrouptype_append__begin(void)
{
wmManipulatorGroupType *wgt = MEM_callocN(sizeof(wmManipulatorGroupType), "manipulatorgrouptype");
wgt->type_update_flag |= WM_MANIPULATORMAPTYPE_KEYMAP_INIT;
return wgt;
}
static void wm_manipulatorgrouptype_append__end(wmManipulatorGroupType *wgt)
@@ -92,6 +90,8 @@ static void wm_manipulatorgrouptype_append__end(wmManipulatorGroupType *wgt)
BLI_assert(wgt->name != NULL);
BLI_assert(wgt->idname != NULL);
wgt->type_update_flag |= WM_MANIPULATORMAPTYPE_KEYMAP_INIT;
/* if not set, use default */
if (wgt->setup_keymap == NULL) {
if (wgt->flag & WM_MANIPULATORGROUPTYPE_SELECT) {

View File

@@ -1016,13 +1016,13 @@ void WM_manipulatorconfig_update(struct Main *bmain)
wgt_ref = wgt_ref->next)
{
if (wgt_ref->type->type_update_flag & WM_MANIPULATORMAPTYPE_KEYMAP_INIT) {
wgt_ref->type->type_update_flag &= ~WM_MANIPULATORMAPTYPE_KEYMAP_INIT;
WM_manipulatormaptype_group_init_runtime_keymap(bmain, wgt_ref->type);
wgt_ref->type->type_update_flag &= ~WM_MANIPULATORMAPTYPE_KEYMAP_INIT;
}
if (wgt_ref->type->type_update_flag & WM_MANIPULATORMAPTYPE_UPDATE_INIT) {
wgt_ref->type->type_update_flag &= ~WM_MANIPULATORMAPTYPE_UPDATE_INIT;
WM_manipulatormaptype_group_init_runtime(bmain, mmap_type, wgt_ref->type);
wgt_ref->type->type_update_flag &= ~WM_MANIPULATORMAPTYPE_UPDATE_INIT;
}
}
}