Merge branch 'blender-v2.82-release'
This commit is contained in:
commit
597d6be61c
|
@ -1027,7 +1027,8 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
|
|||
WORKBENCH_MaterialData *material;
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) {
|
||||
const bool is_active = (ob == draw_ctx->obact);
|
||||
const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d);
|
||||
const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d) &&
|
||||
!DRW_state_is_image_render();
|
||||
const bool use_hide = is_active && DRW_object_use_hide_faces(ob);
|
||||
const int materials_len = MAX2(1, ob->totcol);
|
||||
const Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL;
|
||||
|
|
|
@ -1706,19 +1706,29 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot)
|
|||
|
||||
/**************************** Make Single User ********************************/
|
||||
|
||||
static void libblock_relink_collection(Collection *collection)
|
||||
static void libblock_relink_collection(Collection *collection, const bool do_collection)
|
||||
{
|
||||
BKE_libblock_relink_to_newid(&collection->id);
|
||||
if (do_collection) {
|
||||
BKE_libblock_relink_to_newid(&collection->id);
|
||||
}
|
||||
|
||||
for (CollectionObject *cob = collection->gobject.first; cob != NULL; cob = cob->next) {
|
||||
BKE_libblock_relink_to_newid(&cob->ob->id);
|
||||
}
|
||||
|
||||
for (CollectionChild *child = collection->children.first; child; child = child->next) {
|
||||
libblock_relink_collection(child->collection);
|
||||
libblock_relink_collection(child->collection, true);
|
||||
}
|
||||
}
|
||||
|
||||
static void libblock_relink_collections_from_scene(Scene *scene)
|
||||
{
|
||||
/* Will also handle the master collection. */
|
||||
BKE_libblock_relink_to_newid(&scene->id);
|
||||
|
||||
libblock_relink_collection(scene->master_collection, false);
|
||||
}
|
||||
|
||||
static Collection *single_object_users_collection(Main *bmain,
|
||||
Scene *scene,
|
||||
Collection *collection,
|
||||
|
@ -1807,7 +1817,7 @@ static void single_object_users(
|
|||
#endif
|
||||
|
||||
/* Collection and object pointers in collections */
|
||||
libblock_relink_collection(master_collection);
|
||||
libblock_relink_collections_from_scene(scene);
|
||||
|
||||
/* collection pointers in scene */
|
||||
BKE_scene_groups_relink(scene);
|
||||
|
@ -2056,7 +2066,7 @@ void ED_object_single_users(Main *bmain,
|
|||
* 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. */
|
||||
libblock_relink_collection(scene->master_collection);
|
||||
libblock_relink_collections_from_scene(scene);
|
||||
}
|
||||
|
||||
/* Relink nodetrees' pointers that have been duplicated. */
|
||||
|
|
Loading…
Reference in New Issue