Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-06-27 00:57:00 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-06-27 00:57:33 +0400
commitdcc6300dddbd28ce335b450cfb44b2c4affa3ed8 (patch)
tree3db01d86ec83a75223e004630f4cdf20558454de /source/blender/editors/util
parent2aca720bff109861e2e617940f6e95076458ef71 (diff)
Fix T40691, dyntopo changes lost on save if sculpting on multiple
objects. Flush edits for all objects, not just the active one. Here we might want to disallow leaving an object on sculpt mode when selecting another, but this works, no need to enforce it.
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r--source/blender/editors/util/ed_util.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index c27e0b80b02..47fbfbe3eba 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -155,25 +155,27 @@ void ED_editors_exit(bContext *C)
* rendering, copying, etc. */
void ED_editors_flush_edits(const bContext *C, bool for_render)
{
- Object *obact = CTX_data_active_object(C);
+ Object *ob;
Object *obedit = CTX_data_edit_object(C);
-
+ Main *bmain = CTX_data_main(C);
/* get editmode results */
if (obedit)
ED_object_editmode_load(obedit);
- if (obact && (obact->mode & OB_MODE_SCULPT)) {
- /* flush multires changes (for sculpt) */
- multires_force_update(obact);
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
+ if (ob && (ob->mode & OB_MODE_SCULPT)) {
+ /* flush multires changes (for sculpt) */
+ multires_force_update(ob);
- if (for_render) {
- /* flush changes from dynamic topology sculpt */
- BKE_sculptsession_bm_to_me_for_render(obact);
- }
- else {
- /* Set reorder=false so that saving the file doesn't reorder
+ if (for_render) {
+ /* flush changes from dynamic topology sculpt */
+ BKE_sculptsession_bm_to_me_for_render(ob);
+ }
+ else {
+ /* Set reorder=false so that saving the file doesn't reorder
* the BMesh's elements */
- BKE_sculptsession_bm_to_me(obact, false);
+ BKE_sculptsession_bm_to_me(ob, false);
+ }
}
}
}