Tool System: per space/mode tool support
[blender.git] / source / blender / blenloader / intern / readfile.c
index 9618ae432f1ec6886204dabc23253468854bdf18..42984cfefaaec79b89c272feb4823c5a58ca11f1 100644 (file)
@@ -2911,6 +2911,7 @@ static void direct_link_workspace(FileData *fd, WorkSpace *workspace, const Main
        link_list(fd, &workspace->hook_layout_relations);
        link_list(fd, &workspace->scene_viewlayer_relations);
        link_list(fd, &workspace->owner_ids);
+       link_list(fd, &workspace->tools);
 
        for (WorkSpaceDataRelation *relation = workspace->hook_layout_relations.first;
             relation;
@@ -2936,6 +2937,10 @@ static void direct_link_workspace(FileData *fd, WorkSpace *workspace, const Main
                        }
                }
        }
+
+       for (bToolRef *tref = workspace->tools.first; tref; tref = tref->next) {
+               tref->runtime = NULL;
+       }
 }
 
 static void lib_link_workspace_instance_hook(FileData *fd, WorkSpaceInstanceHook *hook, ID *id)