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 471 Lines • ▼ Show 20 Lines | void update_copy_on_write_scene(const Depsgraph *depsgraph, | ||||
| Scene *scene_cow, | Scene *scene_cow, | ||||
| const Scene *scene_orig) | const Scene *scene_orig) | ||||
| { | { | ||||
| // Some non-pointer data sync, current frame for now. | // Some non-pointer data sync, current frame for now. | ||||
| // TODO(sergey): Are we missing something here? | // TODO(sergey): Are we missing something here? | ||||
| scene_cow->r.cfra = scene_orig->r.cfra; | scene_cow->r.cfra = scene_orig->r.cfra; | ||||
| scene_cow->r.subframe = scene_orig->r.subframe; | scene_cow->r.subframe = scene_orig->r.subframe; | ||||
| // Update bases. | // Update bases. | ||||
| const SceneLayer *scene_layer_orig = (SceneLayer *)scene_orig->render_layers.first; | const ViewLayer *view_layer_orig = (ViewLayer *)scene_orig->view_layers.first; | ||||
| SceneLayer *scene_layer_cow = (SceneLayer *)scene_cow->render_layers.first; | ViewLayer *view_layer_cow = (ViewLayer *)scene_cow->view_layers.first; | ||||
| while (scene_layer_orig != NULL) { | while (view_layer_orig != NULL) { | ||||
| // Update pointers to active base. | // Update pointers to active base. | ||||
| if (scene_layer_orig->basact == NULL) { | if (view_layer_orig->basact == NULL) { | ||||
| scene_layer_cow->basact = NULL; | view_layer_cow->basact = NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| const Object *obact_orig = scene_layer_orig->basact->object; | const Object *obact_orig = view_layer_orig->basact->object; | ||||
| Object *obact_cow = (Object *)depsgraph->get_cow_id(&obact_orig->id); | Object *obact_cow = (Object *)depsgraph->get_cow_id(&obact_orig->id); | ||||
| scene_layer_cow->basact = BKE_scene_layer_base_find(scene_layer_cow, obact_cow); | view_layer_cow->basact = BKE_view_layer_base_find(view_layer_cow, obact_cow); | ||||
| } | } | ||||
| // Update base flags. | // Update base flags. | ||||
| // | // | ||||
| // TODO(sergey): We should probably check visibled/selectabled | // TODO(sergey): We should probably check visibled/selectabled | ||||
| // flag here? | // flag here? | ||||
| const Base *base_orig = (Base *)scene_layer_orig->object_bases.first; | const Base *base_orig = (Base *)view_layer_orig->object_bases.first; | ||||
| Base *base_cow = (Base *)scene_layer_cow->object_bases.first;; | Base *base_cow = (Base *)view_layer_cow->object_bases.first;; | ||||
| while (base_orig != NULL) { | while (base_orig != NULL) { | ||||
| base_cow->flag = base_orig->flag; | base_cow->flag = base_orig->flag; | ||||
| base_orig = base_orig->next; | base_orig = base_orig->next; | ||||
| base_cow = base_cow->next; | base_cow = base_cow->next; | ||||
| } | } | ||||
| scene_layer_orig = scene_layer_orig->next; | view_layer_orig = view_layer_orig->next; | ||||
| scene_layer_cow = scene_layer_cow->next; | view_layer_cow = view_layer_cow->next; | ||||
| } | } | ||||
| // Update edit object pointer. | // Update edit object pointer. | ||||
| if (scene_orig->obedit != NULL) { | if (scene_orig->obedit != NULL) { | ||||
| scene_cow->obedit = (Object *)depsgraph->get_cow_id(&scene_orig->obedit->id); | scene_cow->obedit = (Object *)depsgraph->get_cow_id(&scene_orig->obedit->id); | ||||
| } | } | ||||
| else { | else { | ||||
| scene_cow->obedit = NULL; | scene_cow->obedit = NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 414 Lines • Show Last 20 Lines | |||||