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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-01-20 17:11:12 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-01-20 17:16:22 +0400
commit018fe81779e81ad43b16c74969764ae3b71d4b40 (patch)
treed7b0c1a56e74055ea20358d2d88fa41090245a73 /source/blender/editors/util
parentaa18c4c445cbe7e5cbf0b766a42cfc9e4b764002 (diff)
Fix T38269: scene full copy in mesh edit or sculpt mode did not copy mesh edits.
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r--source/blender/editors/util/ed_util.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index df1dad69db0..ab4cd1697ba 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -51,7 +51,9 @@
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_main.h"
+#include "BKE_multires.h"
#include "BKE_packedFile.h"
+#include "BKE_paint.h"
#include "ED_armature.h"
#include "ED_image.h"
@@ -139,6 +141,32 @@ void ED_editors_exit(bContext *C)
mesh_mirrtopo_table(NULL, 'e');
}
+/* flush any temp data from object editing to DNA before writing files,
+ * rendering, copying, etc. */
+void ED_editors_flush_edits(bContext *C, bool for_render)
+{
+ Object *obact = CTX_data_active_object(C);
+ Object *obedit = CTX_data_edit_object(C);
+
+ /* get editmode results */
+ if (obedit)
+ ED_object_editmode_load(CTX_data_edit_object(C));
+
+ if (obact && (obact->mode & OB_MODE_SCULPT)) {
+ /* flush multires changes (for sculpt) */
+ multires_force_update(obact);
+
+ if (for_render) {
+ /* flush changes from dynamic topology sculpt */
+ sculptsession_bm_to_me_for_render(obact);
+ }
+ else {
+ /* Set reorder=false so that saving the file doesn't reorder
+ * the BMesh's elements */
+ sculptsession_bm_to_me(obact, FALSE);
+ }
+ }
+}
/* ***** XXX: functions are using old blender names, cleanup later ***** */