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 <bastien@blender.org>2020-06-10 19:39:27 +0300
committerBastien Montagne <bastien@blender.org>2020-06-10 20:45:52 +0300
commit91462fbb31baae85b7aa5e5a9ee3d70989ed93e1 (patch)
tree7723c815a2155b4176fdb55ebf76cd66d619a933 /source/blender/editors/object
parent4f314ee5b95a1d01cedca2272056f866d1557d7b (diff)
Cleanup: Remove no more used `ED_object_single_users`.
This utils was only used for scenes' full copy, and was using old deprecated ways to deal with ID relations and such. Good riddance!
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_relations.c130
1 files changed, 0 insertions, 130 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 0e8545e07ba..eed3f2ea90c 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1853,27 +1853,6 @@ void ED_object_single_user(Main *bmain, Scene *scene, Object *ob)
BKE_main_id_clear_newpoins(bmain);
}
-static void new_id_matar(Main *bmain, Material **matar, const int totcol)
-{
- ID *id;
- int a;
-
- for (a = 0; a < totcol; a++) {
- id = (ID *)matar[a];
- if (id && !ID_IS_LINKED(id)) {
- if (id->newid) {
- matar[a] = (Material *)id->newid;
- id_us_plus(id->newid);
- id_us_min(id);
- }
- else if (id->us > 1) {
- matar[a] = ID_NEW_SET(id, BKE_material_copy(bmain, matar[a]));
- id_us_min(id);
- }
- }
- }
-}
-
static void single_obdata_users(
Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag)
{
@@ -2017,115 +1996,6 @@ static void single_mat_users(
FOREACH_OBJECT_FLAG_END;
}
-static void single_mat_users_expand(Main *bmain)
-{
- /* only when 'parent' blocks are LIB_TAG_NEW */
- Object *ob;
- Mesh *me;
- Curve *cu;
- MetaBall *mb;
- bGPdata *gpd;
-
- for (ob = bmain->objects.first; ob; ob = ob->id.next) {
- if (ob->id.tag & LIB_TAG_NEW) {
- new_id_matar(bmain, ob->mat, ob->totcol);
- }
- }
-
- for (me = bmain->meshes.first; me; me = me->id.next) {
- if (me->id.tag & LIB_TAG_NEW) {
- new_id_matar(bmain, me->mat, me->totcol);
- }
- }
-
- for (cu = bmain->curves.first; cu; cu = cu->id.next) {
- if (cu->id.tag & LIB_TAG_NEW) {
- new_id_matar(bmain, cu->mat, cu->totcol);
- }
- }
-
- for (mb = bmain->metaballs.first; mb; mb = mb->id.next) {
- if (mb->id.tag & LIB_TAG_NEW) {
- new_id_matar(bmain, mb->mat, mb->totcol);
- }
- }
-
- for (gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) {
- if (gpd->id.tag & LIB_TAG_NEW) {
- new_id_matar(bmain, gpd->mat, gpd->totcol);
- }
- }
-}
-
-/* used for copying scenes */
-void ED_object_single_users(Main *bmain,
- Scene *scene,
- const bool full,
- const bool copy_collections)
-{
- single_object_users(bmain, scene, NULL, 0, copy_collections);
-
- if (full) {
- single_obdata_users(bmain, scene, NULL, NULL, 0);
- single_object_action_users(bmain, scene, NULL, NULL, 0);
- single_mat_users_expand(bmain);
-
- /* Duplicating obdata and other IDs may require another update of the collections and objects
- * pointers, especially regarding drivers and custom props, see T66641.
- * Note that this whole scene duplication code and 'make single user' functions have to be
- * rewritten at some point to make use of proper modern ID management code,
- * but that is no small task.
- * For now we are doomed to that kind of band-aid to try to cover most of remapping cases. */
-
- /* Will also handle the master collection. */
- BKE_libblock_relink_to_newid(&scene->id);
-
- /* Collection and object pointers in collections */
- libblock_relink_collection(scene->master_collection, false);
- }
-
- /* Relink nodetrees' pointers that have been duplicated. */
- FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
- /* This is a bit convoluted, we want to root ntree of copied IDs and only those,
- * so we first check that old ID has been copied and that ntree is root tree of old ID,
- * then get root tree of new ID and remap its pointers to new ID... */
- if (id->newid && (&ntree->id != id)) {
- ntree = ntreeFromID(id->newid);
- BKE_libblock_relink_to_newid(&ntree->id);
- }
- }
- FOREACH_NODETREE_END;
-
- /* Relink datablock pointer properties */
- {
- IDP_RelinkProperty(scene->id.properties);
-
- FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
- if (!ID_IS_LINKED(ob)) {
- IDP_RelinkProperty(ob->id.properties);
- }
- }
- FOREACH_SCENE_OBJECT_END;
-
- if (scene->nodetree) {
- IDP_RelinkProperty(scene->nodetree->id.properties);
- LISTBASE_FOREACH (bNode *, node, &scene->nodetree->nodes) {
- IDP_RelinkProperty(node->prop);
- }
- }
-
- if (scene->world) {
- IDP_RelinkProperty(scene->world->id.properties);
- }
-
- if (scene->clip) {
- IDP_RelinkProperty(scene->clip->id.properties);
- }
- }
- BKE_main_id_clear_newpoins(bmain);
- DEG_relations_tag_update(bmain);
-}
-
/** \} */
/* ------------------------------------------------------------------- */