Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / object / object_add.c
index d66a176..d75d5de 100644 (file)
@@ -82,6 +82,7 @@
 #include "BKE_material.h"
 #include "BKE_mball.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_nla.h"
 #include "BKE_object.h"
 #include "BKE_particle.h"
@@ -1634,10 +1635,10 @@ static void convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *scene, Objec
        }
 }
 
-static void curvetomesh(Depsgraph *depsgraph, Scene *scene, Object *ob)
+static void curvetomesh(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
 {
        convert_ensure_curve_cache(depsgraph, scene, ob);
-       BKE_mesh_from_nurbs(ob); /* also does users */
+       BKE_mesh_from_nurbs(bmain, ob); /* also does users */
 
        if (ob->type == OB_MESH) {
                BKE_object_free_modifiers(ob, 0);
@@ -1784,7 +1785,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                newob = ob;
                        }
 
-                       BKE_mesh_to_curve(depsgraph, scene, newob);
+                       BKE_mesh_to_curve(bmain, depsgraph, scene, newob);
 
                        if (newob->type == OB_CURVE) {
                                BKE_object_free_modifiers(newob, 0);   /* after derivedmesh calls! */
@@ -1845,7 +1846,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                         *               datablock, but for until we've got granular update
                         *               lets take care by selves.
                         */
-                       BKE_vfont_to_curve(bmain, newob, FO_EDIT);
+                       BKE_vfont_to_curve(newob, FO_EDIT);
 
                        newob->type = OB_CURVE;
                        cu->type = OB_CURVE;
@@ -1886,7 +1887,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                        BKE_curve_curve_dimension_update(cu);
 
                        if (target == OB_MESH) {
-                               curvetomesh(depsgraph, scene, newob);
+                               curvetomesh(bmain, depsgraph, scene, newob);
 
                                /* meshes doesn't use displist */
                                BKE_object_free_curve_cache(newob);
@@ -1910,7 +1911,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                        newob = ob;
                                }
 
-                               curvetomesh(depsgraph, scene, newob);
+                               curvetomesh(bmain, depsgraph, scene, newob);
 
                                /* meshes doesn't use displist */
                                BKE_object_free_curve_cache(newob);
@@ -2097,7 +2098,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer
 
                /* duplicates using userflags */
                if (dupflag & USER_DUP_ACT) {
-                       BKE_animdata_copy_id_action(&obn->id, true);
+                       BKE_animdata_copy_id_action(bmain, &obn->id, true);
                }
 
                if (dupflag & USER_DUP_MAT) {
@@ -2111,7 +2112,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer
                                        id_us_min(id);
 
                                        if (dupflag & USER_DUP_ACT) {
-                                               BKE_animdata_copy_id_action(&obn->mat[a]->id, true);
+                                               BKE_animdata_copy_id_action(bmain, &obn->mat[a]->id, true);
                                        }
                                }
                        }
@@ -2127,7 +2128,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer
                                        }
 
                                        if (dupflag & USER_DUP_ACT) {
-                                               BKE_animdata_copy_id_action(&psys->part->id, true);
+                                               BKE_animdata_copy_id_action(bmain, &psys->part->id, true);
                                        }
 
                                        id_us_min(id);
@@ -2255,9 +2256,9 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer
                        }
 
                        if (dupflag & USER_DUP_ACT) {
-                               BKE_animdata_copy_id_action((ID *)obn->data, true);
+                               BKE_animdata_copy_id_action(bmain, (ID *)obn->data, true);
                                if (key) {
-                                       BKE_animdata_copy_id_action((ID *)key, true);
+                                       BKE_animdata_copy_id_action(bmain, (ID *)key, true);
                                }
                        }