Tool System: store the fallback tool for re-use

The fallback tool was run-time only data,
now it's stored in the blend file.
This commit is contained in:
2020-01-03 12:26:36 +11:00
parent a854840e76
commit a8ce9a143a
5 changed files with 34 additions and 30 deletions

View File

@@ -63,7 +63,9 @@ static void rna_WorkSpaceTool_setup(ID *id,
STRNCPY(tref_rt.op, op_idname);
tref_rt.index = index;
STRNCPY(tref_rt.idname_fallback, idname_fallback);
/* While it's logical to assign both these values from setup,
* it's useful to stored this in DNA for re-use, exceptional case: write to the 'tref'. */
STRNCPY(tref->idname_fallback, idname_fallback);
STRNCPY(tref_rt.keymap_fallback, keymap_fallback);
WM_toolsystem_ref_set_from_runtime(C, (WorkSpace *)id, tref, &tref_rt, idname);