Fix T37967: autosave does not save dynamic topology edits while in sculpt mode.
This commit is contained in:
@@ -46,7 +46,7 @@ struct Mesh;
|
|||||||
void ED_editors_init(struct bContext *C);
|
void ED_editors_init(struct bContext *C);
|
||||||
void ED_editors_exit(struct bContext *C);
|
void ED_editors_exit(struct bContext *C);
|
||||||
|
|
||||||
void ED_editors_flush_edits(struct bContext *C, bool for_render);
|
void ED_editors_flush_edits(const struct bContext *C, bool for_render);
|
||||||
|
|
||||||
/* ************** Undo ************************ */
|
/* ************** Undo ************************ */
|
||||||
|
|
||||||
|
@@ -739,7 +739,6 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
|||||||
View3D *v3d = use_viewport ? CTX_wm_view3d(C) : NULL;
|
View3D *v3d = use_viewport ? CTX_wm_view3d(C) : NULL;
|
||||||
struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
|
struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
|
||||||
const char *name;
|
const char *name;
|
||||||
Object *active_object = CTX_data_active_object(C);
|
|
||||||
ScrArea *sa;
|
ScrArea *sa;
|
||||||
|
|
||||||
/* only one render job at a time */
|
/* only one render job at a time */
|
||||||
|
@@ -143,7 +143,7 @@ void ED_editors_exit(bContext *C)
|
|||||||
|
|
||||||
/* flush any temp data from object editing to DNA before writing files,
|
/* flush any temp data from object editing to DNA before writing files,
|
||||||
* rendering, copying, etc. */
|
* rendering, copying, etc. */
|
||||||
void ED_editors_flush_edits(bContext *C, bool for_render)
|
void ED_editors_flush_edits(const bContext *C, bool for_render)
|
||||||
{
|
{
|
||||||
Object *obact = CTX_data_active_object(C);
|
Object *obact = CTX_data_active_object(C);
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
Object *obedit = CTX_data_edit_object(C);
|
||||||
|
@@ -1086,8 +1086,6 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(w
|
|||||||
wmEventHandler *handler;
|
wmEventHandler *handler;
|
||||||
char filepath[FILE_MAX];
|
char filepath[FILE_MAX];
|
||||||
|
|
||||||
Scene *scene = CTX_data_scene(C);
|
|
||||||
|
|
||||||
WM_event_remove_timer(wm, NULL, wm->autosavetimer);
|
WM_event_remove_timer(wm, NULL, wm->autosavetimer);
|
||||||
|
|
||||||
/* if a modal operator is running, don't autosave, but try again in 10 seconds */
|
/* if a modal operator is running, don't autosave, but try again in 10 seconds */
|
||||||
@@ -1100,12 +1098,7 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scene) {
|
ED_editors_flush_edits(C, false);
|
||||||
Object *ob = OBACT;
|
|
||||||
|
|
||||||
if (ob && ob->mode & OB_MODE_SCULPT)
|
|
||||||
multires_force_update(ob);
|
|
||||||
}
|
|
||||||
|
|
||||||
wm_autosave_location(filepath);
|
wm_autosave_location(filepath);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user