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 342 Lines • ▼ Show 20 Lines | #ifdef NESTED_ID_NASTY_WORKAROUND | ||||
| } | } | ||||
| #endif | #endif | ||||
| return result; | return result; | ||||
| } | } | ||||
| /* For the given scene get view layer which corresponds to an original for the | /* For the given scene get view layer which corresponds to an original for the | ||||
| * scene's evaluated one. This depends on how the scene is pulled into the | * scene's evaluated one. This depends on how the scene is pulled into the | ||||
| * dependency graph. */ | * dependency graph. */ | ||||
| ViewLayer *get_original_view_layer(const Depsgraph *depsgraph, const IDNode *id_node) | ViewLayer *get_original_view_layer(const Depsgraph *depsgraph, const IDNode *id_node) | ||||
| { | { | ||||
| if (id_node->linked_state == DEG_ID_LINKED_DIRECTLY) { | if (id_node->linked_state == DEG_ID_LINKED_DIRECTLY) { | ||||
| return depsgraph->view_layer; | return depsgraph->view_layer; | ||||
| } | } | ||||
| if (id_node->linked_state == DEG_ID_LINKED_VIA_SET) { | if (id_node->linked_state == DEG_ID_LINKED_VIA_SET) { | ||||
| Scene *scene_orig = reinterpret_cast<Scene *>(id_node->id_orig); | Scene *scene_orig = reinterpret_cast<Scene *>(id_node->id_orig); | ||||
| return BKE_view_layer_default_render(scene_orig); | return BKE_view_layer_default_render(scene_orig); | ||||
| ▲ Show 20 Lines • Show All 534 Lines • ▼ Show 20 Lines | switch (id_type) { | ||||
| } | } | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| if (!done) { | if (!done) { | ||||
| done = id_copy_inplace_no_main(id_orig, id_cow); | done = id_copy_inplace_no_main(id_orig, id_cow); | ||||
| } | } | ||||
| if (!done) { | if (!done) { | ||||
| BLI_assert(!"No idea how to perform CoW on datablock"); | BLI_assert_msg(0, "No idea how to perform CoW on datablock"); | ||||
| } | } | ||||
| /* Update pointers to nested ID datablocks. */ | /* Update pointers to nested ID datablocks. */ | ||||
| DEG_COW_PRINT( | DEG_COW_PRINT( | ||||
| " Remapping ID links for %s: id_orig=%p id_cow=%p\n", id_orig->name, id_orig, id_cow); | " Remapping ID links for %s: id_orig=%p id_cow=%p\n", id_orig->name, id_orig, id_cow); | ||||
| #ifdef NESTED_ID_NASTY_WORKAROUND | #ifdef NESTED_ID_NASTY_WORKAROUND | ||||
| ntree_hack_remap_pointers(depsgraph, id_cow); | ntree_hack_remap_pointers(depsgraph, id_cow); | ||||
| #endif | #endif | ||||
| ▲ Show 20 Lines • Show All 214 Lines • Show Last 20 Lines | |||||