Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_edit.cc
| Show First 20 Lines • Show All 709 Lines • ▼ Show 20 Lines | if (ELEM(node->type, | ||||
| BKE_ntree_update_tag_active_output_changed(ntree); | BKE_ntree_update_tag_active_output_changed(ntree); | ||||
| } | } | ||||
| ED_node_tree_propagate_change(nullptr, bmain, ntree); | ED_node_tree_propagate_change(nullptr, bmain, ntree); | ||||
| if ((node->flag & NODE_ACTIVE_TEXTURE) && !was_active_texture) { | if ((node->flag & NODE_ACTIVE_TEXTURE) && !was_active_texture) { | ||||
| /* If active texture changed, free glsl materials. */ | /* If active texture changed, free glsl materials. */ | ||||
| LISTBASE_FOREACH (Material *, ma, &bmain->materials) { | LISTBASE_FOREACH (Material *, ma, &bmain->materials) { | ||||
| if (ma->nodetree && ma->use_nodes && ntreeHasTree(ma->nodetree, ntree)) { | if (ma->nodetree && ma->use_nodes && ntreeContainsTree(ma->nodetree, ntree)) { | ||||
| GPU_material_free(&ma->gpumaterial); | GPU_material_free(&ma->gpumaterial); | ||||
| /* Sync to active texpaint slot, otherwise we can end up painting on a different slot | /* Sync to active texpaint slot, otherwise we can end up painting on a different slot | ||||
| * than we are looking at. */ | * than we are looking at. */ | ||||
| if (ma->texpaintslot) { | if (ma->texpaintslot) { | ||||
| if (node->id != nullptr && GS(node->id->name) == ID_IM) { | if (node->id != nullptr && GS(node->id->name) == ID_IM) { | ||||
| Image *image = (Image *)node->id; | Image *image = (Image *)node->id; | ||||
| for (int i = 0; i < ma->tot_slots; i++) { | for (int i = 0; i < ma->tot_slots; i++) { | ||||
| if (ma->texpaintslot[i].ima == image) { | if (ma->texpaintslot[i].ima == image) { | ||||
| ma->paint_active_slot = i; | ma->paint_active_slot = i; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| LISTBASE_FOREACH (World *, wo, &bmain->worlds) { | LISTBASE_FOREACH (World *, wo, &bmain->worlds) { | ||||
| if (wo->nodetree && wo->use_nodes && ntreeHasTree(wo->nodetree, ntree)) { | if (wo->nodetree && wo->use_nodes && ntreeContainsTree(wo->nodetree, ntree)) { | ||||
| GPU_material_free(&wo->gpumaterial); | GPU_material_free(&wo->gpumaterial); | ||||
| } | } | ||||
| } | } | ||||
| /* Sync to Image Editor under the following conditions: | /* Sync to Image Editor under the following conditions: | ||||
| * - current image is not pinned | * - current image is not pinned | ||||
| * - current image is not a Render Result or ViewerNode (want to keep looking at these) */ | * - current image is not a Render Result or ViewerNode (want to keep looking at these) */ | ||||
| if (node->id != nullptr && GS(node->id->name) == ID_IM) { | if (node->id != nullptr && GS(node->id->name) == ID_IM) { | ||||
| ▲ Show 20 Lines • Show All 2,048 Lines • Show Last 20 Lines | |||||