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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-13 17:29:12 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-13 17:29:12 +0300
commitf61c30f804e36bf00e7124514f02bbee42e0197d (patch)
tree0f947a35c7814cb15ce7cfa1b5a2c1eb01d910d7 /source/blender/editors/mesh
parent5ff1d845ead05ac6ef952782ebd3ed98277ef6c5 (diff)
Cleanup: get rid of last G.main in BMesh code.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c4
-rw-r--r--source/blender/editors/mesh/editmesh_undo.c4
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c5
-rw-r--r--source/blender/editors/mesh/mesh_data.c2
4 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 0625ebe6dd6..70c4f341bd8 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -3223,7 +3223,7 @@ static Base *mesh_separate_tagged(Main *bmain, Scene *scene, Base *base_old, BMe
BM_mesh_normals_update(bm_new);
- BM_mesh_bm_to_me(bm_new, base_new->object->data, (&(struct BMeshToMeshParams){0}));
+ BM_mesh_bm_to_me(bmain, bm_new, base_new->object->data, (&(struct BMeshToMeshParams){0}));
BM_mesh_free(bm_new);
((Mesh *)base_new->object->data)->edit_btmesh = NULL;
@@ -3526,7 +3526,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
if (retval_iter) {
BM_mesh_bm_to_me(
- bm_old, me,
+ bmain, bm_old, me,
(&(struct BMeshToMeshParams){
.calc_object_remap = true,
}));
diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c
index 50aecd0a821..18c383deff0 100644
--- a/source/blender/editors/mesh/editmesh_undo.c
+++ b/source/blender/editors/mesh/editmesh_undo.c
@@ -502,8 +502,8 @@ static void *undomesh_from_editmesh(UndoMesh *um, BMEditMesh *em, Key *key)
/* BM_mesh_validate(em->bm); */ /* for troubleshooting */
BM_mesh_bm_to_me(
- em->bm, &um->me, (&(struct BMeshToMeshParams){
- /* Undo code should not be manipulating 'G.main->object' hooks/vertex-parent. */
+ NULL, em->bm, &um->me, (&(struct BMeshToMeshParams){
+ /* Undo code should not be manipulating 'G_MAIN->object' hooks/vertex-parent. */
.calc_object_remap = false,
.cd_mask_extra = CD_MASK_SHAPE_KEYINDEX,
}));
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 41e8a963383..e1303b14f0e 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -44,6 +44,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_report.h"
@@ -325,7 +326,7 @@ void EDBM_mesh_make(Object *ob, const int select_mode, const bool add_key_index)
* \warning This can invalidate the #DerivedMesh cache of other objects (for linked duplicates).
* Most callers should run #DAG_id_tag_update on \a ob->data, see: T46738, T46913
*/
-void EDBM_mesh_load(Object *ob)
+void EDBM_mesh_load(Main *bmain, Object *ob)
{
Mesh *me = ob->data;
BMesh *bm = me->edit_btmesh->bm;
@@ -337,7 +338,7 @@ void EDBM_mesh_load(Object *ob)
}
BM_mesh_bm_to_me(
- bm, me, (&(struct BMeshToMeshParams){
+ bmain, bm, me, (&(struct BMeshToMeshParams){
.calc_object_remap = true,
}));
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index f3ccdf32938..fc74397010c 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -605,7 +605,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, const wmEvent *e
ED_uvedit_assign_image(bmain, scene, obedit, ima, NULL);
if (exitmode) {
- EDBM_mesh_load(obedit);
+ EDBM_mesh_load(bmain, obedit);
EDBM_mesh_free(me->edit_btmesh);
MEM_freeN(me->edit_btmesh);
me->edit_btmesh = NULL;