diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-09-23 02:40:19 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-09-23 02:40:19 +0300 |
commit | 1dfb89d229304c302b8849756aa0ddd7e8d96488 (patch) | |
tree | db7a2ed403101788b2cb308538d73a99c95621d6 /source/blender/editors | |
parent | 4a1feaa5558ed60388fd3be41db74fbc54f2ab08 (diff) | |
parent | 1b2b7cfa2007172e07d78324bb941d0160b59c42 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
intern/ghost/intern/GHOST_ContextCGL.mm
intern/ghost/intern/GHOST_WindowCocoa.mm
source/blender/makesrna/intern/rna_main.c
Diffstat (limited to 'source/blender/editors')
46 files changed, 480 insertions, 510 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 40dfa01ced8..4ad593b7059 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -4076,7 +4076,7 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, const bAni case ACHANNEL_SETTING_SOLO: /* NLA Tracks only */ //icon = ((enabled) ? ICON_SOLO_OFF : ICON_SOLO_ON); icon = ICON_SOLO_OFF; - tooltip = TIP_("NLA Track is the only one evaluated in this Animation Data block, with all others muted"); + tooltip = TIP_("NLA Track is the only one evaluated in this animation data-block, with all others muted"); break; /* --- */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 0a6ecd7f026..96dd80777f2 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2141,7 +2141,7 @@ static void ANIM_OT_channels_clean_empty(wmOperatorType *ot) /* identifiers */ ot->name = "Remove Empty Animation Data"; ot->idname = "ANIM_OT_channels_clean_empty"; - ot->description = "Delete all empty animation data containers from visible datablocks"; + ot->description = "Delete all empty animation data containers from visible data-blocks"; /* api callbacks */ ot->exec = animchannels_clean_empty_exec; diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index dbc9c8b4f23..f8b98ebb8b7 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -343,12 +343,13 @@ static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, flo } } - range = max_coord - min_coord; - - if (range > FLT_EPSILON) { - factor = 2.0f / range; + if (max_coord > min_coord) { + range = max_coord - min_coord; + if (range > FLT_EPSILON) { + factor = 2.0f / range; + } + offset = -min_coord - range / 2.0f; } - offset = -min_coord - range / 2.0f; } BLI_assert(factor != 0.0f); if (r_offset) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 98be77b491f..f2a35bb1553 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1771,8 +1771,10 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) flag = ANIM_get_keyframing_flags(scene, 1); /* try to insert keyframe using property retrieved from UI */ - but = UI_context_active_but_get(C); - UI_context_active_but_prop_get(C, &ptr, &prop, &index); + if (!(but = UI_context_active_but_prop_get(C, &ptr, &prop, &index))) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } if ((ptr.id.data && ptr.data && prop) && RNA_property_animateable(&ptr, prop)) { if (ptr.type == &RNA_NlaStrip) { @@ -1873,7 +1875,10 @@ static int delete_key_button_exec(bContext *C, wmOperator *op) const bool all = RNA_boolean_get(op->ptr, "all"); /* try to insert keyframe using property retrieved from UI */ - UI_context_active_but_prop_get(C, &ptr, &prop, &index); + if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } if (ptr.id.data && ptr.data && prop) { if (ptr.type == &RNA_NlaStrip) { @@ -1973,7 +1978,10 @@ static int clear_key_button_exec(bContext *C, wmOperator *op) const bool all = RNA_boolean_get(op->ptr, "all"); /* try to insert keyframe using property retrieved from UI */ - UI_context_active_but_prop_get(C, &ptr, &prop, &index); + if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } if (ptr.id.data && ptr.data && prop) { path = RNA_path_from_ID_to_property(&ptr, prop); diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index b907ad150aa..4408ec26b3f 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -296,6 +296,12 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) int index = 0, pflag = 0; const bool all = RNA_boolean_get(op->ptr, "all"); + /* try to add to keyingset using property retrieved from UI */ + if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } + /* verify the Keying Set to use: * - use the active one for now (more control over this can be added later) * - add a new one if it doesn't exist @@ -326,9 +332,6 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1); } - /* try to add to keyingset using property retrieved from UI */ - UI_context_active_but_prop_get(C, &ptr, &prop, &index); - /* check if property is able to be added */ if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { path = RNA_path_from_ID_to_property(&ptr, prop); @@ -396,6 +399,12 @@ static int remove_keyingset_button_exec(bContext *C, wmOperator *op) short success = 0; int index = 0; + /* try to add to keyingset using property retrieved from UI */ + if (UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } + /* verify the Keying Set to use: * - use the active one for now (more control over this can be added later) * - return error if it doesn't exist @@ -412,9 +421,6 @@ static int remove_keyingset_button_exec(bContext *C, wmOperator *op) ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1); } - /* try to add to keyingset using property retrieved from UI */ - UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop) { path = RNA_path_from_ID_to_property(&ptr, prop); diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c index 4d9df06f33f..c492772b282 100644 --- a/source/blender/editors/armature/pose_group.c +++ b/source/blender/editors/armature/pose_group.c @@ -292,7 +292,6 @@ static int group_move_exec(bContext *C, wmOperator *op) bPoseChannel *pchan; bActionGroup *grp; int dir = RNA_enum_get(op->ptr, "direction"); - int grpIndexA, grpIndexB; if (ELEM(NULL, ob, pose)) return OPERATOR_CANCELLED; @@ -305,51 +304,33 @@ static int group_move_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* move bone group */ - grpIndexA = pose->active_group; - if (dir == 1) { /* up */ - void *prev = grp->prev; - - if (prev == NULL) - return OPERATOR_FINISHED; - - BLI_remlink(&pose->agroups, grp); - BLI_insertlinkbefore(&pose->agroups, prev, grp); - - grpIndexB = grpIndexA - 1; - pose->active_group--; - } - else { /* down */ - void *next = grp->next; - - if (next == NULL) - return OPERATOR_FINISHED; - - BLI_remlink(&pose->agroups, grp); - BLI_insertlinkafter(&pose->agroups, next, grp); - - grpIndexB = grpIndexA + 1; - pose->active_group++; - } + if (BLI_listbase_link_move(&pose->agroups, grp, dir)) { + int grpIndexA = pose->active_group; + int grpIndexB = grpIndexA + dir; + + pose->active_group += dir; + /* fix changed bone group indices in bones (swap grpIndexA with grpIndexB) */ + for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { + if (pchan->agrp_index == grpIndexB) { + pchan->agrp_index = grpIndexA; + } + else if (pchan->agrp_index == grpIndexA) { + pchan->agrp_index = grpIndexB; + } + } - /* fix changed bone group indices in bones (swap grpIndexA with grpIndexB) */ - for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { - if (pchan->agrp_index == grpIndexB) - pchan->agrp_index = grpIndexA; - else if (pchan->agrp_index == grpIndexA) - pchan->agrp_index = grpIndexB; + /* notifiers for updates */ + WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); } - /* notifiers for updates */ - WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); - return OPERATOR_FINISHED; } void POSE_OT_group_move(wmOperatorType *ot) { static EnumPropertyItem group_slot_move[] = { - {1, "UP", 0, "Up", ""}, - {-1, "DOWN", 0, "Down", ""}, + {-1, "UP", 0, "Up", ""}, + {1, "DOWN", 0, "Down", ""}, {0, NULL, 0, NULL, NULL} }; @@ -365,7 +346,8 @@ void POSE_OT_group_move(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_enum(ot->srna, "direction", group_slot_move, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", group_slot_move, 0, "Direction", + "Direction to move the active Bone Group towards"); } /* bone group sort element */ diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 2012237ed4e..4af7f3f8727 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -766,32 +766,18 @@ static int poselib_move_exec(bContext *C, wmOperator *op) dir = RNA_enum_get(op->ptr, "direction"); /* move pose */ - if (dir == 1) { /* up */ - void *prev = marker->prev; + if (BLI_listbase_link_move(&act->markers, marker, dir)) { + act->active_marker = marker_index + dir + 1; - if (prev == NULL) - return OPERATOR_FINISHED; - - BLI_remlink(&act->markers, marker); - BLI_insertlinkbefore(&act->markers, prev, marker); + /* send notifiers for this - using keyframe editing notifiers, since action + * may be being shown in anim editors as active action + */ + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } - else { /* down */ - void *next = marker->next; - - if (next == NULL) - return OPERATOR_FINISHED; - - BLI_remlink(&act->markers, marker); - BLI_insertlinkafter(&act->markers, next, marker); + else { + return OPERATOR_CANCELLED; } - act->active_marker = marker_index - dir + 1; - - /* send notifiers for this - using keyframe editing notifiers, since action - * may be being shown in anim editors as active action - */ - WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); - /* done */ return OPERATOR_FINISHED; } @@ -800,8 +786,8 @@ void POSELIB_OT_pose_move(wmOperatorType *ot) { PropertyRNA *prop; static EnumPropertyItem pose_lib_pose_move[] = { - {1, "UP", 0, "Up", ""}, - {-1, "DOWN", 0, "Down", ""}, + {-1, "UP", 0, "Up", ""}, + {1, "DOWN", 0, "Down", ""}, {0, NULL, 0, NULL, NULL} }; @@ -824,7 +810,8 @@ void POSELIB_OT_pose_move(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; - RNA_def_enum(ot->srna, "direction", pose_lib_pose_move, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", pose_lib_pose_move, 0, "Direction", + "Direction to move the chosen pose towards"); } diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index fa7850bc2f4..b645f1fb2f3 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -414,7 +414,6 @@ static bPoseChannel *pose_bone_do_paste(Object *ob, bPoseChannel *chan, const bo static int pose_copy_exec(bContext *C, wmOperator *op) { - Main *bmain = CTX_data_main(C); Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); char str[FILE_MAX]; /* Sanity checking. */ @@ -424,13 +423,36 @@ static int pose_copy_exec(bContext *C, wmOperator *op) } /* Sets chan->flag to POSE_KEY if bone selected. */ set_pose_keys(ob); + /* Construct a local bmain and only put object and it's data into it, + * o this way we don't expand any other objects into the copy buffer + * file. + * + * TODO(sergey): Find an easier way to tell copy buffer to only store + * data we are actually interested in. Maybe pass it a flag to skip + * any datablock expansion? + */ + Main *temp_bmain = BKE_main_new(); + Object ob_copy = *ob; + bArmature arm_copy = *((bArmature *)ob->data); + ob_copy.data = &arm_copy; + BLI_addtail(&temp_bmain->object, &ob_copy); + BLI_addtail(&temp_bmain->armature, &arm_copy); + /* begin copy buffer on a temp bmain. */ + BKE_copybuffer_begin(temp_bmain); /* Store the whole object to the copy buffer because pose can't be * existing on it's own. */ - BKE_copybuffer_begin(bmain); - BKE_copybuffer_tag_ID(&ob->id); + BKE_copybuffer_tag_ID(&ob_copy.id); BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer_pose.blend"); - BKE_copybuffer_save(bmain, str, op->reports); + BKE_copybuffer_save(temp_bmain, str, op->reports); + /* We clear the lists so no datablocks gets freed, + * This is required because objects in temp bmain shares same pointers + * as the real ones. + */ + BLI_listbase_clear(&temp_bmain->object); + BLI_listbase_clear(&temp_bmain->armature); + BKE_main_free(temp_bmain); + /* We are all done! */ BKE_report(op->reports, RPT_INFO, "Copied pose to buffer"); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index b40b51e337f..57e731874b4 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1788,7 +1788,7 @@ void FONT_OT_unlink(wmOperatorType *ot) /* identifiers */ ot->name = "Unlink"; ot->idname = "FONT_OT_unlink"; - ot->description = "Unlink active font data block"; + ot->description = "Unlink active font data-block"; /* api callbacks */ ot->exec = font_unlink_exec; diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index fcb2ce02bde..8576cbca239 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1350,6 +1350,10 @@ static bool gpsculpt_brush_apply_standard(bContext *C, tGP_BrushEditData *gso) CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers) { + bGPDframe *gpf = gpl->actframe; + if (gpf == NULL) + continue; + /* calculate difference matrix if parent object */ if (gpl->parent != NULL) { ED_gpencil_parent_location(gpl, diff_mat); @@ -1358,10 +1362,8 @@ static bool gpsculpt_brush_apply_standard(bContext *C, tGP_BrushEditData *gso) else { parented = false; } - - bGPDframe *gpf = gpl->actframe; - bGPDstroke *gps; - for (gps = gpf->strokes.first; gps; gps = gps->next) { + + for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { /* skip strokes that are invalid for current view */ if (ED_gpencil_stroke_can_use(C, gps) == false) continue; diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 9560ab188a4..7dcbe2cc24c 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -108,7 +108,7 @@ void GPENCIL_OT_data_add(wmOperatorType *ot) /* identifiers */ ot->name = "Grease Pencil Add New"; ot->idname = "GPENCIL_OT_data_add"; - ot->description = "Add new Grease Pencil datablock"; + ot->description = "Add new Grease Pencil data-block"; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* callbacks */ @@ -156,7 +156,7 @@ void GPENCIL_OT_data_unlink(wmOperatorType *ot) /* identifiers */ ot->name = "Grease Pencil Unlink"; ot->idname = "GPENCIL_OT_data_unlink"; - ot->description = "Unlink active Grease Pencil datablock"; + ot->description = "Unlink active Grease Pencil data-block"; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* callbacks */ @@ -197,7 +197,7 @@ void GPENCIL_OT_layer_add(wmOperatorType *ot) /* identifiers */ ot->name = "Add New Layer"; ot->idname = "GPENCIL_OT_layer_add"; - ot->description = "Add new Grease Pencil layer for the active Grease Pencil datablock"; + ot->description = "Add new Grease Pencil layer for the active Grease Pencil data-block"; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -272,21 +272,11 @@ static int gp_layer_move_exec(bContext *C, wmOperator *op) if (ELEM(NULL, gpd, gpl)) return OPERATOR_CANCELLED; - /* up or down? */ - if (direction == GP_LAYER_MOVE_UP) { - /* up */ - BLI_remlink(&gpd->layers, gpl); - BLI_insertlinkbefore(&gpd->layers, gpl->prev, gpl); - } - else { - /* down */ - BLI_remlink(&gpd->layers, gpl); - BLI_insertlinkafter(&gpd->layers, gpl->next, gpl); + BLI_assert(ELEM(direction, -1, 0, 1)); /* we use value below */ + if (BLI_listbase_link_move(&gpd->layers, gpl, direction)) { + WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); } - /* notifiers */ - WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); - return OPERATOR_FINISHED; } @@ -761,14 +751,12 @@ static int gp_stroke_arrange_exec(bContext *C, wmOperator *op) /* some stroke is already at front*/ if ((direction == GP_STROKE_MOVE_TOP) || (direction == GP_STROKE_MOVE_UP)) { if (gps == gpf->strokes.last) { - BKE_report(op->reports, RPT_ERROR, "Some selected stroke is already on top"); return OPERATOR_CANCELLED; } } /* some stroke is already at botom */ if ((direction == GP_STROKE_MOVE_BOTTOM) || (direction == GP_STROKE_MOVE_DOWN)) { if (gps == gpf->strokes.first) { - BKE_report(op->reports, RPT_ERROR, "Some selected stroke is already on bottom"); return OPERATOR_CANCELLED; } } @@ -784,23 +772,21 @@ static int gp_stroke_arrange_exec(bContext *C, wmOperator *op) for (LinkData *link = selected.first; link; link = link->next) { gps = link->data; BLI_remlink(&gpf->strokes, gps); - BLI_insertlinkafter(&gpf->strokes, gpf->strokes.last, gps); + BLI_addtail(&gpf->strokes, gps); } break; /* Bring Forward */ case GP_STROKE_MOVE_UP: for (LinkData *link = selected.last; link; link = link->prev) { gps = link->data; - BLI_remlink(&gpf->strokes, gps); - BLI_insertlinkafter(&gpf->strokes, gps->next, gps); + BLI_listbase_link_move(&gpf->strokes, gps, 1); } break; - /* Send Backward */ + /* Send Backward */ case GP_STROKE_MOVE_DOWN: for (LinkData *link = selected.first; link; link = link->next) { gps = link->data; - BLI_remlink(&gpf->strokes, gps); - BLI_insertlinkbefore(&gpf->strokes, gps->prev, gps); + BLI_listbase_link_move(&gpf->strokes, gps, -1); } break; /* Send to Back */ @@ -808,13 +794,15 @@ static int gp_stroke_arrange_exec(bContext *C, wmOperator *op) for (LinkData *link = selected.last; link; link = link->prev) { gps = link->data; BLI_remlink(&gpf->strokes, gps); - BLI_insertlinkbefore(&gpf->strokes, gpf->strokes.first, gps); + BLI_addhead(&gpf->strokes, gps); } break; default: BLI_assert(0); break; } + BLI_freelistN(&selected); + /* notifiers */ WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); @@ -991,7 +979,7 @@ void GPENCIL_OT_brush_add(wmOperatorType *ot) /* identifiers */ ot->name = "Add Brush"; ot->idname = "GPENCIL_OT_brush_add"; - ot->description = "Add new Grease Pencil drawing brush for the active Grease Pencil datablock"; + ot->description = "Add new Grease Pencil drawing brush for the active Grease Pencil data-block"; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1349,7 +1337,7 @@ void GPENCIL_OT_palette_add(wmOperatorType *ot) /* identifiers */ ot->name = "Add Palette"; ot->idname = "GPENCIL_OT_palette_add"; - ot->description = "Add new Grease Pencil palette for the active Grease Pencil datablock"; + ot->description = "Add new Grease Pencil palette for the active Grease Pencil data-block"; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1566,7 +1554,7 @@ void GPENCIL_OT_palettecolor_add(wmOperatorType *ot) /* identifiers */ ot->name = "Add Palette Color"; ot->idname = "GPENCIL_OT_palettecolor_add"; - ot->description = "Add new Grease Pencil palette color for the active Grease Pencil datablock"; + ot->description = "Add new Grease Pencil palette color for the active Grease Pencil data-block"; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 7175ec3e83d..12d837dfb29 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1504,6 +1504,9 @@ static int gp_stroke_cyclical_set_exec(bContext *C, wmOperator *op) /* loop all selected strokes */ CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers) { + if (gpl->actframe == NULL) + continue; + for (bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->prev) { bGPDpalettecolor *palcolor = gps->palcolor; @@ -1724,6 +1727,9 @@ static int gp_stroke_join_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers) { bGPDframe *gpf = gpl->actframe; + if (gpf == NULL) + continue; + for (gps = gpf->strokes.first; gps; gps = gpsn) { gpsn = gps->next; if (gps->flag & GP_STROKE_SELECT) { diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 26a6fdd7d1f..fd5351394c3 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -161,13 +161,13 @@ enum { UI_BUT_NODE_LINK = (1 << 8), UI_BUT_NODE_ACTIVE = (1 << 9), UI_BUT_DRAG_LOCK = (1 << 10), - UI_BUT_DISABLED = (1 << 11), + UI_BUT_DISABLED = (1 << 11), /* grayed out and uneditable */ UI_BUT_COLOR_LOCK = (1 << 12), UI_BUT_ANIMATED = (1 << 13), UI_BUT_ANIMATED_KEY = (1 << 14), UI_BUT_DRIVEN = (1 << 15), UI_BUT_REDALERT = (1 << 16), - UI_BUT_INACTIVE = (1 << 17), + UI_BUT_INACTIVE = (1 << 17), /* grayed out but still editable */ UI_BUT_LAST_ACTIVE = (1 << 18), UI_BUT_UNDO = (1 << 19), UI_BUT_IMMEDIATE = (1 << 20), @@ -1021,19 +1021,13 @@ void ED_keymap_ui(struct wmKeyConfig *keyconf); void UI_drop_color_copy(struct wmDrag *drag, struct wmDropBox *drop); int UI_drop_color_poll(struct bContext *C, struct wmDrag *drag, const struct wmEvent *event); -/* UI_OT_space_context_cycle direction */ -enum { - SPACE_CONTEXT_CYCLE_PREV, - SPACE_CONTEXT_CYCLE_NEXT, -}; - bool UI_context_copy_to_selected_list( struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, struct ListBase *r_lb, bool *r_use_path_from_id, char **r_path); /* Helpers for Operators */ uiBut *UI_context_active_but_get(const struct bContext *C); -void UI_context_active_but_prop_get( +uiBut *UI_context_active_but_prop_get( const struct bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop, int *r_index); void UI_context_active_but_prop_handle(struct bContext *C); diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index a81221ed54b..f8a5f30a596 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -298,7 +298,10 @@ enum { TH_V3D_CLIPPING_BORDER, TH_METADATA_BG, - TH_METADATA_TEXT + TH_METADATA_TEXT, + + TH_EDGE_BEVEL, + TH_VERTEX_BEVEL }; /* XXX WARNING: previous is saved in file, so do not change order! */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index cbe8654ceb6..6bba35e821f 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1247,7 +1247,6 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2]) if (ot == NULL || WM_operator_poll_context((bContext *)C, ot, but->opcontext) == 0) { but->flag |= UI_BUT_DISABLED; - but->lock = true; } if (but->context) @@ -3122,8 +3121,7 @@ static uiBut *ui_def_but( but->a2 = a2; but->tip = tip; - but->lock = block->lock; - but->lockstr = block->lockstr; + but->disabled_info = block->lockstr; but->dt = block->dt; but->pie_dir = UI_RADIAL_NONE; @@ -3171,10 +3169,8 @@ static uiBut *ui_def_but( but->drawflag |= (block->flag & UI_BUT_ALIGN); - if (but->lock == true) { - if (but->lockstr) { - but->flag |= UI_BUT_DISABLED; - } + if (block->lock == true) { + but->flag |= UI_BUT_DISABLED; } /* keep track of UI_interface.h */ @@ -3219,11 +3215,10 @@ void ui_def_but_icon(uiBut *but, const int icon, const int flag) } } -static void ui_def_but_rna__disable(uiBut *but) +static void ui_def_but_rna__disable(uiBut *but, const char *info) { but->flag |= UI_BUT_DISABLED; - but->lock = true; - but->lockstr = ""; + but->disabled_info = info; } static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *but_p) @@ -3488,8 +3483,9 @@ static uiBut *ui_def_but_rna( but->flag |= UI_BUT_ICON_SUBMENU; } - if (!RNA_property_editable(&but->rnapoin, prop)) { - ui_def_but_rna__disable(but); + const char *info; + if (!RNA_property_editable_info(&but->rnapoin, prop, &info)) { + ui_def_but_rna__disable(but, info); } if (but->flag & UI_BUT_UNDO && (ui_but_is_rna_undo(but) == false)) { @@ -3520,7 +3516,7 @@ static uiBut *ui_def_but_rna_propname(uiBlock *block, int type, int retval, cons else { but = ui_def_but(block, type, retval, propname, x, y, width, height, NULL, min, max, a1, a2, tip); - ui_def_but_rna__disable(but); + ui_def_but_rna__disable(but, "Unknown Property."); } return but; @@ -3548,8 +3544,7 @@ static uiBut *ui_def_but_operator_ptr(uiBlock *block, int type, wmOperatorType * if (!ot) { but->flag |= UI_BUT_DISABLED; - but->lock = true; - but->lockstr = ""; + but->disabled_info = ""; } return but; diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 88924495ae5..991cd54fecf 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -179,7 +179,7 @@ bool ui_but_anim_expression_create(uiBut *but, const char *str) id = (ID *)but->rnapoin.id.data; if ((id == NULL) || (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) { if (G.debug & G_DEBUG) - printf("ERROR: create expression failed - invalid id-datablock for adding drivers (%p)\n", id); + printf("ERROR: create expression failed - invalid data-block for adding drivers (%p)\n", id); return false; } @@ -272,36 +272,6 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) } } -void ui_but_anim_insert_keyframe(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_keyframe_insert_button", WM_OP_INVOKE_DEFAULT, NULL); -} - -void ui_but_anim_delete_keyframe(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_keyframe_delete_button", WM_OP_INVOKE_DEFAULT, NULL); -} - -void ui_but_anim_clear_keyframe(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_keyframe_clear_button", WM_OP_INVOKE_DEFAULT, NULL); -} - -void ui_but_anim_add_driver(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_driver_button_add", WM_OP_INVOKE_DEFAULT, NULL); -} - -void ui_but_anim_remove_driver(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_driver_button_remove", WM_OP_INVOKE_DEFAULT, NULL); -} - void ui_but_anim_copy_driver(bContext *C) { /* this operator calls UI_context_active_but_prop_get */ @@ -313,15 +283,3 @@ void ui_but_anim_paste_driver(bContext *C) /* this operator calls UI_context_active_but_prop_get */ WM_operator_name_call(C, "ANIM_OT_paste_driver_button", WM_OP_INVOKE_DEFAULT, NULL); } - -void ui_but_anim_add_keyingset(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_keyingset_button_add", WM_OP_INVOKE_DEFAULT, NULL); -} - -void ui_but_anim_remove_keyingset(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_keyingset_button_remove", WM_OP_INVOKE_DEFAULT, NULL); -} diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 5ee05a46ada..99913a0e88d 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1256,6 +1256,9 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect) /* matrix after circle */ glPopMatrix(); + + /* We disabled all blender lights above, so restore them here. */ + GPU_default_lights(); } static void ui_draw_but_curve_grid(const rcti *rect, float zoomx, float zoomy, float offsx, float offsy, float step) diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c index ac7b6428217..31598a44b09 100644 --- a/source/blender/editors/interface/interface_eyedropper.c +++ b/source/blender/editors/interface/interface_eyedropper.c @@ -448,8 +448,20 @@ static int eyedropper_exec(bContext *C, wmOperator *op) static int eyedropper_poll(bContext *C) { - if (!CTX_wm_window(C)) return 0; - else return 1; + PointerRNA ptr; + PropertyRNA *prop; + int index_dummy; + uiBut *but; + + /* Only color buttons */ + if ((CTX_wm_window(C) != NULL) && + (but = UI_context_active_but_prop_get(C, &ptr, &prop, &index_dummy)) && + (but->type == UI_BTYPE_COLOR)) + { + return 1; + } + + return 0; } void UI_OT_eyedropper_color(wmOperatorType *ot) @@ -727,16 +739,35 @@ static int datadropper_exec(bContext *C, wmOperator *op) static int datadropper_poll(bContext *C) { - if (!CTX_wm_window(C)) return 0; - else return 1; + PointerRNA ptr; + PropertyRNA *prop; + int index_dummy; + uiBut *but; + + /* data dropper only supports object data */ + if ((CTX_wm_window(C) != NULL) && + (but = UI_context_active_but_prop_get(C, &ptr, &prop, &index_dummy)) && + (but->type == UI_BTYPE_SEARCH_MENU) && + (but->flag & UI_BUT_SEARCH_UNLINK)) + { + if (prop && RNA_property_type(prop) == PROP_POINTER) { + StructRNA *type = RNA_property_pointer_type(&ptr, prop); + const short idcode = RNA_type_to_ID_code(type); + if ((idcode == ID_OB) || OB_DATA_SUPPORT_ID(idcode)) { + return 1; + } + } + } + + return 0; } void UI_OT_eyedropper_id(wmOperatorType *ot) { /* identifiers */ - ot->name = "Eyedropper Datablock"; + ot->name = "Eyedropper Data-Block"; ot->idname = "UI_OT_eyedropper_id"; - ot->description = "Sample a datablock from the 3D View to store in a property"; + ot->description = "Sample a data-block from the 3D View to store in a property"; /* api callbacks */ ot->invoke = datadropper_invoke; @@ -1034,8 +1065,26 @@ static int depthdropper_exec(bContext *C, wmOperator *op) static int depthdropper_poll(bContext *C) { - if (!CTX_wm_window(C)) return 0; - else return 1; + PointerRNA ptr; + PropertyRNA *prop; + int index_dummy; + uiBut *but; + + /* check if there's an active button taking depth value */ + if ((CTX_wm_window(C) != NULL) && + (but = UI_context_active_but_prop_get(C, &ptr, &prop, &index_dummy)) && + (but->type == UI_BTYPE_NUM) && + (prop != NULL)) + { + if ((RNA_property_type(prop) == PROP_FLOAT) && + (RNA_property_subtype(prop) & PROP_UNIT_LENGTH) && + (RNA_property_array_check(prop) == false)) + { + return 1; + } + } + + return 0; } void UI_OT_eyedropper_depth(wmOperatorType *ot) @@ -1084,12 +1133,11 @@ static bool driverdropper_init(bContext *C, wmOperator *op) { DriverDropper *ddr; uiBut *but; - + op->customdata = ddr = MEM_callocN(sizeof(DriverDropper), "DriverDropper"); - - UI_context_active_but_prop_get(C, &ddr->ptr, &ddr->prop, &ddr->index); - but = UI_context_active_but_get(C); - + + but = UI_context_active_but_prop_get(C, &ddr->ptr, &ddr->prop, &ddr->index); + if ((ddr->ptr.data == NULL) || (ddr->prop == NULL) || (RNA_property_editable(&ddr->ptr, ddr->prop) == false) || diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 4972e16bf2e..369eba66f32 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1266,6 +1266,10 @@ static bool ui_drag_toggle_set_xy_xy( } } } + if (changed) { + /* apply now, not on release (or if handlers are cancelled for whatever reason) */ + ui_apply_but_funcs_after(C); + } return changed; } @@ -2248,9 +2252,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data, bool buf_paste_alloc = false; bool show_report = false; /* use to display errors parsing paste input */ - if (mode == 'v' && but->lock == true) { - return; - } + BLI_assert((but->flag & UI_BUT_DISABLED) == 0); /* caller should check */ if (mode == 'c') { /* disallow copying from any passwords */ @@ -6974,6 +6976,12 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * if (but->flag & UI_BUT_DISABLED) return WM_UI_HANDLER_CONTINUE; + /* if but->pointype is set, but->poin should be too */ + BLI_assert(!but->pointype || but->poin); + + /* Only hard-coded stuff here, button interactions with configurable + * keymaps are handled using operators (see #ED_keymap_ui). */ + if ((data->state == BUTTON_STATE_HIGHLIGHT) || (event->type == EVT_DROP)) { /* handle copy-paste */ if (ELEM(event->type, CKEY, VKEY) && event->val == KM_PRESS && @@ -7001,91 +7009,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * else if (event->type == EVT_DROP) { ui_but_drop(C, event, but, data); } - /* handle eyedropper */ - else if ((event->type == EKEY) && (event->val == KM_PRESS)) { - if (IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) { - /* pass */ - } - else { - if (but->type == UI_BTYPE_COLOR) { - WM_operator_name_call(C, "UI_OT_eyedropper_color", WM_OP_INVOKE_DEFAULT, NULL); - return WM_UI_HANDLER_BREAK; - } - else if ((but->type == UI_BTYPE_SEARCH_MENU) && - (but->flag & UI_BUT_SEARCH_UNLINK)) - { - if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_POINTER) { - StructRNA *type = RNA_property_pointer_type(&but->rnapoin, but->rnaprop); - const short idcode = RNA_type_to_ID_code(type); - if ((idcode == ID_OB) || OB_DATA_SUPPORT_ID(idcode)) { - WM_operator_name_call(C, "UI_OT_eyedropper_id", WM_OP_INVOKE_DEFAULT, NULL); - return WM_UI_HANDLER_BREAK; - } - } - } - else if (but->type == UI_BTYPE_NUM) { - if (but->rnaprop && - (RNA_property_type(but->rnaprop) == PROP_FLOAT) && - (RNA_property_subtype(but->rnaprop) & PROP_UNIT_LENGTH) && - (RNA_property_array_check(but->rnaprop) == false)) - { - WM_operator_name_call(C, "UI_OT_eyedropper_depth", WM_OP_INVOKE_DEFAULT, NULL); - return WM_UI_HANDLER_BREAK; - } - } - } - } - /* handle keyframing */ - else if ((event->type == IKEY) && - !IS_EVENT_MOD(event, ctrl, oskey) && - (event->val == KM_PRESS)) - { - if (event->alt) { - if (event->shift) { - ui_but_anim_clear_keyframe(C); - } - else { - ui_but_anim_delete_keyframe(C); - } - } - else { - ui_but_anim_insert_keyframe(C); - } - - ED_region_tag_redraw(data->region); - - return WM_UI_HANDLER_BREAK; - } - /* handle drivers */ - else if ((event->type == DKEY) && - !IS_EVENT_MOD(event, shift, oskey) && - (event->val == KM_PRESS)) - { - /* quick check to prevent this opening within the popup menu its self */ - if (!ELEM(NULL, but->rnapoin.data, but->rnaprop)) { - if (event->alt) - ui_but_anim_remove_driver(C); - else if (event->ctrl) - ui_but_anim_add_driver(C); - - ED_region_tag_redraw(data->region); - } - return WM_UI_HANDLER_BREAK; - } - /* handle keyingsets */ - else if ((event->type == KKEY) && - !IS_EVENT_MOD(event, shift, ctrl, oskey) && - (event->val == KM_PRESS)) - { - if (event->alt) - ui_but_anim_remove_keyingset(C); - else - ui_but_anim_add_keyingset(C); - - ED_region_tag_redraw(data->region); - - return WM_UI_HANDLER_BREAK; - } /* handle menu */ else if ((event->type == RIGHTMOUSE) && !IS_EVENT_MOD(event, shift, ctrl, alt, oskey) && @@ -7098,24 +7021,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * } } - /* verify if we can edit this button */ - if (ELEM(event->type, LEFTMOUSE, RETKEY)) { - /* this should become disabled button .. */ - if (but->lock == true) { - if (but->lockstr) { - WM_report(RPT_INFO, but->lockstr); - button_activate_state(C, but, BUTTON_STATE_EXIT); - return WM_UI_HANDLER_BREAK; - } - } - else if (but->pointype && but->poin == NULL) { - /* there's a pointer needed */ - BKE_reportf(NULL, RPT_WARNING, "DoButton pointer error: %s", but->str); - button_activate_state(C, but, BUTTON_STATE_EXIT); - return WM_UI_HANDLER_BREAK; - } - } - switch (but->type) { case UI_BTYPE_BUT: retval = ui_do_but_BUT(C, but, data, event); @@ -8095,8 +8000,13 @@ uiBut *UI_context_active_but_get(const struct bContext *C) return ui_context_button_active(C, NULL); } -/* helper function for insert keyframe, reset to default, etc operators */ -void UI_context_active_but_prop_get( +/** + * Version of #UI_context_active_but_get that also returns RNA property info. + * Helper function for insert keyframe, reset to default, etc operators. + * + * \return active button, NULL if none found or if it doesn't contain valid RNA data. + */ +uiBut *UI_context_active_but_prop_get( const bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop, int *r_index) { @@ -8112,6 +8022,8 @@ void UI_context_active_but_prop_get( *r_prop = NULL; *r_index = 0; } + + return activebut; } void UI_context_active_but_prop_handle(bContext *C) diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 8336efa381b..fcf827bdbe6 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -271,10 +271,10 @@ struct uiBut { uiButToolTipFunc tip_func; void *tip_argN; - const char *lockstr; + /* info on why button is disabled, displayed in tooltip */ + const char *disabled_info; BIFIconID icon; - bool lock; char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied from the block */ signed char pie_dir; /* direction in a pie menu, used for collision detection (RadialDirection) */ char changed; /* could be made into a single flag */ @@ -729,15 +729,8 @@ void ui_block_align_calc(uiBlock *block); /* interface_anim.c */ void ui_but_anim_flag(uiBut *but, float cfra); -void ui_but_anim_insert_keyframe(struct bContext *C); -void ui_but_anim_delete_keyframe(struct bContext *C); -void ui_but_anim_clear_keyframe(struct bContext *C); -void ui_but_anim_add_driver(struct bContext *C); -void ui_but_anim_remove_driver(struct bContext *C); void ui_but_anim_copy_driver(struct bContext *C); void ui_but_anim_paste_driver(struct bContext *C); -void ui_but_anim_add_keyingset(struct bContext *C); -void ui_but_anim_remove_keyingset(struct bContext *C); bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen); bool ui_but_anim_expression_set(uiBut *but, const char *str); bool ui_but_anim_expression_create(uiBut *but, const char *str); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index e802cf82b8e..976b5ed1193 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -745,8 +745,7 @@ static void ui_item_disabled(uiLayout *layout, const char *name) but = uiDefBut(block, UI_BTYPE_LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); but->flag |= UI_BUT_DISABLED; - but->lock = true; - but->lockstr = ""; + but->disabled_info = ""; } /* operator items */ diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index cb539bb1c5d..7e516474bfd 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1082,79 +1082,6 @@ static void UI_OT_drop_color(wmOperatorType *ot) RNA_def_boolean(ot->srna, "gamma", 0, "Gamma Corrected", "The source color is gamma corrected "); } -/* ------------------------------------------------------------------------- */ - -static EnumPropertyItem space_context_cycle_direction[] = { - {SPACE_CONTEXT_CYCLE_PREV, "PREV", 0, "Previous", ""}, - {SPACE_CONTEXT_CYCLE_NEXT, "NEXT", 0, "Next", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static int space_context_cycle_poll(bContext *C) -{ - ScrArea *sa = CTX_wm_area(C); - return ELEM(sa->spacetype, SPACE_BUTS, SPACE_USERPREF); -} - -/** - * Helper to get the correct RNA pointer/property pair for changing - * the display context of active space type in \sa. - */ -static void context_cycle_prop_get( - bScreen *screen, const ScrArea *sa, - PointerRNA *r_ptr, PropertyRNA **r_prop) -{ - const char *propname; - - switch (sa->spacetype) { - case SPACE_BUTS: - RNA_pointer_create(&screen->id, &RNA_SpaceProperties, sa->spacedata.first, r_ptr); - propname = "context"; - break; - case SPACE_USERPREF: - RNA_pointer_create(NULL, &RNA_UserPreferences, &U, r_ptr); - propname = "active_section"; - break; - } - - *r_prop = RNA_struct_find_property(r_ptr, propname); -} - -static int space_context_cycle_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) -{ - const int direction = RNA_enum_get(op->ptr, "direction"); - - PointerRNA ptr; - PropertyRNA *prop; - context_cycle_prop_get(CTX_wm_screen(C), CTX_wm_area(C), &ptr, &prop); - - const int old_context = RNA_property_enum_get(&ptr, prop); - const int new_context = RNA_property_enum_step( - C, &ptr, prop, old_context, - direction == SPACE_CONTEXT_CYCLE_PREV ? -1 : 1); - RNA_property_enum_set(&ptr, prop, new_context); - RNA_property_update(C, &ptr, prop); - - return OPERATOR_FINISHED; -} - -static void UI_OT_space_context_cycle(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Cycle Space Context"; - ot->description = "Cycle through the editor context by activating the next/previous one"; - ot->idname = "UI_OT_space_context_cycle"; - - /* api callbacks */ - ot->invoke = space_context_cycle_invoke; - ot->poll = space_context_cycle_poll; - - ot->flag = 0; - - RNA_def_enum(ot->srna, "direction", space_context_cycle_direction, SPACE_CONTEXT_CYCLE_NEXT, "Direction", - "Direction to cycle through"); -} - /* ********************************************************* */ /* Registration */ @@ -1174,7 +1101,6 @@ void ED_operatortypes_ui(void) WM_operatortype_append(UI_OT_edittranslation_init); #endif WM_operatortype_append(UI_OT_reloadtranslation); - WM_operatortype_append(UI_OT_space_context_cycle); /* external */ WM_operatortype_append(UI_OT_eyedropper_color); @@ -1185,12 +1111,29 @@ void ED_operatortypes_ui(void) /** * \brief User Interface Keymap - * - * For now only modal maps here, since UI uses special ui-handlers instead of operators. */ void ED_keymap_ui(wmKeyConfig *keyconf) { - WM_keymap_find(keyconf, "User Interface", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "User Interface", 0, 0); + + /* eyedroppers - notice they all have the same shortcut, but pass the event + * through until a suitable eyedropper for the active button is found */ + WM_keymap_add_item(keymap, "UI_OT_eyedropper_color", EKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "UI_OT_eyedropper_id", EKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "UI_OT_eyedropper_depth", EKEY, KM_PRESS, 0, 0); + + /* keyframes */ + WM_keymap_add_item(keymap, "ANIM_OT_keyframe_insert_button", IKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ANIM_OT_keyframe_delete_button", IKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "ANIM_OT_keyframe_clear_button", IKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0); + + /* drivers */ + WM_keymap_add_item(keymap, "ANIM_OT_driver_button_add", DKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "ANIM_OT_driver_button_remove", DKEY, KM_PRESS, KM_CTRL | KM_ALT, 0); + + /* keyingsets */ + WM_keymap_add_item(keymap, "ANIM_OT_keyingset_button_add", KKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ANIM_OT_keyingset_button_remove", KKEY, KM_PRESS, KM_ALT, 0); eyedropper_modal_keymap(keyconf); } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 7a506c5c451..5602e2b9c6d 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -456,7 +456,7 @@ static uiTooltipData *ui_tooltip_data_from_button(bContext *C, uiBut *but) } /* button is disabled, we may be able to tell user why */ - if ((but->flag & UI_BUT_DISABLED) || but->lock) { + if (but->flag & UI_BUT_DISABLED) { const char *disabled_msg = NULL; /* if operator poll check failed, it can give pretty precise info why */ @@ -466,8 +466,8 @@ static uiTooltipData *ui_tooltip_data_from_button(bContext *C, uiBut *but) disabled_msg = CTX_wm_operator_poll_msg_get(C); } /* alternatively, buttons can store some reasoning too */ - else if (but->lockstr) { - disabled_msg = but->lockstr; + else if (but->disabled_info) { + disabled_msg = TIP_(but->disabled_info); } if (disabled_msg && disabled_msg[0]) { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index f3157df4d28..462ad34582b 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -451,12 +451,12 @@ static void template_ID( if (id->lib) { if (id->tag & LIB_TAG_INDIRECT) { but = uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0, 0, UI_UNIT_X, UI_UNIT_Y, - NULL, 0, 0, 0, 0, TIP_("Indirect library datablock, cannot change")); + NULL, 0, 0, 0, 0, TIP_("Indirect library data-block, cannot change")); UI_but_flag_enable(but, UI_BUT_DISABLED); } else { but = uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0, 0, UI_UNIT_X, UI_UNIT_Y, - NULL, 0, 0, 0, 0, TIP_("Direct linked library datablock, click to make local")); + NULL, 0, 0, 0, 0, TIP_("Direct linked library data-block, click to make local")); if (!id_make_local(CTX_data_main(C), id, true /* test */, false) || (idfrom && idfrom->lib)) UI_but_flag_enable(but, UI_BUT_DISABLED); } @@ -582,7 +582,7 @@ static void template_ID( else { if ((RNA_property_flag(template->prop) & PROP_NEVER_UNLINK) == 0) { but = uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, - TIP_("Unlink datablock " + TIP_("Unlink data-block " "(Shift + Click to set users to zero, data will then not be saved)")); UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index c8ff335f2a0..6b7867c845f 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -305,6 +305,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo cp = ts->vertex; break; case TH_VERTEX_SELECT: cp = ts->vertex_select; break; + case TH_VERTEX_BEVEL: + cp = ts->vertex_bevel; break; case TH_VERTEX_UNREFERENCED: cp = ts->vertex_unreferenced; break; case TH_VERTEX_SIZE: @@ -321,6 +323,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo cp = ts->edge_sharp; break; case TH_EDGE_CREASE: cp = ts->edge_crease; break; + case TH_EDGE_BEVEL: + cp = ts->edge_bevel; break; case TH_EDITMESH_ACTIVE: cp = ts->editmesh_active; break; case TH_EDGE_FACESEL: @@ -898,12 +902,14 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255); rgba_char_args_set(btheme->tv3d.vertex, 0, 0, 0, 255); rgba_char_args_set(btheme->tv3d.vertex_select, 255, 133, 0, 255); + rgba_char_args_set(btheme->tv3d.vertex_bevel, 0, 165, 255, 255); rgba_char_args_set(btheme->tv3d.vertex_unreferenced, 0, 0, 0, 255); btheme->tv3d.vertex_size = 3; btheme->tv3d.outline_width = 1; rgba_char_args_set(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255); rgba_char_args_set(btheme->tv3d.edge_select, 255, 160, 0, 255); rgba_char_args_set(btheme->tv3d.edge_seam, 219, 37, 18, 255); + rgba_char_args_set(btheme->tv3d.edge_bevel, 0, 165, 255, 255); rgba_char_args_set(btheme->tv3d.edge_facesel, 75, 75, 75, 255); rgba_char_args_set(btheme->tv3d.face, 0, 0, 0, 18); rgba_char_args_set(btheme->tv3d.face_select, 255, 133, 0, 60); @@ -2734,6 +2740,14 @@ void init_userdef_do_versions(void) } } + if (!USER_VERSION_ATLEAST(278, 1)) { + bTheme *btheme; + for (btheme = U.themes.first; btheme; btheme = btheme->next) { + rgba_char_args_set(btheme->tv3d.vertex_bevel, 0, 165, 255, 255); + rgba_char_args_set(btheme->tv3d.edge_bevel, 0, 165, 255, 255); + } + } + /** * Include next version bump. * diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index bc6a4dc3de2..14cbcfc7fd0 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2341,7 +2341,7 @@ void OBJECT_OT_make_local(wmOperatorType *ot) /* identifiers */ ot->name = "Make Local"; - ot->description = "Make library linked datablocks local to this file"; + ot->description = "Make library linked data-blocks local to this file"; ot->idname = "OBJECT_OT_make_local"; /* api callbacks */ @@ -2436,7 +2436,7 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot) RNA_def_boolean(ot->srna, "object", 0, "Object", "Make single user objects"); RNA_def_boolean(ot->srna, "obdata", 0, "Object Data", "Make single user object data"); - RNA_def_boolean(ot->srna, "material", 0, "Materials", "Make materials local to each datablock"); + RNA_def_boolean(ot->srna, "material", 0, "Materials", "Make materials local to each data-block"); RNA_def_boolean(ot->srna, "texture", 0, "Textures", "Make textures local to each material (needs 'Materials' to be set too)"); RNA_def_boolean(ot->srna, "animation", 0, "Object Animation", "Make animation data local to each object"); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index ad41fb23a69..bd016b7fcfb 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -3633,7 +3633,8 @@ static int vgroup_move_exec(bContext *C, wmOperator *op) Object *ob = ED_object_context(C); bDeformGroup *def; char *name_array; - int dir = RNA_enum_get(op->ptr, "direction"), ret; + int dir = RNA_enum_get(op->ptr, "direction"); + int ret = OPERATOR_FINISHED; def = BLI_findlink(&ob->defbase, ob->actdef - 1); if (!def) { @@ -3642,36 +3643,25 @@ static int vgroup_move_exec(bContext *C, wmOperator *op) name_array = vgroup_init_remap(ob); - if (dir == 1) { /*up*/ - void *prev = def->prev; + if (BLI_listbase_link_move(&ob->defbase, def, dir)) { + ret = vgroup_do_remap(ob, name_array, op); - BLI_remlink(&ob->defbase, def); - BLI_insertlinkbefore(&ob->defbase, prev, def); - } - else { /*down*/ - void *next = def->next; - - BLI_remlink(&ob->defbase, def); - BLI_insertlinkafter(&ob->defbase, next, def); + if (ret != OPERATOR_CANCELLED) { + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); + } } - ret = vgroup_do_remap(ob, name_array, op); - if (name_array) MEM_freeN(name_array); - if (ret != OPERATOR_CANCELLED) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); - } - return ret; } void OBJECT_OT_vertex_group_move(wmOperatorType *ot) { static EnumPropertyItem vgroup_slot_move[] = { - {1, "UP", 0, "Up", ""}, - {-1, "DOWN", 0, "Down", ""}, + {-1, "UP", 0, "Up", ""}, + {1, "DOWN", 0, "Down", ""}, {0, NULL, 0, NULL, NULL} }; @@ -3687,7 +3677,8 @@ void OBJECT_OT_vertex_group_move(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_enum(ot->srna, "direction", vgroup_slot_move, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", vgroup_slot_move, 0, "Direction", + "Direction to move the active vertex group towards"); } static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr) diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index ee2772ce31a..db0ffb90344 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -133,6 +133,7 @@ typedef struct OGLRender { TaskPool *task_pool; bool pool_ok; + bool is_animation; SpinLock reports_lock; #ifdef DEBUG_TIME @@ -372,12 +373,10 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) } if (ibuf_result != NULL) { - - RE_render_result_rect_from_ibuf(rr, &scene->r, ibuf_result, oglrender->view_id); - - if ((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW)) + if ((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW)) { BKE_image_stamp_buf(scene, camera, NULL, rect, NULL, rr->rectx, rr->recty, 4); - + } + RE_render_result_rect_from_ibuf(rr, &scene->r, ibuf_result, oglrender->view_id); IMB_freeImBuf(ibuf_result); } } @@ -636,6 +635,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->cfrao = scene->r.cfra; oglrender->write_still = is_write_still && !is_animation; + oglrender->is_animation = is_animation; oglrender->views_len = BKE_scene_multiview_num_views_get(&scene->r); @@ -701,12 +701,12 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->task_pool = BLI_task_pool_create(task_scheduler, oglrender); } + oglrender->pool_ok = true; + BLI_spin_init(&oglrender->reports_lock); } else { oglrender->task_pool = NULL; } - oglrender->pool_ok = true; - BLI_spin_init(&oglrender->reports_lock); #ifdef DEBUG_TIME oglrender->time_start = PIL_check_seconds_timer(); @@ -721,9 +721,11 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) Scene *scene = oglrender->scene; int i; - BLI_task_pool_work_and_wait(oglrender->task_pool); - BLI_task_pool_free(oglrender->task_pool); - BLI_spin_end(&oglrender->reports_lock); + if (oglrender->is_animation) { + BLI_task_pool_work_and_wait(oglrender->task_pool); + BLI_task_pool_free(oglrender->task_pool); + BLI_spin_end(&oglrender->reports_lock); + } #ifdef DEBUG_TIME printf("Total render time: %f\n", PIL_check_seconds_timer() - oglrender->time_start); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 39256bc8ca3..7eb2552487b 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -448,7 +448,8 @@ void OBJECT_OT_material_slot_move(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_enum(ot->srna, "direction", material_slot_move, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", material_slot_move, 0, "Direction", + "Direction to move the active material towards"); } /********************** new material operator *********************/ @@ -827,14 +828,10 @@ static int freestyle_module_move_exec(bContext *C, wmOperator *op) FreestyleModuleConfig *module = ptr.data; int dir = RNA_enum_get(op->ptr, "direction"); - if (dir == 1) { - BKE_freestyle_module_move_up(&srl->freestyleConfig, module); + if (BKE_freestyle_module_move(&srl->freestyleConfig, module, dir)) { + DAG_id_tag_update(&scene->id, 0); + WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); } - else { - BKE_freestyle_module_move_down(&srl->freestyleConfig, module); - } - DAG_id_tag_update(&scene->id, 0); - WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); return OPERATOR_FINISHED; } @@ -842,8 +839,8 @@ static int freestyle_module_move_exec(bContext *C, wmOperator *op) void SCENE_OT_freestyle_module_move(wmOperatorType *ot) { static EnumPropertyItem direction_items[] = { - {1, "UP", 0, "Up", ""}, - {-1, "DOWN", 0, "Down", ""}, + {-1, "UP", 0, "Up", ""}, + {1, "DOWN", 0, "Down", ""}, {0, NULL, 0, NULL, NULL} }; @@ -860,7 +857,8 @@ void SCENE_OT_freestyle_module_move(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; /* props */ - RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", + "Direction to move the chosen style module towards"); } static int freestyle_lineset_add_exec(bContext *C, wmOperator *UNUSED(op)) @@ -990,14 +988,10 @@ static int freestyle_lineset_move_exec(bContext *C, wmOperator *op) SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); int dir = RNA_enum_get(op->ptr, "direction"); - if (dir == 1) { - FRS_move_active_lineset_up(&srl->freestyleConfig); - } - else { - FRS_move_active_lineset_down(&srl->freestyleConfig); + if (FRS_move_active_lineset(&srl->freestyleConfig, dir)) { + DAG_id_tag_update(&scene->id, 0); + WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); } - DAG_id_tag_update(&scene->id, 0); - WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); return OPERATOR_FINISHED; } @@ -1005,8 +999,8 @@ static int freestyle_lineset_move_exec(bContext *C, wmOperator *op) void SCENE_OT_freestyle_lineset_move(wmOperatorType *ot) { static EnumPropertyItem direction_items[] = { - {1, "UP", 0, "Up", ""}, - {-1, "DOWN", 0, "Down", ""}, + {-1, "UP", 0, "Up", ""}, + {1, "DOWN", 0, "Down", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1023,7 +1017,8 @@ void SCENE_OT_freestyle_lineset_move(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; /* props */ - RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", + "Direction to move the active line set towards"); } static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op) @@ -1346,6 +1341,7 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op) PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier); LineStyleModifier *modifier = ptr.data; int dir = RNA_enum_get(op->ptr, "direction"); + bool changed = false; if (!freestyle_linestyle_check_report(lineset, op->reports)) { return OPERATOR_CANCELLED; @@ -1353,23 +1349,26 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op) switch (freestyle_get_modifier_type(&ptr)) { case LS_MODIFIER_TYPE_COLOR: - BKE_linestyle_color_modifier_move(lineset->linestyle, modifier, dir); + changed = BKE_linestyle_color_modifier_move(lineset->linestyle, modifier, dir); break; case LS_MODIFIER_TYPE_ALPHA: - BKE_linestyle_alpha_modifier_move(lineset->linestyle, modifier, dir); + changed = BKE_linestyle_alpha_modifier_move(lineset->linestyle, modifier, dir); break; case LS_MODIFIER_TYPE_THICKNESS: - BKE_linestyle_thickness_modifier_move(lineset->linestyle, modifier, dir); + changed = BKE_linestyle_thickness_modifier_move(lineset->linestyle, modifier, dir); break; case LS_MODIFIER_TYPE_GEOMETRY: - BKE_linestyle_geometry_modifier_move(lineset->linestyle, modifier, dir); + changed = BKE_linestyle_geometry_modifier_move(lineset->linestyle, modifier, dir); break; default: BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier"); return OPERATOR_CANCELLED; } - DAG_id_tag_update(&lineset->linestyle->id, 0); - WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle); + + if (changed) { + DAG_id_tag_update(&lineset->linestyle->id, 0); + WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle); + } return OPERATOR_FINISHED; } @@ -1377,8 +1376,8 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op) void SCENE_OT_freestyle_modifier_move(wmOperatorType *ot) { static EnumPropertyItem direction_items[] = { - {1, "UP", 0, "Up", ""}, - {-1, "DOWN", 0, "Down", ""}, + {-1, "UP", 0, "Up", ""}, + {1, "DOWN", 0, "Down", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1395,7 +1394,8 @@ void SCENE_OT_freestyle_modifier_move(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; /* props */ - RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", + "Direction to move the chosen modifier towards"); } static int freestyle_stroke_material_create_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 574f8871e53..a26d4f040e4 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1383,9 +1383,12 @@ static void region_subwindow(wmWindow *win, ARegion *ar, bool activate) static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *handlers, int flag) { /* note, add-handler checks if it already exists */ - + /* XXX it would be good to have boundbox checks for some of these... */ if (flag & ED_KEYMAP_UI) { + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "User Interface", 0, 0); + WM_event_add_keymap_handler(handlers, keymap); + /* user interface widgets */ UI_region_handlers_add(handlers); } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index e446194a1da..a6b6ccd5a66 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4174,6 +4174,86 @@ static void SCREEN_OT_region_blend(wmOperatorType *ot) /* properties */ } +/* ******************** space context cycling operator ******************** */ + +/* SCREEN_OT_space_context_cycle direction */ +enum { + SPACE_CONTEXT_CYCLE_PREV, + SPACE_CONTEXT_CYCLE_NEXT, +}; + +static EnumPropertyItem space_context_cycle_direction[] = { + {SPACE_CONTEXT_CYCLE_PREV, "PREV", 0, "Previous", ""}, + {SPACE_CONTEXT_CYCLE_NEXT, "NEXT", 0, "Next", ""}, + {0, NULL, 0, NULL, NULL} +}; + +static int space_context_cycle_poll(bContext *C) +{ + ScrArea *sa = CTX_wm_area(C); + /* sa might be NULL if called out of window bounds */ + return (sa && ELEM(sa->spacetype, SPACE_BUTS, SPACE_USERPREF)); +} + +/** + * Helper to get the correct RNA pointer/property pair for changing + * the display context of active space type in \sa. + */ +static void context_cycle_prop_get( + bScreen *screen, const ScrArea *sa, + PointerRNA *r_ptr, PropertyRNA **r_prop) +{ + const char *propname; + + switch (sa->spacetype) { + case SPACE_BUTS: + RNA_pointer_create(&screen->id, &RNA_SpaceProperties, sa->spacedata.first, r_ptr); + propname = "context"; + break; + case SPACE_USERPREF: + RNA_pointer_create(NULL, &RNA_UserPreferences, &U, r_ptr); + propname = "active_section"; + break; + } + + *r_prop = RNA_struct_find_property(r_ptr, propname); +} + +static int space_context_cycle_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) +{ + const int direction = RNA_enum_get(op->ptr, "direction"); + + PointerRNA ptr; + PropertyRNA *prop; + context_cycle_prop_get(CTX_wm_screen(C), CTX_wm_area(C), &ptr, &prop); + + const int old_context = RNA_property_enum_get(&ptr, prop); + const int new_context = RNA_property_enum_step( + C, &ptr, prop, old_context, + direction == SPACE_CONTEXT_CYCLE_PREV ? -1 : 1); + RNA_property_enum_set(&ptr, prop, new_context); + RNA_property_update(C, &ptr, prop); + + return OPERATOR_FINISHED; +} + +static void SCREEN_OT_space_context_cycle(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Cycle Space Context"; + ot->description = "Cycle through the editor context by activating the next/previous one"; + ot->idname = "SCREEN_OT_space_context_cycle"; + + /* api callbacks */ + ot->invoke = space_context_cycle_invoke; + ot->poll = space_context_cycle_poll; + + ot->flag = 0; + + RNA_def_enum(ot->srna, "direction", space_context_cycle_direction, SPACE_CONTEXT_CYCLE_NEXT, "Direction", + "Direction to cycle through"); +} + /* **************** Assigning operatortypes to global list, adding handlers **************** */ @@ -4209,6 +4289,7 @@ void ED_operatortypes_screen(void) WM_operatortype_append(SCREEN_OT_screencast); WM_operatortype_append(SCREEN_OT_userpref_show); WM_operatortype_append(SCREEN_OT_region_blend); + WM_operatortype_append(SCREEN_OT_space_context_cycle); /*frame changes*/ WM_operatortype_append(SCREEN_OT_frame_offset); @@ -4332,10 +4413,9 @@ void ED_keymap_screen(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "SCREEN_OT_screenshot", F3KEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SCREEN_OT_screencast", F3KEY, KM_PRESS, KM_ALT, 0); - /* UI */ - kmi = WM_keymap_add_item(keymap, "UI_OT_space_context_cycle", TABKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "SCREEN_OT_space_context_cycle", TABKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "direction", SPACE_CONTEXT_CYCLE_NEXT); - kmi = WM_keymap_add_item(keymap, "UI_OT_space_context_cycle", TABKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "SCREEN_OT_space_context_cycle", TABKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", SPACE_CONTEXT_CYCLE_PREV); /* tests */ diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index d60c8e8dbd9..f5d115442c6 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -371,6 +371,8 @@ typedef struct ProjPaintState { */ const MLoopUV **dm_mloopuv; const MLoopUV **dm_mloopuv_clone; /* other UV map, use for cloning between layers */ + + bool use_colormanagement; } ProjPaintState; typedef union pixelPointer { @@ -1623,7 +1625,12 @@ static ProjPixel *project_paint_uvpixel_init( unsigned char rgba_ub[4]; float rgba[4]; project_face_pixel(lt_other_tri_uv, ibuf_other, w, rgba_ub, NULL); - srgb_to_linearrgb_uchar4(rgba, rgba_ub); + if (ps->use_colormanagement) { + srgb_to_linearrgb_uchar4(rgba, rgba_ub); + } + else { + rgba_uchar_to_float(rgba, rgba_ub); + } straight_to_premul_v4_v4(((ProjPixelClone *)projPixel)->clonepx.f, rgba); } } @@ -1632,7 +1639,12 @@ static ProjPixel *project_paint_uvpixel_init( float rgba[4]; project_face_pixel(lt_other_tri_uv, ibuf_other, w, NULL, rgba); premul_to_straight_v4(rgba); - linearrgb_to_srgb_uchar3(((ProjPixelClone *)projPixel)->clonepx.ch, rgba); + if (ps->use_colormanagement) { + linearrgb_to_srgb_uchar3(((ProjPixelClone *)projPixel)->clonepx.ch, rgba); + } + else { + rgb_float_to_uchar(((ProjPixelClone *)projPixel)->clonepx.ch, rgba); + } ((ProjPixelClone *)projPixel)->clonepx.ch[3] = rgba[3] * 255; } else { /* char to char */ @@ -4359,7 +4371,12 @@ static void do_projectpaint_draw( if (ps->is_texbrush) { mul_v3_v3v3(rgb, texrgb, ps->paint_color_linear); /* TODO(sergey): Support texture paint color space. */ - linearrgb_to_srgb_v3_v3(rgb, rgb); + if (ps->use_colormanagement) { + linearrgb_to_srgb_v3_v3(rgb, rgb); + } + else { + copy_v3_v3(rgb, rgb); + } } else { copy_v3_v3(rgb, ps->paint_color); @@ -4957,11 +4974,21 @@ static void paint_proj_stroke_ps( /* handle gradient and inverted stroke color here */ if (ps->tool == PAINT_TOOL_DRAW) { paint_brush_color_get(scene, brush, false, ps->mode == BRUSH_STROKE_INVERT, distance, pressure, ps->paint_color, NULL); - srgb_to_linearrgb_v3_v3(ps->paint_color_linear, ps->paint_color); + if (ps->use_colormanagement) { + srgb_to_linearrgb_v3_v3(ps->paint_color_linear, ps->paint_color); + } + else { + copy_v3_v3(ps->paint_color_linear, ps->paint_color); + } } else if (ps->tool == PAINT_TOOL_FILL) { copy_v3_v3(ps->paint_color, BKE_brush_color_get(scene, brush)); - srgb_to_linearrgb_v3_v3(ps->paint_color_linear, ps->paint_color); + if (ps->use_colormanagement) { + srgb_to_linearrgb_v3_v3(ps->paint_color_linear, ps->paint_color); + } + else { + copy_v3_v3(ps->paint_color_linear, ps->paint_color); + } } else if (ps->tool == PAINT_TOOL_MASK) { ps->stencil_value = brush->weight; @@ -5112,7 +5139,9 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int ps->normal_angle_inner__cos = cosf(ps->normal_angle_inner); ps->dither = settings->imapaint.dither; - + + ps->use_colormanagement = BKE_scene_check_color_management_enabled(CTX_data_scene(C)); + return; } @@ -5783,7 +5812,7 @@ void PAINT_OT_add_texture_paint_slot(wmOperatorType *ot) /* properties */ prop = RNA_def_enum(ot->srna, "type", layer_type_items, 0, "Type", "Merge method to use"); RNA_def_property_flag(prop, PROP_HIDDEN); - RNA_def_string(ot->srna, "name", IMA_DEF_NAME, MAX_ID_NAME - 2, "Name", "Image datablock name"); + RNA_def_string(ot->srna, "name", IMA_DEF_NAME, MAX_ID_NAME - 2, "Name", "Image data-block name"); prop = RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384); RNA_def_property_subtype(prop, PROP_PIXEL); prop = RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 52c39e5c7a1..432918f0e37 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -813,7 +813,7 @@ static void SOUND_OT_unpack(wmOperatorType *ot) /* properties */ RNA_def_enum(ot->srna, "method", rna_enum_unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack"); - RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Sound Name", "Sound datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */ + RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Sound Name", "Sound data-block name to unpack"); /* XXX, weark!, will fail with library, name collisions */ } /* ******************************************************* */ diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c index 6755a6316cc..fdf2dfe8371 100644 --- a/source/blender/editors/space_action/action_data.c +++ b/source/blender/editors/space_action/action_data.c @@ -669,8 +669,8 @@ void ACTION_OT_unlink(wmOperatorType *ot) ot->poll = action_unlink_poll; /* properties */ - prop = RNA_def_boolean(ot->srna, "force_delete", false, "Force Delete", - "Clear Fake User and remove copy stashed in this datablock's NLA stack"); + prop = RNA_def_boolean(ot->srna, "force_delete", false, "Force Delete", "Clear Fake User and remove " + "copy stashed in this data-block's NLA stack"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 2825af9d5cf..a1ecb1c4f5c 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1011,7 +1011,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) block = uiLayoutGetBlock(row); UI_block_emboss_set(block, UI_EMBOSS_NONE); but = uiDefIconButBitC(block, UI_BTYPE_ICON_TOGGLE, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, - 0, 0, 0, 0, TIP_("Follow context or keep fixed datablock displayed")); + 0, 0, 0, 0, TIP_("Follow context or keep fixed data-block displayed")); UI_but_flag_disable(but, UI_BUT_UNDO); /* skip undo on screen buttons */ UI_but_func_set(but, pin_cb, NULL, NULL); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 6778a0b1805..de8d7609509 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -476,7 +476,7 @@ void CLIP_OT_view_pan(wmOperatorType *ot) ot->poll = ED_space_clip_view_clip_poll; /* flags */ - ot->flag = OPTYPE_BLOCKING; + ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_CURSOR; /* properties */ RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX, diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 9f5e98d2431..b7228f634bf 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1061,7 +1061,8 @@ void FILE_OT_bookmark_move(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER; /* No undo! */ - RNA_def_enum(ot->srna, "direction", slot_move, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", slot_move, 0, "Direction", + "Direction to move the active bookmark towards"); } static int reset_recent_exec(bContext *C, wmOperator *UNUSED(op)) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index a89d3494af0..b4dd5c4a87f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2546,7 +2546,7 @@ void IMAGE_OT_new(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "name", IMA_DEF_NAME, MAX_ID_NAME - 2, "Name", "Image datablock name"); + RNA_def_string(ot->srna, "name", IMA_DEF_NAME, MAX_ID_NAME - 2, "Name", "Image data-block name"); prop = RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384); RNA_def_property_subtype(prop, PROP_PIXEL); prop = RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384); @@ -2847,7 +2847,7 @@ void IMAGE_OT_unpack(wmOperatorType *ot) /* properties */ RNA_def_enum(ot->srna, "method", rna_enum_unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack"); - RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Image Name", "Image datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */ + RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Image Name", "Image data-block name to unpack"); /* XXX, weark!, will fail with library, name collisions */ } /******************** sample image operator ********************/ diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 957d5a96e1e..9a8a5df78e4 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -424,7 +424,7 @@ static int nlachannels_pushdown_exec(bContext *C, wmOperator *op) /* active animdata block */ if (nla_panel_context(C, &adt_ptr, NULL, NULL) == 0 || (adt_ptr.data == NULL)) { BKE_report(op->reports, RPT_ERROR, "No active AnimData block to use " - "(select a datablock expander first or set the appropriate flags on an AnimData block)"); + "(select a data-block expander first or set the appropriate flags on an AnimData block)"); return OPERATOR_CANCELLED; } else { diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 3e7e8ccc3f4..1f298373a80 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -605,8 +605,8 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) else if (act->idroot == 0) { /* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */ BKE_reportf(op->reports, RPT_WARNING, - "Action '%s' does not specify what datablocks it can be used on " - "(try setting the 'ID Root Type' setting from the Datablocks Editor " + "Action '%s' does not specify what data-blocks it can be used on " + "(try setting the 'ID Root Type' setting from the data-blocks editor " "for this action to avoid future problems)", act->id.name + 2); } diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index b50df02beae..d49df2afbd4 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -382,7 +382,7 @@ void NODE_OT_add_file(wmOperatorType *ot) WM_operator_properties_filesel( ot, FILE_TYPE_FOLDER | FILE_TYPE_IMAGE | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); - RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME - 2, "Name", "Datablock name to assign"); + RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME - 2, "Name", "Data-block name to assign"); } /* ****************** Add Mask Node Operator ******************* */ @@ -441,7 +441,7 @@ void NODE_OT_add_mask(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; - RNA_def_string(ot->srna, "name", "Mask", MAX_ID_NAME - 2, "Name", "Datablock name to assign"); + RNA_def_string(ot->srna, "name", "Mask", MAX_ID_NAME - 2, "Name", "Data-block name to assign"); } /********************** New node tree operator *********************/ diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index fcee64775a9..7cf40ca07f6 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -835,11 +835,11 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOops *soops if (id->flag & LIB_FAKEUSER) { icon = ICON_FILE_TICK; - tip = TIP_("Datablock will be retained using a fake user"); + tip = TIP_("Data-block will be retained using a fake user"); } else { icon = ICON_X; - tip = TIP_("Datablock has no users and will be deleted"); + tip = TIP_("Data-block has no users and will be deleted"); } bt = uiDefIconButBitS(block, UI_BTYPE_TOGGLE, LIB_FAKEUSER, 1, icon, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X, UI_UNIT_Y, @@ -852,14 +852,14 @@ static void outliner_draw_userbuts(uiBlock *block, ARegion *ar, SpaceOops *soops bt = uiDefBut(block, UI_BTYPE_BUT, 1, buf, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, - TIP_("Number of users of this datablock")); + TIP_("Number of users of this data-block")); UI_but_flag_enable(bt, but_flag); bt = uiDefButBitS(block, UI_BTYPE_TOGGLE, LIB_FAKEUSER, 1, (id->flag & LIB_FAKEUSER) ? "F" : " ", (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX), te->ys, UI_UNIT_X, UI_UNIT_Y, &id->flag, 0, 0, 0, 0, - TIP_("Datablock has a 'fake' user which will keep it in the file " + TIP_("Data-block has a 'fake' user which will keep it in the file " "even if nothing else uses it")); UI_but_func_set(bt, restrictbutton_id_user_toggle, id, NULL); UI_but_flag_enable(bt, but_flag); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 65608c8c15a..8eb53d0d7b9 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -320,7 +320,7 @@ static void id_delete(bContext *C, ReportList *reports, TreeElement *te, TreeSto } else if (BKE_library_ID_is_indirectly_used(bmain, id) && ID_REAL_USERS(id) <= 1) { BKE_reportf(reports, RPT_WARNING, - "Cannot delete id '%s', indirectly used datablocks need at least one user", + "Cannot delete id '%s', indirectly used data-blocks need at least one user", id->name); return; } @@ -389,7 +389,7 @@ static int outliner_id_delete_invoke(bContext *C, wmOperator *op, const wmEvent void OUTLINER_OT_id_delete(wmOperatorType *ot) { - ot->name = "Delete Datablock"; + ot->name = "Delete Data-Block"; ot->idname = "OUTLINER_OT_id_delete"; ot->description = "Delete the ID under cursor"; @@ -422,7 +422,7 @@ static int outliner_id_remap_exec(bContext *C, wmOperator *op) if (ID_IS_LINKED_DATABLOCK(old_id)) { BKE_reportf(op->reports, RPT_WARNING, - "Old ID '%s' is linked from a library, indirect usages of this datablock will not be remapped", + "Old ID '%s' is linked from a library, indirect usages of this data-block will not be remapped", old_id->name); } @@ -1942,7 +1942,7 @@ static int outliner_orphans_purge_invoke(bContext *C, wmOperator *op, const wmEv { /* present a prompt to informing users that this change is irreversible */ return WM_operator_confirm_message(C, op, - "Purging unused datablocks cannot be undone. " + "Purging unused data-blocks cannot be undone. " "Click here to proceed..."); } @@ -1964,7 +1964,7 @@ void OUTLINER_OT_orphans_purge(wmOperatorType *ot) /* identifiers */ ot->idname = "OUTLINER_OT_orphans_purge"; ot->name = "Purge All"; - ot->description = "Clear all orphaned datablocks without any users from the file (cannot be undone)"; + ot->description = "Clear all orphaned data-blocks without any users from the file (cannot be undone)"; /* callbacks */ ot->invoke = outliner_orphans_purge_invoke; diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index e38886abeac..ecb4949350f 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -900,7 +900,7 @@ static EnumPropertyItem prop_object_op_types[] = { {OL_OP_DELETE, "DELETE", 0, "Delete", ""}, {OL_OP_DELETE_HIERARCHY, "DELETE_HIERARCHY", 0, "Delete Hierarchy", ""}, {OL_OP_REMAP, "REMAP", 0, "Remap Users", - "Make all users of selected datablocks to use instead a new chosen one"}, + "Make all users of selected data-blocks to use instead a new chosen one"}, {OL_OP_TOGVIS, "TOGVIS", 0, "Toggle Visible", ""}, {OL_OP_TOGSEL, "TOGSEL", 0, "Toggle Selectable", ""}, {OL_OP_TOGREN, "TOGREN", 0, "Toggle Renderable", ""}, @@ -1046,7 +1046,7 @@ static EnumPropertyItem prop_group_op_types[] = { {OL_GROUPOP_LINK, "LINK", 0, "Link Group Objects to Scene", ""}, {OL_GROUPOP_DELETE, "DELETE", 0, "Delete Group", "WARNING: no undo"}, {OL_GROUPOP_REMAP, "REMAP", 0, "Remap Users", - "Make all users of selected datablocks to use instead current (clicked) one"}, + "Make all users of selected data-blocks to use instead current (clicked) one"}, {OL_GROUPOP_INSTANCE, "INSTANCE", 0, "Instance Groups in Scene", ""}, {OL_GROUPOP_TOGVIS, "TOGVIS", 0, "Toggle Visible Group", ""}, {OL_GROUPOP_TOGSEL, "TOGSEL", 0, "Toggle Selectable", ""}, @@ -1153,9 +1153,9 @@ static EnumPropertyItem prop_id_op_types[] = { {OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""}, {OUTLINER_IDOP_DELETE, "DELETE", 0, "Delete", "WARNING: no undo"}, {OUTLINER_IDOP_REMAP, "REMAP", 0, "Remap Users", - "Make all users of selected datablocks to use instead current (clicked) one"}, + "Make all users of selected data-blocks to use instead current (clicked) one"}, {OUTLINER_IDOP_FAKE_ADD, "ADD_FAKE", 0, "Add Fake User", - "Ensure datablock gets saved even if it isn't in use (e.g. for motion and material libraries)"}, + "Ensure data-block gets saved even if it isn't in use (e.g. for motion and material libraries)"}, {OUTLINER_IDOP_FAKE_CLEAR, "CLEAR_FAKE", 0, "Clear Fake User", ""}, {OUTLINER_IDOP_RENAME, "RENAME", 0, "Rename", ""}, {OUTLINER_IDOP_SELECT_LINKED, "SELECT_LINKED", 0, "Select Linked", ""}, @@ -1476,8 +1476,8 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op) else if (act->idroot == 0) { /* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */ BKE_reportf(op->reports, RPT_WARNING, - "Action '%s' does not specify what datablocks it can be used on " - "(try setting the 'ID Root Type' setting from the Datablocks Editor " + "Action '%s' does not specify what data-blocks it can be used on " + "(try setting the 'ID Root Type' setting from the data-blocks editor " "for this action to avoid future problems)", act->id.name + 2); } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index e7428fd79d9..83012eac39e 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -197,7 +197,7 @@ void TEXT_OT_new(wmOperatorType *ot) /* identifiers */ ot->name = "Create Text Block"; ot->idname = "TEXT_OT_new"; - ot->description = "Create a new text data block"; + ot->description = "Create a new text data-block"; /* api callbacks */ ot->exec = text_new_exec; @@ -288,7 +288,7 @@ void TEXT_OT_open(wmOperatorType *ot) /* identifiers */ ot->name = "Open Text Block"; ot->idname = "TEXT_OT_open"; - ot->description = "Open a new text data block"; + ot->description = "Open a new text data-block"; /* api callbacks */ ot->exec = text_open_exec; @@ -348,7 +348,7 @@ void TEXT_OT_reload(wmOperatorType *ot) /* identifiers */ ot->name = "Reload"; ot->idname = "TEXT_OT_reload"; - ot->description = "Reload active text data block from its file"; + ot->description = "Reload active text data-block from its file"; /* api callbacks */ ot->exec = text_reload_exec; @@ -397,7 +397,7 @@ void TEXT_OT_unlink(wmOperatorType *ot) /* identifiers */ ot->name = "Unlink"; ot->idname = "TEXT_OT_unlink"; - ot->description = "Unlink active text data block"; + ot->description = "Unlink active text data-block"; /* api callbacks */ ot->exec = text_unlink_exec; @@ -512,7 +512,7 @@ void TEXT_OT_save(wmOperatorType *ot) /* identifiers */ ot->name = "Save"; ot->idname = "TEXT_OT_save"; - ot->description = "Save active text data block"; + ot->description = "Save active text data-block"; /* api callbacks */ ot->exec = text_save_exec; @@ -3187,7 +3187,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot) /* identifiers */ ot->name = "To 3D Object"; ot->idname = "TEXT_OT_to_3d_object"; - ot->description = "Create 3D text object from active text data block"; + ot->description = "Create 3D text object from active text data-block"; /* api callbacks */ ot->exec = text_to_3d_object_exec; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index d308c11fe9e..0a7dc9012f9 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3078,7 +3078,7 @@ static DMDrawOption draw_dm_bweights__setDrawOptions(void *userData, int index) if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) { const float bweight = BM_ELEM_CD_GET_FLOAT(eed, data->cd_layer_offset); if (bweight != 0.0f) { - UI_ThemeColorBlend(TH_WIRE_EDIT, TH_EDGE_SELECT, bweight); + UI_ThemeColorBlend(TH_WIRE_EDIT, TH_EDGE_BEVEL, bweight); return DM_DRAW_OPTION_NORMAL; } } @@ -3094,7 +3094,7 @@ static void draw_dm_bweights__mapFunc(void *userData, int index, const float co[ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) { const float bweight = BM_ELEM_CD_GET_FLOAT(eve, data->cd_layer_offset); if (bweight != 0.0f) { - UI_ThemeColorBlend(TH_VERTEX, TH_VERTEX_SELECT, bweight); + UI_ThemeColorBlend(TH_VERTEX, TH_VERTEX_BEVEL, bweight); glVertex3fv(co); } } |