Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
| Show First 20 Lines • Show All 679 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (ModifierData *, md, &object_cow->modifiers) { | ||||
| if (md->type != eModifierType_ParticleSystem) { | if (md->type != eModifierType_ParticleSystem) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ParticleSystemModifierData *psmd = reinterpret_cast<ParticleSystemModifierData *>(md); | ParticleSystemModifierData *psmd = reinterpret_cast<ParticleSystemModifierData *>(md); | ||||
| psmd->flag |= eParticleSystemFlag_file_loaded; | psmd->flag |= eParticleSystemFlag_file_loaded; | ||||
| } | } | ||||
| } | } | ||||
| void reset_particle_system_edit_eval(Object *object_cow) | void reset_particle_system_edit_eval(const Depsgraph *depsgraph, Object *object_cow) | ||||
| { | { | ||||
| /* Inactive (and render) dependency graphs are living in own little bubble, should not care about | |||||
| * edit mode at all. */ | |||||
| if (!DEG_is_active(reinterpret_cast<const ::Depsgraph *>(depsgraph))) { | |||||
| return; | |||||
| } | |||||
| LISTBASE_FOREACH (ParticleSystem *, psys, &object_cow->particlesystem) { | LISTBASE_FOREACH (ParticleSystem *, psys, &object_cow->particlesystem) { | ||||
| ParticleSystem *orig_psys = psys->orig_psys; | ParticleSystem *orig_psys = psys->orig_psys; | ||||
| if (orig_psys->edit != NULL) { | if (orig_psys->edit != NULL) { | ||||
| orig_psys->edit->psys_eval = NULL; | orig_psys->edit->psys_eval = NULL; | ||||
| orig_psys->edit->psmd_eval = NULL; | orig_psys->edit->psmd_eval = NULL; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void update_particles_after_copy(const Object *object_orig, Object *object_cow) | void update_particles_after_copy(const Depsgraph *depsgraph, | ||||
| const Object *object_orig, | |||||
| Object *object_cow) | |||||
| { | { | ||||
| update_particle_system_orig_pointers(object_orig, object_cow); | update_particle_system_orig_pointers(object_orig, object_cow); | ||||
| set_particle_system_modifiers_loaded(object_cow); | set_particle_system_modifiers_loaded(object_cow); | ||||
| reset_particle_system_edit_eval(object_cow); | reset_particle_system_edit_eval(depsgraph, object_cow); | ||||
| } | } | ||||
| void update_pose_orig_pointers(const bPose *pose_orig, bPose *pose_cow) | void update_pose_orig_pointers(const bPose *pose_orig, bPose *pose_cow) | ||||
| { | { | ||||
| update_list_orig_pointers(&pose_orig->chanbase, &pose_cow->chanbase, &bPoseChannel::orig_pchan); | update_list_orig_pointers(&pose_orig->chanbase, &pose_cow->chanbase, &bPoseChannel::orig_pchan); | ||||
| } | } | ||||
| void update_modifiers_orig_pointers(const Object *object_orig, Object *object_cow) | void update_modifiers_orig_pointers(const Object *object_orig, Object *object_cow) | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | case ID_OB: { | ||||
| const bArmature *armature_orig = (bArmature *)object_orig->data; | const bArmature *armature_orig = (bArmature *)object_orig->data; | ||||
| bArmature *armature_cow = (bArmature *)object_cow->data; | bArmature *armature_cow = (bArmature *)object_cow->data; | ||||
| BKE_pose_remap_bone_pointers(armature_cow, object_cow->pose); | BKE_pose_remap_bone_pointers(armature_cow, object_cow->pose); | ||||
| if (armature_orig->edbo == NULL) { | if (armature_orig->edbo == NULL) { | ||||
| update_pose_orig_pointers(object_orig->pose, object_cow->pose); | update_pose_orig_pointers(object_orig->pose, object_cow->pose); | ||||
| } | } | ||||
| BKE_pose_pchan_index_rebuild(object_cow->pose); | BKE_pose_pchan_index_rebuild(object_cow->pose); | ||||
| } | } | ||||
| update_particles_after_copy(object_orig, object_cow); | update_particles_after_copy(depsgraph, object_orig, object_cow); | ||||
| update_modifiers_orig_pointers(object_orig, object_cow); | update_modifiers_orig_pointers(object_orig, object_cow); | ||||
| break; | break; | ||||
| } | } | ||||
| case ID_SCE: { | case ID_SCE: { | ||||
| Scene *scene_cow = (Scene *)id_cow; | Scene *scene_cow = (Scene *)id_cow; | ||||
| const Scene *scene_orig = (const Scene *)id_orig; | const Scene *scene_orig = (const Scene *)id_orig; | ||||
| scene_cow->toolsettings = scene_orig->toolsettings; | scene_cow->toolsettings = scene_orig->toolsettings; | ||||
| scene_cow->eevee.light_cache = scene_orig->eevee.light_cache; | scene_cow->eevee.light_cache = scene_orig->eevee.light_cache; | ||||
| ▲ Show 20 Lines • Show All 851 Lines • Show Last 20 Lines | |||||