diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2022-08-23 15:25:18 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-08-23 15:25:18 +0300 |
commit | 13b2716e1cf9447ebab2fcd4b157d6d232490334 (patch) | |
tree | 48cc7638d5be2d6b3067af7b662eccd9dc60a974 /source/blender | |
parent | 60e2dfd1e84e78cd3d182c94e0548869d6108351 (diff) | |
parent | 65870821da69ebdf38c407a9a583b90c0693393a (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/io/wavefront_obj/importer/obj_import_mtl.cc | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 16 |
2 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc index 02e09a77a5d..a863111b165 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc @@ -97,10 +97,8 @@ static Image *create_placeholder_image(Main *bmain, const std::string &path) static Image *load_texture_image(Main *bmain, const tex_map_XX &tex_map, - bNode *r_node, bool relative_paths) { - BLI_assert(r_node && r_node->type == SH_NODE_TEX_IMAGE); Image *image = nullptr; /* First try treating texture path as relative. */ @@ -371,7 +369,8 @@ void ShaderNodetreeWrap::add_image_textures(Main *bmain, Material *mat, bool rel } bNode *image_texture = add_node_to_tree(SH_NODE_TEX_IMAGE); - Image *image = load_texture_image(bmain, texture_map.value, image_texture, relative_paths); + BLI_assert(image_texture); + Image *image = load_texture_image(bmain, texture_map.value, relative_paths); if (image == nullptr) { continue; } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 3ea06578fad..0909621d70c 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1267,6 +1267,20 @@ static void rna_NodeTree_active_node_set(PointerRNA *ptr, if (node && BLI_findindex(&ntree->nodes, node) != -1) { nodeSetActive(ntree, node); + + /* Handle NODE_DO_OUTPUT as well. */ + if (node->typeinfo->nclass == NODE_CLASS_OUTPUT && node->type != CMP_NODE_OUTPUT_FILE) { + /* If this node becomes the active output, the others of the same type can't be the active + * output anymore. */ + LISTBASE_FOREACH (bNode *, other_node, &ntree->nodes) { + if (other_node->type == node->type) { + other_node->flag &= ~NODE_DO_OUTPUT; + } + } + node->flag |= NODE_DO_OUTPUT; + ntreeSetOutput(ntree); + BKE_ntree_update_tag_active_output_changed(ntree); + } } else { nodeClearActive(ntree); @@ -12400,7 +12414,7 @@ static void rna_def_nodetree_nodes_api(BlenderRNA *brna, PropertyRNA *cprop) prop, "rna_NodeTree_active_node_get", "rna_NodeTree_active_node_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Node", "Active node in this tree"); - RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL); + RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, "rna_NodeTree_update"); } static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop) |