Fix T64608: DOF Focus object, not linked to new copy, Scen "full_copy".

Note that there are probably many other similar cases... This code is
really legacy, should use library_query helpers and other modern
BKE_library code instead of doing its own dirty cooking...
This commit is contained in:
Bastien Montagne 2019-06-11 20:48:52 +02:00
parent c058c33864
commit 42f4c14732
Notes: blender-bot 2023-02-14 08:45:09 +01:00
Referenced by issue #64608, DOF Focus object, not linked to new copy, Scen "full_copy"
1 changed files with 8 additions and 6 deletions

View File

@ -29,19 +29,20 @@
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_mesh_types.h"
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_light_types.h"
#include "DNA_lattice_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
#include "DNA_object_types.h"
#include "DNA_vfont_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_world_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
@ -1852,7 +1853,7 @@ static void single_obdata_users(
{
Light *la;
Curve *cu;
/* Camera *cam; */
Camera *cam;
Mesh *me;
Lattice *lat;
ID *id;
@ -1869,7 +1870,8 @@ static void single_obdata_users(
ob->data = la = ID_NEW_SET(ob->data, BKE_light_copy(bmain, ob->data));
break;
case OB_CAMERA:
ob->data = ID_NEW_SET(ob->data, BKE_camera_copy(bmain, ob->data));
cam = ob->data = ID_NEW_SET(ob->data, BKE_camera_copy(bmain, ob->data));
ID_NEW_REMAP(cam->dof.focus_object);
break;
case OB_MESH:
/* Needed to remap texcomesh below. */