diff options
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index bf2dc550067..6b16e19f790 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1751,7 +1751,7 @@ static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const in if ((base->flag & flag) == flag) { if (!ID_IS_LINKED_DATABLOCK(ob) && ob->id.us > 1) { /* base gets copy of object */ - obn = BKE_object_copy(ob); + obn = BKE_object_copy(bmain, ob); base->object = obn; if (copy_groups) { @@ -1784,7 +1784,7 @@ static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const in } if (all_duplicated) { - groupn = BKE_group_copy(group); + groupn = BKE_group_copy(bmain, group); for (go = groupn->gobject.first; go; go = go->next) go->ob = (Object *)go->ob->id.newid; @@ -1821,7 +1821,7 @@ void ED_object_single_user(Main *bmain, Scene *scene, Object *ob) single_object_users(bmain, scene, NULL, OB_DONE, copy_groups); } -static void new_id_matar(Material **matar, const int totcol) +static void new_id_matar(Main *bmain, Material **matar, const int totcol) { ID *id; int a; @@ -1835,7 +1835,7 @@ static void new_id_matar(Material **matar, const int totcol) id_us_min(id); } else if (id->us > 1) { - matar[a] = BKE_material_copy(matar[a]); + matar[a] = BKE_material_copy(bmain, matar[a]); id_us_min(id); id->newid = (ID *)matar[a]; } @@ -1865,7 +1865,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, const int flag) switch (ob->type) { case OB_LAMP: - ob->data = la = BKE_lamp_copy(ob->data); + ob->data = la = BKE_lamp_copy(bmain, ob->data); for (a = 0; a < MAX_MTEX; a++) { if (la->mtex[a]) { ID_NEW(la->mtex[a]->object); @@ -1873,37 +1873,37 @@ static void single_obdata_users(Main *bmain, Scene *scene, const int flag) } break; case OB_CAMERA: - ob->data = BKE_camera_copy(ob->data); + ob->data = BKE_camera_copy(bmain, ob->data); break; case OB_MESH: - ob->data = me = BKE_mesh_copy(ob->data); + ob->data = me = BKE_mesh_copy(bmain, ob->data); if (me->key) BKE_animdata_copy_id_action((ID *)me->key); break; case OB_MBALL: - ob->data = BKE_mball_copy_ex(bmain, ob->data); + ob->data = BKE_mball_copy(bmain, ob->data); break; case OB_CURVE: case OB_SURF: case OB_FONT: - ob->data = cu = BKE_curve_copy_ex(bmain, ob->data); + ob->data = cu = BKE_curve_copy(bmain, ob->data); ID_NEW(cu->bevobj); ID_NEW(cu->taperobj); if (cu->key) BKE_animdata_copy_id_action((ID *)cu->key); break; case OB_LATTICE: - ob->data = lat = BKE_lattice_copy_ex(bmain, ob->data); + ob->data = lat = BKE_lattice_copy(bmain, ob->data); if (lat->key) BKE_animdata_copy_id_action((ID *)lat->key); break; case OB_ARMATURE: DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - ob->data = BKE_armature_copy(ob->data); + ob->data = BKE_armature_copy(bmain, ob->data); BKE_pose_rebuild(ob, ob->data); break; case OB_SPEAKER: - ob->data = BKE_speaker_copy(ob->data); + ob->data = BKE_speaker_copy(bmain, ob->data); break; default: if (G.debug & G_DEBUG) @@ -1945,7 +1945,7 @@ static void single_object_action_users(Scene *scene, const int flag) } } -static void single_mat_users(Scene *scene, const int flag, const bool do_textures) +static void single_mat_users(Main *bmain, Scene *scene, const int flag, const bool do_textures) { Object *ob; Base *base; @@ -1962,7 +1962,7 @@ static void single_mat_users(Scene *scene, const int flag, const bool do_texture /* do not test for LIB_TAG_NEW: this functions guaranteed delivers single_users! */ if (ma->id.us > 1) { - man = BKE_material_copy(ma); + man = BKE_material_copy(bmain, ma); BKE_animdata_copy_id_action(&man->id); man->id.us = 0; @@ -1973,7 +1973,7 @@ static void single_mat_users(Scene *scene, const int flag, const bool do_texture if (ma->mtex[b] && (tex = ma->mtex[b]->tex)) { if (tex->id.us > 1) { id_us_min(&tex->id); - tex = BKE_texture_copy(tex); + tex = BKE_texture_copy(bmain, tex); BKE_animdata_copy_id_action(&tex->id); man->mtex[b]->tex = tex; } @@ -1987,7 +1987,7 @@ static void single_mat_users(Scene *scene, const int flag, const bool do_texture } } -static void do_single_tex_user(Tex **from) +static void do_single_tex_user(Main *bmain, Tex **from) { Tex *tex, *texn; @@ -2000,7 +2000,7 @@ static void do_single_tex_user(Tex **from) id_us_min(&tex->id); } else if (tex->id.us > 1) { - texn = BKE_texture_copy(tex); + texn = BKE_texture_copy(bmain, tex); BKE_animdata_copy_id_action(&texn->id); tex->id.newid = (ID *)texn; id_us_min(&tex->id); @@ -2020,7 +2020,7 @@ static void single_tex_users_expand(Main *bmain) if (ma->id.tag & LIB_TAG_NEW) { for (b = 0; b < MAX_MTEX; b++) { if (ma->mtex[b] && ma->mtex[b]->tex) { - do_single_tex_user(&(ma->mtex[b]->tex)); + do_single_tex_user(bmain, &(ma->mtex[b]->tex)); } } } @@ -2030,7 +2030,7 @@ static void single_tex_users_expand(Main *bmain) if (la->id.tag & LIB_TAG_NEW) { for (b = 0; b < MAX_MTEX; b++) { if (la->mtex[b] && la->mtex[b]->tex) { - do_single_tex_user(&(la->mtex[b]->tex)); + do_single_tex_user(bmain, &(la->mtex[b]->tex)); } } } @@ -2040,7 +2040,7 @@ static void single_tex_users_expand(Main *bmain) if (wo->id.tag & LIB_TAG_NEW) { for (b = 0; b < MAX_MTEX; b++) { if (wo->mtex[b] && wo->mtex[b]->tex) { - do_single_tex_user(&(wo->mtex[b]->tex)); + do_single_tex_user(bmain, &(wo->mtex[b]->tex)); } } } @@ -2059,19 +2059,19 @@ static void single_mat_users_expand(Main *bmain) for (ob = bmain->object.first; ob; ob = ob->id.next) if (ob->id.tag & LIB_TAG_NEW) - new_id_matar(ob->mat, ob->totcol); + new_id_matar(bmain, ob->mat, ob->totcol); for (me = bmain->mesh.first; me; me = me->id.next) if (me->id.tag & LIB_TAG_NEW) - new_id_matar(me->mat, me->totcol); + new_id_matar(bmain, me->mat, me->totcol); for (cu = bmain->curve.first; cu; cu = cu->id.next) if (cu->id.tag & LIB_TAG_NEW) - new_id_matar(cu->mat, cu->totcol); + new_id_matar(bmain, cu->mat, cu->totcol); for (mb = bmain->mball.first; mb; mb = mb->id.next) if (mb->id.tag & LIB_TAG_NEW) - new_id_matar(mb->mat, mb->totcol); + new_id_matar(bmain, mb->mat, mb->totcol); /* material imats */ for (ma = bmain->mat.first; ma; ma = ma->id.next) @@ -2376,7 +2376,7 @@ static int make_single_user_exec(bContext *C, wmOperator *op) } if (RNA_boolean_get(op->ptr, "material")) { - single_mat_users(scene, flag, RNA_boolean_get(op->ptr, "texture")); + single_mat_users(bmain, scene, flag, RNA_boolean_get(op->ptr, "texture")); } #if 0 /* can't do this separate from materials */ |