From 6e076c41641ff5a8bbb8377b1d1bf73c128ea195 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 Mar 2013 10:28:19 +0000 Subject: Better fix for "To Sphere" crashing in Image editor. It appeared to be in use for mask/uv modes. --- source/blender/editors/transform/transform_conversions.c | 2 +- source/blender/editors/transform/transform_generics.c | 2 +- source/blender/editors/transform/transform_ops.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index cf960c953c3..f84c967711c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -6469,7 +6469,7 @@ void createTransData(bContext *C, TransInfo *t) sort_trans_data_dist(t); } } - else { + else if (t->obedit) { createTransUVs(C, t); if (t->data && (t->flag & T_PROP_EDIT)) { sort_trans_data(t); // makes selected become first in array diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 2a3b0bc8726..3d3b8009c99 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1160,7 +1160,7 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even t->options |= CTX_MASK; } else { - BLI_assert(0); + /* image not in uv edit, nor in mask mode, can happen for some tools */ } } else if (t->spacetype == SPACE_NODE) { diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 778795bb3a1..60b0c655691 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -721,7 +721,7 @@ static void TRANSFORM_OT_tosphere(struct wmOperatorType *ot) ot->exec = transform_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; - ot->poll = ED_operator_view3d_active; + ot->poll = ED_operator_screenactive; RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1); -- cgit v1.2.3 From 0c07c33fec4ef04f2931863f40f4447aaf810064 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 26 Mar 2013 12:45:10 +0000 Subject: Correction to recent prefetch commit When using movie as a clip no need to prefetch in cases no proxies are sued at this moment. --- source/blender/editors/space_clip/clip_editor.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 05e05b95967..b00cc564a99 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -1142,6 +1142,9 @@ static bool prefetch_check_early_out(const bContext *C) if ((user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) == 0) return true; } + else { + return true; + } } clip_len = BKE_movieclip_get_duration(clip); -- cgit v1.2.3 From b4bd43e02283d5c2df07b49441a9de24f327736f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 26 Mar 2013 14:33:53 +0000 Subject: I18n: various "new data translation" fixes... --- source/blender/editors/gpencil/gpencil_edit.c | 10 ++++++---- source/blender/editors/render/CMakeLists.txt | 4 ++++ source/blender/editors/render/SConscript | 7 ++++++- source/blender/editors/render/render_shading.c | 8 +++++--- source/blender/editors/space_image/image_ops.c | 18 ++++++++++++++---- source/blender/editors/space_node/node_add.c | 11 ++++++++--- 6 files changed, 43 insertions(+), 15 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index e4c7a1edbcb..ad32c5fcccf 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -43,6 +43,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "DNA_anim_types.h" #include "DNA_curve_types.h" #include "DNA_object_types.h" @@ -229,7 +231,7 @@ static int gp_data_add_exec(bContext *C, wmOperator *op) bGPdata *gpd = (*gpd_ptr); id_us_min(&gpd->id); - *gpd_ptr = gpencil_data_addnew("GPencil"); + *gpd_ptr = gpencil_data_addnew(DATA_("GPencil")); } /* notifiers */ @@ -312,10 +314,10 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } if (*gpd_ptr == NULL) - *gpd_ptr = gpencil_data_addnew("GPencil"); - + *gpd_ptr = gpencil_data_addnew(DATA_("GPencil")); + /* add new layer now */ - gpencil_layer_addnew(*gpd_ptr, "GP_Layer", 1); + gpencil_layer_addnew(*gpd_ptr, DATA_("GP_Layer"), 1); /* notifiers */ WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); diff --git a/source/blender/editors/render/CMakeLists.txt b/source/blender/editors/render/CMakeLists.txt index 3c5fd0b4ef7..c0b9088017e 100644 --- a/source/blender/editors/render/CMakeLists.txt +++ b/source/blender/editors/render/CMakeLists.txt @@ -68,4 +68,8 @@ if(WITH_HEADLESS) add_definitions(-DWITH_HEADLESS) endif() +if(WITH_INTERNATIONAL) + add_definitions(-DWITH_INTERNATIONAL) +endif() + blender_add_lib(bf_editor_render "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/render/SConscript b/source/blender/editors/render/SConscript index 73bc711edd9..9350caf5a12 100644 --- a/source/blender/editors/render/SConscript +++ b/source/blender/editors/render/SConscript @@ -35,6 +35,8 @@ incs += ' ../../gpu' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' incs += ' ../../blenloader ../../bmesh ../../blenfont' +defs = [] + if env['OURPLATFORM'] == 'linux': cflags='-pthread' incs += ' ../../../extern/binreloc/include' @@ -54,4 +56,7 @@ if env['OURPLATFORM'] == 'darwin': if env['WITH_BF_OPENMP']: env.Append(CFLAGS=['-DPARALLEL=1']) -env.BlenderLib ( 'bf_editors_render', sources, Split(incs), [], libtype=['core'], priority=[45]) +if env['WITH_BF_INTERNATIONAL']: + defs.append('WITH_INTERNATIONAL') + +env.BlenderLib('bf_editors_render', sources, Split(incs), defs, libtype=['core'], priority=[45]) diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index dc26bde6861..979ccf3cf02 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -428,10 +428,12 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op)) PropertyRNA *prop; /* add or copy texture */ - if (tex) + if (tex) { tex = BKE_texture_copy(tex); - else + } + else { tex = add_texture(bmain, DATA_("Texture")); + } /* hook into UI */ uiIDContextProperty(C, &ptr, &prop); @@ -480,7 +482,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op)) wo = BKE_world_copy(wo); } else { - wo = add_world(bmain, "World"); + wo = add_world(bmain, DATA_("World")); if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(C, &wo->id); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 7e0767bfcfb..4a78c54e9c0 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1707,6 +1707,7 @@ void IMAGE_OT_reload(wmOperatorType *ot) } /********************** new image operator *********************/ +#define IMA_DEF_NAME N_("Untitled") static int image_new_exec(bContext *C, wmOperator *op) { @@ -1717,7 +1718,8 @@ static int image_new_exec(bContext *C, wmOperator *op) Main *bmain; PointerRNA ptr, idptr; PropertyRNA *prop; - char name[MAX_ID_NAME - 2]; + char _name[MAX_ID_NAME - 2]; + char *name = _name; float color[4]; int width, height, floatbuf, gen_type, alpha; @@ -1727,7 +1729,12 @@ static int image_new_exec(bContext *C, wmOperator *op) obedit = CTX_data_edit_object(C); bmain = CTX_data_main(C); - RNA_string_get(op->ptr, "name", name); + prop = RNA_struct_find_property(op->ptr, "name"); + RNA_property_string_get(op->ptr, prop, name); + if (!RNA_property_is_set(op->ptr, prop)) { + /* Default value, we can translate! */ + name = (char *)DATA_(name); + } width = RNA_int_get(op->ptr, "width"); height = RNA_int_get(op->ptr, "height"); floatbuf = RNA_boolean_get(op->ptr, "float"); @@ -1775,8 +1782,9 @@ static int image_new_exec(bContext *C, wmOperator *op) /* XXX Note: the WM_operator_props_dialog_popup() doesn't work for uiIDContextProperty(), image is not being that way */ static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { + /* Better for user feedback. */ + RNA_string_set(op->ptr, "name", DATA_(IMA_DEF_NAME)); return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, 5 * UI_UNIT_Y); - } void IMAGE_OT_new(wmOperatorType *ot) @@ -1797,7 +1805,7 @@ void IMAGE_OT_new(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME - 2, "Name", "Image datablock name"); + RNA_def_string(ot->srna, "name", IMA_DEF_NAME, MAX_ID_NAME - 2, "Name", "Image datablock name"); RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384); RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384); prop = RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f); @@ -1809,6 +1817,8 @@ void IMAGE_OT_new(wmOperatorType *ot) RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth"); } +#undef IMA_DEF_NAME + /********************* invert operators *********************/ static int image_invert_poll(bContext *C) diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index fb9e1221c38..0201071ada4 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -83,7 +83,7 @@ bNode *node_add_node(const bContext *C, const char *idname, int type, float locx /* generics */ node->locx = locx; - node->locy = locy + 60.0f; // arbitrary.. so its visible, (0,0) is top of node + node->locy = locy + 60.0f; /* arbitrary... so its visible, (0,0) is top of node */ nodeSetSelected(node, TRUE); /* node location is mapped */ @@ -436,7 +436,8 @@ static int new_node_tree_exec(bContext *C, wmOperator *op) PointerRNA ptr, idptr; PropertyRNA *prop; const char *idname; - char treename[MAX_ID_NAME - 2] = "NodeTree"; + char _treename[MAX_ID_NAME - 2]; + char *treename = _treename; if (RNA_struct_property_is_set(op->ptr, "type")) { prop = RNA_struct_find_property(op->ptr, "type"); @@ -445,8 +446,12 @@ static int new_node_tree_exec(bContext *C, wmOperator *op) else if (snode) idname = snode->tree_idname; - if (RNA_struct_property_is_set(op->ptr, "name")) + if (RNA_struct_property_is_set(op->ptr, "name")) { RNA_string_get(op->ptr, "name", treename); + } + else { + treename = (char *)DATA_("NodeTree"); + } if (!ntreeTypeFind(idname)) { BKE_reportf(op->reports, RPT_ERROR, "Node tree type %s undefined", idname); -- cgit v1.2.3 From e1db5a050d2be78836a389705003595df29e1eb7 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 Mar 2013 15:00:56 +0000 Subject: Sequencer usability: Brought back old tools "Remove Gap(s)" and "Insert Gap". It's actually one of the first tools I ever coded for it in 90ies, so useful! * Remove Gap(s) This checks if there's no strip at a given position, and slides all strips together to the left, until the gap is closed. - BackSpace key, remove gap at current frame (or first gap at right of frame) - SHIFT+BackSpace, remove all gaps at or to right of current frame. * Insert Gap Shifts all strips to right of current frame with 10 frames. (Amount can be set in Toolbar redo panel). --- .../editors/space_sequencer/sequencer_edit.c | 88 ++++++++++++++++++++-- .../editors/space_sequencer/sequencer_intern.h | 4 + .../editors/space_sequencer/sequencer_ops.c | 7 ++ 3 files changed, 92 insertions(+), 7 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index f0ed8d4107d..68362a1c6e4 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -988,30 +988,104 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene) } -static void UNUSED_FUNCTION(no_gaps) (Scene *scene) +static int sequencer_no_gap_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, FALSE); - int cfra, first = 0, done; - + rctf rectf; + int cfra, efra, sfra, first = 0, done; + int do_all = RNA_boolean_get(op->ptr, "all"); - if (ed == NULL) return; + if (ed == NULL) return OPERATOR_CANCELLED; - for (cfra = CFRA; cfra <= EFRA; cfra++) { + /* get first and last frame */ + boundbox_seq(scene, &rectf); + sfra = (int)rectf.xmin; + efra = (int)rectf.xmax; + + /* first check if the current frame has a gap already */ + for (cfra = CFRA; cfra >= sfra; cfra--) { + if (BKE_sequencer_evaluate_frame(scene, cfra)) { + first = 1; + break; + } + } + + for ( ; cfra < efra; cfra++) { + /* first == 0 means there's still no strip to remove a gap for */ if (first == 0) { if (BKE_sequencer_evaluate_frame(scene, cfra) ) first = 1; } - else { + else if (BKE_sequencer_evaluate_frame(scene, cfra) == 0) { done = TRUE; while (BKE_sequencer_evaluate_frame(scene, cfra) == 0) { done = insert_gap(scene, -1, cfra); if (done == 0) break; } - if (done == 0) break; + if (done == 0 || do_all == 0) break; } } + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); + + return OPERATOR_FINISHED; + +} + + +void SEQUENCER_OT_no_gap(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Remove Gap"; + ot->idname = "SEQUENCER_OT_no_gap"; + ot->description = "Remove gap at current frame to first strip at the right"; + + /* api callbacks */ +// ot->invoke = sequencer_snap_invoke; + ot->exec = sequencer_no_gap_exec; + ot->poll = sequencer_edit_poll; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "all", 0, "All Gaps", "Do all gaps to right of current frame"); } +static int sequencer_insert_gap_exec(bContext *C, wmOperator *op) +{ + Scene *scene = CTX_data_scene(C); + Editing *ed = BKE_sequencer_editing_get(scene, FALSE); + int frames = RNA_int_get(op->ptr, "frames"); + + if (ed == NULL) return OPERATOR_CANCELLED; + + insert_gap(scene, frames, CFRA); + + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); + + return OPERATOR_FINISHED; + +} + +void SEQUENCER_OT_insert_gap(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Insert Gap"; + ot->idname = "SEQUENCER_OT_insert_gap"; + ot->description = "Insert gap at current frame to first strips at the right"; + + /* api callbacks */ + // ot->invoke = sequencer_snap_invoke; + ot->exec = sequencer_insert_gap_exec; + ot->poll = sequencer_edit_poll; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_int(ot->srna, "frames", 10, 0, 1000, "Frames", "Frames to insert after current strip", 0, INT_MAX); +} + + #if 0 static int seq_get_snaplimit(View2D *v2d) { diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index cd79c43eac2..4eb71c9fb09 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -97,7 +97,11 @@ void SEQUENCER_OT_images_separate(struct wmOperatorType *ot); void SEQUENCER_OT_meta_toggle(struct wmOperatorType *ot); void SEQUENCER_OT_meta_make(struct wmOperatorType *ot); void SEQUENCER_OT_meta_separate(struct wmOperatorType *ot); + +void SEQUENCER_OT_no_gap(struct wmOperatorType *ot); +void SEQUENCER_OT_insert_gap(struct wmOperatorType *ot); void SEQUENCER_OT_snap(struct wmOperatorType *ot); + void SEQUENCER_OT_strip_jump(struct wmOperatorType *ot); void SEQUENCER_OT_swap(struct wmOperatorType *ot); void SEQUENCER_OT_swap_data(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 70b288a59e6..7ddc5a77555 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -72,6 +72,9 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_meta_toggle); WM_operatortype_append(SEQUENCER_OT_meta_make); WM_operatortype_append(SEQUENCER_OT_meta_separate); + + WM_operatortype_append(SEQUENCER_OT_no_gap); + WM_operatortype_append(SEQUENCER_OT_insert_gap); WM_operatortype_append(SEQUENCER_OT_snap); WM_operatortype_append(SEQUENCER_OT_strip_jump); WM_operatortype_append(SEQUENCER_OT_swap); @@ -213,6 +216,10 @@ void sequencer_keymap(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_swap", LEFTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "side", SEQ_SIDE_LEFT); RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_swap", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "side", SEQ_SIDE_RIGHT); + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_no_gap", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "all", FALSE); + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_no_gap", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "all", TRUE); + WM_keymap_add_item(keymap, "SEQUENCER_OT_insert_gap", EQUALKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "SEQUENCER_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_swap_inputs", SKEY, KM_PRESS, KM_ALT, 0); -- cgit v1.2.3 From 22000aa2fc74c3ebd8a9469fe52cff6006e0e52d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 26 Mar 2013 15:48:20 +0000 Subject: Wrong soft/hard limits used in r55600 --- source/blender/editors/space_sequencer/sequencer_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 68362a1c6e4..516ec6f3a0d 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1082,7 +1082,7 @@ void SEQUENCER_OT_insert_gap(struct wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_int(ot->srna, "frames", 10, 0, 1000, "Frames", "Frames to insert after current strip", 0, INT_MAX); + RNA_def_int(ot->srna, "frames", 10, 0, INT_MAX, "Frames", "Frames to insert after current strip", 0, 1000); } -- cgit v1.2.3 From 166cdf8b5aaf5f36012f8d62a4882ec838bd5cb3 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 Mar 2013 17:49:57 +0000 Subject: Bug fix - own collection. - Scopes in Sequencer were not drawing OK (drawing code assumed alpha) - Histogram in Sequencer now uses same formula to quantify R G B as the other histogram in Blender (per channel). I seriously thought of dropping this, and add the same sidebar here as we have for Image window. However, what stops me is that current code is very optimized, and has OMP hints. Will check instead on cleaner drawing here now. --- .../editors/space_sequencer/sequencer_draw.c | 9 ++-- .../editors/space_sequencer/sequencer_scopes.c | 56 ++++++++++++---------- 2 files changed, 38 insertions(+), 27 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 7ebe04f666b..1a4d461c3c1 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1061,9 +1061,12 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, display_buffer); - if (sseq->flag & SEQ_USE_ALPHA) { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + /* only draw alpha for main buffer */ + if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { + if (sseq->flag & SEQ_USE_ALPHA) { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } } glBegin(GL_QUADS); diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index 6ed34a79510..c8b70c0ce4a 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -107,20 +107,20 @@ static void wform_put_border(unsigned char *tgt, int w, int h) for (x = 0; x < w; x++) { unsigned char *p = tgt + 4 * x; - p[1] = p[3] = 255.0; - p[4 * w + 1] = p[4 * w + 3] = 255.0; + p[1] = p[3] = 155; + p[4 * w + 1] = p[4 * w + 3] = 155; p = tgt + 4 * (w * (h - 1) + x); - p[1] = p[3] = 255.0; - p[-4 * w + 1] = p[-4 * w + 3] = 255.0; + p[1] = p[3] = 155; + p[-4 * w + 1] = p[-4 * w + 3] = 155; } for (y = 0; y < h; y++) { unsigned char *p = tgt + 4 * w * y; - p[1] = p[3] = 255.0; - p[4 + 1] = p[4 + 3] = 255.0; + p[1] = p[3] = 155; + p[4 + 1] = p[4 + 3] = 155; p = tgt + 4 * (w * y + w - 1); - p[1] = p[3] = 255.0; - p[-4 + 1] = p[-4 + 3] = 255.0; + p[1] = p[3] = 155; + p[-4 + 1] = p[-4 + 3] = 155; } } @@ -156,7 +156,8 @@ static ImBuf *make_waveform_view_from_ibuf_byte(ImBuf *ibuf) unsigned char wtable[256]; wform_put_grid(tgt, w, h); - + wform_put_border(tgt, w, h); + for (x = 0; x < 256; x++) { wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, waveform_gamma) * 255); } @@ -181,8 +182,6 @@ static ImBuf *make_waveform_view_from_ibuf_byte(ImBuf *ibuf) } } - wform_put_border(tgt, w, h); - return rval; } @@ -454,8 +453,8 @@ static void draw_histogram_bar(ImBuf *ibuf, int x, float val, int col) static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf) { ImBuf *rval = IMB_allocImBuf(515, 128, 32, IB_rect); - int c, x, y; - unsigned int n; + int x, y; + unsigned int nr, ng, nb; unsigned char *src = (unsigned char *) ibuf->rect; unsigned int bins[3][HIS_STEPS]; @@ -487,19 +486,28 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf) } } - n = 0; - for (c = 0; c < 3; c++) { - for (x = 0; x < HIS_STEPS; x++) { - if (bins[c][x] > n) { - n = bins[c][x]; - } - } + nr = nb = ng = 0; + for (x = 0; x < HIS_STEPS; x++) { + if (bins[0][x] > nr) + nr = bins[0][x]; + if (bins[1][x] > ng) + ng = bins[1][x]; + if (bins[2][x] > nb) + nb = bins[2][x]; } - for (c = 0; c < 3; c++) { - for (x = 0; x < HIS_STEPS; x++) { - draw_histogram_bar(rval, x * 2 + 1, ((float) bins[c][x]) / n, c); - draw_histogram_bar(rval, x * 2 + 2, ((float) bins[c][x]) / n, c); + for (x = 0; x < HIS_STEPS; x++) { + if (nr) { + draw_histogram_bar(rval, x * 2 + 1, ((float) bins[0][x]) / nr, 0); + draw_histogram_bar(rval, x * 2 + 2, ((float) bins[0][x]) / nr, 0); + } + if (ng) { + draw_histogram_bar(rval, x * 2 + 1, ((float) bins[1][x]) / ng, 1); + draw_histogram_bar(rval, x * 2 + 2, ((float) bins[1][x]) / ng, 1); + } + if (nb) { + draw_histogram_bar(rval, x * 2 + 1, ((float) bins[2][x]) / nb, 2); + draw_histogram_bar(rval, x * 2 + 2, ((float) bins[2][x]) / nb, 2); } } -- cgit v1.2.3 From 879e4fd9be91b590a9c15fc68bdb9850f6f15bb1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Mar 2013 20:34:13 +0000 Subject: sequencer gaps - remove unneeded checks (poll checks editor is non-null) - use booleans - rename operator SEQUENCER_OT_gap_remove, _gap_insert also quiet shadow warning in rigidbody.c (shadowing 'loc') --- .../editors/space_sequencer/sequencer_edit.c | 49 ++++++++++------------ .../editors/space_sequencer/sequencer_intern.h | 4 +- .../editors/space_sequencer/sequencer_ops.c | 10 ++--- 3 files changed, 29 insertions(+), 34 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 516ec6f3a0d..fb372a7b838 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -866,11 +866,11 @@ static int cut_seq_list(Scene *scene, ListBase *slist, int cutframe, return (seq_first_new != NULL); } -static int insert_gap(Scene *scene, int gap, int cfra) +static bool insert_gap(Scene *scene, int gap, int cfra) { Sequence *seq; Editing *ed = BKE_sequencer_editing_get(scene, FALSE); - int done = FALSE; + bool done = false; /* all strips >= cfra are shifted */ @@ -881,7 +881,7 @@ static int insert_gap(Scene *scene, int gap, int cfra) if (seq->startdisp >= cfra) { seq->start += gap; BKE_sequence_calc(scene, seq); - done = TRUE; + done = true; } } SEQ_END @@ -988,15 +988,13 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene) } -static int sequencer_no_gap_exec(bContext *C, wmOperator *op) +static int sequencer_gap_remove_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - Editing *ed = BKE_sequencer_editing_get(scene, FALSE); rctf rectf; - int cfra, efra, sfra, first = 0, done; - int do_all = RNA_boolean_get(op->ptr, "all"); - - if (ed == NULL) return OPERATOR_CANCELLED; + int cfra, efra, sfra; + bool first = false, done; + bool do_all = RNA_boolean_get(op->ptr, "all"); /* get first and last frame */ boundbox_seq(scene, &rectf); @@ -1006,23 +1004,23 @@ static int sequencer_no_gap_exec(bContext *C, wmOperator *op) /* first check if the current frame has a gap already */ for (cfra = CFRA; cfra >= sfra; cfra--) { if (BKE_sequencer_evaluate_frame(scene, cfra)) { - first = 1; + first = true; break; } } for ( ; cfra < efra; cfra++) { /* first == 0 means there's still no strip to remove a gap for */ - if (first == 0) { - if (BKE_sequencer_evaluate_frame(scene, cfra) ) first = 1; + if (first == false) { + if (BKE_sequencer_evaluate_frame(scene, cfra) ) first = true; } else if (BKE_sequencer_evaluate_frame(scene, cfra) == 0) { - done = TRUE; + done = true; while (BKE_sequencer_evaluate_frame(scene, cfra) == 0) { done = insert_gap(scene, -1, cfra); - if (done == 0) break; + if (done == false) break; } - if (done == 0 || do_all == 0) break; + if (done == false || do_all == false) break; } } @@ -1033,16 +1031,16 @@ static int sequencer_no_gap_exec(bContext *C, wmOperator *op) } -void SEQUENCER_OT_no_gap(struct wmOperatorType *ot) +void SEQUENCER_OT_gap_remove(struct wmOperatorType *ot) { /* identifiers */ - ot->name = "Remove Gap"; - ot->idname = "SEQUENCER_OT_no_gap"; + ot->name = "Remove Gaps"; + ot->idname = "SEQUENCER_OT_gap_remove"; ot->description = "Remove gap at current frame to first strip at the right"; /* api callbacks */ // ot->invoke = sequencer_snap_invoke; - ot->exec = sequencer_no_gap_exec; + ot->exec = sequencer_gap_remove_exec; ot->poll = sequencer_edit_poll; /* flags */ @@ -1051,14 +1049,11 @@ void SEQUENCER_OT_no_gap(struct wmOperatorType *ot) RNA_def_boolean(ot->srna, "all", 0, "All Gaps", "Do all gaps to right of current frame"); } -static int sequencer_insert_gap_exec(bContext *C, wmOperator *op) +static int sequencer_gap_insert_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - Editing *ed = BKE_sequencer_editing_get(scene, FALSE); int frames = RNA_int_get(op->ptr, "frames"); - if (ed == NULL) return OPERATOR_CANCELLED; - insert_gap(scene, frames, CFRA); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); @@ -1067,16 +1062,16 @@ static int sequencer_insert_gap_exec(bContext *C, wmOperator *op) } -void SEQUENCER_OT_insert_gap(struct wmOperatorType *ot) +void SEQUENCER_OT_gap_insert(struct wmOperatorType *ot) { /* identifiers */ - ot->name = "Insert Gap"; - ot->idname = "SEQUENCER_OT_insert_gap"; + ot->name = "Insert Gaps"; + ot->idname = "SEQUENCER_OT_gap_insert"; ot->description = "Insert gap at current frame to first strips at the right"; /* api callbacks */ // ot->invoke = sequencer_snap_invoke; - ot->exec = sequencer_insert_gap_exec; + ot->exec = sequencer_gap_insert_exec; ot->poll = sequencer_edit_poll; /* flags */ diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 4eb71c9fb09..32a6c49da89 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -98,8 +98,8 @@ void SEQUENCER_OT_meta_toggle(struct wmOperatorType *ot); void SEQUENCER_OT_meta_make(struct wmOperatorType *ot); void SEQUENCER_OT_meta_separate(struct wmOperatorType *ot); -void SEQUENCER_OT_no_gap(struct wmOperatorType *ot); -void SEQUENCER_OT_insert_gap(struct wmOperatorType *ot); +void SEQUENCER_OT_gap_remove(struct wmOperatorType *ot); +void SEQUENCER_OT_gap_insert(struct wmOperatorType *ot); void SEQUENCER_OT_snap(struct wmOperatorType *ot); void SEQUENCER_OT_strip_jump(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 7ddc5a77555..a236a97a803 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -73,8 +73,8 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_meta_make); WM_operatortype_append(SEQUENCER_OT_meta_separate); - WM_operatortype_append(SEQUENCER_OT_no_gap); - WM_operatortype_append(SEQUENCER_OT_insert_gap); + WM_operatortype_append(SEQUENCER_OT_gap_remove); + WM_operatortype_append(SEQUENCER_OT_gap_insert); WM_operatortype_append(SEQUENCER_OT_snap); WM_operatortype_append(SEQUENCER_OT_strip_jump); WM_operatortype_append(SEQUENCER_OT_swap); @@ -216,9 +216,9 @@ void sequencer_keymap(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_swap", LEFTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "side", SEQ_SIDE_LEFT); RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_swap", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "side", SEQ_SIDE_RIGHT); - RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_no_gap", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "all", FALSE); - RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_no_gap", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "all", TRUE); - WM_keymap_add_item(keymap, "SEQUENCER_OT_insert_gap", EQUALKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_gap_remove", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "all", FALSE); + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_gap_remove", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "all", TRUE); + WM_keymap_add_item(keymap, "SEQUENCER_OT_gap_insert", EQUALKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_swap_inputs", SKEY, KM_PRESS, KM_ALT, 0); -- cgit v1.2.3 From aaa547faff8709cc92a6eaa73ac2fe4c1f042b2c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Mar 2013 20:51:43 +0000 Subject: uv project tool: take scene aspect into account when calculating the camera bounds. --- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index b80862d4db5..7585f872f1a 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1339,7 +1339,9 @@ static int uv_from_view_exec(bContext *C, wmOperator *op) } } else if (camera) { - struct ProjCameraInfo *uci = BLI_uvproject_camera_info(v3d->camera, obedit->obmat, scene->r.xsch, scene->r.ysch); + struct ProjCameraInfo *uci = BLI_uvproject_camera_info(v3d->camera, obedit->obmat, + scene->r.xsch * scene->r.xasp, + scene->r.ysch * scene->r.yasp); if (uci) { BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { -- cgit v1.2.3 From 974d73bfbfbd3f10ad28c3da52e2a6cd84a3b8b8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Mar 2013 21:26:44 +0000 Subject: report [#34772] Incorrect aspect for tex mapping from camera view There was no good way to UV project from a camera with non-square view-border without it stretching the image (even using 'Correct Aspect'). While this isnt a bug its useful to do a UV projection without stretching the image, added 'Camera Bounds' option. --- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 7585f872f1a..ba8b26c9083 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1339,10 +1339,14 @@ static int uv_from_view_exec(bContext *C, wmOperator *op) } } else if (camera) { + const bool camera_bounds = RNA_boolean_get(op->ptr, "camera_bounds"); struct ProjCameraInfo *uci = BLI_uvproject_camera_info(v3d->camera, obedit->obmat, - scene->r.xsch * scene->r.xasp, - scene->r.ysch * scene->r.yasp); + camera_bounds ? (scene->r.xsch * scene->r.xasp) : 1.0f, + camera_bounds ? (scene->r.ysch * scene->r.yasp) : 1.0f); + + // BLI_uvproject_camera_info_scale + if (uci) { BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) @@ -1403,7 +1407,10 @@ void UV_OT_project_from_view(wmOperatorType *ot) ot->poll = uv_from_view_poll; /* properties */ - RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", "Use orthographic projection"); + RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", + "Use orthographic projection"); + RNA_def_boolean(ot->srna, "camera_bounds", 1, "Camera Bounds", + "Map UVs to the camera region taking resolution and aspect into account"); uv_map_clip_correct_properties(ot); } -- cgit v1.2.3 From 1942452ce52fa917198fee6f389f1bc7e4c620fe Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Tue, 26 Mar 2013 21:34:39 +0000 Subject: Paint system: Random texture mapping * Support for 2d painting. * Better random generation and useof the result. --- source/blender/editors/sculpt_paint/paint_image_2d.c | 4 +++- source/blender/editors/sculpt_paint/paint_stroke.c | 9 +++------ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 9bc232c6a61..a45209de643 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -345,6 +345,7 @@ static void brush_painter_2d_refresh_cache(BrushPainter *painter, const float po const int diameter = 2 * BKE_brush_size_get(scene, brush); const float alpha = BKE_brush_alpha_get(scene, brush); const bool do_tiled = ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_3D); + const bool do_random = brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM; float rotation = -mtex->rot; if (mtex->brush_map_mode == MTEX_MAP_MODE_VIEW) { @@ -354,7 +355,8 @@ static void brush_painter_2d_refresh_cache(BrushPainter *painter, const float po if (diameter != cache->lastsize || alpha != cache->lastalpha || brush->jitter != cache->lastjitter || - rotation != cache->last_rotation) + rotation != cache->last_rotation || + do_random) { if (cache->ibuf) { IMB_freeImBuf(cache->ibuf); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index d7e2d010f03..ca48524096a 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -188,13 +188,10 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, ups->brush_rotation = 0.0f; } - if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) { - ups->tex_mouse[0] = BLI_frand() * stroke->vc.ar->sizex; - ups->tex_mouse[1] = BLI_frand() * stroke->vc.ar->sizey;; - } - else { + if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) + BKE_brush_randomize_texture_coordinates(ups); + else copy_v2_v2(ups->tex_mouse, mouse); - } } if (brush->flag & BRUSH_ANCHORED) { -- cgit v1.2.3 From 79b8d890273c20b6689c6246100ba39a5c2857e3 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 27 Mar 2013 12:29:00 +0000 Subject: Tiny fix for sequencer: "View selected strip(s)" now includes the active strip (which can be deselected in cases). Less confusing this way, also because active strip is being drawn very visible. --- source/blender/editors/space_sequencer/sequencer_edit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index fb372a7b838..d285cd6e6a4 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2328,6 +2328,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) View2D *v2d = UI_view2d_fromcontext(C); ARegion *ar = CTX_wm_region(C); Editing *ed = BKE_sequencer_editing_get(scene, FALSE); + Sequence *last_seq = BKE_sequencer_active_get(scene); Sequence *seq; rctf cur_new = v2d->cur; @@ -2344,7 +2345,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; for (seq = ed->seqbasep->first; seq; seq = seq->next) { - if (seq->flag & SELECT) { + if ((seq->flag & SELECT) || (seq == last_seq)) { xmin = min_ii(xmin, seq->startdisp); xmax = max_ii(xmax, seq->enddisp); -- cgit v1.2.3 From 1c886435c845fd10f27497f6febc718f75e2e93a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 27 Mar 2013 17:22:12 +0000 Subject: Fix for Node Editor tool "Find next/prev of same type". This is the first half of the commit, it's going to be reviewed further. It also depends on other work in node drawing (to not reshuffle order on every select/activate). At least it works quite nice for the shortcuts shift [ and shift ] --- source/blender/editors/space_node/node_intern.h | 3 + source/blender/editors/space_node/node_ops.c | 12 +++- source/blender/editors/space_node/node_select.c | 91 +++++++++++++++++++++++++ source/blender/editors/space_node/node_view.c | 2 +- 4 files changed, 104 insertions(+), 4 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 48051014c58..6354c467bb1 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -123,8 +123,11 @@ void NODE_OT_select_lasso(struct wmOperatorType *ot); void NODE_OT_select_same_type(struct wmOperatorType *ot); void NODE_OT_select_same_type_next(struct wmOperatorType *ot); void NODE_OT_select_same_type_prev(struct wmOperatorType *ot); +void NODE_OT_activate_connected(struct wmOperatorType *ot); /* node_view.c */ +int space_node_view_flag(struct bContext *C, SpaceNode *snode, ARegion *ar, const int node_flag); + void NODE_OT_view_all(struct wmOperatorType *ot); void NODE_OT_view_selected(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 1e4e02b6ae1..0c8cd63f1bf 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -60,7 +60,8 @@ void node_operatortypes(void) WM_operatortype_append(NODE_OT_select_same_type); WM_operatortype_append(NODE_OT_select_same_type_next); WM_operatortype_append(NODE_OT_select_same_type_prev); - + WM_operatortype_append(NODE_OT_activate_connected); + WM_operatortype_append(NODE_OT_view_all); WM_operatortype_append(NODE_OT_view_selected); @@ -318,9 +319,14 @@ void node_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "NODE_OT_select_linked_to", LKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "NODE_OT_select_linked_from", LKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NODE_OT_select_same_type", GKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "NODE_OT_select_same_type_next", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "NODE_OT_select_same_type_prev", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); +// WM_keymap_add_item(keymap, "NODE_OT_select_same_type_next", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); +// WM_keymap_add_item(keymap, "NODE_OT_select_same_type_prev", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "NODE_OT_activate_connected", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "prev", FALSE); + kmi = WM_keymap_add_item(keymap, "NODE_OT_activate_connected", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "prev", TRUE); + node_group_operators(keymap, "ShaderNodeGroup"); node_group_operators(keymap, "CompositorNodeGroup"); node_group_operators(keymap, "TextureNodeGroup"); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index faebeabdbba..894c4898029 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -816,3 +816,94 @@ void NODE_OT_select_same_type_prev(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } + +/* ************************** */ + + +static int node_activate_connected_exec(bContext *C, wmOperator *op) +{ + SpaceNode *snode = CTX_wm_space_node(C); + ARegion *ar = CTX_wm_region(C); + bNode **node_array; + bNode *active = nodeGetActive(snode->edittree); + int totnodes; + int revert = RNA_boolean_get(op->ptr, "prev"); + int same_type = 1; + + ntreeGetDependencyList(snode->edittree, &node_array, &totnodes); + + if (totnodes > 1) { + int a; + + for (a = 0; a < totnodes; a++) { + if (node_array[a] == active) + break; + } + + if (same_type) { + bNode *node = NULL; + + while (node == NULL) { + if (revert) a--; + else a++; + + if (a < 0 || a >= totnodes) + break; + + node = node_array[a]; + + if (node->type == active->type) + break; + else node = NULL; + } + if (node) + active = node; + } + else { + if (revert) { + if (a == 0) + active = node_array[totnodes - 1]; + else + active = node_array[a - 1]; + } + else { + if (a == totnodes - 1) + active = node_array[0]; + else + active = node_array[a + 1]; + } + } + + node_select_single(C, active); + + /* is note outside view? */ + if (active->totr.xmax < ar->v2d.cur.xmin || active->totr.xmin > ar->v2d.cur.xmax || + active->totr.ymax < ar->v2d.cur.ymin || active->totr.ymin > ar->v2d.cur.ymax) + space_node_view_flag(C, snode, CTX_wm_region(C), NODE_SELECT); + + } + + if (node_array) + MEM_freeN(node_array); + + return OPERATOR_FINISHED; +} + +void NODE_OT_activate_connected(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Activate/View Connected"; + ot->description = "Activate and view connected nodes, step by step"; + ot->idname = "NODE_OT_activate_connected"; + + /* api callbacks */ + ot->exec = node_activate_connected_exec; + ot->poll = ED_operator_node_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "prev", 0, "Previous", ""); + +} + diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index 293913dff11..eed8a10a1db 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -66,7 +66,7 @@ /* **************** View All Operator ************** */ -static int space_node_view_flag(bContext *C, SpaceNode *snode, ARegion *ar, const int node_flag) +int space_node_view_flag(bContext *C, SpaceNode *snode, ARegion *ar, const int node_flag) { bNode *node; rctf cur_new; -- cgit v1.2.3 From b163256b33605bd27616caefe63de7cca53c9439 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 27 Mar 2013 18:28:25 +0000 Subject: Node Editor To complete previous commit: New "Activate same type next/prev" operator - replaces the two not working previous ones. This selects/activates and views the next or previous node of same type. Shortcuts: Shift ] and Shift [ --- source/blender/editors/space_node/node_intern.h | 4 +- source/blender/editors/space_node/node_ops.c | 10 ++-- source/blender/editors/space_node/node_select.c | 67 +++---------------------- 3 files changed, 10 insertions(+), 71 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 6354c467bb1..7e4397a6cb0 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -121,9 +121,7 @@ void NODE_OT_select_linked_from(struct wmOperatorType *ot); void NODE_OT_select_border(struct wmOperatorType *ot); void NODE_OT_select_lasso(struct wmOperatorType *ot); void NODE_OT_select_same_type(struct wmOperatorType *ot); -void NODE_OT_select_same_type_next(struct wmOperatorType *ot); -void NODE_OT_select_same_type_prev(struct wmOperatorType *ot); -void NODE_OT_activate_connected(struct wmOperatorType *ot); +void NODE_OT_select_same_type_step(struct wmOperatorType *ot); /* node_view.c */ int space_node_view_flag(struct bContext *C, SpaceNode *snode, ARegion *ar, const int node_flag); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 0c8cd63f1bf..4d229c6fe18 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -58,9 +58,7 @@ void node_operatortypes(void) WM_operatortype_append(NODE_OT_select_border); WM_operatortype_append(NODE_OT_select_lasso); WM_operatortype_append(NODE_OT_select_same_type); - WM_operatortype_append(NODE_OT_select_same_type_next); - WM_operatortype_append(NODE_OT_select_same_type_prev); - WM_operatortype_append(NODE_OT_activate_connected); + WM_operatortype_append(NODE_OT_select_same_type_step); WM_operatortype_append(NODE_OT_view_all); WM_operatortype_append(NODE_OT_view_selected); @@ -319,12 +317,10 @@ void node_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "NODE_OT_select_linked_to", LKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "NODE_OT_select_linked_from", LKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NODE_OT_select_same_type", GKEY, KM_PRESS, KM_SHIFT, 0); -// WM_keymap_add_item(keymap, "NODE_OT_select_same_type_next", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); -// WM_keymap_add_item(keymap, "NODE_OT_select_same_type_prev", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); - kmi = WM_keymap_add_item(keymap, "NODE_OT_activate_connected", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "NODE_OT_select_same_type_step", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "prev", FALSE); - kmi = WM_keymap_add_item(keymap, "NODE_OT_activate_connected", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "NODE_OT_select_same_type_step", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "prev", TRUE); node_group_operators(keymap, "ShaderNodeGroup"); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 894c4898029..cdb89a66867 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -762,65 +762,10 @@ void NODE_OT_select_same_type(wmOperatorType *ot) /* ****** Select The Next/Prev Node Of The Same Type ****** */ -static int node_select_same_type_next_exec(bContext *C, wmOperator *UNUSED(op)) -{ - SpaceNode *snode = CTX_wm_space_node(C); - - node_select_same_type_np(snode, 0); - - ED_node_sort(snode->edittree); - - WM_event_add_notifier(C, NC_NODE | NA_SELECTED, NULL); - - return OPERATOR_FINISHED; -} - -void NODE_OT_select_same_type_next(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Select Same Type Next"; - ot->description = "Select the next node of the same type"; - ot->idname = "NODE_OT_select_same_type_next"; - - /* api callbacks */ - ot->exec = node_select_same_type_next_exec; - ot->poll = ED_operator_node_active; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - -static int node_select_same_type_prev_exec(bContext *C, wmOperator *UNUSED(op)) -{ - SpaceNode *snode = CTX_wm_space_node(C); - - node_select_same_type_np(snode, 1); - - ED_node_sort(snode->edittree); - - WM_event_add_notifier(C, NC_NODE | NA_SELECTED, NULL); - return OPERATOR_FINISHED; -} - -void NODE_OT_select_same_type_prev(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Select Same Type Prev"; - ot->description = "Select the prev node of the same type"; - ot->idname = "NODE_OT_select_same_type_prev"; - - /* api callbacks */ - ot->exec = node_select_same_type_prev_exec; - ot->poll = ED_operator_node_active; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - /* ************************** */ -static int node_activate_connected_exec(bContext *C, wmOperator *op) +static int node_select_same_type_step_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -889,15 +834,15 @@ static int node_activate_connected_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NODE_OT_activate_connected(wmOperatorType *ot) +void NODE_OT_select_same_type_step(wmOperatorType *ot) { /* identifiers */ - ot->name = "Activate/View Connected"; - ot->description = "Activate and view connected nodes, step by step"; - ot->idname = "NODE_OT_activate_connected"; + ot->name = "Activate Same Type Next/Prev"; + ot->description = "Activate and view same node type, step by step"; + ot->idname = "NODE_OT_select_same_type_step"; /* api callbacks */ - ot->exec = node_activate_connected_exec; + ot->exec = node_select_same_type_step_exec; ot->poll = ED_operator_node_active; /* flags */ -- cgit v1.2.3 From 9c73c910395e8dd057a134dc3a68b7f78656d00b Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 27 Mar 2013 18:31:18 +0000 Subject: Sequencer "Insert Gap" and "Remove Gap" tooltip fix - to denote this doesn't use selection. The use of this tool is to insert or remove time for a timeline. --- source/blender/editors/space_sequencer/sequencer_edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index d285cd6e6a4..135fddfd348 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1036,7 +1036,7 @@ void SEQUENCER_OT_gap_remove(struct wmOperatorType *ot) /* identifiers */ ot->name = "Remove Gaps"; ot->idname = "SEQUENCER_OT_gap_remove"; - ot->description = "Remove gap at current frame to first strip at the right"; + ot->description = "Remove gap at current frame to first strip at the right, independent of selection or locked state of strips"; /* api callbacks */ // ot->invoke = sequencer_snap_invoke; @@ -1067,7 +1067,7 @@ void SEQUENCER_OT_gap_insert(struct wmOperatorType *ot) /* identifiers */ ot->name = "Insert Gaps"; ot->idname = "SEQUENCER_OT_gap_insert"; - ot->description = "Insert gap at current frame to first strips at the right"; + ot->description = "Insert gap at current frame to first strips at the right, independent of selection or locked state of strips"; /* api callbacks */ // ot->invoke = sequencer_snap_invoke; -- cgit v1.2.3 From c766b0792a114e1a488efee0b944190255beb05e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 27 Mar 2013 19:09:50 +0000 Subject: I18n fixes for C panels & menus (we have to specify the default bpyrna context here, else we get the horrible "empty" string (as translation_context of panels is an array, not a pointer, so it's never NULL). --- source/blender/editors/space_buttons/buttons_context.c | 1 + source/blender/editors/space_clip/clip_buttons.c | 3 ++- source/blender/editors/space_clip/clip_toolbar.c | 3 ++- source/blender/editors/space_file/file_panels.c | 5 +++++ source/blender/editors/space_graph/graph_buttons.c | 5 +++++ source/blender/editors/space_image/image_buttons.c | 3 ++- source/blender/editors/space_info/space_info.c | 1 + source/blender/editors/space_nla/nla_buttons.c | 18 ++++++++++++------ source/blender/editors/space_node/node_buttons.c | 16 ++++++++++------ source/blender/editors/space_node/node_header.c | 3 ++- .../editors/space_sequencer/sequencer_buttons.c | 1 + source/blender/editors/space_view3d/view3d_buttons.c | 3 +++ source/blender/editors/space_view3d/view3d_toolbar.c | 6 ++++-- 13 files changed, 50 insertions(+), 18 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 0bdae9e32f4..a22a8cbb0a4 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1072,6 +1072,7 @@ void buttons_context_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype buttons panel context"); strcpy(pt->idname, "BUTTONS_PT_context"); strcpy(pt->label, N_("Context")); /* XXX C panels are not available through RNA (bpy.types)! */ + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = buttons_panel_context; pt->flag = PNL_NO_HEADER; BLI_addtail(&art->paneltypes, pt); diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c index 9409ce42d3a..8d863193b76 100644 --- a/source/blender/editors/space_clip/clip_buttons.c +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -79,7 +79,8 @@ void ED_clip_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel gpencil"); strcpy(pt->idname, "CLIP_PT_gpencil"); - strcpy(pt->label, "Grease Pencil"); + strcpy(pt->label, N_("Grease Pencil")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = gpencil_panel_standard_header; pt->draw = gpencil_panel_standard; pt->flag |= PNL_DEFAULT_CLOSED; diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c index 10175d07300..42300f88a4f 100644 --- a/source/blender/editors/space_clip/clip_toolbar.c +++ b/source/blender/editors/space_clip/clip_toolbar.c @@ -257,7 +257,8 @@ void ED_clip_tool_props_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel last operator"); strcpy(pt->idname, "CLIP_PT_last_operator"); - strcpy(pt->label, "Operator"); + strcpy(pt->label, N_("Operator")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = clip_panel_operator_redo_header; pt->draw = clip_panel_operator_redo; BLI_addtail(&art->paneltypes, pt); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 9a7f528be78..35179511563 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -219,30 +219,35 @@ void file_panels_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype file system directories"); strcpy(pt->idname, "FILE_PT_system"); strcpy(pt->label, N_("System")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = file_panel_system; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype file system bookmarks"); strcpy(pt->idname, "FILE_PT_system_bookmarks"); strcpy(pt->label, N_("System Bookmarks")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = file_panel_system_bookmarks; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype file bookmarks"); strcpy(pt->idname, "FILE_PT_bookmarks"); strcpy(pt->label, N_("Bookmarks")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = file_panel_bookmarks; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype file recent directories"); strcpy(pt->idname, "FILE_PT_recent"); strcpy(pt->label, N_("Recent")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = file_panel_recent; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype file operator properties"); strcpy(pt->idname, "FILE_PT_operator"); strcpy(pt->label, N_("Operator")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->poll = file_panel_operator_poll; pt->draw_header = file_panel_operator_header; pt->draw = file_panel_operator; diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index f1501857b13..f7ec8e8682d 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -803,6 +803,7 @@ void graph_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype graph panel view"); strcpy(pt->idname, "GRAPH_PT_view"); strcpy(pt->label, N_("View Properties")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = graph_panel_view; pt->flag |= PNL_DEFAULT_CLOSED; BLI_addtail(&art->paneltypes, pt); @@ -810,6 +811,7 @@ void graph_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype graph panel properties"); strcpy(pt->idname, "GRAPH_PT_properties"); strcpy(pt->label, N_("Active F-Curve")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = graph_panel_properties; pt->poll = graph_panel_poll; BLI_addtail(&art->paneltypes, pt); @@ -817,6 +819,7 @@ void graph_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype graph panel properties"); strcpy(pt->idname, "GRAPH_PT_key_properties"); strcpy(pt->label, N_("Active Keyframe")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = graph_panel_key_properties; pt->poll = graph_panel_poll; BLI_addtail(&art->paneltypes, pt); @@ -825,6 +828,7 @@ void graph_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype graph panel drivers"); strcpy(pt->idname, "GRAPH_PT_drivers"); strcpy(pt->label, N_("Drivers")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = graph_panel_drivers; pt->poll = graph_panel_drivers_poll; BLI_addtail(&art->paneltypes, pt); @@ -832,6 +836,7 @@ void graph_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype graph panel modifiers"); strcpy(pt->idname, "GRAPH_PT_modifiers"); strcpy(pt->label, N_("Modifiers")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = graph_panel_modifiers; pt->poll = graph_panel_poll; BLI_addtail(&art->paneltypes, pt); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 70001b59528..5398f886396 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -880,7 +880,8 @@ void image_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil"); strcpy(pt->idname, "IMAGE_PT_gpencil"); - strcpy(pt->label, "Grease Pencil"); + strcpy(pt->label, N_("Grease Pencil")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = gpencil_panel_standard_header; pt->draw = gpencil_panel_standard; BLI_addtail(&art->paneltypes, pt); diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 1577ac338e7..a3eb7c06876 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -300,6 +300,7 @@ static void recent_files_menu_register(void) mt = MEM_callocN(sizeof(MenuType), "spacetype info menu recent files"); strcpy(mt->idname, "INFO_MT_file_open_recent"); strcpy(mt->label, N_("Open Recent...")); + strcpy(mt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); mt->draw = recent_files_menu_draw; WM_menutype_add(mt); } diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index e952bec0dd0..41ec0297560 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -501,7 +501,8 @@ void nla_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype nla panel animdata"); strcpy(pt->idname, "NLA_PT_animdata"); - strcpy(pt->label, "Animation Data"); + strcpy(pt->label, N_("Animation Data")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = nla_panel_animdata; pt->poll = nla_animdata_panel_poll; pt->flag = PNL_DEFAULT_CLOSED; @@ -509,35 +510,40 @@ void nla_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype nla panel track"); strcpy(pt->idname, "NLA_PT_track"); - strcpy(pt->label, "Active Track"); + strcpy(pt->label, N_("Active Track")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = nla_panel_track; pt->poll = nla_track_panel_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype nla panel properties"); strcpy(pt->idname, "NLA_PT_properties"); - strcpy(pt->label, "Active Strip"); + strcpy(pt->label, N_("Active Strip")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = nla_panel_properties; pt->poll = nla_strip_panel_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype nla panel properties"); strcpy(pt->idname, "NLA_PT_actionclip"); - strcpy(pt->label, "Action Clip"); + strcpy(pt->label, N_("Action Clip")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = nla_panel_actclip; pt->poll = nla_strip_actclip_panel_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype nla panel evaluation"); strcpy(pt->idname, "NLA_PT_evaluation"); - strcpy(pt->label, "Evaluation"); + strcpy(pt->label, N_("Evaluation")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = nla_panel_evaluation; pt->poll = nla_strip_eval_panel_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype nla panel modifiers"); strcpy(pt->idname, "NLA_PT_modifiers"); - strcpy(pt->label, "Modifiers"); + strcpy(pt->label, N_("Modifiers")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = nla_panel_modifiers; pt->poll = nla_strip_eval_panel_poll; BLI_addtail(&art->paneltypes, pt); diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index efdb7c0d85d..d0a77e273f0 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -211,13 +211,13 @@ static void node_tree_interface_panel(const bContext *C, Panel *pa) split = uiLayoutRow(row, TRUE); col = uiLayoutColumn(split, TRUE); - uiItemL(col, "Inputs:", ICON_NONE); + uiItemL(col, IFACE_("Inputs:"), ICON_NONE); uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "", &ptr, "inputs", &ptr, "active_input", 0, 0, 0); opptr = uiItemFullO(col, "NODE_OT_tree_socket_add", "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&opptr, "in_out", SOCK_IN); col = uiLayoutColumn(split, TRUE); - uiItemL(col, "Outputs:", ICON_NONE); + uiItemL(col, IFACE_("Outputs:"), ICON_NONE); uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "", &ptr, "outputs", &ptr, "active_output", 0, 0, 0); opptr = uiItemFullO(col, "NODE_OT_tree_socket_add", "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&opptr, "in_out", SOCK_OUT); @@ -248,14 +248,16 @@ void node_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype node panel active node"); strcpy(pt->idname, "NODE_PT_item"); - strcpy(pt->label, IFACE_("Active Node")); + strcpy(pt->label, N_("Active Node")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = active_node_panel; pt->poll = active_node_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype node panel node sockets"); strcpy(pt->idname, "NODE_PT_sockets"); - strcpy(pt->label, "Sockets"); + strcpy(pt->label, N_("Sockets")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = node_sockets_panel; pt->poll = node_sockets_poll; pt->flag |= PNL_DEFAULT_CLOSED; @@ -263,14 +265,16 @@ void node_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype node panel tree interface"); strcpy(pt->idname, "NODE_PT_node_tree_interface"); - strcpy(pt->label, "Interface"); + strcpy(pt->label, N_("Interface")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = node_tree_interface_panel; pt->poll = node_tree_interface_poll; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype node panel gpencil"); strcpy(pt->idname, "NODE_PT_gpencil"); - strcpy(pt->label, "Grease Pencil"); + strcpy(pt->label, N_("Grease Pencil")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = gpencil_panel_standard_header; pt->draw = gpencil_panel_standard; pt->poll = active_nodetree_poll; diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index 175bbce756e..8de2daf9e42 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -81,7 +81,8 @@ void node_menus_register(void) mt = MEM_callocN(sizeof(MenuType), "spacetype node menu add"); strcpy(mt->idname, "NODE_MT_add"); - strcpy(mt->label, "Add"); + strcpy(mt->label, N_("Add")); + strcpy(mt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); mt->draw = node_menu_add; WM_menutype_add(mt); } diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index 21128408a97..197cc64dea4 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -67,6 +67,7 @@ void sequencer_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype sequencer panel gpencil"); strcpy(pt->idname, "SEQUENCER_PT_gpencil"); strcpy(pt->label, N_("Grease Pencil")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = gpencil_panel_standard_header; pt->draw = gpencil_panel_standard; pt->poll = sequencer_grease_pencil_panel_poll; diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 533bb30d8d1..a439b5b5b87 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1270,12 +1270,14 @@ void view3d_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object"); strcpy(pt->idname, "VIEW3D_PT_object"); strcpy(pt->label, N_("Transform")); /* XXX C panels not available through RNA (bpy.types)! */ + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = view3d_panel_object; BLI_addtail(&art->paneltypes, pt); pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil"); strcpy(pt->idname, "VIEW3D_PT_gpencil"); strcpy(pt->label, N_("Grease Pencil")); /* XXX C panels are not available through RNA (bpy.types)! */ + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = gpencil_panel_standard_header; pt->draw = gpencil_panel_standard; BLI_addtail(&art->paneltypes, pt); @@ -1283,6 +1285,7 @@ void view3d_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup"); strcpy(pt->idname, "VIEW3D_PT_vgroup"); strcpy(pt->label, N_("Vertex Groups")); /* XXX C panels are not available through RNA (bpy.types)! */ + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = view3d_panel_vgroup; pt->poll = view3d_panel_vgroup_poll; BLI_addtail(&art->paneltypes, pt); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index d3bf8a30792..603d9a1595c 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -238,7 +238,8 @@ void view3d_toolshelf_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel tools"); strcpy(pt->idname, "VIEW3D_PT_tool_shelf"); - strcpy(pt->label, "Tool Shelf"); + strcpy(pt->label, N_("Tool Shelf")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = view3d_panel_tool_shelf; BLI_addtail(&art->paneltypes, pt); } @@ -249,7 +250,8 @@ void view3d_tool_props_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator"); strcpy(pt->idname, "VIEW3D_PT_last_operator"); - strcpy(pt->label, "Operator"); + strcpy(pt->label, N_("Operator")); + strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = view3d_panel_operator_redo_header; pt->draw = view3d_panel_operator_redo; BLI_addtail(&art->paneltypes, pt); -- cgit v1.2.3