From 82fc02fb48e6015373f3c5c1425ffc8b80b16a05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 30 Jul 2012 16:42:26 +0000 Subject: [PATCH 1/4] fix for own error in r43796, 'Find Missing Files', could set the path to an empty string. --- source/blender/blenlib/intern/bpath.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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); From b43699aa126db985033fd66d98658a7ab56cf5f7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 30 Jul 2012 17:02:28 +0000 Subject: [PATCH 2/4] fix own mistake getting an image for the image open file selector. --- source/blender/editors/space_image/image_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index d34f734c6c2..8376a0bf0d3 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -919,7 +919,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; } } From 75046eadbfafba508ed3b3297ba90936072e8550 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 30 Jul 2012 17:11:59 +0000 Subject: [PATCH 3/4] Mango request: option to create nodes with hidden preview by default --- release/scripts/startup/bl_ui/space_node.py | 1 + source/blender/editors/space_node/node_edit.c | 4 ++++ source/blender/makesdna/DNA_space_types.h | 1 + source/blender/makesrna/intern/rna_space.c | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 961ab08efdd..40fe9be9135 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -236,6 +236,7 @@ class NODE_PT_quality(bpy.types.Panel): layout.prop(tree, "use_opencl") layout.prop(tree, "two_pass") layout.prop(snode, "show_highlight") + layout.prop(snode, "use_hidden_preview") class NODE_MT_node_color_presets(Menu): 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 ca2917cb03b..b9603e2cdb1 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -903,6 +903,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 74780faa700..74f6b16a111 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2989,6 +2989,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) From 9880f7fa507e57fa19191a8d5a03c6b6b11623d5 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 30 Jul 2012 17:12:01 +0000 Subject: [PATCH 4/4] Minor code cleanup --- release/scripts/startup/bl_ui/space_node.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 40fe9be9135..ccdf44a7dc2 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -230,14 +230,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") - layout.prop(snode, "use_hidden_preview") - + 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"""