Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/space_node.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later | /* SPDX-License-Identifier: GPL-2.0-or-later | ||||
| * Copyright 2008 Blender Foundation. All rights reserved. */ | * Copyright 2008 Blender Foundation. All rights reserved. */ | ||||
| /** \file | /** \file | ||||
| * \ingroup spnode | * \ingroup spnode | ||||
| */ | */ | ||||
| #include "DNA_ID.h" | |||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.h" | ||||
| #include "DNA_light_types.h" | #include "DNA_light_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_lib_remap.h" | #include "BKE_lib_remap.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "ED_node.h" | #include "ED_node.h" | ||||
| #include "ED_render.h" | #include "ED_render.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_space_api.h" | #include "ED_space_api.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| #include "DEG_depsgraph.h" | |||||
| #include "BLO_read_write.h" | #include "BLO_read_write.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "RNA_prototypes.h" | #include "RNA_prototypes.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| ▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH_INDEX (bNodeTreePath *, path, &snode->treepath, i) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void ED_node_set_active_viewer_key(SpaceNode *snode) | void ED_node_set_active_viewer_key(SpaceNode *snode) | ||||
| { | { | ||||
| bNodeTreePath *path = (bNodeTreePath *)snode->treepath.last; | bNodeTreePath *path = (bNodeTreePath *)snode->treepath.last; | ||||
| if (snode->nodetree && path) { | if (snode->nodetree && path) { | ||||
| /* A change in active viewer may result in the change of the output node used by the | |||||
| * compositor, so we need to get notified about such changes. */ | |||||
| if (snode->nodetree->active_viewer_key.value != path->parent_key.value) { | |||||
| DEG_id_tag_update(&snode->nodetree->id, ID_RECALC_NTREE_OUTPUT); | |||||
| WM_main_add_notifier(NC_NODE, nullptr); | |||||
| } | |||||
| snode->nodetree->active_viewer_key = path->parent_key; | snode->nodetree->active_viewer_key = path->parent_key; | ||||
| } | } | ||||
| } | } | ||||
| void ED_node_cursor_location_get(const SpaceNode *snode, float value[2]) | void ED_node_cursor_location_get(const SpaceNode *snode, float value[2]) | ||||
| { | { | ||||
| copy_v2_v2(value, snode->runtime->cursor); | copy_v2_v2(value, snode->runtime->cursor); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 976 Lines • Show Last 20 Lines | |||||