diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 0b063cb6fba..8598d1e3ca6 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -242,13 +242,17 @@ class NODE_PT_quality(bpy.types.Panel): snode = context.space_data tree = snode.node_tree - layout.prop(tree, "render_quality", text="Render") - layout.prop(tree, "edit_quality", text="Edit") - layout.prop(tree, "chunk_size") - layout.prop(tree, "use_opencl") - layout.prop(tree, "two_pass") - layout.prop(snode, "show_highlight") - + col = layout.column() + col.prop(tree, "render_quality", text="Render") + col.prop(tree, "edit_quality", text="Edit") + col.prop(tree, "chunk_size") + + col = layout.column() + col.prop(tree, "use_opencl") + col.prop(tree, "two_pass") + col.prop(snode, "show_highlight") + col.prop(snode, "use_hidden_preview") + class NODE_MT_node_color_presets(Menu): """Predefined node color""" diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index f458c158fb2..ed2684befb1 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -191,12 +191,14 @@ void BLI_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *re data.count_tot, data.count_changed, data.count_failed); } -/* find this file recursively, use the biggest file so thumbnails don't get used by mistake - * - dir: subdir to search - * - filename: set this filename - * - filesize: filesize for the file +/** + * find this file recursively, use the biggest file so thumbnails don't get used by mistake + * \param filename_new: the path will be copied here, caller must initialize as empyu string. + * \param dirname: subdir to search + * \param filename: set this filename + * \param filesize: filesize for the file * - * return found: 1/0. + * \returns found: 1/0. */ #define MAX_RECUR 16 static int findFileRecursive(char *filename_new, @@ -213,8 +215,6 @@ static int findFileRecursive(char *filename_new, int size; int found = FALSE; - filename_new[0] = '\0'; - dir = opendir(dirname); if (dir == NULL) @@ -271,6 +271,8 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char int recur_depth = 0; int found; + filename_new[0] = '\0'; + found = findFileRecursive(filename_new, data->searchdir, BLI_path_basename((char *)path_src), &filesize, &recur_depth); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 5fd17946bf5..02469184fef 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -920,7 +920,7 @@ static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event) oldptr = RNA_property_pointer_get(&ptr, prop); oldima = (Image *)oldptr.id.data; /* unlikely to fail but better avoid strange crash */ - if (oldima && GS(oldima->id.name) != ID_IM) { + if (oldima && GS(oldima->id.name) == ID_IM) { ima = oldima; } } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index c04bcdac142..b3ef4561b72 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2589,6 +2589,10 @@ bNode *node_add_node(SpaceNode *snode, Main *bmain, Scene *scene, bNodeTemplate if (node->id) id_us_plus(node->id); + + if (snode->flag & SNODE_USE_HIDDEN_PREVIEW) + node->flag &= ~NODE_PREVIEW; + snode_update(snode, node); } diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 5c70376c553..2002ad42838 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -912,6 +912,7 @@ typedef enum eSpaceNode_Flag { SNODE_SHOW_B = (1 << 9), SNODE_AUTO_RENDER = (1 << 5), SNODE_SHOW_HIGHLIGHT = (1 << 6), + SNODE_USE_HIDDEN_PREVIEW = (1 << 10), } eSpaceNode_Flag; /* snode->texfrom */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index df98be71cfe..73661937fcd 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -3005,6 +3005,11 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_SHOW_HIGHLIGHT); RNA_def_property_ui_text(prop, "Highlight", "Highlight nodes that are being calculated"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); + + prop = RNA_def_property(srna, "use_hidden_preview", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_USE_HIDDEN_PREVIEW); + RNA_def_property_ui_text(prop, "Hide Preview", "Hide preview for newly creating nodes"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); } static void rna_def_space_logic(BlenderRNA *brna)