Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-24 07:39:20 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-24 07:39:20 +0400
commitd120ec146d3c28b7243371b0de1edf4ba590470c (patch)
treea05f182978c6007bb9193f6ad0b4f2b210394ee8 /source/blender/editors
parent3df023ae82eef0ea105dc61c9730af87b59a07d1 (diff)
parent93c3593d825aafe30aaf051182e50bde4c6084dd (diff)
Merged changes in the trunk up to revision 54802.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c3
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c233
-rw-r--r--source/blender/editors/animation/anim_draw.c17
-rw-r--r--source/blender/editors/animation/anim_filter.c4
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c8
-rw-r--r--source/blender/editors/animation/drivers.c4
-rw-r--r--source/blender/editors/animation/keyframing.c26
-rw-r--r--source/blender/editors/animation/keyingsets.c7
-rw-r--r--source/blender/editors/armature/editarmature.c4
-rw-r--r--source/blender/editors/armature/poseobject.c2
-rw-r--r--source/blender/editors/curve/editcurve.c20
-rw-r--r--source/blender/editors/curve/editfont.c15
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c19
-rw-r--r--source/blender/editors/include/ED_anim_api.h3
-rw-r--r--source/blender/editors/include/ED_object.h6
-rw-r--r--source/blender/editors/include/ED_view3d.h2
-rw-r--r--source/blender/editors/include/UI_interface.h7
-rw-r--r--source/blender/editors/include/UI_resources.h1
-rw-r--r--source/blender/editors/interface/interface.c20
-rw-r--r--source/blender/editors/interface/interface_handlers.c112
-rw-r--r--source/blender/editors/interface/interface_intern.h4
-rw-r--r--source/blender/editors/interface/interface_ops.c217
-rw-r--r--source/blender/editors/interface/interface_regions.c14
-rw-r--r--source/blender/editors/interface/interface_templates.c58
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
-rw-r--r--source/blender/editors/interface/resources.c10
-rw-r--r--source/blender/editors/interface/view2d.c3
-rw-r--r--source/blender/editors/interface/view2d_ops.c9
-rw-r--r--source/blender/editors/mesh/editface.c4
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c17
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c10
-rw-r--r--source/blender/editors/mesh/editmesh_select.c2
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c202
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c4
-rw-r--r--source/blender/editors/mesh/meshtools.c2
-rw-r--r--source/blender/editors/object/object_add.c42
-rw-r--r--source/blender/editors/object/object_bake.c25
-rw-r--r--source/blender/editors/object/object_constraint.c19
-rw-r--r--source/blender/editors/object/object_edit.c26
-rw-r--r--source/blender/editors/object/object_group.c10
-rw-r--r--source/blender/editors/object/object_hook.c6
-rw-r--r--source/blender/editors/object/object_intern.h4
-rw-r--r--source/blender/editors/object/object_modifier.c30
-rw-r--r--source/blender/editors/object/object_ops.c4
-rw-r--r--source/blender/editors/object/object_relations.c74
-rw-r--r--source/blender/editors/object/object_select.c18
-rw-r--r--source/blender/editors/object/object_transform.c9
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c2
-rw-r--r--source/blender/editors/physics/particle_boids.c14
-rw-r--r--source/blender/editors/physics/particle_object.c17
-rw-r--r--source/blender/editors/physics/rigidbody_constraint.c6
-rw-r--r--source/blender/editors/physics/rigidbody_object.c8
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/editors/screen/area.c10
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c60
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c7
-rw-r--r--source/blender/editors/space_clip/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_clip/SConscript3
-rw-r--r--source/blender/editors/space_clip/clip_buttons.c83
-rw-r--r--source/blender/editors/space_clip/clip_dopesheet_draw.c27
-rw-r--r--source/blender/editors/space_clip/clip_editor.c2
-rw-r--r--source/blender/editors/space_clip/clip_toolbar.c10
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c4
-rw-r--r--source/blender/editors/space_console/console_draw.c5
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c5
-rw-r--r--source/blender/editors/space_image/image_ops.c4
-rw-r--r--source/blender/editors/space_info/info_draw.c4
-rw-r--r--source/blender/editors/space_info/info_stats.c18
-rw-r--r--source/blender/editors/space_info/textview.c31
-rw-r--r--source/blender/editors/space_info/textview.h1
-rw-r--r--source/blender/editors/space_node/drawnode.c4
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c14
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c14
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c48
-rw-r--r--source/blender/editors/space_sequencer/sequencer_modifier.c4
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c32
-rw-r--r--source/blender/editors/space_text/text_ops.c2
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c16
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c65
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c69
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c12
-rw-r--r--source/blender/editors/transform/transform.c259
-rw-r--r--source/blender/editors/transform/transform.h5
-rw-r--r--source/blender/editors/transform/transform_constraints.c28
-rw-r--r--source/blender/editors/transform/transform_conversions.c18
-rw-r--r--source/blender/editors/transform/transform_generics.c31
-rw-r--r--source/blender/editors/transform/transform_orientations.c10
-rw-r--r--source/blender/editors/transform/transform_snap.c3
-rw-r--r--source/blender/editors/uvedit/CMakeLists.txt5
-rw-r--r--source/blender/editors/uvedit/SConscript9
-rw-r--r--source/blender/editors/uvedit/uvedit_buttons.c10
-rw-r--r--source/blender/editors/uvedit/uvedit_intern.h2
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c22
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c2
97 files changed, 1411 insertions, 950 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 7362935b4cc..bc7b62df185 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3021,8 +3021,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
else
offset = 0;
- /* calculate appropriate y-coordinates for icon buttons
- */
+ /* calculate appropriate y-coordinates for icon buttons */
y = (ymaxc - yminc) / 2 + yminc;
ymid = y - 0.5f * ICON_WIDTH;
/* y-coordinates for text is only 4 down from middle */
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 275cf723dcd..15a8222dec2 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -1159,6 +1159,218 @@ static void ANIM_OT_channels_move(wmOperatorType *ot)
ot->prop = RNA_def_enum(ot->srna, "direction", prop_animchannel_rearrange_types, REARRANGE_ANIMCHAN_DOWN, "Direction", "");
}
+/* ******************** Group Channel Operator ************************ */
+
+static int animchannels_grouping_poll(bContext *C)
+{
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceLink *sl;
+
+ /* channels region test */
+ /* TODO: could enhance with actually testing if channels region? */
+ if (ELEM(NULL, sa, CTX_wm_region(C)))
+ return 0;
+
+ /* animation editor test - must be suitable modes only */
+ sl = CTX_wm_space_data(C);
+
+ switch (sa->spacetype) {
+ /* supported... */
+ case SPACE_ACTION:
+ {
+ SpaceAction *saction = (SpaceAction *)sl;
+
+ /* dopesheet and action only - all others are for other datatypes or have no groups */
+ if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_DOPESHEET) == 0)
+ return 0;
+ }
+ break;
+
+ case SPACE_IPO:
+ {
+ SpaceIpo *sipo = (SpaceIpo *)sl;
+
+ /* drivers can't have groups... */
+ if (sipo->mode != SIPO_MODE_ANIMATION)
+ return 0;
+ }
+ break;
+
+ /* unsupported... */
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
+/* ----------------------------------------------------------- */
+
+static void animchannels_group_channels(bAnimContext *ac, bAnimListElem *adt_ref, const char name[])
+{
+ AnimData *adt = adt_ref->adt;
+ bAction *act = adt->action;
+
+ if (act) {
+ ListBase anim_data = {NULL, NULL};
+ int filter;
+
+ /* find selected F-Curves to re-group */
+ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL);
+ ANIM_animdata_filter(ac, &anim_data, filter, adt_ref, ANIMCONT_CHANNEL);
+
+ if (anim_data.first) {
+ bActionGroup *agrp;
+ bAnimListElem *ale;
+
+ /* create new group, which should now be part of the action */
+ agrp = action_groups_add_new(act, name);
+ BLI_assert(agrp != NULL);
+
+ /* transfer selected F-Curves across to new group */
+ for (ale = anim_data.first; ale; ale = ale->next) {
+ FCurve *fcu = (FCurve *)ale->data;
+ bActionGroup *grp = fcu->grp;
+
+ /* remove F-Curve from group, then group too if it is now empty */
+ action_groups_remove_channel(act, fcu);
+
+ if ((grp) && (grp->channels.first == NULL)) {
+ BLI_freelinkN(&act->groups, grp);
+ }
+
+ /* add F-Curve to group */
+ action_groups_add_channel(act, agrp, fcu);
+ }
+ }
+
+ /* cleanup */
+ BLI_freelistN(&anim_data);
+ }
+}
+
+static int animchannels_group_exec(bContext *C, wmOperator *op)
+{
+ bAnimContext ac;
+ char name[MAX_NAME];
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+
+ /* get name for new group */
+ RNA_string_get(op->ptr, "name", name);
+
+ /* XXX: name for group should never be empty... */
+ if (name[0]) {
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ /* handle each animdata block separately, so that the regrouping doesn't flow into blocks */
+ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_ANIMDATA | ANIMFILTER_NODUPLIS);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ for (ale = anim_data.first; ale; ale = ale->next) {
+ animchannels_group_channels(&ac, ale, name);
+ }
+
+ /* free temp data */
+ BLI_freelistN(&anim_data);
+
+ /* updatss */
+ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+static void ANIM_OT_channels_group(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Group Channels";
+ ot->idname = "ANIM_OT_channels_group";
+ ot->description = "Add selected F-Curves to a new group";
+
+ /* callbacks */
+ ot->invoke = WM_operator_props_popup;
+ ot->exec = animchannels_group_exec;
+ ot->poll = animchannels_grouping_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* props */
+ ot->prop = RNA_def_string(ot->srna, "name", "New Group",
+ sizeof(((bActionGroup *)NULL)->name),
+ "Name", "Name of newly created group");
+ /* RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE); */ /* XXX: still not too sure about this - keeping same text is confusing... */
+}
+
+/* ----------------------------------------------------------- */
+
+static int animchannels_ungroup_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ bAnimContext ac;
+
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+
+ /* just selected F-Curves... */
+ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ for (ale = anim_data.first; ale; ale = ale->next) {
+ /* find action for this F-Curve... */
+ if (ale->adt && ale->adt->action) {
+ FCurve *fcu = (FCurve *)ale->data;
+ bAction *act = ale->adt->action;
+
+ /* only proceed to remove if F-Curve is in a group... */
+ if (fcu->grp) {
+ bActionGroup *agrp = fcu->grp;
+
+ /* remove F-Curve from group and add at tail (ungrouped) */
+ action_groups_remove_channel(act, fcu);
+ BLI_addtail(&act->curves, fcu);
+
+ /* delete group if it is now empty */
+ if (agrp->channels.first == NULL) {
+ BLI_freelinkN(&act->groups, agrp);
+ }
+ }
+ }
+ }
+
+ /* cleanup */
+ BLI_freelistN(&anim_data);
+
+ /* updates */
+ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+static void ANIM_OT_channels_ungroup(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Ungroup Channels";
+ ot->idname = "ANIM_OT_channels_ungroup";
+ ot->description = "Remove selected F-Curves from their current groups";
+
+ /* callbacks */
+ ot->exec = animchannels_ungroup_exec;
+ ot->poll = animchannels_grouping_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
/* ******************** Delete Channel Operator *********************** */
static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1245,13 +1457,13 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
BLI_freelinkN(&gpd->layers, gpl);
}
break;
-
+
case ANIMTYPE_MASKLAYER:
{
/* Mask layer */
Mask *mask = (Mask *)ale->id;
MaskLayer *masklay = (MaskLayer *)ale->data;
-
+
/* try to delete the layer's data and the layer itself */
BKE_mask_layer_remove(mask, masklay);
}
@@ -1342,10 +1554,10 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
/* TODO: find out why this is the case, and fix that */
if (ale->type == ANIMTYPE_OBJECT)
continue;
-
+
/* enable the setting */
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_ADD);
-
+
/* now, also flush selection status up/down as appropriate */
ANIM_flush_setting_anim_channels(&ac, &all_data, ale, ACHANNEL_SETTING_VISIBLE, 1);
}
@@ -1419,10 +1631,10 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(o
/* TODO: find out why this is the case, and fix that */
if (ale->type == ANIMTYPE_OBJECT)
continue;
-
+
/* change the setting */
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, vis);
-
+
/* now, also flush selection status up/down as appropriate */
ANIM_flush_setting_anim_channels(&ac, &all_data, ale, ACHANNEL_SETTING_VISIBLE, (vis == ACHANNEL_SETFLAG_ADD));
}
@@ -2243,7 +2455,7 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
}
notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
- }
+ }
break;
case ANIMTYPE_GROUP:
@@ -2495,6 +2707,9 @@ void ED_operatortypes_animchannels(void)
WM_operatortype_append(ANIM_OT_channels_visibility_set);
WM_operatortype_append(ANIM_OT_channels_fcurves_enable);
+
+ WM_operatortype_append(ANIM_OT_channels_group);
+ WM_operatortype_append(ANIM_OT_channels_ungroup);
}
// TODO: check on a poll callback for this, to get hotkeys into menus
@@ -2548,6 +2763,10 @@ void ED_keymap_animchannels(wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_move", PAGEUPKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "direction", REARRANGE_ANIMCHAN_TOP);
RNA_enum_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_move", PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "direction", REARRANGE_ANIMCHAN_BOTTOM);
+ /* grouping */
+ WM_keymap_add_item(keymap, "ANIM_OT_channels_group", GKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "ANIM_OT_channels_ungroup", GKEY, KM_PRESS, KM_ALT, 0);
+
/* Graph Editor only */
WM_keymap_add_item(keymap, "ANIM_OT_channels_visibility_set", VKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "ANIM_OT_channels_visibility_toggle", VKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index d83d1805f0e..eb1f5ef1043 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -399,20 +399,23 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short rest
static short bezt_unit_mapping_apply(KeyframeEditData *ked, BezTriple *bezt)
{
/* mapping factor is stored in f1, flags are stored in i1 */
- short only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS);
- short sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS);
+ const bool only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS);
+ const bool sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS);
+ const bool skip_knot = (ked->i1 & ANIM_UNITCONV_SKIPKNOTS);
float fac = ked->f1;
/* adjust BezTriple handles only if allowed to */
- if (only_keys == 0) {
- if ((sel_vs == 0) || (bezt->f1 & SELECT))
+ if (only_keys == false) {
+ if ((sel_vs == false) || (bezt->f1 & SELECT))
bezt->vec[0][1] *= fac;
- if ((sel_vs == 0) || (bezt->f3 & SELECT))
+ if ((sel_vs == false) || (bezt->f3 & SELECT))
bezt->vec[2][1] *= fac;
}
- if ((sel_vs == 0) || (bezt->f2 & SELECT))
- bezt->vec[1][1] *= fac;
+ if (skip_knot == false) {
+ if ((sel_vs == false) || (bezt->f2 & SELECT))
+ bezt->vec[1][1] *= fac;
+ }
return 0;
}
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 37fd05f75a5..3480db2c5d8 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -2391,6 +2391,10 @@ static size_t animdata_filter_animchan(bAnimContext *ac, ListBase *anim_data, bD
items += animdata_filter_dopesheet_ob(ac, anim_data, ads, channel->data, filter_mode);
break;
+ case ANIMTYPE_ANIMDATA:
+ items += animfilter_block_data(ac, anim_data, ads, channel->id, filter_mode);
+ break;
+
default:
printf("ERROR: Unsupported channel type (%d) in animdata_filter_animchan()\n", channel->type);
break;
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index d8e3349e998..b6d24e21057 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -143,7 +143,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
/* no array index */
arrayname = "";
}
-
+
/* putting this all together into the buffer */
/* XXX we need to check for invalid names...
* XXX the name length limit needs to be passed in or as some define */
@@ -151,7 +151,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
BLI_snprintf(name, 256, "%s%s (%s)", arrayname, propname, structname);
else
BLI_snprintf(name, 256, "%s%s", arrayname, propname);
-
+
/* free temp name if nameprop is set */
if (free_structname)
MEM_freeN((void *)structname);
@@ -170,11 +170,11 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
else {
/* invalid path */
BLI_snprintf(name, 256, "\"%s[%d]\"", fcu->rna_path, fcu->array_index);
-
+
/* icon for this should be the icon for the base ID */
/* TODO: or should we just use the error icon? */
icon = RNA_struct_ui_icon(id_ptr.type);
-
+
/* tag F-Curve as disabled - as not usable path */
fcu->flag |= FCURVE_DISABLED;
}
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 25833c13925..cd5e873f40d 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -489,8 +489,6 @@ static int add_driver_button_exec(bContext *C, wmOperator *op)
/* send updates */
uiContextAnimUpdate(C);
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); // XXX
}
@@ -541,8 +539,6 @@ static int remove_driver_button_exec(bContext *C, wmOperator *op)
/* send updates */
uiContextAnimUpdate(C);
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); // XXX
}
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index c99f939300e..6d1e6eab26b 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1215,7 +1215,6 @@ static int modify_key_op_poll(bContext *C)
static int insert_key_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
KeyingSet *ks = NULL;
int type = RNA_enum_get(op->ptr, "type");
@@ -1261,9 +1260,6 @@ static int insert_key_exec(bContext *C, wmOperator *op)
else
BKE_report(op->reports, RPT_WARNING, "Keying set failed to insert any keyframes");
- /* send updates */
- DAG_ids_flush_update(bmain, 0);
-
return OPERATOR_FINISHED;
}
@@ -1371,7 +1367,6 @@ void ANIM_OT_keyframe_insert_menu(wmOperatorType *ot)
static int delete_key_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
KeyingSet *ks = NULL;
int type = RNA_enum_get(op->ptr, "type");
@@ -1417,9 +1412,6 @@ static int delete_key_exec(bContext *C, wmOperator *op)
else
BKE_report(op->reports, RPT_WARNING, "Keying set failed to remove any keyframes");
- /* send updates */
- DAG_ids_flush_update(bmain, 0);
-
return OPERATOR_FINISHED;
}
@@ -1459,8 +1451,6 @@ void ANIM_OT_keyframe_delete(wmOperatorType *ot)
static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain = CTX_data_main(C);
-
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
/* just those in active action... */
@@ -1505,12 +1495,11 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op))
}
/* update... */
- ob->recalc |= OB_RECALC_OB;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
CTX_DATA_END;
/* send updates */
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
return OPERATOR_FINISHED;
@@ -1536,7 +1525,6 @@ void ANIM_OT_keyframe_clear_v3d(wmOperatorType *ot)
static int delete_key_v3d_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
float cfra = (float)CFRA;
@@ -1563,12 +1551,11 @@ static int delete_key_v3d_exec(bContext *C, wmOperator *op)
/* report success (or failure) */
BKE_reportf(op->reports, RPT_INFO, "Object '%s' successfully had %d keyframes removed", id->name + 2, success);
- ob->recalc |= OB_RECALC_OB;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
CTX_DATA_END;
/* send updates */
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
return OPERATOR_FINISHED;
@@ -1596,7 +1583,6 @@ void ANIM_OT_keyframe_delete_v3d(wmOperatorType *ot)
static int insert_key_button_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
PointerRNA ptr = {{NULL}};
PropertyRNA *prop = NULL;
@@ -1655,8 +1641,6 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
/* send updates */
uiContextAnimUpdate(C);
- DAG_ids_flush_update(bmain, 0);
-
/* send notifiers that keyframes have been changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
@@ -1686,7 +1670,6 @@ void ANIM_OT_keyframe_insert_button(wmOperatorType *ot)
static int delete_key_button_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
PointerRNA ptr = {{NULL}};
PropertyRNA *prop = NULL;
@@ -1728,8 +1711,6 @@ static int delete_key_button_exec(bContext *C, wmOperator *op)
/* send updates */
uiContextAnimUpdate(C);
- DAG_ids_flush_update(bmain, 0);
-
/* send notifiers that keyframes have been changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
@@ -1760,7 +1741,6 @@ void ANIM_OT_keyframe_delete_button(wmOperatorType *ot)
static int clear_key_button_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
PointerRNA ptr = {{NULL}};
PropertyRNA *prop = NULL;
char *path;
@@ -1800,8 +1780,6 @@ static int clear_key_button_exec(bContext *C, wmOperator *op)
/* send updates */
uiContextAnimUpdate(C);
- DAG_ids_flush_update(bmain, 0);
-
/* send notifiers that keyframes have been changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 28db7bf572d..4e8d7bdafe5 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -289,7 +289,6 @@ void ANIM_OT_keying_set_path_remove(wmOperatorType *ot)
static int add_keyingset_button_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop = NULL;
@@ -360,7 +359,6 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op)
if (success) {
/* send updates */
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL);
/* show notification/report header, so that users notice that something changed */
@@ -392,7 +390,6 @@ void ANIM_OT_keyingset_button_add(wmOperatorType *ot)
static int remove_keyingset_button_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop = NULL;
@@ -442,7 +439,6 @@ static int remove_keyingset_button_exec(bContext *C, wmOperator *op)
if (success) {
/* send updates */
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL);
/* show warning */
@@ -1006,7 +1002,8 @@ int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSe
{
Object *ob = (Object *)ksp->id;
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; // XXX: only object transforms only?
+ // XXX: only object transforms?
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
}
break;
}
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 06e00cd02c1..2eac6ba87ee 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -1004,7 +1004,7 @@ int join_armature_exec(bContext *C, wmOperator *UNUSED(op))
}
CTX_DATA_END;
- DAG_scene_sort(bmain, scene); /* because we removed object(s) */
+ DAG_relations_tag_update(bmain); /* because we removed object(s) */
ED_armature_from_edit(ob);
ED_armature_edit_free(ob);
@@ -1217,7 +1217,7 @@ static int separate_armature_exec(bContext *C, wmOperator *UNUSED(op))
/* 2) duplicate base */
newbase = ED_object_add_duplicate(bmain, scene, oldbase, USER_DUP_ARM); /* only duplicate linked armature */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
newob = newbase->object;
newbase->flag &= ~SELECT;
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 38924105316..c7d1e428355 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -238,7 +238,7 @@ static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNU
/* show popup dialog to allow editing of range... */
// FIXME: hardcoded dimensions here are just arbitrary
- return WM_operator_props_dialog_popup(C, op, 200, 200);
+ return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 10 * UI_UNIT_Y);
}
/* For the object with pose/action: create path curves for selected bones
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index a67bf00a559..b5aa55dbda9 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1395,7 +1395,7 @@ static int separate_exec(bContext *C, wmOperator *op)
/* 1. duplicate the object and data */
newbase = ED_object_add_duplicate(bmain, scene, oldbase, 0); /* 0 = fully linked */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
ED_base_object_select(newbase, BA_DESELECT);
newob = newbase->object;
@@ -2034,11 +2034,12 @@ static int switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
EditNurb *editnurb = cu->editnurb;
Nurb *nu;
- for (nu = editnurb->nurbs.first; nu; nu = nu->next)
+ for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
if (isNurbsel(nu)) {
BKE_nurb_direction_switch(nu);
keyData_switchDirectionNurb(cu, nu);
}
+ }
if (ED_curve_updateAnimPaths(obedit->data))
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, obedit);
@@ -2481,10 +2482,11 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
/**************** select start/end operators **************/
-/* (de)selects first or last of visible part of each Nurb depending on selFirst */
-/* selFirst: defines the end of which to select */
-/* doswap: defines if selection state of each first/last control point is swapped */
-/* selstatus: selection status in case doswap is false */
+/* (de)selects first or last of visible part of each Nurb depending on selFirst
+ * selFirst: defines the end of which to select
+ * doswap: defines if selection state of each first/last control point is swapped
+ * selstatus: selection status in case doswap is false
+ */
void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatus)
{
ListBase *editnurb = object_editcurve_get(obedit);
@@ -2558,7 +2560,7 @@ void CURVE_OT_de_select_first(wmOperatorType *ot)
/* identifiers */
ot->name = "(De)select First";
ot->idname = "CURVE_OT_de_select_first";
- ot->description = "(De)select first of visible part of each Nurb";
+ ot->description = "(De)select first of visible part of each NURBS";
/* api cfirstbacks */
ot->exec = de_select_first_exec;
@@ -2583,7 +2585,7 @@ void CURVE_OT_de_select_last(wmOperatorType *ot)
/* identifiers */
ot->name = "(De)select Last";
ot->idname = "CURVE_OT_de_select_last";
- ot->description = "(De)select last of visible part of each Nurb";
+ ot->description = "(De)select last of visible part of each NURBS";
/* api clastbacks */
ot->exec = de_select_last_exec;
@@ -6216,7 +6218,7 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op))
cu = ob->data;
BLI_movelisttolist(&cu->nurb, &tempbase);
- DAG_scene_sort(bmain, scene); // because we removed object(s), call before editmode!
+ DAG_relations_tag_update(bmain); // because we removed object(s), call before editmode!
ED_object_enter_editmode(C, EM_WAITCURSOR);
ED_object_exit_editmode(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO);
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 257dfca051f..af6b90a9958 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -1070,21 +1070,13 @@ void FONT_OT_change_character(wmOperatorType *ot)
/******************* line break operator ********************/
-static int line_break_exec(bContext *C, wmOperator *op)
+static int line_break_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
Curve *cu = obedit->data;
- EditFont *ef = cu->editfont;
- const int ctrl = RNA_boolean_get(op->ptr, "ctrl");
- if (ctrl) {
- insert_into_textbuf(obedit, 1);
- if (ef->textbuf[cu->pos] != '\n')
- insert_into_textbuf(obedit, '\n');
- }
- else
- insert_into_textbuf(obedit, '\n');
+ insert_into_textbuf(obedit, '\n');
cu->selstart = cu->selend = 0;
@@ -1106,9 +1098,6 @@ void FONT_OT_line_break(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
- RNA_def_boolean(ot->srna, "ctrl", 0, "Ctrl", ""); // XXX what is this?
}
/******************* delete operator **********************/
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 41ef4bd0b95..8cd2bd861bc 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -39,6 +39,8 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "PIL_time.h"
#include "BKE_gpencil.h"
@@ -1457,28 +1459,27 @@ static void gpencil_draw_status_indicators(tGPsdata *p)
case GP_STATUS_PAINTING:
/* only print this for paint-sessions, otherwise it gets annoying */
if (GPENCIL_SKETCH_SESSIONS_ON(p->scene))
- ED_area_headerprint(p->sa, "Grease Pencil: Drawing/erasing stroke... Release to end stroke");
+ ED_area_headerprint(p->sa, IFACE_("Grease Pencil: Drawing/erasing stroke... Release to end stroke"));
break;
case GP_STATUS_IDLING:
/* print status info */
switch (p->paintmode) {
case GP_PAINTMODE_ERASER:
- ED_area_headerprint(p->sa,
- "Grease Pencil Erase Session: Hold and drag LMB or RMB to erase |"
- " ESC/Enter to end");
+ ED_area_headerprint(p->sa, IFACE_("Grease Pencil Erase Session: Hold and drag LMB or RMB to erase |"
+ " ESC/Enter to end"));
break;
case GP_PAINTMODE_DRAW_STRAIGHT:
- ED_area_headerprint(p->sa, "Grease Pencil Line Session: Hold and drag LMB to draw | "
- "ESC/Enter to end");
+ ED_area_headerprint(p->sa, IFACE_("Grease Pencil Line Session: Hold and drag LMB to draw | "
+ "ESC/Enter to end"));
break;
case GP_PAINTMODE_DRAW:
- ED_area_headerprint(p->sa, "Grease Pencil Freehand Session: Hold and drag LMB to draw | "
- "ESC/Enter to end");
+ ED_area_headerprint(p->sa, IFACE_("Grease Pencil Freehand Session: Hold and drag LMB to draw | "
+ "ESC/Enter to end"));
break;
default: /* unhandled future cases */
- ED_area_headerprint(p->sa, "Grease Pencil Session: ESC/Enter to end");
+ ED_area_headerprint(p->sa, IFACE_("Grease Pencil Session: ESC/Enter to end"));
break;
}
break;
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 7ce25b11f93..414d2075bf6 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -558,7 +558,8 @@ typedef enum eAnimUnitConv_Flags {
/* only touch selected BezTriples */
ANIM_UNITCONV_ONLYSEL = (1 << 2),
/* only touch selected vertices */
- ANIM_UNITCONV_SELVERTS = (1 << 3)
+ ANIM_UNITCONV_SELVERTS = (1 << 3),
+ ANIM_UNITCONV_SKIPKNOTS = (1 << 4),
} eAnimUnitConv_Flags;
/* Get unit conversion factor for given ID + F-Curve */
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index e212f2cc17d..2c43f6e4f25 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -161,7 +161,7 @@ void object_test_constraints(struct Object *ob);
void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con);
void ED_object_constraint_update(struct Object *ob);
-void ED_object_constraint_dependency_update(struct Main *bmain, struct Scene *scene, struct Object *ob);
+void ED_object_constraint_dependency_update(struct Main *bmain, struct Object *ob);
/* object_lattice.c */
int mouse_lattice(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
@@ -179,9 +179,9 @@ enum {
struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
struct Object *ob, const char *name, int type);
-int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
+int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain,
struct Object *ob, struct ModifierData *md);
-void ED_object_modifier_clear(struct Main *bmain, struct Scene *scene, struct Object *ob);
+void ED_object_modifier_clear(struct Main *bmain, struct Object *ob);
int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index ac2c47216a6..46f4515e0ca 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -85,7 +85,7 @@ typedef struct ViewDepths {
} ViewDepths;
float *give_cursor(struct Scene *scene, struct View3D *v3d);
-void ED_view3d_cursor3d_position(struct bContext *C, float *fp, int mx, int my);
+void ED_view3d_cursor3d_position(struct bContext *C, float fp[3], const int mval[2]);
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], const float dist);
void ED_view3d_from_m4(float mat[4][4], float ofs[3], float quat[4], float *dist);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 434fb58184f..78689c078c6 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -361,7 +361,7 @@ void uiPupMenuInvoke(struct bContext *C, const char *idname); /* popup registere
* but allow using all button types and creating an own layout. */
typedef uiBlock * (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1);
-typedef void (*uiBlockCancelFunc)(void *arg1);
+typedef void (*uiBlockCancelFunc)(struct bContext *C, void *arg1);
void uiPupBlock(struct bContext *C, uiBlockCreateFunc func, void *arg);
void uiPupBlockO(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext);
@@ -437,6 +437,7 @@ void uiButSetDragValue(uiBut *but);
void uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale);
int UI_but_active_drop_name(struct bContext *C);
+struct uiBut *ui_but_find_mouse_over(struct ARegion *ar, int x, int y);
void uiButSetFlag(uiBut *but, int flag);
void uiButClearFlag(uiBut *but, int flag);
@@ -447,6 +448,8 @@ void uiButClearDrawFlag(uiBut *but, int flag);
/* special button case, only draw it when used actively, for outliner etc */
int uiButActiveOnly(const struct bContext *C, uiBlock *block, uiBut *but);
+void uiButExecute(const struct bContext *C, uiBut *but);
+
/* Buttons
*
@@ -832,6 +835,8 @@ void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *te
void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
+/* Default UIList class name, keep in sync with its declaration in bl_ui/__init__.py */
+#define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list"
void uiTemplateList(uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id,
struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr,
const char *active_propname, int rows, int maxrows, int layout_type);
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index df07e05ec06..450d97eb20e 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -155,6 +155,7 @@ enum {
TH_CONSOLE_INFO,
TH_CONSOLE_ERROR,
TH_CONSOLE_CURSOR,
+ TH_CONSOLE_SELECT,
TH_SEQ_MOVIE,
TH_SEQ_MOVIECLIP,
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index d245349f2c4..37249896e34 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -636,7 +636,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
/* move button over from oldblock to new block */
BLI_remlink(&oldblock->buttons, oldbut);
- BLI_insertlink(&block->buttons, but, oldbut);
+ BLI_insertlinkafter(&block->buttons, but, oldbut);
oldbut->block = block;
*butpp = oldbut;
@@ -713,6 +713,12 @@ int uiButActiveOnly(const bContext *C, uiBlock *block, uiBut *but)
return 1;
}
+/* simulate button click */
+void uiButExecute(const bContext *C, uiBut *but)
+{
+ ui_button_execute_do((bContext *)C, CTX_wm_region(C), but);
+}
+
/* use to check if we need to disable undo, but don't make any changes
* returns FALSE if undo needs to be disabled. */
static int ui_but_is_rna_undo(uiBut *but)
@@ -1394,6 +1400,18 @@ int ui_is_but_float(uiBut *but)
return 0;
}
+int ui_is_but_bool(uiBut *but)
+{
+ if (ELEM5(but->type, TOG, TOGN, TOGR, ICONTOG, ICONTOGN))
+ return 1;
+
+ if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_BOOLEAN)
+ return 1;
+
+ return 0;
+}
+
+
int ui_is_but_unit(uiBut *but)
{
UnitSettings *unit = but->block->unit;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index b166e532f84..5cff61f4239 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -85,6 +85,7 @@
/* proto */
static void ui_add_smart_controller(bContext *C, uiBut *from, uiBut *to);
static void ui_add_link(bContext *C, uiBut *from, uiBut *to);
+static int ui_do_but_EXIT(bContext *C, uiBut *but, struct uiHandleButtonData *data, const wmEvent *event);
/***************** structs and defines ****************/
@@ -761,14 +762,27 @@ static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data,
WM_gestures_remove(C);
if (ABS(data->dragstartx - event->x) + ABS(data->dragstarty - event->y) > U.dragthreshold) {
- wmDrag *drag;
-
+
button_activate_state(C, but, BUTTON_STATE_EXIT);
data->cancel = TRUE;
- drag = WM_event_start_drag(C, but->icon, but->dragtype, but->dragpoin, ui_get_but_val(but));
- if (but->imb)
- WM_event_drag_image(drag, but->imb, but->imb_scale, BLI_rctf_size_x(&but->rect), BLI_rctf_size_y(&but->rect));
+ if (ui_is_but_bool(but)) {
+ const bool is_set = (ui_get_but_val(but) != 0.0);
+ PointerRNA ptr;
+ WM_operator_properties_create(&ptr, "UI_OT_drag_toggle");
+ RNA_boolean_set(&ptr, "state", !is_set);
+ RNA_int_set(&ptr, "last_x", data->dragstartx);
+ RNA_int_set(&ptr, "last_y", data->dragstarty);
+ WM_operator_name_call(C, "UI_OT_drag_toggle", WM_OP_INVOKE_DEFAULT, &ptr);
+ WM_operator_properties_free(&ptr);
+ }
+ else {
+ wmDrag *drag;
+
+ drag = WM_event_start_drag(C, but->icon, but->dragtype, but->dragpoin, ui_get_but_val(but));
+ if (but->imb)
+ WM_event_drag_image(drag, but->imb, but->imb_scale, BLI_rctf_size_x(&but->rect), BLI_rctf_size_y(&but->rect));
+ }
return 1;
}
@@ -2472,13 +2486,24 @@ static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHa
static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
{
if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS && ui_is_but_bool(but)) {
+ button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG);
+ data->dragstartx = event->x;
+ data->dragstarty = event->y;
+ return WM_UI_HANDLER_CONTINUE;
+ }
+
if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
data->togdual = event->ctrl;
data->togonly = !event->shift;
button_activate_state(C, but, BUTTON_STATE_EXIT);
- return WM_UI_HANDLER_BREAK;
+ return WM_UI_HANDLER_CONTINUE;
}
}
+ else if (data->state == BUTTON_STATE_WAIT_DRAG) {
+ /* note: the 'BUTTON_STATE_WAIT_DRAG' part of 'ui_do_but_EXIT' could be refactored into its own function */
+ return ui_do_but_EXIT(C, but, data, event);
+ }
return WM_UI_HANDLER_CONTINUE;
}
@@ -2499,6 +2524,12 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, con
return WM_UI_HANDLER_CONTINUE;
}
}
+ if (event->type == LEFTMOUSE && ui_is_but_bool(but)) {
+ button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG);
+ data->dragstartx = event->x;
+ data->dragstarty = event->y;
+ return WM_UI_HANDLER_CONTINUE;
+ }
if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
int ret = WM_UI_HANDLER_BREAK;
@@ -3215,6 +3246,12 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, co
return WM_UI_HANDLER_BREAK;
}
}
+ if (event->type == LEFTMOUSE && ui_is_but_bool(but)) {
+ button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG);
+ data->dragstartx = event->x;
+ data->dragstarty = event->y;
+ return WM_UI_HANDLER_BREAK;
+ }
/* regular open menu */
if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
@@ -3404,6 +3441,19 @@ static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
return WM_UI_HANDLER_CONTINUE;
}
+/* scales a vector so no axis exceeds max
+ * (could become BLI_math func) */
+static void clamp_axis_max_v3(float v[3], const float max)
+{
+ const float v_max = max_fff(v[0], v[1], v[2]);
+ if (v_max > max) {
+ mul_v3_fl(v, max / v_max);
+ if (v[0] > max) v[0] = max;
+ if (v[1] > max) v[1] = max;
+ if (v[2] > max) v[2] = max;
+ }
+}
+
static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, int my, const short shift)
{
float rgb[3];
@@ -3480,6 +3530,11 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
if (color_profile && ((int)but->a1 != UI_GRAD_SV))
ui_block_to_scene_linear_v3(but->block, rgb);
+ /* clamp because with color conversion we can exceed range [#34295] */
+ if ((int)but->a1 == UI_GRAD_V_ALT) {
+ clamp_axis_max_v3(rgb, but->softmax);
+ }
+
copy_v3_v3(data->vec, rgb);
data->draglastx = mx;
@@ -4198,7 +4253,7 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
/* resize histogram widget itself */
- hist->height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
+ hist->height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
}
else {
/* scale histogram values (dy / 10 for better control) */
@@ -4282,7 +4337,7 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx,
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
/* resize waveform widget itself */
- scopes->wavefrm_height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
+ scopes->wavefrm_height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
}
else {
/* scale waveform values */
@@ -4364,7 +4419,7 @@ static int ui_numedit_but_VECTORSCOPE(uiBut *but, uiHandleButtonData *data, int
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
/* resize vectorscope widget itself */
- scopes->vecscope_height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
+ scopes->vecscope_height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
}
data->draglastx = mx;
@@ -4567,7 +4622,7 @@ static int ui_numedit_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonDa
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
/* resize preview widget itself */
- scopes->track_preview_height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
+ scopes->track_preview_height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
}
else {
if (!scopes->track_locked) {
@@ -5397,7 +5452,7 @@ static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y)
return 1;
}
-static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y)
+uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y)
{
uiBlock *block;
uiBut *but, *butover = NULL;
@@ -5711,7 +5766,8 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA
button_activate_state(C, but, BUTTON_STATE_WAIT_FLASH);
}
-static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *but, int mousemove, int onfree)
+static void button_activate_exit(bContext *C, uiBut *but, uiHandleButtonData *data,
+ const bool mousemove, const bool onfree)
{
uiBlock *block = but->block;
uiBut *bt;
@@ -5766,8 +5822,10 @@ static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *b
ED_region_tag_redraw(data->region);
/* clean up button */
- MEM_freeN(but->active);
- but->active = NULL;
+ if (but->active) {
+ MEM_freeN(but->active);
+ but->active = NULL;
+ }
but->flag &= ~(UI_ACTIVE | UI_SELECT);
but->flag |= UI_BUT_LAST_ACTIVE;
if (!onfree)
@@ -5790,7 +5848,7 @@ void ui_button_active_free(const bContext *C, uiBut *but)
if (but->active) {
data = but->active;
data->cancel = TRUE;
- button_activate_exit((bContext *)C, data, but, 0, 1);
+ button_activate_exit((bContext *)C, but, data, false, true);
}
}
@@ -6016,6 +6074,20 @@ void ui_button_activate_do(bContext *C, ARegion *ar, uiBut *but)
ui_do_button(C, but->block, but, &event);
}
+void ui_button_execute_do(struct bContext *C, struct ARegion *ar, uiBut *but)
+{
+ /* note: ideally we would not have to change 'but->active' howevwer
+ * some functions we call don't use data (as they should be doing) */
+ void *active_back = but->active;
+ uiHandleButtonData *data = MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData_Fake");
+ but->active = data;
+ data->region = ar;
+ ui_apply_button(C, but->block, but, data, true);
+ /* use onfree event so undo is handled by caller and apply is already done above */
+ button_activate_exit((bContext *)C, but, data, false, true);
+ but->active = active_back;
+}
+
static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type)
{
uiBut *oldbut;
@@ -6025,7 +6097,7 @@ static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiBu
if (oldbut) {
data = oldbut->active;
data->cancel = TRUE;
- button_activate_exit(C, data, oldbut, 0, 0);
+ button_activate_exit(C, oldbut, data, false, false);
}
button_activate_init(C, ar, but, type);
@@ -6197,7 +6269,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
postbut = data->postbut;
posttype = data->posttype;
- button_activate_exit(C, data, but, (postbut == NULL), 0);
+ button_activate_exit(C, but, data, (postbut == NULL), false);
/* for jumping to the next button with tab while text editing */
if (postbut)
@@ -6326,7 +6398,7 @@ static void ui_handle_button_return_submenu(bContext *C, const wmEvent *event, u
if (menu->menuretval != UI_RETURN_OK)
data->cancel = TRUE;
- button_activate_exit(C, data, but, 1, 0);
+ button_activate_exit(C, but, data, true, false);
}
else if (menu->menuretval & UI_RETURN_OUT) {
if (event->type == MOUSEMOVE && ui_mouse_inside_button(data->region, but, event->x, event->y)) {
@@ -6340,7 +6412,7 @@ static void ui_handle_button_return_submenu(bContext *C, const wmEvent *event, u
}
else {
data->cancel = TRUE;
- button_activate_exit(C, data, but, 1, 0);
+ button_activate_exit(C, but, data, true, false);
}
}
}
@@ -7141,7 +7213,7 @@ static int ui_handler_popup(bContext *C, const wmEvent *event, void *userdata)
WM_operator_name_call(C, temp.optype->idname, temp.opcontext, NULL);
}
else if (temp.cancel_func)
- temp.cancel_func(temp.popup_arg);
+ temp.cancel_func(C, temp.popup_arg);
}
else {
/* re-enable tooltips */
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index eb7f09c7b34..f0e59f1f935 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -406,6 +406,7 @@ extern void ui_set_but_soft_range(uiBut *but, double value);
extern void ui_check_but(uiBut *but);
extern int ui_is_but_float(uiBut *but);
+extern int ui_is_but_bool(uiBut *but);
extern int ui_is_but_unit(uiBut *but);
extern int ui_is_but_rna_valid(uiBut *but);
extern int ui_is_but_utf8(uiBut *but);
@@ -429,7 +430,7 @@ struct uiPopupBlockHandle {
int popup;
void (*popup_func)(struct bContext *C, void *arg, int event);
- void (*cancel_func)(void *arg);
+ void (*cancel_func)(struct bContext *C, void *arg);
void *popup_arg;
struct wmTimer *scrolltimer;
@@ -509,6 +510,7 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, struct uiWidgetColors *wc
/* interface_handlers.c */
extern void ui_pan_to_scroll(const struct wmEvent *event, int *type, int *val);
extern void ui_button_activate_do(struct bContext *C, struct ARegion *ar, uiBut *but);
+extern void ui_button_execute_do(struct bContext *C, struct ARegion *ar, uiBut *but);
extern void ui_button_active_free(const struct bContext *C, uiBut *but);
extern int ui_button_is_active(struct ARegion *ar);
extern int ui_button_open_menu_direction(uiBut *but);
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index e03a171da18..d48d699d881 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -1071,6 +1071,222 @@ static void UI_OT_reloadtranslation(wmOperatorType *ot)
ot->exec = reloadtranslation_exec;
}
+
+/* -------------------------------------------------------------------- */
+/* Toggle Drag Operator */
+
+typedef struct DragOpInfo {
+ bool xy_lock[2];
+ float but_cent_start[2];
+ eButType but_type_start;
+} DragOpInfo;
+
+typedef struct DragOpPlotData {
+ bContext *C;
+ ARegion *ar;
+ bool is_set;
+ eButType but_type_start;
+ bool do_draw;
+ const uiBut *but_prev;
+} DragOpPlotData;
+
+static const uiBut *ui_but_set_xy(bContext *C, ARegion *ar, const bool is_set, const eButType but_type_start,
+ const int xy[2], const uiBut *but_prev)
+{
+ uiBut *but = ui_but_find_mouse_over(ar, xy[0], xy[1]);
+
+ if (but_prev == but) {
+ return but_prev;
+ }
+
+ if (but && ui_is_but_bool(but) && but->type == but_type_start) {
+ /* is it pressed? */
+ bool is_set_but = (ui_get_but_val(but) != 0.0);
+ BLI_assert(ui_is_but_bool(but) == true);
+ if (is_set_but != is_set) {
+ uiButExecute(C, but);
+ return but;
+ }
+ }
+
+ return but_prev;
+}
+
+static int ui_but_set_cb(int x, int y, void *data_v)
+{
+ DragOpPlotData *data = data_v;
+ int xy[2] = {x, y};
+ data->but_prev = ui_but_set_xy(data->C, data->ar, data->is_set, data->but_type_start, xy, data->but_prev);
+ return 1; /* keep going */
+}
+
+/* operates on buttons between 2 mouse-points */
+static bool ui_but_set_xy_xy(bContext *C, ARegion *ar, const bool is_set, const eButType but_type_start,
+ const int xy_src[2], const int xy_dst[2])
+{
+ DragOpPlotData data;
+ data.C = C;
+ data.ar = ar;
+ data.is_set = is_set;
+ data.but_type_start = but_type_start;
+ data.do_draw = false;
+ data.but_prev = NULL;
+
+
+ /* prevent dragging too fast loosing buttons */
+ plot_line_v2v2i(xy_src, xy_dst, ui_but_set_cb, &data);
+
+ return data.do_draw;
+}
+
+static void ui_drag_but_set(bContext *C, wmOperator *op, const int xy_input[2])
+{
+ ARegion *ar = CTX_wm_region(C);
+ DragOpInfo *drag_info = op->customdata;
+ bool do_draw = false;
+
+ const bool is_set = RNA_boolean_get(op->ptr, "state");
+ const int xy_last[2] = {RNA_int_get(op->ptr, "last_x"),
+ RNA_int_get(op->ptr, "last_y")};
+
+ int xy[2];
+
+ /**
+ * Initialize Locking:
+ *
+ * Check if we need to initialize the lock axis by finding if the first
+ * button we mouse over is X or Y aligned, then lock the mouse to that axis after.
+ */
+ if (drag_info->xy_lock[0] == false && drag_info->xy_lock[1] == false) {
+ ARegion *ar = CTX_wm_region(C);
+
+ /* first store the buttons original coords */
+ uiBut *but = ui_but_find_mouse_over(ar, xy_input[0], xy_input[1]);
+ if (but) {
+ const float but_cent_new[2] = {BLI_rctf_cent_x(&but->rect),
+ BLI_rctf_cent_y(&but->rect)};
+
+ /* check if this is a different button, chances are high the button wont move about :) */
+ if (len_manhattan_v2v2(drag_info->but_cent_start, but_cent_new) > 1.0f) {
+ if (fabsf(drag_info->but_cent_start[0] - but_cent_new[0]) <
+ fabsf(drag_info->but_cent_start[1] - but_cent_new[1]))
+ {
+ drag_info->xy_lock[0] = true;
+ }
+ else {
+ drag_info->xy_lock[1] = true;
+ }
+ }
+ }
+ }
+ /* done with axis locking */
+
+
+ xy[0] = (drag_info->xy_lock[0] == false) ? xy_input[0] : xy_last[0];
+ xy[1] = (drag_info->xy_lock[1] == false) ? xy_input[1] : xy_last[1];
+
+
+ /* touch all buttons between last mouse coord and this one */
+ do_draw = ui_but_set_xy_xy(C, ar, is_set, drag_info->but_type_start, xy_last, xy);
+
+ if (do_draw) {
+ ED_region_tag_redraw(ar);
+ }
+
+ RNA_int_set(op->ptr, "last_x", xy[0]);
+ RNA_int_set(op->ptr, "last_y", xy[1]);
+}
+
+static int ui_drag_toggle_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ int xy_last[2] = {RNA_int_get(op->ptr, "last_x"),
+ RNA_int_get(op->ptr, "last_y")};
+
+ float but_cent_start[2];
+ eButType but_type_start;
+ DragOpInfo *drag_info;
+
+ {
+ /* find the button where we started dragging */
+ ARegion *ar = CTX_wm_region(C);
+ uiBut *but = ui_but_find_mouse_over(ar, xy_last[0], xy_last[1]);
+ if (but) {
+ but_cent_start[0] = BLI_rctf_cent_x(&but->rect);
+ but_cent_start[1] = BLI_rctf_cent_y(&but->rect);
+ but_type_start = but->type;
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
+ }
+
+ drag_info = op->customdata = MEM_callocN(sizeof(DragOpInfo), __func__);
+ copy_v2_v2(drag_info->but_cent_start, but_cent_start);
+ drag_info->but_type_start = but_type_start;
+
+ /* set the initial button */
+ ui_drag_but_set(C, op, xy_last);
+ ui_drag_but_set(C, op, &event->x);
+
+ WM_event_add_modal_handler(C, op);
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int ui_drag_toggle_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ bool done = false;
+
+ switch (event->type) {
+ case LEFTMOUSE:
+ {
+ if (event->val != KM_PRESS) {
+ done = true;
+ }
+ break;
+ }
+ case MOUSEMOVE:
+ {
+ ui_drag_but_set(C, op, &event->x);
+ break;
+ }
+ }
+
+ if (done) {
+ MEM_freeN(op->customdata);
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_RUNNING_MODAL;
+ }
+}
+
+static int ui_drag_toggle_cancel(bContext *UNUSED(C), wmOperator *op)
+{
+ MEM_freeN(op->customdata);
+ return OPERATOR_CANCELLED;
+}
+
+static void UI_OT_drag_toggle(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Button Drag Toggle";
+ ot->description = "";
+ ot->idname = "UI_OT_drag_toggle";
+
+ /* api callbacks */
+ ot->invoke = ui_drag_toggle_invoke;
+ ot->modal = ui_drag_toggle_modal;
+ ot->cancel = ui_drag_toggle_cancel;
+
+ /* flags */
+ ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL;
+
+ /* properties */
+ RNA_def_boolean(ot->srna, "state", true, "State", "");
+ RNA_def_int(ot->srna, "last_x", 0, 0, INT_MAX, "X", "", 0, INT_MAX);
+ RNA_def_int(ot->srna, "last_y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX);
+}
+
/* ********************************************************* */
/* Registration */
@@ -1088,5 +1304,6 @@ void UI_buttons_operatortypes(void)
WM_operatortype_append(UI_OT_edittranslation_init);
#endif
WM_operatortype_append(UI_OT_reloadtranslation);
+ WM_operatortype_append(UI_OT_drag_toggle);
}
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 9b2ed9f0984..03c127f33c8 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -2574,7 +2574,7 @@ static void operator_cb(bContext *C, void *arg, int retval)
WM_operator_free(op);
}
-static void confirm_cancel_operator(void *opv)
+static void confirm_cancel_operator(bContext *UNUSED(C), void *opv)
{
WM_operator_free(opv);
}
@@ -2621,7 +2621,7 @@ void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...)
va_list ap;
char titlestr[256];
- BLI_snprintf(titlestr, sizeof(titlestr), "OK? %%i%d", ICON_QUESTION);
+ BLI_snprintf(titlestr, sizeof(titlestr), IFACE_("OK? %%i%d"), ICON_QUESTION);
va_start(ap, str);
vconfirm_opname(C, opname, titlestr, str, ap);
@@ -2635,7 +2635,7 @@ void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...)
* The operator state for this is implicitly OPERATOR_RUNNING_MODAL */
void uiPupMenuSaveOver(bContext *C, wmOperator *op, const char *filename)
{
- confirm_operator(C, op, "Save Over?", filename);
+ confirm_operator(C, op, IFACE_("Save Over?"), filename);
}
void uiPupMenuNotice(bContext *C, const char *str, ...)
@@ -2653,7 +2653,7 @@ void uiPupMenuError(bContext *C, const char *str, ...)
char nfmt[256];
char titlestr[256];
- BLI_snprintf(titlestr, sizeof(titlestr), "Error %%i%d", ICON_ERROR);
+ BLI_snprintf(titlestr, sizeof(titlestr), IFACE_("Error %%i%d"), ICON_ERROR);
BLI_strncpy(nfmt, str, sizeof(nfmt));
@@ -2680,13 +2680,13 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
/* pass */
}
else if (report->type >= RPT_ERROR) {
- BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message);
+ BLI_dynstr_appendf(ds, IFACE_("Error %%i%d%%t|%s"), ICON_ERROR, report->message);
}
else if (report->type >= RPT_WARNING) {
- BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message);
+ BLI_dynstr_appendf(ds, IFACE_("Warning %%i%d%%t|%s"), ICON_ERROR, report->message);
}
else if (report->type >= RPT_INFO) {
- BLI_dynstr_appendf(ds, "Info %%i%d%%t|%s", ICON_INFO, report->message);
+ BLI_dynstr_appendf(ds, IFACE_("Info %%i%d%%t|%s"), ICON_INFO, report->message);
}
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 5e9a70ea895..900ba7de559 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -551,8 +551,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
/* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack.
Only for images, sound and fonts */
if (id && BKE_pack_check(id)) {
-
- but = uiDefIconButO(block, BUT, "FILE_OT_unpack_item", WM_OP_INVOKE_REGION_WIN, ICON_PACKAGE, 0, 0, UI_UNIT_X, UI_UNIT_Y, "Packed File");
+ but = uiDefIconButO(block, BUT, "FILE_OT_unpack_item", WM_OP_INVOKE_REGION_WIN, ICON_PACKAGE, 0, 0,
+ UI_UNIT_X, UI_UNIT_Y, TIP_("Packed File, click to unpack"));
uiButGetOperatorPtrRNA(but);
RNA_string_set(but->opptr, "id_name", id->name + 2);
@@ -700,7 +700,7 @@ void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, co
uiItemL(row, text, ICON_NONE);
}
else
- uiItemL(row, "ID-Block:", ICON_NONE);
+ uiItemL(row, IFACE_("ID-Block:"), ICON_NONE);
/* ID-Type Selector - just have a menu of icons */
/* FIXME: the icon-only setting doesn't work when we supply a blank name */
@@ -744,7 +744,7 @@ void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propna
/************************ Modifier Template *************************/
-#define ERROR_LIBDATA_MESSAGE "Can't edit external libdata"
+#define ERROR_LIBDATA_MESSAGE IFACE_("Can't edit external libdata")
static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v)
{
@@ -844,8 +844,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
block = uiLayoutGetBlock(row);
/* VIRTUAL MODIFIER */
/* XXX this is not used now, since these cannot be accessed via RNA */
- BLI_snprintf(str, sizeof(str), "%s parent deform", md->name);
- uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name");
+ BLI_snprintf(str, sizeof(str), IFACE_("%s parent deform"), md->name);
+ uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Modifier name"));
but = uiDefBut(block, BUT, 0, IFACE_("Make Real"), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0,
TIP_("Convert virtual modifier to a real modifier"));
@@ -952,18 +952,22 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
if (!(ob->mode & OB_MODE_PARTICLE_EDIT) && psys->pathcache) {
if (ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB))
- uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_duplicates_make_real");
+ uiItemO(row, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Convert"), ICON_NONE,
+ "OBJECT_OT_duplicates_make_real");
else if (psys->part->ren_as == PART_DRAW_PATH)
- uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_modifier_convert");
+ uiItemO(row, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Convert"), ICON_NONE,
+ "OBJECT_OT_modifier_convert");
}
}
else {
uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT);
- uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply"), 0, "apply_as", MODIFIER_APPLY_DATA);
+ uiItemEnumO(row, "OBJECT_OT_modifier_apply", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Apply"),
+ 0, "apply_as", MODIFIER_APPLY_DATA);
if (modifier_isSameTopology(md) && !modifier_isNonGeometrical(md)) {
- uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply as Shape Key"), 0,
- "apply_as", MODIFIER_APPLY_SHAPE);
+ uiItemEnumO(row, "OBJECT_OT_modifier_apply",
+ CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Apply as Shape Key"),
+ 0, "apply_as", MODIFIER_APPLY_SHAPE);
}
}
@@ -973,7 +977,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
if (!ELEM5(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem,
eModifierType_Cloth, eModifierType_Smoke))
{
- uiItemO(row, IFACE_("Copy"), ICON_NONE, "OBJECT_OT_modifier_copy");
+ uiItemO(row, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE,
+ "OBJECT_OT_modifier_copy");
}
}
@@ -1052,9 +1057,8 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event)
case B_CONSTRAINT_CHANGETARGET:
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
if (ob->pose) ob->pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
break;
}
#endif
@@ -1095,10 +1099,10 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
cti = BKE_constraint_get_typeinfo(con);
if (cti == NULL) {
/* exception for 'Null' constraint - it doesn't have constraint typeinfo! */
- BLI_strncpy(typestr, (con->type == CONSTRAINT_TYPE_NULL) ? "Null" : "Unknown", sizeof(typestr));
+ BLI_strncpy(typestr, (con->type == CONSTRAINT_TYPE_NULL) ? IFACE_("Null") : IFACE_("Unknown"), sizeof(typestr));
}
else
- BLI_strncpy(typestr, cti->name, sizeof(typestr));
+ BLI_strncpy(typestr, IFACE_(cti->name), sizeof(typestr));
/* determine whether constraint is proxy protected or not */
if (BKE_proxylocked_constraints_owner(ob, pchan))
@@ -1203,7 +1207,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
/* Set but-locks for protected settings (magic numbers are used here!) */
if (proxy_protected)
- uiBlockSetButLock(block, 1, "Cannot edit Proxy-Protected Constraint");
+ uiBlockSetButLock(block, 1, IFACE_("Cannot edit Proxy-Protected Constraint"));
/* Draw constraint data */
if ((con->flag & CONSTRAINT_EXPAND) == 0) {
@@ -1487,7 +1491,7 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
row = uiLayoutRow(layout, FALSE);
- uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE);
+ uiItemR(row, &ptr, "position", 0, IFACE_("Pos"), ICON_NONE);
bt = block->buttons.last;
uiButSetFunc(bt, colorband_update_cb, bt, coba);
@@ -1585,7 +1589,8 @@ static uiBlock *icon_view_menu(bContext *C, ARegion *ar, void *arg_litem)
/* arg_litem is malloced, can be freed by parent button */
cb = *((RNAUpdateCb *)arg_litem);
- icon = RNA_property_enum_get(&cb.ptr, cb.prop);
+ /* unused */
+ // icon = RNA_property_enum_get(&cb.ptr, cb.prop);
block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW);
@@ -1683,7 +1688,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
hist = (Histogram *)cptr.data;
- hist->height = (hist->height <= UI_UNIT_Y) ? UI_UNIT_Y : hist->height;
+ hist->height = (hist->height <= 20) ? 20 : hist->height;
bt = uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * hist->height,
hist, 0, 0, 0, 0, "");
@@ -1722,7 +1727,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
block = uiLayoutAbsoluteBlock(layout);
- scopes->wavefrm_height = (scopes->wavefrm_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->wavefrm_height;
+ scopes->wavefrm_height = (scopes->wavefrm_height <= 20) ? 20 : scopes->wavefrm_height;
bt = uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * scopes->wavefrm_height,
scopes, 0, 0, 0, 0, "");
@@ -1760,7 +1765,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
block = uiLayoutAbsoluteBlock(layout);
- scopes->vecscope_height = (scopes->vecscope_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->vecscope_height;
+ scopes->vecscope_height = (scopes->vecscope_height <= 20) ? 20 : scopes->vecscope_height;
bt = uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
UI_DPI_FAC * scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
@@ -2487,6 +2492,13 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
int min, max;
/* validate arguments */
+ /* Forbid default UI_UL_DEFAULT_CLASS_NAME list class without a custom list_id! */
+ if (!strcmp(UI_UL_DEFAULT_CLASS_NAME, listtype_name) && !(list_id && list_id[0])) {
+ RNA_warning("template_list using default '%s' UIList class must provide a custom list_id",
+ UI_UL_DEFAULT_CLASS_NAME);
+ return;
+ }
+
block = uiLayoutGetBlock(layout);
if (!active_dataptr->data) {
@@ -3010,7 +3022,7 @@ void uiTemplateColorspaceSettings(uiLayout *layout, PointerRNA *ptr, const char
colorspace_settings_ptr = RNA_property_pointer_get(ptr, prop);
- uiItemL(layout, "Input Color Space:", ICON_NONE);
+ uiItemL(layout, IFACE_("Input Color Space:"), ICON_NONE);
uiItemR(layout, &colorspace_settings_ptr, "name", 0, "", ICON_NONE);
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 6735c8b173c..68df8e29957 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1804,7 +1804,7 @@ static void widget_state_menu_item(uiWidgetType *wt, int state)
}
/* regular disabled */
else if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE)) {
- widget_state_blend(wt->wcol.text, wt->wcol.text_sel, 0.5f);
+ widget_state_blend(wt->wcol.text, wt->wcol.inner, 0.5f);
}
/* regular active */
else if (state & UI_ACTIVE) {
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 009d52ea283..acea6e133f4 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -433,6 +433,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
cp = ts->console_error; break;
case TH_CONSOLE_CURSOR:
cp = ts->console_cursor; break;
+ case TH_CONSOLE_SELECT:
+ cp = ts->console_select; break;
case TH_HANDLE_VERTEX:
cp = ts->handle_vertex;
@@ -947,6 +949,7 @@ void ui_theme_init_default(void)
rgba_char_args_set(btheme->tconsole.console_info, 0, 170, 0, 255);
rgba_char_args_set(btheme->tconsole.console_error, 220, 96, 96, 255);
rgba_char_args_set(btheme->tconsole.console_cursor, 220, 96, 96, 255);
+ rgba_char_args_set(btheme->tconsole.console_select, 255, 255, 255, 48);
/* space time */
btheme->ttime = btheme->tv3d;
@@ -2160,6 +2163,13 @@ void init_userdef_do_versions(void)
}
}
+ if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 11)) {
+ bTheme *btheme;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_test_set(btheme->tconsole.console_select, 255, 255, 255, 48);
+ }
+ }
+
/* NOTE!! from now on use U.versionfile and U.subversionfile */
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index ae89b25d5ea..ad6428c7e80 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -39,6 +39,7 @@
#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
+#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
@@ -1805,7 +1806,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
/* draw vertical steps */
if (dfac > 0.0f) {
- BLF_rotation_default(90.0f);
+ BLF_rotation_default(M_PI / 2);
BLF_enable_default(BLF_ROTATION);
for (; fac < vert.ymax - 10; fac += dfac, val += grid->dy) {
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index fbbcb650e68..7f1140501b5 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -1034,14 +1034,17 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
}
else {
/* 'continuous' or 'dolly' */
- float fac;
+ float fac, zoomfac = 0.001f * v2d->maxzoom;
+
+ /* some view2d's (graph) don't have min/max zoom, or extreme ones */
+ CLAMP (zoomfac, 0.001f, 0.01f);
/* x-axis transform */
- fac = 0.01f * (event->x - vzd->lastx);
+ fac = zoomfac * (event->x - vzd->lastx);
dx = fac * BLI_rctf_size_x(&v2d->cur);
/* y-axis transform */
- fac = 0.01f * (event->y - vzd->lasty);
+ fac = zoomfac * (event->y - vzd->lasty);
dy = fac * BLI_rctf_size_y(&v2d->cur);
}
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 3fbfaabbc0d..7ac27e038a4 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -34,6 +34,8 @@
#include "BLI_math.h"
#include "BLI_edgehash.h"
+#include "BLF_translation.h"
+
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -429,7 +431,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
if (me == 0 || me->totpoly == 0) return;
if (mode == 0)
- mode = pupmenu("Seams %t|Mark Border Seam %x1|Clear Seam %x2");
+ mode = pupmenu(IFACE_("Seams %t|Mark Border Seam %x1|Clear Seam %x2"));
if (mode != 1 && mode != 2)
return;
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index bc7fe783e78..d7dbe3506b1 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -41,6 +41,8 @@
#include "BLI_smallhash.h"
#include "BLI_memarena.h"
+#include "BLF_translation.h"
+
#include "BKE_DerivedMesh.h"
#include "BKE_context.h"
@@ -212,15 +214,16 @@ static void knife_input_ray_segment(KnifeTool_OpData *kcd, const float mval[2],
static void knife_update_header(bContext *C, KnifeTool_OpData *kcd)
{
- #define HEADER_LENGTH 190
+ #define HEADER_LENGTH 256
char header[HEADER_LENGTH];
- BLI_snprintf(header, HEADER_LENGTH, "LMB: define cut lines, Return/Spacebar: confirm, Esc or RMB: cancel, E: new cut, Ctrl: midpoint snap (%s), "
- "Shift: ignore snap (%s), C: angle constrain (%s), Z: cut through (%s)",
- kcd->snap_midpoints ? "On" : "Off",
- kcd->ignore_edge_snapping ? "On" : "Off",
- kcd->angle_snapping ? "On" : "Off",
- kcd->cut_through ? "On" : "Off");
+ BLI_snprintf(header, HEADER_LENGTH, IFACE_("LMB: define cut lines, Return/Spacebar: confirm, Esc or RMB: cancel, "
+ "E: new cut, Ctrl: midpoint snap (%s), Shift: ignore snap (%s), "
+ "C: angle constrain (%s), Z: cut through (%s)"),
+ kcd->snap_midpoints ? IFACE_("On") : IFACE_("Off"),
+ kcd->ignore_edge_snapping ? IFACE_("On") : IFACE_("Off"),
+ kcd->angle_snapping ? IFACE_("On") : IFACE_("Off"),
+ kcd->cut_through ? IFACE_("On") : IFACE_("Off"));
ED_area_headerprint(CTX_wm_area(C), header);
}
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index d1373363992..83542915ec2 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -37,6 +37,8 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_modifier.h"
#include "BKE_report.h"
@@ -411,10 +413,8 @@ static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt)
lcd->eed = edge;
ringsel_find_edge(lcd, 1);
}
- ED_area_headerprint(sa,
- "Select a ring to be cut, "
- "use mouse-wheel or page-up/down for number of cuts, "
- "Hold Alt for smooth");
+ ED_area_headerprint(sa, IFACE_("Select a ring to be cut, use mouse-wheel or page-up/down for number of cuts, "
+ "hold Alt for smooth"));
return OPERATOR_RUNNING_MODAL;
}
@@ -543,7 +543,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
if (show_cuts) {
char buf[64];
- BLI_snprintf(buf, sizeof(buf), "Number of Cuts: %d, Smooth: %.2f (Alt)", cuts, smoothness);
+ BLI_snprintf(buf, sizeof(buf), IFACE_("Number of Cuts: %d, Smooth: %.2f (Alt)"), cuts, smoothness);
ED_area_headerprint(CTX_wm_area(C), buf);
}
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 88d826c2f98..57f116693f8 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -2678,7 +2678,7 @@ void MESH_OT_select_nth(wmOperatorType *ot)
/* identifiers */
ot->name = "Checker Deselect";
ot->idname = "MESH_OT_select_nth";
- ot->description = "Deselect every Nth element starting from a selected vertex, edge or face";
+ ot->description = "Deselect every Nth element starting from the active vertex, edge or face";
/* api callbacks */
ot->exec = edbm_select_nth_exec;
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index b58e393811d..dcb25423b80 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -47,6 +47,8 @@
#include "BLI_math.h"
#include "BLI_rand.h"
+#include "BLF_translation.h"
+
#include "BKE_material.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
@@ -2387,7 +2389,7 @@ static void shape_propagate(BMEditMesh *em, wmOperator *op)
//TAG Mesh Objects that share this data
for (base = scene->base.first; base; base = base->next) {
if (base->object && base->object->data == me) {
- base->object->recalc = OB_RECALC_DATA;
+ DAG_id_tag_update(&base->object->id, OB_RECALC_DATA);
}
}
#endif
@@ -3040,7 +3042,7 @@ static int mesh_separate_tagged(Main *bmain, Scene *scene, Base *base_old, BMesh
CustomData_bmesh_init_pool(&bm_new->pdata, bm_mesh_allocsize_default.totface, BM_FACE);
base_new = ED_object_add_duplicate(bmain, scene, base_old, USER_DUP_MESH);
- /* DAG_scene_sort(bmain, scene); */ /* normally would call directly after but in this case delay recalc */
+ /* DAG_relations_tag_update(bmain); */ /* normally would call directly after but in this case delay recalc */
assign_matarar(base_new->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */
ED_base_object_select(base_new, BA_SELECT);
@@ -3274,7 +3276,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
if (retval) {
/* delay depsgraph recalc until all objects are duplicated */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
return OPERATOR_FINISHED;
}
@@ -4651,15 +4653,9 @@ void MESH_OT_noise(wmOperatorType *ot)
RNA_def_float(ot->srna, "factor", 0.1f, -FLT_MAX, FLT_MAX, "Factor", "", 0.0f, 1.0f);
}
-#define NEW_BEVEL 1
-
typedef struct {
BMEditMesh *em;
BMBackup mesh_backup;
-#ifndef NEW_BEVEL
- float *weights;
- int li;
-#endif
int mcenter[2];
float initial_length;
float pixel_size; /* use when mouse input is interpreted as spatial distance */
@@ -4672,104 +4668,34 @@ typedef struct {
static void edbm_bevel_update_header(wmOperator *op, bContext *C)
{
-#ifdef NEW_BEVEL
- static char str[] = "Confirm: Enter/LClick, Cancel: (Esc/RMB), offset: %s, segments: %d";
-#else
- static char str[] = "Confirm: Enter/LClick, Cancel: (Esc/RMB), factor: %s, Use Dist (D): %s: Use Even (E): %s";
- BevelData *opdata = op->customdata;
-#endif
+ const char *str = IFACE_("Confirm: Enter/LClick, Cancel: (Esc/RMB), Offset: %s, Segments: %d");
char msg[HEADER_LENGTH];
ScrArea *sa = CTX_wm_area(C);
if (sa) {
-#ifdef NEW_BEVEL
char offset_str[NUM_STR_REP_LEN];
BLI_snprintf(offset_str, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "offset"));
BLI_snprintf(msg, HEADER_LENGTH, str,
offset_str,
RNA_int_get(op->ptr, "segments")
);
-#else
- char factor_str[NUM_STR_REP_LEN];
- if (hasNumInput(&opdata->num_input))
- outputNumInput(&opdata->num_input, factor_str);
- else
- BLI_snprintf(factor_str, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "percent"));
- BLI_snprintf(msg, HEADER_LENGTH, str,
- factor_str,
- RNA_boolean_get(op->ptr, "use_dist") ? "On" : "Off",
- RNA_boolean_get(op->ptr, "use_even") ? "On" : "Off"
- );
-#endif
ED_area_headerprint(sa, msg);
}
}
-#ifndef NEW_BEVEL
-static void edbm_bevel_recalc_weights(wmOperator *op)
-{
- float df, s, ftot;
- int i;
- int recursion = 1; /* RNA_int_get(op->ptr, "recursion"); */ /* temp removed, see comment below */
- BevelData *opdata = op->customdata;
-
- if (opdata->weights) {
- /* TODO should change to free only when new recursion is greater than old */
- MEM_freeN(opdata->weights);
- }
- opdata->weights = MEM_mallocN(sizeof(float) * recursion, "bevel weights");
-
- /* ugh, stupid math depends somewhat on angles!*/
- /* dfac = 1.0/(float)(recursion + 1); */ /* UNUSED */
- df = 1.0;
- for (i = 0, ftot = 0.0f; i < recursion; i++) {
- s = powf(df, 1.25f);
-
- opdata->weights[i] = s;
- ftot += s;
-
- df *= 2.0f;
- }
-
- mul_vn_fl(opdata->weights, recursion, 1.0f / (float)ftot);
-}
-#endif
-
static int edbm_bevel_init(bContext *C, wmOperator *op, int is_modal)
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BMEdit_FromObject(obedit);
-#ifdef NEW_BEVEL
- BevelData *opdata;
-#else
- BMIter iter;
- BMEdge *eed;
BevelData *opdata;
- int li;
-#endif
if (em == NULL) {
return 0;
}
op->customdata = opdata = MEM_mallocN(sizeof(BevelData), "beveldata_mesh_operator");
-
-#ifndef NEW_BEVEL
- BM_data_layer_add(em->bm, &em->bm->edata, CD_PROP_FLT);
- li = CustomData_number_of_layers(&em->bm->edata, CD_PROP_FLT) - 1;
-
- BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
- float d = len_v3v3(eed->v1->co, eed->v2->co);
- float *dv = CustomData_bmesh_get_n(&em->bm->edata, eed->head.data, CD_PROP_FLT, li);
-
- *dv = d;
- }
-
- opdata->li = li;
- opdata->weights = NULL;
-#endif
opdata->em = em;
opdata->is_modal = is_modal;
@@ -4781,9 +4707,6 @@ static int edbm_bevel_init(bContext *C, wmOperator *op, int is_modal)
/* avoid the cost of allocating a bm copy */
if (is_modal)
opdata->mesh_backup = EDBM_redo_state_store(em);
-#ifndef NEW_BEVEL
- edbm_bevel_recalc_weights(op);
-#endif
return 1;
}
@@ -4793,7 +4716,6 @@ static int edbm_bevel_calc(wmOperator *op)
BevelData *opdata = op->customdata;
BMEditMesh *em = opdata->em;
BMOperator bmop;
-#ifdef NEW_BEVEL
float offset = RNA_float_get(op->ptr, "offset");
int segments = RNA_int_get(op->ptr, "segments");
int vertex_only = RNA_boolean_get(op->ptr, "vertex_only");
@@ -4822,35 +4744,6 @@ static int edbm_bevel_calc(wmOperator *op)
/* no need to de-select existing geometry */
if (!EDBM_op_finish(em, &bmop, op, TRUE))
return 0;
-#else
- int i;
-
- float factor = RNA_float_get(op->ptr, "percent") /*, dfac */ /* UNUSED */;
- int recursion = 1; /* RNA_int_get(op->ptr, "recursion"); */ /* temp removed, see comment below */
- const int use_even = RNA_boolean_get(op->ptr, "use_even");
- const int use_dist = RNA_boolean_get(op->ptr, "use_dist");
-
- /* revert to original mesh */
- if (opdata->is_modal) {
- EDBM_redo_state_restore(opdata->mesh_backup, em, FALSE);
- }
-
- for (i = 0; i < recursion; i++) {
- float fac = opdata->weights[recursion - i - 1] * factor;
-
-
- if (!EDBM_op_init(em, &bmop, op,
- "bevel geom=%hev percent=%f lengthlayer=%i use_lengths=%b use_even=%b use_dist=%b",
- BM_ELEM_SELECT, fac, opdata->li, TRUE, use_even, use_dist))
- {
- return 0;
- }
-
- BMO_op_exec(em->bm, &bmop);
- if (!EDBM_op_finish(em, &bmop, op, TRUE))
- return 0;
- }
-#endif
EDBM_mesh_normals_update(opdata->em);
@@ -4868,12 +4761,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
if (sa) {
ED_area_headerprint(sa, NULL);
}
-#ifndef NEW_BEVEL
- BM_data_layer_free_n(opdata->em->bm, &opdata->em->bm->edata, CD_PROP_FLT, opdata->li);
- if (opdata->weights)
- MEM_freeN(opdata->weights);
-#endif
if (opdata->is_modal) {
EDBM_redo_state_free(&opdata->mesh_backup, NULL, FALSE);
}
@@ -4954,11 +4842,7 @@ static int edbm_bevel_invoke(bContext *C, wmOperator *op, wmEvent *event)
static float edbm_bevel_mval_factor(wmOperator *op, wmEvent *event)
{
BevelData *opdata = op->customdata;
-#ifdef NEW_BEVEL
int use_dist = TRUE;
-#else
- int use_dist = RNA_boolean_get(op->ptr, "use_dist");
-#endif
float mdiff[2];
float factor;
@@ -4976,11 +4860,7 @@ static float edbm_bevel_mval_factor(wmOperator *op, wmEvent *event)
/* Fake shift-transform... */
if (event->shift) {
if (opdata->shift_factor < 0.0f) {
-#ifdef NEW_BEVEL
opdata->shift_factor = RNA_float_get(op->ptr, "offset");
-#else
- opdata->shift_factor = RNA_float_get(op->ptr, "factor");
-#endif
}
factor = (factor - opdata->shift_factor) * 0.1f + opdata->shift_factor;
}
@@ -5005,7 +4885,6 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
if (event->val == KM_PRESS) {
/* Try to handle numeric inputs... */
-#ifdef NEW_BEVEL
if (handleNumInput(&opdata->num_input, event)) {
float value = RNA_float_get(op->ptr, "offset");
@@ -5015,18 +4894,6 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
edbm_bevel_update_header(op, C);
return OPERATOR_RUNNING_MODAL;
}
-#else
- if (handleNumInput(&opdata->num_input, event)) {
- float factor = RNA_float_get(op->ptr, "percent");
- applyNumInput(&opdata->num_input, &factor);
- CLAMP(factor, 0.0f, 1.0f);
- RNA_float_set(op->ptr, "percent", factor);
-
- edbm_bevel_calc(C, op);
- edbm_bevel_update_header(op, C);
- return OPERATOR_RUNNING_MODAL;
- }
-#endif
}
switch (event->type) {
@@ -5038,11 +4905,7 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
case MOUSEMOVE:
if (!hasNumInput(&opdata->num_input)) {
const float factor = edbm_bevel_mval_factor(op, event);
-#ifdef NEW_BEVEL
RNA_float_set(op->ptr, "offset", factor);
-#else
- RNA_float_set(op->ptr, "percent", factor);
-#endif
edbm_bevel_calc(op);
edbm_bevel_update_header(op, C);
@@ -5056,7 +4919,6 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
edbm_bevel_exit(C, op);
return OPERATOR_FINISHED;
-#ifdef NEW_BEVEL
case WHEELUPMOUSE: /* change number of segments */
case PAGEUPKEY:
if (event->val == KM_RELEASE)
@@ -5078,33 +4940,6 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
edbm_bevel_calc(op);
edbm_bevel_update_header(op, C);
break;
-
-#else
- case EKEY:
- if (event->val == KM_PRESS) {
- int use_even = RNA_boolean_get(op->ptr, "use_even");
- RNA_boolean_set(op->ptr, "use_even", !use_even);
-
- edbm_bevel_calc(C, op);
- edbm_bevel_update_header(op, C);
- }
- break;
-
- case DKEY:
- if (event->val == KM_PRESS) {
- int use_dist = RNA_boolean_get(op->ptr, "use_dist");
- RNA_boolean_set(op->ptr, "use_dist", !use_dist);
-
- {
- const float factor = edbm_bevel_mval_factor(op, event);
- RNA_float_set(op->ptr, "percent", factor);
- }
-
- edbm_bevel_calc(C, op);
- edbm_bevel_update_header(op, C);
- }
- break;
-#endif
}
return OPERATOR_RUNNING_MODAL;
@@ -5127,20 +4962,9 @@ void MESH_OT_bevel(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_GRAB_POINTER | OPTYPE_BLOCKING;
-#ifdef NEW_BEVEL
RNA_def_float(ot->srna, "offset", 0.0f, -FLT_MAX, FLT_MAX, "Offset", "", 0.0f, 1.0f);
RNA_def_int(ot->srna, "segments", 1, 1, 50, "Segments", "Segments for curved edge", 1, 8);
RNA_def_boolean(ot->srna, "vertex_only", FALSE, "Vertex only", "Bevel only vertices");
-#else
- /* take note, used as a factor _and_ a distance depending on 'use_dist' */
- RNA_def_float(ot->srna, "percent", 0.0f, -FLT_MAX, FLT_MAX, "Percentage", "", 0.0f, 1.0f);
- /* XXX, disabled for 2.63 release, needs to work much better without overlap before we can give to users. */
-/* RNA_def_int(ot->srna, "recursion", 1, 1, 50, "Recursion Level", "Recursion Level", 1, 8); */
-
- RNA_def_boolean(ot->srna, "use_even", FALSE, "Even", "Calculate evenly spaced bevel");
- RNA_def_boolean(ot->srna, "use_dist", FALSE, "Distance", "Interpret the percent in blender units");
-#endif
-
}
static int edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op)
@@ -5212,12 +5036,8 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C)
{
InsetData *opdata = op->customdata;
- static const char str[] = "Confirm: Enter/LClick, "
- "Cancel: (Esc/RClick), "
- "thickness: %s, "
- "depth (Ctrl to tweak): %s (%s), "
- "Outset (O): (%s), "
- "Boundary (B): (%s)";
+ const char *str = IFACE_("Confirm: Enter/LClick, Cancel: (Esc/RClick), Thickness: %s, "
+ "Depth (Ctrl to tweak): %s (%s), Outset (O): (%s), Boundary (B): (%s)");
char msg[HEADER_LENGTH];
ScrArea *sa = CTX_wm_area(C);
@@ -5233,9 +5053,9 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C)
BLI_snprintf(msg, HEADER_LENGTH, str,
flts_str,
flts_str + NUM_STR_REP_LEN,
- opdata->modify_depth ? "On" : "Off",
- RNA_boolean_get(op->ptr, "use_outset") ? "On" : "Off",
- RNA_boolean_get(op->ptr, "use_boundary") ? "On" : "Off"
+ opdata->modify_depth ? IFACE_("On") : IFACE_("Off"),
+ RNA_boolean_get(op->ptr, "use_outset") ? IFACE_("On") : IFACE_("Off"),
+ RNA_boolean_get(op->ptr, "use_boundary") ? IFACE_("On") : IFACE_("Off")
);
ED_area_headerprint(sa, msg);
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index d62eba9728c..fd90246f791 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -136,8 +136,10 @@ void EDBM_mesh_clear(BMEditMesh *em)
/* free tessellation data */
em->tottri = 0;
- if (em->looptris)
+ if (em->looptris) {
MEM_freeN(em->looptris);
+ em->looptris = NULL;
+ }
}
void EDBM_stats_update(BMEditMesh *em)
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index cb69faa5b51..f983a43f573 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -559,7 +559,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
- DAG_scene_sort(bmain, scene); // removed objects, need to rebuild dag before editmode call
+ DAG_relations_tag_update(bmain); // removed objects, need to rebuild dag
#if 0
ED_object_enter_editmode(C, EM_WAITCURSOR);
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index ffaa6f61cae..bc577f6ee29 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -381,7 +381,7 @@ Object *ED_object_add_type(bContext *C, int type, const float loc[3], const floa
ED_object_base_init_transform(C, BASACT, loc, rot);
DAG_id_type_tag(bmain, ID_OB);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
if (ob->data) {
ED_render_id_flush_update(bmain, ob->data);
}
@@ -469,7 +469,7 @@ static int effector_add_exec(bContext *C, wmOperator *op)
ob->pd = object_add_collision_fields(type);
- DAG_scene_sort(CTX_data_main(C), CTX_data_scene(C));
+ DAG_relations_tag_update(CTX_data_main(C));
return OPERATOR_FINISHED;
}
@@ -815,7 +815,7 @@ static int group_instance_add_exec(bContext *C, wmOperator *op)
if (0 == RNA_struct_property_is_set(op->ptr, "location")) {
wmEvent *event = CTX_wm_window(C)->eventstate;
ED_object_location_from_view(C, loc);
- ED_view3d_cursor3d_position(C, loc, event->x, event->y);
+ ED_view3d_cursor3d_position(C, loc, event->mval);
RNA_float_set_array(op->ptr, "location", loc);
}
}
@@ -835,9 +835,9 @@ static int group_instance_add_exec(bContext *C, wmOperator *op)
id_lib_extern(&group->id);
/* works without this except if you try render right after, see: 22027 */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
- WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
return OPERATOR_FINISHED;
}
@@ -993,13 +993,12 @@ static int object_delete_exec(bContext *C, wmOperator *op)
if (scene->id.flag & LIB_DOIT) {
scene->id.flag &= ~LIB_DOIT;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
}
}
- DAG_ids_flush_update(bmain, 0);
return OPERATOR_FINISHED;
}
@@ -1260,8 +1259,7 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SCENE, scene);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
@@ -1325,7 +1323,7 @@ static Base *duplibase_for_convert(Scene *scene, Base *base, Object *ob)
}
obn = BKE_object_copy(ob);
- obn->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
basen = MEM_mallocN(sizeof(Base), "duplibase");
*basen = *base;
@@ -1427,7 +1425,7 @@ static int convert_exec(bContext *C, wmOperator *op)
}
else {
newob = ob;
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
}
/* make new mesh data from the original copy */
@@ -1492,7 +1490,7 @@ static int convert_exec(bContext *C, wmOperator *op)
for (ob1 = bmain->object.first; ob1; ob1 = ob1->id.next) {
if (ob1->data == ob->data) {
ob1->type = OB_CURVE;
- ob1->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob1->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
}
}
}
@@ -1623,7 +1621,7 @@ static int convert_exec(bContext *C, wmOperator *op)
}
/* delete object should renew depsgraph */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
}
// XXX ED_object_enter_editmode(C, 0);
@@ -1639,7 +1637,7 @@ static int convert_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_OBJECT | ND_DATA, BASACT->object);
}
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, scene);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
@@ -1691,7 +1689,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
else {
obn = BKE_object_copy(ob);
- obn->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
basen = MEM_mallocN(sizeof(Base), "duplibase");
*basen = *base;
@@ -1816,7 +1814,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_ARMATURE:
- obn->recalc |= OB_RECALC_DATA;
+ DAG_id_tag_update(&obn->id, OB_RECALC_DATA);
if (obn->pose)
obn->pose->flag |= POSE_RECALC;
if (dupflag & USER_DUP_ARM) {
@@ -1906,7 +1904,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
/* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */
/* leaves selection of base/object unaltered.
* note: don't call this within a loop since clear_* funcs loop over the entire database.
- * note: caller must do DAG_scene_sort(bmain, scene);
+ * note: caller must do DAG_relations_tag_update(bmain);
* this is not done automatic since we may duplicate many objects in a batch */
Base *ED_object_add_duplicate(Main *bmain, Scene *scene, Base *base, int dupflag)
{
@@ -1927,7 +1925,7 @@ Base *ED_object_add_duplicate(Main *bmain, Scene *scene, Base *base, int dupflag
BKE_object_relink(ob);
set_sca_new_poins_ob(ob);
- /* DAG_scene_sort(bmain, scene); */ /* caller must do */
+ /* DAG_relations_tag_update(bmain); */ /* caller must do */
if (ob->data) {
ED_render_id_flush_update(bmain, ob->data);
@@ -1971,8 +1969,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
copy_object_set_idnew(C, dupflag);
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
@@ -2040,15 +2037,14 @@ static int add_named_exec(bContext *C, wmOperator *op)
if (event) {
ED_object_location_from_view(C, basen->object->loc);
- ED_view3d_cursor3d_position(C, basen->object->loc, event->x, event->y);
+ ED_view3d_cursor3d_position(C, basen->object->loc, event->mval);
}
ED_base_object_activate(C, basen);
copy_object_set_idnew(C, dupflag);
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
MEM_freeN(base);
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 322ba99593e..a680230fb32 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -257,11 +257,18 @@ static DerivedMesh *multiresbake_create_hiresdm(Scene *scene, Object *ob, int *l
return dm;
}
-static void clear_images(MTFace *mtface, int totface)
+typedef enum ClearFlag {
+ CLEAR_NORMAL = 1
+} ClearFlag;
+
+
+static void clear_images(MTFace *mtface, int totface, ClearFlag flag)
{
int a;
const float vec_alpha[4] = {0.0f, 0.0f, 0.0f, 0.0f};
const float vec_solid[4] = {0.0f, 0.0f, 0.0f, 1.0f};
+ const float nor_alpha[4] = {0.5f, 0.5f, 1.0f, 0.0f};
+ const float nor_solid[4] = {0.5f, 0.5f, 1.0f, 1.0f};
for (a = 0; a < totface; a++)
mtface[a].tpage->id.flag &= ~LIB_DOIT;
@@ -272,7 +279,11 @@ static void clear_images(MTFace *mtface, int totface)
if ((ima->id.flag & LIB_DOIT) == 0) {
ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
- IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
+ if (flag == CLEAR_NORMAL)
+ IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? nor_alpha : nor_solid);
+ else
+ IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
+
ima->id.flag |= LIB_DOIT;
BKE_image_release_ibuf(ima, ibuf, NULL);
@@ -300,7 +311,10 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op)
ob = base->object;
me = (Mesh *)ob->data;
- clear_images(me->mtface, me->totface);
+ if (scene->r.bake_mode == RE_BAKE_NORMALS && scene->r.bake_normal_space == R_BAKE_SPACE_TANGENT)
+ clear_images(me->mtface, me->totface, CLEAR_NORMAL);
+ else
+ clear_images(me->mtface, me->totface, 0);
}
CTX_DATA_END;
}
@@ -395,7 +409,10 @@ static void multiresbake_startjob(void *bkv, short *stop, short *do_update, floa
DerivedMesh *dm = data->lores_dm;
MTFace *mtface = CustomData_get_layer(&dm->faceData, CD_MTFACE);
- clear_images(mtface, dm->getNumTessFaces(dm));
+ if (bkj->mode == RE_BAKE_NORMALS)
+ clear_images(mtface, dm->getNumTessFaces(dm), CLEAR_NORMAL);
+ else
+ clear_images(mtface, dm->getNumTessFaces(dm), 0);
}
}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 7746329c17f..84b989e2f59 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1146,12 +1146,12 @@ void ED_object_constraint_update(Object *ob)
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
-void ED_object_constraint_dependency_update(Main *bmain, Scene *scene, Object *ob)
+void ED_object_constraint_dependency_update(Main *bmain, Object *ob)
{
ED_object_constraint_update(ob);
if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
}
static int constraint_poll(bContext *C)
@@ -1310,7 +1310,6 @@ void CONSTRAINT_OT_move_up(wmOperatorType *ot)
static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
/* free constraints for all selected bones */
@@ -1322,7 +1321,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op))
CTX_DATA_END;
/* force depsgraph to get recalculated since relationships removed */
- DAG_scene_sort(bmain, scene); /* sort order of objects */
+ DAG_relations_tag_update(bmain);
/* note, calling BIK_clear_data() isn't needed here */
@@ -1349,7 +1348,6 @@ void POSE_OT_constraints_clear(wmOperatorType *ot)
static int object_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
/* do freeing */
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
@@ -1360,7 +1358,7 @@ static int object_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op))
CTX_DATA_END;
/* force depsgraph to get recalculated since relationships removed */
- DAG_scene_sort(bmain, scene); /* sort order of objects */
+ DAG_relations_tag_update(bmain);
/* do updates */
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, NULL);
@@ -1385,7 +1383,6 @@ void OBJECT_OT_constraints_clear(wmOperatorType *ot)
static int pose_constraint_copy_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
bPoseChannel *pchan = CTX_data_active_pose_bone(C);
/* don't do anything if bone doesn't exist or doesn't have any constraints */
@@ -1407,7 +1404,7 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
/* force depsgraph to get recalculated since new relationships added */
- DAG_scene_sort(bmain, scene); /* sort order of objects/bones */
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, NULL);
@@ -1432,7 +1429,6 @@ void POSE_OT_constraints_copy(wmOperatorType *ot)
static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
Object *obact = ED_object_active_context(C);
/* copy all constraints from active object to all selected objects */
@@ -1447,7 +1443,7 @@ static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op))
CTX_DATA_END;
/* force depsgraph to get recalculated since new relationships added */
- DAG_scene_sort(bmain, scene); /* sort order of objects */
+ DAG_relations_tag_update(bmain);
/* notifiers for updates */
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_ADDED, NULL);
@@ -1615,7 +1611,6 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o
static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase *list, int type, short setTarget)
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
bPoseChannel *pchan;
bConstraint *con;
@@ -1709,7 +1704,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
/* force depsgraph to get recalculated since new relationships added */
- DAG_scene_sort(bmain, scene); /* sort order of objects */
+ DAG_relations_tag_update(bmain);
if ((ob->type == OB_ARMATURE) && (pchan)) {
ob->pose->flag |= POSE_RECALC; /* sort pose channels */
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 4807e7364ea..b94c9e940dc 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -150,7 +150,7 @@ static int object_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op))
}
if (changed) {
DAG_id_type_tag(bmain, ID_OB);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
@@ -207,7 +207,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op)
if (changed) {
DAG_id_type_tag(bmain, ID_OB);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C));
@@ -771,7 +771,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
Base *base;
Curve *cu, *cu1;
Nurb *nu;
- int do_scene_sort = FALSE;
+ bool do_depgraph_update = false;
if (scene->id.lib) return;
@@ -798,7 +798,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
for (base = FIRSTBASE; base; base = base->next) {
if (base != BASACT) {
if (TESTBASELIB(v3d, base)) {
- base->object->recalc |= OB_RECALC_OB;
+ DAG_id_tag_update(&base->object->id, OB_RECALC_DATA);
if (event == 1) { /* loc */
copy_v3_v3(base->object->loc, ob->loc);
@@ -897,7 +897,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
BLI_strncpy(cu1->family, cu->family, sizeof(cu1->family));
- base->object->recalc |= OB_RECALC_DATA;
+ DAG_id_tag_update(&base->object->id, OB_RECALC_DATA);
}
}
else if (event == 19) { /* bevel settings */
@@ -913,7 +913,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
cu1->ext1 = cu->ext1;
cu1->ext2 = cu->ext2;
- base->object->recalc |= OB_RECALC_DATA;
+ DAG_id_tag_update(&base->object->id, OB_RECALC_DATA);
}
}
else if (event == 25) { /* curve resolution */
@@ -932,7 +932,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
nu = nu->next;
}
- base->object->recalc |= OB_RECALC_DATA;
+ DAG_id_tag_update(&base->object->id, OB_RECALC_DATA);
}
}
else if (event == 21) {
@@ -948,7 +948,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
}
modifier_copyData(md, tmd);
- base->object->recalc |= OB_RECALC_DATA;
+ DAG_id_tag_update(&base->object->id, OB_RECALC_DATA);
}
}
}
@@ -956,7 +956,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
/* Copy the constraint channels over */
BKE_copy_constraints(&base->object->constraints, &ob->constraints, TRUE);
- do_scene_sort = TRUE;
+ do_depgraph_update = true;
}
else if (event == 23) {
base->object->softflag = ob->softflag;
@@ -1008,10 +1008,8 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
}
}
- if (do_scene_sort)
- DAG_scene_sort(bmain, scene);
-
- DAG_ids_flush_update(bmain, 0);
+ if (do_depgraph_update)
+ DAG_relations_tag_update(bmain);
}
static void UNUSED_FUNCTION(copy_attr_menu) (Main * bmain, Scene * scene, View3D * v3d)
@@ -1151,7 +1149,7 @@ static int object_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *U
/* show popup dialog to allow editing of range... */
/* FIXME: hardcoded dimensions here are just arbitrary */
- return WM_operator_props_dialog_popup(C, op, 200, 200);
+ return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 10 * UI_UNIT_Y);
}
/* Calculate/recalculate whole paths (avs.path_sf to avs.path_ef) */
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 9b683a1ba98..3112bb21091 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -137,7 +137,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_WARNING, "Skipped some groups because of cycle detected");
}
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL);
return OPERATOR_FINISHED;
@@ -197,7 +197,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
if (!ok) BKE_report(op->reports, RPT_ERROR, "Active object contains no groups");
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL);
return OPERATOR_FINISHED;
@@ -229,7 +229,7 @@ static int group_objects_remove_all_exec(bContext *C, wmOperator *UNUSED(op))
}
CTX_DATA_END;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL);
return OPERATOR_FINISHED;
@@ -269,7 +269,7 @@ static int group_objects_remove_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL);
return OPERATOR_FINISHED;
@@ -319,7 +319,7 @@ static int group_create_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 1387ef94091..43736909c40 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -516,7 +516,7 @@ static int add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *ob
mul_serie_m4(hmd->parentinv, ob->imat, obedit->obmat, NULL,
NULL, NULL, NULL, NULL, NULL);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
return TRUE;
}
@@ -558,7 +558,7 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
}
}
-void OBJECT_OT_hook_add_selobj(wmOperatorType *ot)
+void OBJECT_OT_hook_add_selob(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Hook to Selected Object";
@@ -592,7 +592,7 @@ static int object_add_hook_newob_exec(bContext *C, wmOperator *op)
}
}
-void OBJECT_OT_hook_add_newobj(wmOperatorType *ot)
+void OBJECT_OT_hook_add_newob(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Hook to New Object";
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 0be9c92897e..4523ac098d6 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -127,8 +127,8 @@ void OBJECT_OT_join_shapes(struct wmOperatorType *ot);
void OBJECT_OT_convert(struct wmOperatorType *ot);
/* object_hook.c */
-void OBJECT_OT_hook_add_selobj(struct wmOperatorType *ot);
-void OBJECT_OT_hook_add_newobj(struct wmOperatorType *ot);
+void OBJECT_OT_hook_add_selob(struct wmOperatorType *ot);
+void OBJECT_OT_hook_add_newob(struct wmOperatorType *ot);
void OBJECT_OT_hook_remove(struct wmOperatorType *ot);
void OBJECT_OT_hook_select(struct wmOperatorType *ot);
void OBJECT_OT_hook_assign(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 00082b03781..8d29813e2ac 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -151,10 +151,10 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
ob->pd = object_add_collision_fields(0);
ob->pd->deflect = 1;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
}
else if (type == eModifierType_Surface)
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
else if (type == eModifierType_Multires) {
/* set totlvl from existing MDISPS layer if object already had it */
multiresModifier_set_levels_from_disps((MultiresModifierData *)new_md, ob);
@@ -330,7 +330,7 @@ static int object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
return 1;
}
-int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Object *ob, ModifierData *md)
+int ED_object_modifier_remove(ReportList *reports, Main *bmain, Object *ob, ModifierData *md)
{
int sort_depsgraph = 0;
int ok;
@@ -343,15 +343,12 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob
}
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-
- /* sorting has to be done after the update so that dynamic systems can react properly */
- if (sort_depsgraph)
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
return 1;
}
-void ED_object_modifier_clear(Main *bmain, Scene *scene, Object *ob)
+void ED_object_modifier_clear(Main *bmain, Object *ob)
{
ModifierData *md = ob->modifiers.first;
int sort_depsgraph = 0;
@@ -370,10 +367,7 @@ void ED_object_modifier_clear(Main *bmain, Scene *scene, Object *ob)
}
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-
- /* sorting has to be done after the update so that dynamic systems can react properly */
- if (sort_depsgraph)
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
}
int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md)
@@ -391,7 +385,7 @@ int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md
}
BLI_remlink(&ob->modifiers, md);
- BLI_insertlink(&ob->modifiers, md->prev->prev, md);
+ BLI_insertlinkbefore(&ob->modifiers, md->prev, md);
}
return 1;
@@ -412,7 +406,7 @@ int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData *
}
BLI_remlink(&ob->modifiers, md);
- BLI_insertlink(&ob->modifiers, md->next, md);
+ BLI_insertlinkafter(&ob->modifiers, md->next, md);
}
return 1;
@@ -522,7 +516,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
}
}
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
return 1;
}
@@ -728,7 +722,7 @@ int ED_object_modifier_copy(ReportList *UNUSED(reports), Object *ob, ModifierDat
nmd = modifier_new(md->type);
modifier_copyData(md, nmd);
- BLI_insertlink(&ob->modifiers, md, nmd);
+ BLI_insertlinkafter(&ob->modifiers, md, nmd);
modifier_unique_name(&ob->modifiers, nmd);
return 1;
@@ -884,7 +878,7 @@ static int modifier_remove_exec(bContext *C, wmOperator *op)
ModifierData *md = edit_modifier_property_get(op, ob, 0);
int mode_orig = ob ? ob->mode : 0;
- if (!ob || !md || !ED_object_modifier_remove(op->reports, bmain, scene, ob, md))
+ if (!ob || !md || !ED_object_modifier_remove(op->reports, bmain, ob, md))
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
@@ -1831,7 +1825,7 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op)
arm_md->object = arm_ob;
arm_md->deformflag = ARM_DEF_VGROUP | ARM_DEF_QUATERNION;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index d26ea89bd1e..bf408d6dbe4 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -217,8 +217,8 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_group_link);
WM_operatortype_append(OBJECT_OT_group_remove);
- WM_operatortype_append(OBJECT_OT_hook_add_selobj);
- WM_operatortype_append(OBJECT_OT_hook_add_newobj);
+ WM_operatortype_append(OBJECT_OT_hook_add_selob);
+ WM_operatortype_append(OBJECT_OT_hook_add_newob);
WM_operatortype_append(OBJECT_OT_hook_remove);
WM_operatortype_append(OBJECT_OT_hook_select);
WM_operatortype_append(OBJECT_OT_hook_assign);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 629dba465bc..c5e8310e9fb 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -223,7 +223,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
{
if (ob != obedit) {
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
par = obedit->parent;
while (par) {
@@ -260,7 +260,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT, NULL);
@@ -364,7 +364,7 @@ static int make_proxy_exec(bContext *C, wmOperator *op)
BKE_object_make_proxy(newob, ob, gob);
/* depsgraph flushes are needed for the new data */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
DAG_id_tag_update(&newob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, newob);
}
@@ -512,14 +512,13 @@ void ED_object_parent_clear(Object *ob, int type)
break;
}
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
}
/* note, poll should check for editable scene */
static int parent_clear_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
int type = RNA_enum_get(op->ptr, "type");
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
@@ -528,8 +527,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL);
return OPERATOR_FINISHED;
@@ -597,7 +595,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
bPoseChannel *pchan = NULL;
int pararm = ELEM4(partype, PAR_ARMATURE, PAR_ARMATURE_NAME, PAR_ARMATURE_ENVELOPE, PAR_ARMATURE_AUTO);
- par->recalc |= OB_RECALC_OB;
+ DAG_id_tag_update(&par->id, OB_RECALC_OB);
/* preconditions */
if (partype == PAR_FOLLOW || partype == PAR_PATH_CONST) {
@@ -762,7 +760,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
invert_m4_m4(ob->parentinv, workob.obmat);
}
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA);
}
}
@@ -791,8 +789,7 @@ static int parent_set_exec(bContext *C, wmOperator *op)
if (!ok)
return OPERATOR_CANCELLED;
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL);
@@ -903,7 +900,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *par = ED_object_active_context(C);
- par->recalc |= OB_RECALC_OB;
+ DAG_id_tag_update(&par->id, OB_RECALC_OB);
/* context iterator */
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
@@ -918,7 +915,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op)
memset(ob->loc, 0, 3 * sizeof(float));
/* set recalc flags */
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA);
/* set parenting type for object - object only... */
ob->parent = par;
@@ -928,8 +925,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_scene_sort(bmain, CTX_data_scene(C));
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
@@ -955,7 +951,6 @@ void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot)
static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
@@ -965,13 +960,12 @@ static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op))
ob->partype -= PARSLOW;
BKE_object_where_is_calc(scene, ob);
ob->partype |= PARSLOW;
- ob->recalc |= OB_RECALC_OB;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
}
}
CTX_DATA_END;
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SCENE, scene);
return OPERATOR_FINISHED;
@@ -998,7 +992,6 @@ void OBJECT_OT_slow_parent_clear(wmOperatorType *ot)
static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
@@ -1006,12 +999,11 @@ static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op))
if (ob->parent)
ob->partype |= PARSLOW;
- ob->recalc |= OB_RECALC_OB;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
CTX_DATA_END;
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SCENE, scene);
return OPERATOR_FINISHED;
@@ -1046,7 +1038,6 @@ static EnumPropertyItem prop_clear_track_types[] = {
static int object_track_clear_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
int type = RNA_enum_get(op->ptr, "type");
if (CTX_data_edit_object(C)) {
@@ -1059,7 +1050,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
/* remove track-object for old track */
ob->track = NULL;
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
/* also remove all tracking constraints */
for (con = ob->constraints.last; con; con = pcon) {
@@ -1073,8 +1064,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_ids_flush_update(bmain, 0);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
@@ -1111,7 +1101,6 @@ static EnumPropertyItem prop_make_track_types[] = {
static int track_set_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
Object *obact = ED_object_active_context(C);
int type = RNA_enum_get(op->ptr, "type");
@@ -1127,7 +1116,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
data = con->data;
data->tar = obact;
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
/* Lamp, Camera and Speaker track differently by default */
if (ob->type == OB_LAMP || ob->type == OB_CAMERA || ob->type == OB_SPEAKER)
@@ -1147,7 +1136,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
data = con->data;
data->tar = obact;
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
/* Lamp, Camera and Speaker track differently by default */
if (ob->type == OB_LAMP || ob->type == OB_CAMERA || ob->type == OB_SPEAKER) {
@@ -1169,7 +1158,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
data = con->data;
data->tar = obact;
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
/* Lamp, Camera and Speaker track differently by default */
if (ob->type == OB_LAMP || ob->type == OB_CAMERA || ob->type == OB_SPEAKER) {
@@ -1181,8 +1170,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
}
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
@@ -1297,7 +1285,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, scene);
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
return OPERATOR_FINISHED;
}
@@ -1360,7 +1348,6 @@ Base *ED_object_scene_link(Scene *scene, Object *ob)
static int make_links_scene_exec(bContext *C, wmOperator *op)
{
- Main *bmain = CTX_data_main(C);
Scene *scene_to = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));
if (scene_to == NULL) {
@@ -1384,8 +1371,6 @@ static int make_links_scene_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- DAG_ids_flush_update(bmain, 0);
-
/* redraw the 3D view because the object center points are colored differently */
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL);
@@ -1476,7 +1461,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
/* if amount of material indices changed: */
test_object_materials(ob_dst->data);
- ob_dst->recalc |= OB_RECALC_DATA;
+ DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA);
break;
case MAKE_LINKS_MATERIALS:
/* new approach, using functions from kernel */
@@ -1515,7 +1500,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
break;
case MAKE_LINKS_MODIFIERS:
BKE_object_link_modifiers(ob_dst, ob_src);
- ob_dst->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
break;
case MAKE_LINKS_FONTS:
{
@@ -1535,7 +1520,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
cu_dst->vfontbi = cu_src->vfontbi;
id_us_plus((ID *)cu_dst->vfontbi);
- ob_dst->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
break;
}
}
@@ -1554,10 +1539,9 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
}
}
- DAG_scene_sort(bmain, scene);
-
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
+
return OPERATOR_FINISHED;
}
@@ -1706,7 +1690,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
id = ob->data;
if (id && id->us > 1 && id->lib == NULL) {
- ob->recalc = OB_RECALC_DATA;
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
BKE_copy_animdata_id_action(id);
@@ -1742,7 +1726,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
ob->data = BKE_lattice_copy(ob->data);
break;
case OB_ARMATURE:
- ob->recalc |= OB_RECALC_DATA;
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
ob->data = BKE_armature_copy(ob->data);
BKE_pose_rebuild(ob, ob->data);
break;
@@ -1778,7 +1762,7 @@ static void single_object_action_users(Scene *scene, int flag)
for (base = FIRSTBASE; base; base = base->next) {
ob = base->object;
if (ob->id.lib == NULL && (flag == 0 || (base->flag & SELECT)) ) {
- ob->recalc = OB_RECALC_DATA;
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
BKE_copy_animdata_id_action(&ob->id);
}
}
@@ -2148,7 +2132,6 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot)
static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- Main *bmain = CTX_data_main(C);
Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
Material *ma;
char name[MAX_ID_NAME - 2];
@@ -2160,7 +2143,6 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *even
assign_material(base->object, ma, 1, BKE_MAT_ASSIGN_USERPREF);
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma);
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 07eca749a74..775a2897513 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -527,6 +527,7 @@ static EnumPropertyItem prop_select_grouped_types[] = {
{11, "PROPERTIES", 0, "Properties", "Game Properties"},
{12, "KEYINGSET", 0, "Keying Set", "Objects included in active Keying Set"},
{13, "LAMP_TYPE", 0, "Lamp Type", "Matching lamp types"},
+ {14, "PASS_INDEX", 0, "Pass Index", "Matching object pass index"},
{0, NULL, 0, NULL, NULL}
};
@@ -677,6 +678,20 @@ static short select_similar_lamps(bContext *C, Object *ob)
CTX_DATA_END;
return changed;
}
+static short select_similar_pass_index(bContext *C, Object *ob)
+{
+ char changed = 0;
+
+ CTX_DATA_BEGIN (C, Base *, base, selectable_bases)
+ {
+ if ((base->object->index == ob->index) && !(base->flag & SELECT)) {
+ ED_base_object_select(base, BA_SELECT);
+ changed = 1;
+ }
+ }
+ CTX_DATA_END;
+ return changed;
+}
static short select_grouped_type(bContext *C, Object *ob)
{
short changed = 0;
@@ -842,7 +857,8 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
else if (nr == 11) changed |= select_grouped_gameprops(C, ob);
else if (nr == 12) changed |= select_grouped_keyingset(C, ob);
else if (nr == 13) changed |= select_similar_lamps(C, ob);
-
+ else if (nr == 14) changed |= select_similar_pass_index(C, ob);
+
if (changed) {
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C));
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 9dd34623739..01dcac2d1b4 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -213,7 +213,6 @@ static void object_clear_scale(Object *ob)
static int object_clear_transform_generic_exec(bContext *C, wmOperator *op,
void (*clear_func)(Object *), const char default_ksName[])
{
- Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
KeyingSet *ks;
@@ -244,8 +243,6 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op,
CTX_DATA_END;
/* this is needed so children are also updated */
- DAG_ids_flush_update(bmain, 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
@@ -318,7 +315,6 @@ void OBJECT_OT_scale_clear(wmOperatorType *ot)
static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain = CTX_data_main(C);
float *v1, *v3;
float mat[3][3];
@@ -338,8 +334,6 @@ static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op))
}
CTX_DATA_END;
- DAG_ids_flush_update(bmain, 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
@@ -424,7 +418,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
cu = ob->data;
- if (!(cu->flag & CU_3D) && (apply_rot || apply_loc)) {
+ if (((ob->type == OB_CURVE) && !(cu->flag & CU_3D)) && (apply_rot || apply_loc)) {
BKE_report(reports, RPT_ERROR,
"Neither rotation nor location could be applied to a 2D curve, doing nothing");
change = 0;
@@ -991,7 +985,6 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
DAG_id_tag_update(&tob->id, OB_RECALC_OB | OB_RECALC_DATA);
if (tot_change) {
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
}
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index ecc7ea4ae00..48316cfccb7 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -172,8 +172,8 @@ static int type_toggle_exec(bContext *C, wmOperator *op)
/* update dependency */
DAG_id_tag_update(&cObject->id, OB_RECALC_DATA);
+ DAG_relations_tag_update(CTX_data_main(C));
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, cObject);
- DAG_scene_sort(CTX_data_main(C), scene);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c
index dc309ec3c31..8a5f623c533 100644
--- a/source/blender/editors/physics/particle_boids.c
+++ b/source/blender/editors/physics/particle_boids.c
@@ -100,7 +100,6 @@ void BOID_OT_rule_add(wmOperatorType *ot)
static int rule_del_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings);
ParticleSettings *part = ptr.data;
BoidRule *rule;
@@ -123,7 +122,7 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op))
if (rule)
rule->flag |= BOIDRULE_CURRENT;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
return OPERATOR_FINISHED;
@@ -158,7 +157,7 @@ static int rule_move_up_exec(bContext *C, wmOperator *UNUSED(op))
for (rule = state->rules.first; rule; rule=rule->next) {
if (rule->flag & BOIDRULE_CURRENT && rule->prev) {
BLI_remlink(&state->rules, rule);
- BLI_insertlink(&state->rules, rule->prev->prev, rule);
+ BLI_insertlinkbefore(&state->rules, rule->prev, rule);
DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
break;
@@ -194,7 +193,7 @@ static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op))
for (rule = state->rules.first; rule; rule=rule->next) {
if (rule->flag & BOIDRULE_CURRENT && rule->next) {
BLI_remlink(&state->rules, rule);
- BLI_insertlink(&state->rules, rule->next, rule);
+ BLI_insertlinkafter(&state->rules, rule->next, rule);
DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
break;
@@ -254,7 +253,6 @@ void BOID_OT_state_add(wmOperatorType *ot)
static int state_del_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings);
ParticleSettings *part = ptr.data;
BoidState *state;
@@ -280,7 +278,7 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op))
state->flag |= BOIDSTATE_CURRENT;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
return OPERATOR_FINISHED;
@@ -316,7 +314,7 @@ static int state_move_up_exec(bContext *C, wmOperator *UNUSED(op))
for (state = boids->states.first; state; state=state->next) {
if (state->flag & BOIDSTATE_CURRENT && state->prev) {
BLI_remlink(&boids->states, state);
- BLI_insertlink(&boids->states, state->prev->prev, state);
+ BLI_insertlinkbefore(&boids->states, state->prev, state);
break;
}
}
@@ -351,7 +349,7 @@ static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op))
for (state = boids->states.first; state; state=state->next) {
if (state->flag & BOIDSTATE_CURRENT && state->next) {
BLI_remlink(&boids->states, state);
- BLI_insertlink(&boids->states, state->next, state);
+ BLI_insertlinkafter(&boids->states, state->next, state);
DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
break;
}
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 23069ab8a08..5fd2a0806e9 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -151,7 +151,6 @@ static int psys_poll(bContext *C)
static int new_particle_settings_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene = CTX_data_scene(C);
Main *bmain= CTX_data_main(C);
ParticleSystem *psys;
ParticleSettings *part = NULL;
@@ -177,7 +176,7 @@ static int new_particle_settings_exec(bContext *C, wmOperator *UNUSED(op))
psys_check_boid_data(psys);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
@@ -205,7 +204,6 @@ void PARTICLE_OT_new(wmOperatorType *ot)
static int new_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= ptr.data;
Object *ob = ptr.id.data;
@@ -226,7 +224,7 @@ static int new_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
BLI_addtail(&psys->targets, pt);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
@@ -251,7 +249,6 @@ void PARTICLE_OT_new_target(wmOperatorType *ot)
static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= ptr.data;
Object *ob = ptr.id.data;
@@ -275,7 +272,7 @@ static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
if (pt)
pt->flag |= PTARGET_CURRENT;
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
@@ -313,7 +310,7 @@ static int target_move_up_exec(bContext *C, wmOperator *UNUSED(op))
for (; pt; pt=pt->next) {
if (pt->flag & PTARGET_CURRENT && pt->prev) {
BLI_remlink(&psys->targets, pt);
- BLI_insertlink(&psys->targets, pt->prev->prev, pt);
+ BLI_insertlinkbefore(&psys->targets, pt->prev, pt);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
@@ -351,7 +348,7 @@ static int target_move_down_exec(bContext *C, wmOperator *UNUSED(op))
for (; pt; pt=pt->next) {
if (pt->flag & PTARGET_CURRENT && pt->next) {
BLI_remlink(&psys->targets, pt);
- BLI_insertlink(&psys->targets, pt->next, pt);
+ BLI_insertlinkafter(&psys->targets, pt->next, pt);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
@@ -390,7 +387,7 @@ static int dupliob_move_up_exec(bContext *C, wmOperator *UNUSED(op))
for (dw=part->dupliweights.first; dw; dw=dw->next) {
if (dw->flag & PART_DUPLIW_CURRENT && dw->prev) {
BLI_remlink(&part->dupliweights, dw);
- BLI_insertlink(&part->dupliweights, dw->prev->prev, dw);
+ BLI_insertlinkbefore(&part->dupliweights, dw->prev, dw);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, NULL);
break;
@@ -512,7 +509,7 @@ static int dupliob_move_down_exec(bContext *C, wmOperator *UNUSED(op))
for (dw=part->dupliweights.first; dw; dw=dw->next) {
if (dw->flag & PART_DUPLIW_CURRENT && dw->next) {
BLI_remlink(&part->dupliweights, dw);
- BLI_insertlink(&part->dupliweights, dw->next, dw);
+ BLI_insertlinkafter(&part->dupliweights, dw->next, dw);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, NULL);
break;
diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c
index a72a409f277..b3f92d3de46 100644
--- a/source/blender/editors/physics/rigidbody_constraint.c
+++ b/source/blender/editors/physics/rigidbody_constraint.c
@@ -96,6 +96,8 @@ void ED_rigidbody_con_add(wmOperator *op, Scene *scene, Object *ob, int type)
/* add constraint to rigid body constraint group */
add_to_group(rbw->constraints, ob, scene, NULL);
+
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
void ED_rigidbody_con_remove(Scene *scene, Object *ob)
@@ -130,8 +132,6 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op)
ED_rigidbody_con_add(op, scene, ob, type);
/* send updates */
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
/* done */
@@ -177,8 +177,6 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op)
}
/* send updates */
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
/* done */
diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c
index 2bf962f4f4a..6bcdf6e07aa 100644
--- a/source/blender/editors/physics/rigidbody_object.c
+++ b/source/blender/editors/physics/rigidbody_object.c
@@ -151,8 +151,6 @@ static int rigidbody_ob_add_exec(bContext *C, wmOperator *op)
ED_rigidbody_ob_add(op, scene, ob, type);
/* send updates */
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
/* done */
@@ -197,8 +195,6 @@ static int rigidbody_ob_remove_exec(bContext *C, wmOperator *op)
ED_rigidbody_ob_remove(scene, ob);
/* send updates */
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
/* done */
@@ -242,8 +238,6 @@ static int rigidbody_obs_add_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
/* send updates */
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
@@ -289,8 +283,6 @@ static int rigidbody_obs_remove_exec(bContext *C, wmOperator *UNUSED(op))
CTX_DATA_END;
/* send updates */
- DAG_ids_flush_update(CTX_data_main(C), 0);
-
WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL);
/* done */
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 7ba6a92e4be..ea18f2c8fbb 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -264,7 +264,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
/* sequencer has got tricker ocnversion happened above */
IMB_buffer_float_from_float(rr->rectf, rr->rectf,
- 4, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, FALSE,
+ 4, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, TRUE,
oglrender->sizex, oglrender->sizey, oglrender->sizex, oglrender->sizex);
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 8afe07b4689..46f726e45c6 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -446,7 +446,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
glClear(GL_COLOR_BUFFER_BIT);
UI_ThemeColor(TH_TEXT);
- BLF_draw_default(20, 8, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX);
+ BLF_draw_default(UI_UNIT_X, 0.4f * UI_UNIT_Y, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX);
}
else if (at->draw) {
at->draw(C, ar);
@@ -1965,11 +1965,13 @@ void ED_region_visible_rect(ARegion *ar, rcti *rect)
for (; arn; arn = arn->next) {
if (ar != arn && arn->overlap) {
if (BLI_rcti_isect(rect, &arn->winrct, NULL)) {
- /* overlap left */
- if (rect->xmin == arn->winrct.xmin)
+
+ /* overlap left, also check 1 pixel offset (2 regions on one side) */
+ if ( ABS(rect->xmin - arn->winrct.xmin) < 2)
rect->xmin = arn->winrct.xmax;
+
/* overlap right */
- if (rect->xmax == arn->winrct.xmax)
+ if ( ABS(rect->xmax - arn->winrct.xmax) < 2)
rect->xmax = arn->winrct.xmin;
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 1f8c06f6bf7..edeb66d9281 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -5035,7 +5035,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps)
ps->is_texbrush = false;
}
- /* sizeof ProjPixel, since we alloc this a _lot_ */
+ /* sizeof(ProjPixel), since we alloc this a _lot_ */
ps->pixel_sizeof = project_paint_pixel_sizeof(ps->tool);
BLI_assert(ps->pixel_sizeof >= sizeof(ProjPixel));
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 10f4dc2aebc..342671698d2 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -441,7 +441,12 @@ static void paint_mesh_restore_co(Sculpt *sd, Object *ob)
SculptUndoType type = (brush->sculpt_tool == SCULPT_TOOL_MASK ?
SCULPT_UNDO_MASK : SCULPT_UNDO_COORDS);
- unode = sculpt_undo_push_node(ob, nodes[n], type);
+ if (ss->bm) {
+ unode = sculpt_undo_push_node(ob, nodes[n], type);
+ }
+ else {
+ unode = sculpt_undo_get_node(nodes[n]);
+ }
if (unode) {
PBVHVertexIter vd;
SculptOrigVertData orig_data;
@@ -878,7 +883,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
/* Return a multiplier for brush strength on a particular vertex. */
static float tex_strength(SculptSession *ss, Brush *br,
- const float point[3],
+ const float point[3],
const float len,
const float sculpt_normal[3],
const short vno[3],
@@ -1406,8 +1411,8 @@ static float bmesh_neighbor_average_mask(BMesh *bm, BMVert *v)
for (i = 0; i < 3; i++) {
BMVert *v2 = adj_v[i];
float *vmask = CustomData_bmesh_get(&bm->vdata,
- v2->head.data,
- CD_PAINT_MASK);
+ v2->head.data,
+ CD_PAINT_MASK);
avg += (*vmask);
total++;
}
@@ -1418,8 +1423,8 @@ static float bmesh_neighbor_average_mask(BMesh *bm, BMVert *v)
}
else {
float *vmask = CustomData_bmesh_get(&bm->vdata,
- v->head.data,
- CD_PAINT_MASK);
+ v->head.data,
+ CD_PAINT_MASK);
return (*vmask);
}
}
@@ -1933,11 +1938,11 @@ static void do_grab_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
if (sculpt_brush_test(&test, orig_data.co)) {
const float fade = bstrength * tex_strength(ss, brush,
- orig_data.co,
- test.dist,
+ orig_data.co,
+ test.dist,
ss->cache->sculpt_normal_symm,
- orig_data.no,
- NULL, vd.mask ? *vd.mask : 0.0f);
+ orig_data.no,
+ NULL, vd.mask ? *vd.mask : 0.0f);
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
@@ -2072,11 +2077,11 @@ static void do_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
if (sculpt_brush_test(&test, orig_data.co)) {
const float fade = bstrength * tex_strength(ss, brush,
- orig_data.co,
- test.dist,
+ orig_data.co,
+ test.dist,
ss->cache->sculpt_normal_symm,
orig_data.no,
- NULL, vd.mask ? *vd.mask : 0.0f);
+ NULL, vd.mask ? *vd.mask : 0.0f);
mul_v3_v3fl(proxy[vd.i], cono, fade);
@@ -2130,7 +2135,7 @@ static void do_rotate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
test.dist,
ss->cache->sculpt_normal_symm,
orig_data.no,
- NULL, vd.mask ? *vd.mask : 0.0f);
+ NULL, vd.mask ? *vd.mask : 0.0f);
mul_v3_m4v3(proxy[vd.i], m, orig_data.co);
sub_v3_v3(proxy[vd.i], orig_data.co);
@@ -3000,7 +3005,7 @@ static void sculpt_topology_update(Sculpt *sd, Object *ob, Brush *brush)
if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) {
BKE_pbvh_bmesh_update_topology(ss->pbvh, mode,
- ss->cache->location,
+ ss->cache->location,
ss->cache->radius);
}
@@ -3153,7 +3158,7 @@ static void sculpt_combine_proxies(Sculpt *sd, Object *ob)
PBVHVertexIter vd;
PBVHProxyNode *proxies;
int proxy_count;
- float (*orco)[3];
+ float (*orco)[3] = NULL;
if (use_orco && !ss->bm)
orco = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS)->co;
@@ -3308,7 +3313,7 @@ static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm,
typedef void (*BrushActionFunc)(Sculpt *sd, Object *ob, Brush *brush);
static void do_radial_symmetry(Sculpt *sd, Object *ob, Brush *brush,
- BrushActionFunc action,
+ BrushActionFunc action,
const char symm, const int axis,
const float feather)
{
@@ -4072,7 +4077,7 @@ static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin)
}
if (BKE_pbvh_node_raycast(srd->ss->pbvh, node, origco, use_origco,
- srd->ray_start, srd->ray_normal, &srd->dist))
+ srd->ray_start, srd->ray_normal, &srd->dist))
{
srd->hit = 1;
*tmin = srd->dist;
@@ -4660,24 +4665,25 @@ static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(o
}
static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op,
- wmEvent *UNUSED(event))
+ wmEvent *UNUSED(event))
{
Object *ob = CTX_data_active_object(C);
Mesh *me = ob->data;
SculptSession *ss = ob->sculpt;
const char *msg = "Dynamic-topology sculpting will not preserve"
- "vertex colors, UVs, or other customdata";
+ "vertex colors, UVs, or other customdata";
if (!ss->bm) {
int i;
for (i = 0; i < CD_NUMTYPES; i++) {
if (!ELEM7(i, CD_MVERT, CD_MEDGE, CD_MFACE,
- CD_MLOOP, CD_MPOLY, CD_PAINT_MASK,
- CD_ORIGINDEX) &&
- (CustomData_has_layer(&me->vdata, i) ||
- CustomData_has_layer(&me->edata, i) ||
- CustomData_has_layer(&me->fdata, i))) {
+ CD_MLOOP, CD_MPOLY, CD_PAINT_MASK,
+ CD_ORIGINDEX) &&
+ (CustomData_has_layer(&me->vdata, i) ||
+ CustomData_has_layer(&me->edata, i) ||
+ CustomData_has_layer(&me->fdata, i)))
+ {
/* The mesh has customdata that will be lost, let the
* user confirm this is OK */
return WM_operator_confirm_message(C, op, msg);
@@ -4758,8 +4764,8 @@ static int sculpt_symmetrize_exec(bContext *C, wmOperator *UNUSED(op))
/* Symmetrize and re-triangulate */
BMO_op_callf(ss->bm, BMO_FLAG_DEFAULTS,
- "symmetrize input=%avef direction=%i",
- sd->symmetrize_direction);
+ "symmetrize input=%avef direction=%i",
+ sd->symmetrize_direction);
sculpt_dynamic_topology_triangulate(ss->bm);
/* Finish undo */
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 91f069d16de..95d43fd334e 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -36,6 +36,8 @@
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "DNA_armature_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
@@ -1029,7 +1031,8 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
block = uiLayoutGetBlock(row);
uiBlockSetEmboss(block, UI_EMBOSSN);
- but = uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed");
+ but = uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag,
+ 0, 0, 0, 0, IFACE_("Follow context or keep fixed datablock displayed"));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
uiButSetFunc(but, pin_cb, NULL, NULL);
@@ -1069,7 +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, "Context");
+ strcpy(pt->label, N_("Context")); /* XXX C panels are not available through RNA (bpy.types)! */
pt->draw = buttons_panel_context;
pt->flag = PNL_NO_HEADER;
BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/space_clip/CMakeLists.txt b/source/blender/editors/space_clip/CMakeLists.txt
index 75e3d8d5685..e09a8b41262 100644
--- a/source/blender/editors/space_clip/CMakeLists.txt
+++ b/source/blender/editors/space_clip/CMakeLists.txt
@@ -57,4 +57,8 @@ set(SRC
clip_intern.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_clip "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_clip/SConscript b/source/blender/editors/space_clip/SConscript
index 2cbefee0170..c65a076186f 100644
--- a/source/blender/editors/space_clip/SConscript
+++ b/source/blender/editors/space_clip/SConscript
@@ -32,4 +32,7 @@ defs = []
incs = '../include ../../blenkernel ../../blenloader ../../blenfont ../../blenlib ../../imbuf ../../makesdna'
incs += ' ../../makesrna ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../gpu'
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
env.BlenderLib ( 'bf_editors_space_clip', sources, Split(incs), defs, libtype=['core'], priority=[95] )
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c
index 2cb6d8c9234..b2d31ececa5 100644
--- a/source/blender/editors/space_clip/clip_buttons.c
+++ b/source/blender/editors/space_clip/clip_buttons.c
@@ -43,6 +43,8 @@
#include "BLI_listbase.h"
#include "BLI_rect.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_screen.h"
@@ -124,7 +126,7 @@ void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
row = uiLayoutRow(layout, FALSE);
block = uiLayoutGetBlock(row);
- uiDefBut(block, LABEL, 0, "File Path:", 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
row = uiLayoutRow(layout, FALSE);
split = uiLayoutSplit(row, 0.0f, FALSE);
@@ -167,16 +169,16 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
scopesptr = RNA_property_pointer_get(ptr, prop);
scopes = (MovieClipScopes *)scopesptr.data;
- rect.xmin = 0; rect.xmax = 200;
- rect.ymin = 0; rect.ymax = 120;
+ rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X;
+ rect.ymin = 0; rect.ymax = 6.0f * UI_UNIT_Y;
block = uiLayoutAbsoluteBlock(layout);
scopes->track_preview_height =
- (scopes->track_preview_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->track_preview_height;
+ (scopes->track_preview_height <= 20) ? 20 : scopes->track_preview_height;
uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
- scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
+ scopes->track_preview_height * UI_DPI_FAC, scopes, 0, 0, 0, 0, "");
}
/********************* Marker Template ************************/
@@ -387,11 +389,11 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
block = uiLayoutGetBlock(layout);
if (cb->marker_flag & MARKER_DISABLED)
- tip = "Marker is disabled at current frame";
+ tip = TIP_("Marker is disabled at current frame");
else
- tip = "Marker is enabled at current frame";
+ tip = TIP_("Marker is enabled at current frame");
- bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20,
+ bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, UI_UNIT_X, UI_UNIT_Y,
&cb->marker_flag, 0, 0, 1, 0, tip);
uiButSetNFunc(bt, marker_update_cb, cb, NULL);
}
@@ -405,7 +407,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
if (track->flag & TRACK_LOCKED) {
uiLayoutSetActive(layout, FALSE);
block = uiLayoutAbsoluteBlock(layout);
- uiDefBut(block, LABEL, 0, "Track is locked", 0, 0, 300, 19, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, IFACE_("Track is locked"), 0, 0, UI_UNIT_X*15.0f, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
return;
}
@@ -434,12 +436,12 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
uiBlockSetNFunc(block, marker_update_cb, cb, NULL);
if (cb->marker_flag & MARKER_DISABLED)
- tip = "Marker is disabled at current frame";
+ tip = TIP_("Marker is disabled at current frame");
else
- tip = "Marker is enabled at current frame";
+ tip = TIP_("Marker is enabled at current frame");
- uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, "Enabled", 10, 190, 145, 19, &cb->marker_flag,
- 0, 0, 0, 0, tip);
+ uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 10, 190, 145, 19,
+ &cb->marker_flag, 0, 0, 0, 0, tip);
col = uiLayoutColumn(layout, TRUE);
uiLayoutSetActive(col, (cb->marker_flag & MARKER_DISABLED) == 0);
@@ -447,33 +449,34 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
block = uiLayoutAbsoluteBlock(col);
uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, 0, "Position:", 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
- uiDefButF(block, NUM, B_MARKER_POS, "X:", 10, 171, 145, 19, &cb->marker_pos[0],
- -10 * width, 10.0 * width, step, digits, "X-position of marker at frame in screen coordinates");
- uiDefButF(block, NUM, B_MARKER_POS, "Y:", 165, 171, 145, 19, &cb->marker_pos[1],
- -10 * height, 10.0 * height, step, digits, "Y-position of marker at frame in screen coordinates");
-
- uiDefBut(block, LABEL, 0, "Offset:", 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
- uiDefButF(block, NUM, B_MARKER_OFFSET, "X:", 10, 133, 145, 19, &cb->track_offset[0],
- -10 * width, 10.0 * width, step, digits, "X-offset to parenting point");
- uiDefButF(block, NUM, B_MARKER_OFFSET, "Y:", 165, 133, 145, 19, &cb->track_offset[1],
- -10 * height, 10.0 * height, step, digits, "Y-offset to parenting point");
-
- uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
- uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Width:", 10, 95, 300, 19, &cb->marker_pat[0], 3.0f,
- 10.0 * width, step, digits, "Width of marker's pattern in screen coordinates");
- uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Height:", 10, 76, 300, 19, &cb->marker_pat[1], 3.0f,
- 10.0 * height, step, digits, "Height of marker's pattern in screen coordinates");
-
- uiDefBut(block, LABEL, 0, "Search Area:", 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
- uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "X:", 10, 38, 145, 19, &cb->marker_search_pos[0],
- -width, width, step, digits, "X-position of search at frame relative to marker's position");
- uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "Y:", 165, 38, 145, 19, &cb->marker_search_pos[1],
- -height, height, step, digits, "X-position of search at frame relative to marker's position");
- uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Width:", 10, 19, 300, 19, &cb->marker_search[0], 3.0f,
- 10.0 * width, step, digits, "Width of marker's search in screen soordinates");
- uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Height:", 10, 0, 300, 19, &cb->marker_search[1], 3.0f,
- 10.0 * height, step, digits, "Height of marker's search in screen soordinates");
+ uiDefBut(block, LABEL, 0, IFACE_("Position:"), 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
+ uiDefButF(block, NUM, B_MARKER_POS, IFACE_("X:"), 10, 171, 145, 19, &cb->marker_pos[0],
+ -10 * width, 10.0 * width, step, digits, TIP_("X-position of marker at frame in screen coordinates"));
+ uiDefButF(block, NUM, B_MARKER_POS, IFACE_("Y:"), 165, 171, 145, 19, &cb->marker_pos[1],
+ -10 * height, 10.0 * height, step, digits,
+ TIP_("Y-position of marker at frame in screen coordinates"));
+
+ uiDefBut(block, LABEL, 0, IFACE_("Offset:"), 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
+ uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("X:"), 10, 133, 145, 19, &cb->track_offset[0],
+ -10 * width, 10.0 * width, step, digits, TIP_("X-offset to parenting point"));
+ uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("Y:"), 165, 133, 145, 19, &cb->track_offset[1],
+ -10 * height, 10.0 * height, step, digits, TIP_("Y-offset to parenting point"));
+
+ uiDefBut(block, LABEL, 0, IFACE_("Pattern Area:"), 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
+ uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 10, 95, 300, 19, &cb->marker_pat[0], 3.0f,
+ 10.0 * width, step, digits, TIP_("Width of marker's pattern in screen coordinates"));
+ uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 10, 76, 300, 19, &cb->marker_pat[1], 3.0f,
+ 10.0 * height, step, digits, TIP_("Height of marker's pattern in screen coordinates"));
+
+ uiDefBut(block, LABEL, 0, IFACE_("Search Area:"), 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
+ uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 10, 38, 145, 19, &cb->marker_search_pos[0],
+ -width, width, step, digits, TIP_("X-position of search at frame relative to marker's position"));
+ uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 165, 38, 145, 19, &cb->marker_search_pos[1],
+ -height, height, step, digits, TIP_("Y-position of search at frame relative to marker's position"));
+ uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 10, 19, 300, 19, &cb->marker_search[0], 3.0f,
+ 10.0 * width, step, digits, TIP_("Width of marker's search in screen coordinates"));
+ uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 10, 0, 300, 19, &cb->marker_search[1], 3.0f,
+ 10.0 * height, step, digits, TIP_("Height of marker's search in screen coordinates"));
uiBlockEndAlign(block);
}
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index 09d97c36436..b1be9217819 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -145,6 +145,31 @@ static void draw_keyframe_shape(float x, float y, float xscale, float yscale, sh
glPopMatrix();
}
+static void clip_draw_dopesheet_background(ARegion *ar, MovieClip *clip)
+{
+ View2D *v2d = &ar->v2d;
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
+ MovieTrackingDopesheetCoverageSegment *coverage_segment;
+
+ for (coverage_segment = dopesheet->coverage_segments.first;
+ coverage_segment;
+ coverage_segment = coverage_segment->next)
+ {
+ if (coverage_segment->coverage < TRACKING_COVERAGE_OK) {
+ int start_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, coverage_segment->start_frame);
+ int end_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, coverage_segment->end_frame);
+
+ if (coverage_segment->coverage == TRACKING_COVERAGE_BAD)
+ glColor4f(1.0f, 0.0f, 0.0f, 0.07f);
+ else
+ glColor4f(1.0f, 1.0f, 0.0f, 0.07f);
+
+ glRectf(start_frame, v2d->cur.ymin, end_frame, v2d->cur.ymax);
+ }
+ }
+}
+
void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
{
MovieClip *clip = ED_space_clip_get_clip(sc);
@@ -179,6 +204,8 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
glEnable(GL_BLEND);
+ clip_draw_dopesheet_background(ar, clip);
+
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
float yminc = (float) (y - CHANNEL_HEIGHT_HALF);
float ymaxc = (float) (y + CHANNEL_HEIGHT_HALF);
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 927834a8924..728110dfeee 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -618,7 +618,7 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf, const unsign
context->last_texture = glaGetOneInteger(GL_TEXTURE_2D);
/* image texture need to be rebinded if displaying another image buffer
- * assuming displaying happens of footage frames only on which painting doesn't heppen.
+ * assuming displaying happens of footage frames only on which painting doesn't happen.
* so not changed image buffer pointer means unchanged image content */
need_rebind |= context->texture_ibuf != ibuf;
need_rebind |= context->display_buffer != display_buffer;
diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c
index ad70abf5732..7543988b5aa 100644
--- a/source/blender/editors/space_clip/clip_toolbar.c
+++ b/source/blender/editors/space_clip/clip_toolbar.c
@@ -33,11 +33,15 @@
#include "DNA_windowmanager_types.h"
+#include "RNA_access.h"
+
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_screen.h"
@@ -197,16 +201,16 @@ static void clip_panel_operator_redo_header(const bContext *C, Panel *pa)
wmOperator *op = WM_operator_last_redo(C);
if (op)
- BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
+ BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname));
else
- BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname));
+ BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname));
}
static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op)
{
if (op->type->flag & OPTYPE_MACRO) {
for (op = op->macro.first; op; op = op->next) {
- uiItemL(pa->layout, op->type->name, ICON_NONE);
+ uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE);
clip_panel_operator_redo_operator(C, pa, op);
}
}
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 56a890c714a..77ed197c1d7 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1105,7 +1105,7 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo
{
TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
int framenr = tmj->sfra;
- //double t = PIL_check_seconds_timer();
+ // double t = PIL_check_seconds_timer();
while (framenr != tmj->efra) {
if (tmj->delay > 0) {
@@ -1141,7 +1141,7 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo
break;
}
- //printf("Tracking time: %lf\n", PIL_check_seconds_timer()-t);
+ // printf("Tracking time: %lf\n", PIL_check_seconds_timer()-t);
}
static void track_markers_updatejob(void *tmv)
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index c195cb39157..73747239255 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -193,6 +193,10 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha
return TVC_LINE_FG;
}
+static void console_textview_const_colors(TextViewContext *UNUSED(tvc), unsigned char bg_sel[4])
+{
+ UI_GetThemeColor4ubv(TH_CONSOLE_SELECT, bg_sel);
+}
static int console_textview_main__internal(struct SpaceConsole *sc, ARegion *ar, int draw,
int mval[2], void **mouse_pick, int *pos_pick)
@@ -210,6 +214,7 @@ static int console_textview_main__internal(struct SpaceConsole *sc, ARegion *ar,
tvc.step = console_textview_step;
tvc.line_get = console_textview_line_get;
tvc.line_color = console_textview_line_color;
+ tvc.const_colors = console_textview_const_colors;
tvc.arg1 = sc;
tvc.arg2 = NULL;
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 483348db18e..ab16a9d55e6 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -383,10 +383,7 @@ static void do_graph_region_driver_buttons(bContext *C, void *UNUSED(arg), int e
case B_IPO_DEPCHANGE:
{
/* rebuild depsgraph for the new deps */
- DAG_scene_sort(bmain, scene);
-
- /* force an update of depsgraph */
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
}
break;
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 2d2d29d9eaa..dc834d88323 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1084,7 +1084,7 @@ void IMAGE_OT_match_movie_length(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Match Movie Length";
- ot->description = "Set image's users length to the one of this video";
+ ot->description = "Set image's user's length to the one of this video";
ot->idname = "IMAGE_OT_match_movie_length";
/* api callbacks */
@@ -1777,7 +1777,7 @@ 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, wmEvent *UNUSED(event))
{
- return WM_operator_props_dialog_popup(C, op, 300, 100);
+ return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, 5 * UI_UNIT_Y);
}
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index 54afc9a0849..a748c303b5d 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -251,7 +251,8 @@ static int report_textview_line_color(struct TextViewContext *tvc, unsigned char
#undef USE_INFO_NEWLINE
-static int info_textview_main__internal(struct SpaceInfo *sinfo, ARegion *ar, ReportList *reports, int draw, int mval[2], void **mouse_pick, int *pos_pick)
+static int info_textview_main__internal(struct SpaceInfo *sinfo, ARegion *ar, ReportList *reports,
+ int draw, int mval[2], void **mouse_pick, int *pos_pick)
{
int ret = 0;
@@ -264,6 +265,7 @@ static int info_textview_main__internal(struct SpaceInfo *sinfo, ARegion *ar, Re
tvc.step = report_textview_step;
tvc.line_get = report_textview_line_get;
tvc.line_color = report_textview_line_color;
+ tvc.const_colors = NULL;
tvc.arg1 = sinfo;
tvc.arg2 = reports;
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index 976769752f9..5a8a77f7350 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -367,9 +367,9 @@ static void stats_string(Scene *scene)
mmap_in_use = MEM_get_mapped_memory_in_use();
/* get memory statistics */
- s = memstr + sprintf(memstr, IFACE_(" | Mem:%.2fM"), (double)((mem_in_use - mmap_in_use) >> 10) / 1024.0);
+ s = memstr + sprintf(memstr, " | Mem:%.2fM", (double)((mem_in_use - mmap_in_use) >> 10) / 1024.0);
if (mmap_in_use)
- sprintf(s, IFACE_(" (%.2fM)"), (double)((mmap_in_use) >> 10) / 1024.0);
+ sprintf(s, " (%.2fM)", (double)((mmap_in_use) >> 10) / 1024.0);
s = stats->infostr;
@@ -377,32 +377,32 @@ static void stats_string(Scene *scene)
if (scene->obedit) {
if (BKE_keyblock_from_object(scene->obedit))
- s += sprintf(s, IFACE_("(Key) "));
+ s += sprintf(s, "(Key) ");
if (scene->obedit->type == OB_MESH) {
- s += sprintf(s, IFACE_("Verts:%d/%d | Edges:%d/%d | Faces:%d/%d | Tris:%d"),
+ s += sprintf(s, "Verts:%d/%d | Edges:%d/%d | Faces:%d/%d | Tris:%d",
stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel,
stats->totface, stats->tottri);
}
else if (scene->obedit->type == OB_ARMATURE) {
- s += sprintf(s, IFACE_("Verts:%d/%d | Bones:%d/%d"), stats->totvertsel, stats->totvert, stats->totbonesel,
+ s += sprintf(s, "Verts:%d/%d | Bones:%d/%d", stats->totvertsel, stats->totvert, stats->totbonesel,
stats->totbone);
}
else {
- s += sprintf(s, IFACE_("Verts:%d/%d"), stats->totvertsel, stats->totvert);
+ s += sprintf(s, "Verts:%d/%d", stats->totvertsel, stats->totvert);
}
strcat(s, memstr);
}
else if (ob && (ob->mode & OB_MODE_POSE)) {
- s += sprintf(s, IFACE_("Bones:%d/%d %s"),
+ s += sprintf(s, "Bones:%d/%d %s",
stats->totbonesel, stats->totbone, memstr);
}
else if (stats_is_object_dynamic_topology_sculpt(ob)) {
- s += sprintf(s, IFACE_("Verts:%d | Tris:%d"), stats->totvert, stats->tottri);
+ s += sprintf(s, "Verts:%d | Tris:%d", stats->totvert, stats->tottri);
}
else {
- s += sprintf(s, IFACE_("Verts:%d | Faces:%d | Tris:%d | Objects:%d/%d | Lamps:%d/%d%s"),
+ s += sprintf(s, "Verts:%d | Faces:%d | Tris:%d | Objects:%d/%d | Lamps:%d/%d%s",
stats->totvert, stats->totface, stats->tottri, stats->totobjsel, stats->totobj, stats->totlampsel,
stats->totlamp, memstr);
}
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index fc0a7b3b883..66f4904c340 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -68,31 +68,28 @@ BLI_INLINE void console_step_sel(ConsoleDrawContext *cdc, const int step)
cdc->sel[1] += step;
}
-static void console_draw_sel(const int sel[2], const int xy[2], const int str_len_draw, int cwidth, int lheight)
+static void console_draw_sel(const int sel[2], const int xy[2], const int str_len_draw, int cwidth, int lheight,
+ const unsigned char bg_sel[4])
{
if (sel[0] <= str_len_draw && sel[1] >= 0) {
const int sta = max_ii(sel[0], 0);
const int end = min_ii(sel[1], str_len_draw);
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_halftone);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glColor4ub(255, 255, 255, 48);
+ glColor4ubv(bg_sel);
glRecti(xy[0] + (cwidth * sta), xy[1] - 2 + lheight, xy[0] + (cwidth * end), xy[1] - 2);
- glDisable(GL_POLYGON_STIPPLE);
glDisable(GL_BLEND);
}
}
-
/* return 0 if the last line is off the screen
* should be able to use this for any string type */
static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const int str_len,
- const unsigned char *fg, const unsigned char *bg)
+ const unsigned char fg[3], const unsigned char bg[3], const unsigned char bg_sel[4])
{
int rct_ofs = cdc->lheight / 4;
int tot_lines = (str_len / cdc->console_width) + 1; /* total number of lines for wrapping */
@@ -108,7 +105,8 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
/* wrap */
if (str_len > cdc->console_width)
- ofs += (cdc->console_width * ((int)((((float)(y_next - cdc->mval[1]) / (float)(y_next - cdc->xy[1])) * tot_lines))));
+ ofs += cdc->console_width * ((int)((((float)(y_next - cdc->mval[1]) /
+ (float)(y_next - cdc->xy[1])) * tot_lines)));
CLAMP(ofs, 0, str_len);
*cdc->pos_pick += str_len - ofs;
@@ -158,7 +156,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
if (cdc->sel[0] != cdc->sel[1]) {
console_step_sel(cdc, -initial_offset);
// glColor4ub(255, 0, 0, 96); // debug
- console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->lheight);
+ console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->lheight, bg_sel);
console_step_sel(cdc, cdc->console_width);
glColor3ubv(fg);
}
@@ -173,7 +171,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
if (cdc->sel[0] != cdc->sel[1]) {
// glColor4ub(0, 255, 0, 96); // debug
- console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->lheight);
+ console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->lheight, bg_sel);
console_step_sel(cdc, cdc->console_width);
glColor3ubv(fg);
}
@@ -207,7 +205,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, const i
isel[1] = str_len - cdc->sel[0];
// glColor4ub(255, 255, 0, 96); // debug
- console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->lheight);
+ console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->lheight, bg_sel);
console_step_sel(cdc, -(str_len + 1));
}
@@ -269,6 +267,11 @@ int textview_draw(TextViewContext *tvc, const int draw, int mval[2], void **mous
}
if (tvc->begin(tvc)) {
+ unsigned char bg_sel[4] = {0};
+
+ if (draw && tvc->const_colors) {
+ tvc->const_colors(tvc, bg_sel);
+ }
do {
const char *ext_line;
@@ -282,7 +285,11 @@ int textview_draw(TextViewContext *tvc, const int draw, int mval[2], void **mous
tvc->line_get(tvc, &ext_line, &ext_len);
- if (!console_draw_string(&cdc, ext_line, ext_len, (color_flag & TVC_LINE_FG) ? fg : NULL, (color_flag & TVC_LINE_BG) ? bg : NULL)) {
+ if (!console_draw_string(&cdc, ext_line, ext_len,
+ (color_flag & TVC_LINE_FG) ? fg : NULL,
+ (color_flag & TVC_LINE_BG) ? bg : NULL,
+ bg_sel))
+ {
/* when drawing, if we pass v2d->cur.ymax, then quit */
if (draw) {
break; /* past the y limits */
diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h
index d0fab880dc3..653c9b83a50 100644
--- a/source/blender/editors/space_info/textview.h
+++ b/source/blender/editors/space_info/textview.h
@@ -46,6 +46,7 @@ typedef struct TextViewContext {
int (*step)(struct TextViewContext *tvc);
int (*line_get)(struct TextViewContext *tvc, const char **, int *);
int (*line_color)(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3]);
+ void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]); /* constant theme colors */
void *iter;
int iter_index;
int iter_char; /* char intex, used for multi-line report display */
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index f303bba9886..b211bca4c0a 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -2163,12 +2163,12 @@ static void node_composit_buts_file_output_details(uiLayout *layout, bContext *C
active_index = RNA_int_get(ptr, "active_input_index");
/* using different collection properties if multilayer format is enabled */
if (multilayer) {
- uiTemplateList(col, C, "UI_UL_list", "", ptr, "layer_slots", ptr, "active_input_index", 0, 0, 0);
+ uiTemplateList(col, C, "UI_UL_list", "file_output_node", ptr, "layer_slots", ptr, "active_input_index", 0, 0, 0);
RNA_property_collection_lookup_int(ptr, RNA_struct_find_property(ptr, "layer_slots"),
active_index, &active_input_ptr);
}
else {
- uiTemplateList(col, C, "UI_UL_list", "", ptr, "file_slots", ptr, "active_input_index", 0, 0, 0);
+ uiTemplateList(col, C, "UI_UL_list", "file_output_node", ptr, "file_slots", ptr, "active_input_index", 0, 0, 0);
RNA_property_collection_lookup_int(ptr, RNA_struct_find_property(ptr, "file_slots"),
active_index, &active_input_ptr);
}
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index ab660b9cd4a..9a1b3628196 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1432,8 +1432,7 @@ static int parent_drop_exec(bContext *C, wmOperator *op)
ED_object_parent_set(op->reports, bmain, scene, ob, par, partype, FALSE, FALSE);
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL);
@@ -1522,8 +1521,7 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
if ((par->type != OB_ARMATURE) && (par->type != OB_CURVE) && (par->type != OB_LATTICE)) {
if (ED_object_parent_set(op->reports, bmain, scene, ob, par, partype, FALSE, FALSE)) {
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL);
}
@@ -1706,8 +1704,7 @@ static int parent_clear_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
ED_object_parent_clear(ob, RNA_enum_get(op->ptr, "type"));
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL);
return OPERATOR_FINISHED;
@@ -1795,8 +1792,7 @@ static int scene_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
ED_base_object_select(base, BA_SELECT);
}
- DAG_scene_sort(bmain, scene);
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(bmain);
WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene);
@@ -1828,7 +1824,6 @@ void OUTLINER_OT_scene_drop(wmOperatorType *ot)
static int material_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- Main *bmain = CTX_data_main(C);
Material *ma = NULL;
Object *ob = NULL;
SpaceOops *soops = CTX_wm_space_outliner(C);
@@ -1860,7 +1855,6 @@ static int material_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
assign_material(ob, ma, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF);
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index b2070cc2f1c..303782f3fbd 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -619,7 +619,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
* cleanup tree here to prevent such cases. */
outliner_cleanup_tree(soops);
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(bmain);
str = "Delete Objects";
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
}
@@ -712,10 +712,8 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
if (event == 3) { /* instance */
- Main *bmain = CTX_data_main(C);
-
/* works without this except if you try render right after, see: 22027 */
- DAG_scene_sort(bmain, scene);
+ DAG_relations_tag_update(CTX_data_main(C));
}
ED_undo_push(C, prop_group_op_types[event].name);
@@ -1110,14 +1108,8 @@ static int outliner_animdata_operation_exec(bContext *C, wmOperator *op)
/* update dependencies */
if (updateDeps) {
- Main *bmain = CTX_data_main(C);
- Scene *scene = CTX_data_scene(C);
-
/* rebuild depsgraph for the new deps */
- DAG_scene_sort(bmain, scene);
-
- /* force an update of depsgraph */
- DAG_ids_flush_update(bmain, 0);
+ DAG_relations_tag_update(CTX_data_main(C));
}
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 97943f7e6ac..7be2d51a3c0 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -817,18 +817,23 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
/* like duplicate, but only duplicate and cut overlapping strips,
- * strips to the left of the cutframe are ignored and strips to the right are moved into the new list */
-static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe,
+ * strips to the left of the cutframe are ignored and strips to the right
+ * are moved to the end of slist
+ * we have to work on the same slist (not using a seperate list), since
+ * otherwise dupli_seq can't check for duplicate names properly and
+ * may generate strips with the same name (which will mess up animdata)
+ */
+
+static int cut_seq_list(Scene *scene, ListBase *slist, int cutframe,
Sequence * (*cut_seq)(Scene *, Sequence *, int))
{
- int did_something = FALSE;
Sequence *seq, *seq_next_iter;
+ Sequence *seq_first_new = NULL;
- seq = old->first;
-
- while (seq) {
+ seq = slist->first;
+
+ while (seq && seq != seq_first_new) {
seq_next_iter = seq->next; /* we need this because we may remove seq */
-
seq->tmp = NULL;
if (seq->flag & SELECT) {
if (cutframe > seq->startdisp &&
@@ -836,22 +841,29 @@ static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe
{
Sequence *seqn = cut_seq(scene, seq, cutframe);
if (seqn) {
- BLI_addtail(new, seqn);
+ BLI_addtail(slist, seqn);
+ if (seq_first_new == NULL) {
+ seq_first_new = seqn;
+ }
}
- did_something = TRUE;
}
else if (seq->enddisp <= cutframe) {
/* do nothing */
}
else if (seq->startdisp >= cutframe) {
- /* move into new list */
- BLI_remlink(old, seq);
- BLI_addtail(new, seq);
+ /* move to tail */
+ BLI_remlink(slist, seq);
+ BLI_addtail(slist, seq);
+
+ if (seq_first_new == NULL) {
+ seq_first_new = seq;
+ }
}
}
seq = seq_next_iter;
}
- return did_something;
+
+ return (seq_first_new != NULL);
}
static int insert_gap(Scene *scene, int gap, int cfra)
@@ -1488,25 +1500,21 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
int cut_side, cut_hard, cut_frame;
- ListBase newlist;
int changed;
cut_frame = RNA_int_get(op->ptr, "frame");
cut_hard = RNA_enum_get(op->ptr, "type");
cut_side = RNA_enum_get(op->ptr, "side");
- newlist.first = newlist.last = NULL;
-
if (cut_hard == SEQ_CUT_HARD) {
- changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_hard);
+ changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_hard);
}
else {
- changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_soft);
+ changed = cut_seq_list(scene, ed->seqbasep, cut_frame, cut_seq_soft);
}
- if (newlist.first) { /* got new strips ? */
+ if (changed) { /* got new strips ? */
Sequence *seq;
- BLI_movelisttolist(ed->seqbasep, &newlist);
if (cut_side != SEQ_SIDE_BOTH) {
SEQP_BEGIN (ed, seq)
diff --git a/source/blender/editors/space_sequencer/sequencer_modifier.c b/source/blender/editors/space_sequencer/sequencer_modifier.c
index a4a485b34c6..51df21e509a 100644
--- a/source/blender/editors/space_sequencer/sequencer_modifier.c
+++ b/source/blender/editors/space_sequencer/sequencer_modifier.c
@@ -180,13 +180,13 @@ static int strip_modifier_move_exec(bContext *C, wmOperator *op)
if (direction == SEQ_MODIFIER_MOVE_UP) {
if (smd->prev) {
BLI_remlink(&seq->modifiers, smd);
- BLI_insertlink(&seq->modifiers, smd->prev->prev, smd);
+ BLI_insertlinkbefore(&seq->modifiers, smd->prev, smd);
}
}
else if (direction == SEQ_MODIFIER_MOVE_DOWN) {
if (smd->next) {
BLI_remlink(&seq->modifiers, smd);
- BLI_insertlink(&seq->modifiers, smd->next, smd);
+ BLI_insertlinkafter(&seq->modifiers, smd->next, smd);
}
}
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index 94977fc5f0f..7c18b5c283a 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -162,23 +162,29 @@ static GHash *text_autocomplete_build(Text *text)
gh = BLI_ghash_str_new(__func__);
for (linep = text->lines.first; linep; linep = linep->next) {
- int i_start = 0;
- int i_end = 0;
+ size_t i_start = 0;
+ size_t i_end = 0;
+ size_t i_pos = 0;
while (i_start < linep->len) {
/* seek identifier beginning */
- while (i_start < linep->len && !text_check_identifier_nodigit(linep->line[i_start])) {
- i_start++;
+ i_pos = i_start;
+ while ((i_start < linep->len) &&
+ (!text_check_identifier_nodigit_unicode(BLI_str_utf8_as_unicode_and_size_safe(&linep->line[i_start], &i_pos))))
+ {
+ i_start = i_pos;
}
- i_end = i_start;
- while (i_end < linep->len && text_check_identifier(linep->line[i_end])) {
- i_end++;
+ i_pos = i_end = i_start;
+ while ((i_end < linep->len) &&
+ (text_check_identifier_unicode(BLI_str_utf8_as_unicode_and_size_safe(&linep->line[i_end], &i_pos))))
+ {
+ i_end = i_pos;
}
if ((i_start != i_end) &&
/* check we're at the beginning of a line or that the previous char is not an identifier
- * this prevents digits from being added */
- ((i_start < 1) || !text_check_identifier(linep->line[i_start - 1])))
+ * this prevents digits from being added */
+ ((i_start < 1) || !text_check_identifier_unicode(BLI_str_utf8_as_unicode(&linep->line[i_start - 1]))))
{
char *str_sub = &linep->line[i_start];
const int choice_len = i_end - i_start;
@@ -197,7 +203,13 @@ static GHash *text_autocomplete_build(Text *text)
str_sub[choice_len] = str_sub_last;
}
}
- i_start = i_end;
+ if (i_end != i_start) {
+ i_start = i_end;
+ }
+ else {
+ /* highly unlikely, but prevent eternal loop */
+ i_start++;
+ }
}
}
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index b60528bcee8..9b5d453d8a3 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -1929,7 +1929,7 @@ static int text_jump_exec(bContext *C, wmOperator *op)
static int text_jump_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- return WM_operator_props_dialog_popup(C, op, 200, 100);
+ return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y);
}
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 35a0111e575..2cef10e1981 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -236,8 +236,9 @@ static struct TextureDrawState {
Object *ob;
int is_lit, is_tex;
int color_profile;
+ bool use_backface_culling;
unsigned char obcol[4];
-} Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}};
+} Gtexdraw = {NULL, 0, 0, 0, false, {0, 0, 0, 0}};
static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *ma, struct TextureDrawState gtexdraw)
{
@@ -250,7 +251,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
static int c_has_texface;
Object *litob = NULL; /* to get mode to turn off mipmap in painting mode */
- int backculled = GEMAT_BACKCULL;
+ int backculled = GEMAT_BACKCULL || gtexdraw.use_backface_culling;
int alphablend = 0;
int textured = 0;
int lit = 0;
@@ -274,7 +275,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
if (ma) {
alphablend = ma->game.alpha_blend;
if (ma->mode & MA_SHLESS) lit = 0;
- backculled = ma->game.flag & GEMAT_BACKCULL;
+ backculled = (ma->game.flag & GEMAT_BACKCULL) || gtexdraw.use_backface_culling;
}
if (texface) {
@@ -375,17 +376,12 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
Gtexdraw.is_tex = is_tex;
Gtexdraw.color_profile = BKE_scene_check_color_management_enabled(scene);
+ Gtexdraw.use_backface_culling = (v3d->flag2 & V3D_BACKFACE_CULLING) != 0;
memcpy(Gtexdraw.obcol, obcol, sizeof(obcol));
set_draw_settings_cached(1, NULL, NULL, Gtexdraw);
glShadeModel(GL_SMOOTH);
- if (v3d->flag2 & V3D_BACKFACE_CULLING) {
- glEnable(GL_CULL_FACE);
- glCullFace(GL_BACK);
- }
- else {
- glDisable(GL_CULL_FACE);
- }
+ glCullFace(GL_BACK);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, (me->flag & ME_TWOSIDED) ? GL_TRUE : GL_FALSE);
}
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index ec716284bf3..bb286194992 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -222,6 +222,9 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
}
+ else {
+ totedgedata = bm->totedgesel;
+ }
/* check for defgroups */
if (evedef)
@@ -400,53 +403,43 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
uiBlockBeginAlign(block);
/* Should be no need to translate these. */
- but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, yi -= buth, 200, buth,
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("X:"), 0, yi -= buth, 200, buth,
&(tfp->ve_median[LOC_X]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, yi -= buth, 200, buth,
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Y:"), 0, yi -= buth, 200, buth,
&(tfp->ve_median[LOC_Y]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, yi -= buth, 200, buth,
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Z:"), 0, yi -= buth, 200, buth,
&(tfp->ve_median[LOC_Z]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
if (totcurvebweight == tot) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, yi -= buth, 200, buth,
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("W:"), 0, yi -= buth, 200, buth,
&(tfp->ve_median[C_BWEIGHT]), 0.01, 100.0, 1, 3, "");
}
uiBlockBeginAlign(block);
uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, IFACE_("Global"),
0, yi -= buth + but_margin, 100, buth,
- &v3d->flag, 0, 0, 0, 0, "Displays global values");
+ &v3d->flag, 0, 0, 0, 0, TIP_("Displays global values"));
uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, IFACE_("Local"),
100, yi, 100, buth,
- &v3d->flag, 0, 0, 0, 0, "Displays local values");
+ &v3d->flag, 0, 0, 0, 0, TIP_("Displays local values"));
uiBlockEndAlign(block);
/* Meshes... */
if (meshdata) {
if (totedgedata) {
- Mesh *me = ob->data;
- BMEditMesh *em = me->edit_btmesh;
- BMesh *bm = em->bm;
-
- const int cd_edge_bweight_offset = CustomData_get_offset(&bm->edata, CD_BWEIGHT);
- const int cd_edge_crease_offset = CustomData_get_offset(&bm->edata, CD_CREASE);
-
- if (cd_edge_crease_offset != -1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
- totedgedata == 1 ? IFACE_("Crease:") : IFACE_("Mean Crease:"),
- 0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[M_CREASE]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
- }
-
- if (cd_edge_bweight_offset != -1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
- totedgedata == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"),
- 0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[M_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
- }
+ /* customdata layer added on demand */
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
+ totedgedata == 1 ? IFACE_("Crease:") : IFACE_("Mean Crease:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[M_CREASE]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+ /* customdata layer added on demand */
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
+ totedgedata == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[M_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
}
if (totskinradius) {
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
@@ -461,11 +454,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
/* Curve... */
else if (totcurvedata == 1) {
- uiDefButR(block, NUM, 0, "Weight", 0, yi -= buth + but_margin, 200, buth,
+ uiDefButR(block, NUM, 0, IFACE_("Weight"), 0, yi -= buth + but_margin, 200, buth,
&data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL);
- uiDefButR(block, NUM, 0, "Radius", 0, yi -= buth + but_margin, 200, buth,
+ uiDefButR(block, NUM, 0, IFACE_("Radius"), 0, yi -= buth + but_margin, 200, buth,
&data_ptr, "radius", 0, 0.0, 100.0, 1, 3, NULL);
- uiDefButR(block, NUM, 0, "Tilt", 0, yi -= buth + but_margin, 200, buth,
+ uiDefButR(block, NUM, 0, IFACE_("Tilt"), 0, yi -= buth + but_margin, 200, buth,
&data_ptr, "tilt", 0, -FLT_MAX, FLT_MAX, 1, 3, NULL);
}
else if (totcurvedata > 1) {
@@ -483,7 +476,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
/* Lattice... */
else if (totlattdata == 1) {
- uiDefButR(block, NUM, 0, "Weight", 0, yi -= buth + but_margin, 200, buth,
+ uiDefButR(block, NUM, 0, IFACE_("Weight"), 0, yi -= buth + but_margin, 200, buth,
&data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL);
}
else if (totlattdata > 1) {
@@ -529,7 +522,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
if (median[M_CREASE] != 0.0f) {
- const int cd_edge_crease_offset = CustomData_get_offset(&bm->edata, CD_CREASE);
+ const int cd_edge_crease_offset = (BM_mesh_cd_flag_ensure(bm, me, ME_CDFLAG_EDGE_CREASE),
+ CustomData_get_offset(&bm->edata, CD_CREASE));
const float sca = compute_scale_factor(ve_median[M_CREASE], median[M_CREASE]);
BMEdge *eed;
@@ -561,7 +555,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
if (median[M_WEIGHT] != 0.0f) {
- const int cd_edge_bweight_offset = CustomData_get_offset(&bm->edata, CD_BWEIGHT);
+ const int cd_edge_bweight_offset = (BM_mesh_cd_flag_ensure(bm, me, ME_CDFLAG_EDGE_BWEIGHT),
+ CustomData_get_offset(&bm->edata, CD_BWEIGHT));
const float sca = compute_scale_factor(ve_median[M_WEIGHT], median[M_WEIGHT]);
BMEdge *eed;
@@ -1274,20 +1269,20 @@ void view3d_buttons_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
strcpy(pt->idname, "VIEW3D_PT_object");
- strcpy(pt->label, "Transform");
+ strcpy(pt->label, N_("Transform")); /* XXX C panels not available through RNA (bpy.types)! */
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, "Grease Pencil");
+ strcpy(pt->label, N_("Grease Pencil")); /* XXX C panels are not available through RNA (bpy.types)! */
pt->draw_header = gpencil_panel_standard_header;
pt->draw = gpencil_panel_standard;
BLI_addtail(&art->paneltypes, pt);
pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
strcpy(pt->idname, "VIEW3D_PT_vgroup");
- strcpy(pt->label, "Vertex Groups");
+ strcpy(pt->label, N_("Vertex Groups")); /* XXX C panels are not available through RNA (bpy.types)! */
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_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 2b28b958248..4aaa3332252 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -75,7 +75,9 @@
#include "BIF_glutil.h"
#include "WM_api.h"
+
#include "BLF_api.h"
+#include "BLF_translation.h"
#include "ED_armature.h"
#include "ED_keyframing.h"
@@ -345,7 +347,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
CLAMP(blend_fac, 0.3f, 1.0f);
- UI_ThemeColorBlend(TH_BACK, TH_GRID, blend_fac);
+ UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, blend_fac);
drawgrid_draw(ar, wx, wy, x, y, dx_scalar);
}
@@ -374,7 +376,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
}
}
else { /* start blending out */
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+ UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
@@ -382,7 +384,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
}
}
else { /* start blending out (GRID_MIN_PX < dx < (GRID_MIN_PX * 10)) */
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+ UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
@@ -401,21 +403,21 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
drawgrid_draw(ar, wx, wy, x, y, dx);
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+ UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
}
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+ UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
}
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
+ UI_ThemeColorBlend(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
@@ -804,28 +806,28 @@ static const char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
switch (rv3d->view) {
case RV3D_VIEW_FRONT:
- if (rv3d->persp == RV3D_ORTHO) name = "Front Ortho";
- else name = "Front Persp";
+ if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Front Ortho");
+ else name = IFACE_("Front Persp");
break;
case RV3D_VIEW_BACK:
- if (rv3d->persp == RV3D_ORTHO) name = "Back Ortho";
- else name = "Back Persp";
+ if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Back Ortho");
+ else name = IFACE_("Back Persp");
break;
case RV3D_VIEW_TOP:
- if (rv3d->persp == RV3D_ORTHO) name = "Top Ortho";
- else name = "Top Persp";
+ if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Top Ortho");
+ else name = IFACE_("Top Persp");
break;
case RV3D_VIEW_BOTTOM:
- if (rv3d->persp == RV3D_ORTHO) name = "Bottom Ortho";
- else name = "Bottom Persp";
+ if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Bottom Ortho");
+ else name = IFACE_("Bottom Persp");
break;
case RV3D_VIEW_RIGHT:
- if (rv3d->persp == RV3D_ORTHO) name = "Right Ortho";
- else name = "Right Persp";
+ if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Right Ortho");
+ else name = IFACE_("Right Persp");
break;
case RV3D_VIEW_LEFT:
- if (rv3d->persp == RV3D_ORTHO) name = "Left Ortho";
- else name = "Left Persp";
+ if (rv3d->persp == RV3D_ORTHO) name = IFACE_("Left Ortho");
+ else name = IFACE_("Left Persp");
break;
default:
@@ -833,14 +835,14 @@ static const char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
if ((v3d->camera) && (v3d->camera->type == OB_CAMERA)) {
Camera *cam;
cam = v3d->camera->data;
- name = (cam->type != CAM_ORTHO) ? "Camera Persp" : "Camera Ortho";
+ name = (cam->type != CAM_ORTHO) ? IFACE_("Camera Persp") : IFACE_("Camera Ortho");
}
else {
- name = "Object as Camera";
+ name = IFACE_("Object as Camera");
}
}
else {
- name = (rv3d->persp == RV3D_ORTHO) ? "User Ortho" : "User Persp";
+ name = (rv3d->persp == RV3D_ORTHO) ? IFACE_("User Ortho") : IFACE_("User Persp");
}
break;
}
@@ -852,16 +854,25 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, rcti *rect)
{
RegionView3D *rv3d = ar->regiondata;
const char *name = view3d_get_name(v3d, rv3d);
+ /* XXX 24 may be a bit small for unicode languages (Chinese in utf-8...) */
+#ifdef WITH_INTERNATIONAL
+ char tmpstr[32];
+#else
char tmpstr[24];
-
+#endif
+
if (v3d->localvd) {
- BLI_snprintf(tmpstr, sizeof(tmpstr), "%s (Local)", name);
+ BLI_snprintf(tmpstr, sizeof(tmpstr), IFACE_("%s (Local)"), name);
name = tmpstr;
}
if (name) {
UI_ThemeColor(TH_TEXT_HI);
+#ifdef WITH_INTERNATIONAL
+ BLF_draw_default(U.widget_unit + rect->xmin, rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr));
+#else
BLF_draw_default_ascii(U.widget_unit + rect->xmin, rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr));
+#endif
}
}
@@ -918,7 +929,7 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
if (kb) {
BLI_snprintf(shapes, sizeof(shapes), ": %s ", kb->name);
if (ob->shapeflag == OB_SHAPE_LOCK) {
- strcat(shapes, " (Pinned)");
+ strcat(shapes, IFACE_(" (Pinned)"));
}
}
}
@@ -2846,14 +2857,18 @@ static void draw_viewport_fps(Scene *scene, rcti *rect)
/* is this more then half a frame behind? */
if (fps + 0.5f < (float)(FPS)) {
UI_ThemeColor(TH_REDALERT);
- BLI_snprintf(printable, sizeof(printable), "fps: %.2f", fps);
+ BLI_snprintf(printable, sizeof(printable), IFACE_("fps: %.2f"), fps);
}
else {
UI_ThemeColor(TH_TEXT_HI);
- BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps + 0.5f));
+ BLI_snprintf(printable, sizeof(printable), IFACE_("fps: %i"), (int)(fps + 0.5f));
}
-
+
+#ifdef WITH_INTERNATIONAL
+ BLF_draw_default(rect->xmin + U.widget_unit, rect->ymax - U.widget_unit, 0.0f, printable, sizeof(printable));
+#else
BLF_draw_default_ascii(rect->xmin + U.widget_unit, rect->ymax - U.widget_unit, 0.0f, printable, sizeof(printable));
+#endif
}
static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const char **grid_unit);
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 8c0a2dc4b65..30ed7a57f9d 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -3858,18 +3858,14 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
/* cursor position in vec, result in vec, mval in region coords */
/* note: cannot use event->mval here (called by object_add() */
-void ED_view3d_cursor3d_position(bContext *C, float *fp, int mx, int my)
+void ED_view3d_cursor3d_position(bContext *C, float fp[3], const int mval[2])
{
Scene *scene = CTX_data_scene(C);
ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
float mval_fl[2];
- int mval[2];
int flip;
-
- mval[0] = mx - ar->winrct.xmin;
- mval[1] = my - ar->winrct.ymin;
flip = initgrabz(rv3d, fp[0], fp[1], fp[2]);
@@ -3917,7 +3913,7 @@ static int view3d_cursor3d_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *
View3D *v3d = CTX_wm_view3d(C);
float *fp = give_cursor(scene, v3d);
- ED_view3d_cursor3d_position(C, fp, event->x, event->y);
+ ED_view3d_cursor3d_position(C, fp, event->mval);
if (v3d && v3d->localvd)
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index f570ec38ae3..6edcf980d58 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -532,7 +532,6 @@ static void make_trans_verts(Object *obedit, float min[3], float max[3], int mod
static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain = CTX_data_main(C);
Object *obedit = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
RegionView3D *rv3d = CTX_wm_region_data(C);
@@ -623,8 +622,6 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
- ob->recalc |= OB_RECALC_OB;
-
vec[0] = -ob->obmat[3][0] + gridf * floorf(0.5f + ob->obmat[3][0] / gridf);
vec[1] = -ob->obmat[3][1] + gridf * floorf(0.5f + ob->obmat[3][1] / gridf);
vec[2] = -ob->obmat[3][2] + gridf * floorf(0.5f + ob->obmat[3][2] / gridf);
@@ -644,12 +641,13 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
/* auto-keyframing */
ED_autokeyframe_object(C, scene, ob, ks);
+
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
}
CTX_DATA_END;
}
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
@@ -674,7 +672,6 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain = CTX_data_main(C);
Object *obedit = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
@@ -748,8 +745,6 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
- ob->recalc |= OB_RECALC_OB;
-
vec[0] = -ob->obmat[3][0] + curs[0];
vec[1] = -ob->obmat[3][1] + curs[1];
vec[2] = -ob->obmat[3][2] + curs[2];
@@ -769,12 +764,13 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
/* auto-keyframing */
ED_autokeyframe_object(C, scene, ob, ks);
+
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
}
CTX_DATA_END;
}
- DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 8ffa04050a2..ea82ebb9234 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -94,6 +94,7 @@
#include "RNA_access.h"
#include "BLF_api.h"
+#include "BLF_translation.h"
#include "transform.h"
@@ -104,6 +105,16 @@ static int doVertSlide(TransInfo *t, float perc);
static void drawEdgeSlide(const struct bContext *C, TransInfo *t);
static void drawVertSlide(const struct bContext *C, TransInfo *t);
+static bool transdata_check_local_center(TransInfo *t)
+{
+ return ((t->around == V3D_LOCAL) && (
+ (t->flag & (T_OBJECT | T_POSE)) ||
+ (t->obedit && t->obedit->type == OB_MESH && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
+ (t->obedit && t->obedit->type == OB_ARMATURE) ||
+ (t->spacetype == SPACE_IPO))
+ );
+}
+
/* ************************** SPACE DEPENDANT CODE **************************** */
void setTransformViewMatrices(TransInfo *t)
@@ -780,22 +791,29 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
if (!(t->flag & T_NO_CONSTRAINT)) {
int constraint_axis, constraint_plane;
int edit_2d = (t->flag & T_2D_EDIT);
- char msg1[] = "along _";
- char msg2[] = "along %s _";
- char msg3[] = "locking %s _";
+ const char *msg1 = "", *msg2 = "", *msg3 = "";
char axis;
/* Initialize */
switch (key_type) {
case XKEY:
+ msg1 = IFACE_("along X");
+ msg2 = IFACE_("along %s X");
+ msg3 = IFACE_("locking %s X");
axis = 'X';
constraint_axis = CON_AXIS0;
break;
case YKEY:
+ msg1 = IFACE_("along Y");
+ msg2 = IFACE_("along %s Y");
+ msg3 = IFACE_("locking %s Y");
axis = 'Y';
constraint_axis = CON_AXIS1;
break;
case ZKEY:
+ msg1 = IFACE_("along Z");
+ msg2 = IFACE_("along %s Z");
+ msg3 = IFACE_("locking %s Z");
axis = 'Z';
constraint_axis = CON_AXIS2;
break;
@@ -803,9 +821,6 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
/* Invalid key */
return;
}
- msg1[sizeof(msg1) - 2] = axis;
- msg2[sizeof(msg2) - 2] = axis;
- msg3[sizeof(msg3) - 2] = axis;
constraint_plane = ((CON_AXIS0 | CON_AXIS1 | CON_AXIS2) & (~constraint_axis));
if (edit_2d && (key_type != ZKEY)) {
@@ -995,10 +1010,10 @@ int transformEvent(TransInfo *t, wmEvent *event)
}
else {
if (t->flag & T_2D_EDIT) {
- setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS0), "along X");
+ setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS0), IFACE_("along X"));
}
else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS0), "along %s X");
+ setUserConstraint(t, t->current_orientation, (CON_AXIS0), IFACE_("along %s X"));
}
}
t->redraw |= TREDRAW_HARD;
@@ -1011,10 +1026,10 @@ int transformEvent(TransInfo *t, wmEvent *event)
}
else {
if (t->flag & T_2D_EDIT) {
- setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS1), "along Y");
+ setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS1), IFACE_("along Y"));
}
else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS1), "along %s Y");
+ setUserConstraint(t, t->current_orientation, (CON_AXIS1), IFACE_("along %s Y"));
}
}
t->redraw |= TREDRAW_HARD;
@@ -1026,7 +1041,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
stopConstraint(t);
}
else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS2), "along %s Z");
+ setUserConstraint(t, t->current_orientation, (CON_AXIS2), IFACE_("along %s Z"));
}
t->redraw |= TREDRAW_HARD;
}
@@ -1037,7 +1052,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
stopConstraint(t);
}
else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS1 | CON_AXIS2), "locking %s X");
+ setUserConstraint(t, t->current_orientation, (CON_AXIS1 | CON_AXIS2), IFACE_("locking %s X"));
}
t->redraw |= TREDRAW_HARD;
}
@@ -1048,7 +1063,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
stopConstraint(t);
}
else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS2), "locking %s Y");
+ setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS2), IFACE_("locking %s Y"));
}
t->redraw |= TREDRAW_HARD;
}
@@ -1059,7 +1074,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
stopConstraint(t);
}
else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS1), "locking %s Z");
+ setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS1), IFACE_("locking %s Z"));
}
t->redraw |= TREDRAW_HARD;
}
@@ -1164,7 +1179,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
/* exception for switching to dolly, or trackball, in camera view */
if (t->flag & T_CAMERA) {
if (t->mode == TFM_TRANSLATION)
- setLocalConstraint(t, (CON_AXIS2), "along local Z");
+ setLocalConstraint(t, (CON_AXIS2), IFACE_("along local Z"));
else if (t->mode == TFM_ROTATION) {
restoreTransObjects(t);
initTrackball(t);
@@ -1656,7 +1671,7 @@ static void drawTransformView(const struct bContext *C, ARegion *UNUSED(ar), voi
static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar)
{
rcti rect;
- const char printable[] = "Auto Keying On";
+ const char *printable = IFACE_("Auto Keying On");
float printable_size[2];
int xco, yco;
@@ -1671,7 +1686,11 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar)
* - original color was red to match the icon, but that clashes badly with a less nasty border
*/
UI_ThemeColorShade(TH_TEXT_HI, -50);
+#ifdef WITH_INTERNATIONAL
+ BLF_draw_default(xco, ar->winy - 17, 0.0f, printable, sizeof(printable));
+#else
BLF_draw_default_ascii(xco, ar->winy - 17, 0.0f, printable, sizeof(printable));
+#endif
/* autokey recording icon... */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -2689,13 +2708,13 @@ int Warp(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "Warp: %s", c);
+ sprintf(str, IFACE_("Warp: %s"), c);
circumfac = DEG2RADF(circumfac);
}
else {
/* default header print */
- sprintf(str, "Warp: %.3f", RAD2DEGF(circumfac));
+ sprintf(str, IFACE_("Warp: %.3f"), RAD2DEGF(circumfac));
}
t->values[0] = circumfac;
@@ -2830,11 +2849,11 @@ int Shear(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "Shear: %s %s", c, t->proptext);
+ sprintf(str, IFACE_("Shear: %s %s"), c, t->proptext);
}
else {
/* default header print */
- sprintf(str, "Shear: %.3f %s (Press X or Y to set shear axis)", value, t->proptext);
+ sprintf(str, IFACE_("Shear: %.3f %s (Press X or Y to set shear axis)"), value, t->proptext);
}
t->values[0] = value;
@@ -2926,30 +2945,30 @@ static void headerResize(TransInfo *t, float vec[3], char *str)
if (t->con.mode & CON_APPLY) {
switch (t->num.idx_max) {
case 0:
- spos += sprintf(spos, "Scale: %s%s %s", &tvec[0], t->con.text, t->proptext);
+ spos += sprintf(spos, IFACE_("Scale: %s%s %s"), &tvec[0], t->con.text, t->proptext);
break;
case 1:
- spos += sprintf(spos, "Scale: %s : %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+ spos += sprintf(spos, IFACE_("Scale: %s : %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
t->con.text, t->proptext);
break;
case 2:
- spos += sprintf(spos, "Scale: %s : %s : %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+ spos += sprintf(spos, IFACE_("Scale: %s : %s : %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
&tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
}
}
else {
if (t->flag & T_2D_EDIT) {
- spos += sprintf(spos, "Scale X: %s Y: %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+ spos += sprintf(spos, IFACE_("Scale X: %s Y: %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
t->con.text, t->proptext);
}
else {
- spos += sprintf(spos, "Scale X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN],
+ spos += sprintf(spos, IFACE_("Scale X: %s Y: %s Z: %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
&tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
}
}
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
- spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+ spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
}
(void)spos;
@@ -3005,12 +3024,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
}
/* local constraint shouldn't alter center */
- if ((t->around == V3D_LOCAL) &&
- ( (t->flag & (T_OBJECT | T_POSE)) ||
- ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
- (t->obedit && t->obedit->type == OB_ARMATURE))
- )
- {
+ if (transdata_check_local_center(t)) {
copy_v3_v3(center, td->center);
}
else if (t->options & CTX_MOVIECLIP) {
@@ -3313,11 +3327,11 @@ int ToSphere(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "To Sphere: %s %s", c, t->proptext);
+ sprintf(str, IFACE_("To Sphere: %s %s"), c, t->proptext);
}
else {
/* default header print */
- sprintf(str, "To Sphere: %.4f %s", ratio, t->proptext);
+ sprintf(str, IFACE_("To Sphere: %.4f %s"), ratio, t->proptext);
}
@@ -3387,20 +3401,16 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
{
float vec[3], totmat[3][3], smat[3][3];
float eul[3], fmat[3][3], quat[4];
- float *center = t->center;
+ const float *center;
/* local constraint shouldn't alter center */
- if (around == V3D_LOCAL) {
- if ( (t->flag & (T_OBJECT | T_POSE)) ||
- (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE)) ||
- (t->obedit && t->obedit->type == OB_ARMATURE))
- {
- center = td->center;
- }
-
- if (t->options & CTX_MOVIECLIP) {
- center = td->center;
- }
+ if (transdata_check_local_center(t) ||
+ ((around == V3D_LOCAL) && (t->options & CTX_MOVIECLIP)))
+ {
+ center = td->center;
+ }
+ else {
+ center = t->center;
}
if (t->flag & T_POINTS) {
@@ -3661,17 +3671,17 @@ int Rotation(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- spos += sprintf(spos, "Rot: %s %s %s", &c[0], t->con.text, t->proptext);
+ spos += sprintf(spos, IFACE_("Rot: %s %s %s"), &c[0], t->con.text, t->proptext);
/* Clamp between -180 and 180 */
final = angle_wrap_rad(DEG2RADF(final));
}
else {
- spos += sprintf(spos, "Rot: %.2f%s %s", RAD2DEGF(final), t->con.text, t->proptext);
+ spos += sprintf(spos, IFACE_("Rot: %.2f%s %s"), RAD2DEGF(final), t->con.text, t->proptext);
}
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
- spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+ spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
}
(void)spos;
@@ -3760,17 +3770,17 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- spos += sprintf(spos, "Trackball: %s %s %s", &c[0], &c[NUM_STR_REP_LEN], t->proptext);
+ spos += sprintf(spos, IFACE_("Trackball: %s %s %s"), &c[0], &c[NUM_STR_REP_LEN], t->proptext);
phi[0] = DEG2RADF(phi[0]);
phi[1] = DEG2RADF(phi[1]);
}
else {
- spos += sprintf(spos, "Trackball: %.2f %.2f %s", RAD2DEGF(phi[0]), RAD2DEGF(phi[1]), t->proptext);
+ spos += sprintf(spos, IFACE_("Trackball: %.2f %.2f %s"), RAD2DEGF(phi[0]), RAD2DEGF(phi[1]), t->proptext);
}
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
- spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+ spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
}
(void)spos;
@@ -3881,7 +3891,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
short chainlen = t->settings->autoik_chainlen;
if (chainlen)
- sprintf(autoik, "AutoIK-Len: %d", chainlen);
+ sprintf(autoik, IFACE_("AutoIK-Len: %d"), chainlen);
else
autoik[0] = '\0';
}
@@ -3914,7 +3924,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
}
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
- spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
+ spos += sprintf(spos, IFACE_(" Proportional size: %.2f"), t->prop_size);
}
(void)spos;
}
@@ -4076,7 +4086,7 @@ int ShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
/* header print for NumInput */
str_p = str;
- str_p += BLI_snprintf(str_p, sizeof(str), "Shrink/Fatten:");
+ str_p += BLI_snprintf(str_p, sizeof(str), IFACE_("Shrink/Fatten:"));
if (hasNumInput(&t->num)) {
char c[NUM_STR_REP_LEN];
outputNumInput(&(t->num), c);
@@ -4098,8 +4108,8 @@ int ShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
str_p += WM_keymap_item_to_string(kmi, str_p, sizeof(str) - (str_p - str));
}
}
- str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), " or Alt) Even Thickness %s",
- (t->flag & T_ALT_TRANSFORM) ? "ON" : "OFF");
+ str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_(" or Alt) Even Thickness %s"),
+ (t->flag & T_ALT_TRANSFORM) ? IFACE_("ON") : IFACE_("OFF"));
/* done with header string */
@@ -4170,7 +4180,7 @@ int Tilt(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "Tilt: %s° %s", &c[0], t->proptext);
+ sprintf(str, IFACE_("Tilt: %s° %s"), &c[0], t->proptext);
final = DEG2RADF(final);
@@ -4178,7 +4188,7 @@ int Tilt(TransInfo *t, const int UNUSED(mval[2]))
t->values[0] = final;
}
else {
- sprintf(str, "Tilt: %.2f° %s", RAD2DEGF(final), t->proptext);
+ sprintf(str, IFACE_("Tilt: %.2f° %s"), RAD2DEGF(final), t->proptext);
}
for (i = 0; i < t->total; i++, td++) {
@@ -4242,10 +4252,10 @@ int CurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
char c[NUM_STR_REP_LEN];
outputNumInput(&(t->num), c);
- sprintf(str, "Shrink/Fatten: %s", c);
+ sprintf(str, IFACE_("Shrink/Fatten: %s"), c);
}
else {
- sprintf(str, "Shrink/Fatten: %3f", ratio);
+ sprintf(str, IFACE_("Shrink/Fatten: %3f"), ratio);
}
for (i = 0; i < t->total; i++, td++) {
@@ -4310,10 +4320,10 @@ int MaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
char c[NUM_STR_REP_LEN];
outputNumInput(&(t->num), c);
- sprintf(str, "Feather Shrink/Fatten: %s", c);
+ sprintf(str, IFACE_("Feather Shrink/Fatten: %s"), c);
}
else {
- sprintf(str, "Feather Shrink/Fatten: %3f", ratio);
+ sprintf(str, IFACE_("Feather Shrink/Fatten: %3f"), ratio);
}
/* detect if no points have feather yet */
@@ -4398,11 +4408,11 @@ int PushPull(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "Push/Pull: %s%s %s", c, t->con.text, t->proptext);
+ sprintf(str, IFACE_("Push/Pull: %s%s %s"), c, t->con.text, t->proptext);
}
else {
/* default header print */
- sprintf(str, "Push/Pull: %.4f%s %s", distance, t->con.text, t->proptext);
+ sprintf(str, IFACE_("Push/Pull: %.4f%s %s"), distance, t->con.text, t->proptext);
}
t->values[0] = distance;
@@ -4519,7 +4529,7 @@ int Bevel(TransInfo *t, const int UNUSED(mval[2]))
const char *mode;
TransData *td = t->data;
- mode = (G.editBMesh->options & BME_BEVEL_VERT) ? "verts only" : "normal";
+ mode = (G.editBMesh->options & BME_BEVEL_VERT) ? IFACE_("verts only") : IFACE_("normal");
distance = t->values[0] / 4; /* 4 just seemed a nice value to me, nothing special */
distance = fabs(distance);
@@ -4534,11 +4544,11 @@ int Bevel(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "Bevel - Dist: %s, Mode: %s (MMB to toggle))", c, mode);
+ sprintf(str, IFACE_("Bevel - Dist: %s, Mode: %s (MMB to toggle))"), c, mode);
}
else {
/* default header print */
- sprintf(str, "Bevel - Dist: %.4f, Mode: %s (MMB to toggle))", distance, mode);
+ sprintf(str, IFACE_("Bevel - Dist: %.4f, Mode: %s (MMB to toggle))"), distance, mode);
}
if (distance < 0) distance = -distance;
@@ -4602,16 +4612,16 @@ int BevelWeight(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
if (weight >= 0.0f)
- sprintf(str, "Bevel Weight: +%s %s", c, t->proptext);
+ sprintf(str, IFACE_("Bevel Weight: +%s %s"), c, t->proptext);
else
- sprintf(str, "Bevel Weight: %s %s", c, t->proptext);
+ sprintf(str, IFACE_("Bevel Weight: %s %s"), c, t->proptext);
}
else {
/* default header print */
if (weight >= 0.0f)
- sprintf(str, "Bevel Weight: +%.3f %s", weight, t->proptext);
+ sprintf(str, IFACE_("Bevel Weight: +%.3f %s"), weight, t->proptext);
else
- sprintf(str, "Bevel Weight: %.3f %s", weight, t->proptext);
+ sprintf(str, IFACE_("Bevel Weight: %.3f %s"), weight, t->proptext);
}
for (i = 0; i < t->total; i++, td++) {
@@ -4675,16 +4685,16 @@ int Crease(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
if (crease >= 0.0f)
- sprintf(str, "Crease: +%s %s", c, t->proptext);
+ sprintf(str, IFACE_("Crease: +%s %s"), c, t->proptext);
else
- sprintf(str, "Crease: %s %s", c, t->proptext);
+ sprintf(str, IFACE_("Crease: %s %s"), c, t->proptext);
}
else {
/* default header print */
if (crease >= 0.0f)
- sprintf(str, "Crease: +%.3f %s", crease, t->proptext);
+ sprintf(str, IFACE_("Crease: +%.3f %s"), crease, t->proptext);
else
- sprintf(str, "Crease: %.3f %s", crease, t->proptext);
+ sprintf(str, IFACE_("Crease: %.3f %s"), crease, t->proptext);
}
for (i = 0; i < t->total; i++, td++) {
@@ -4743,14 +4753,14 @@ static void headerBoneSize(TransInfo *t, float vec[3], char *str)
/* hmm... perhaps the y-axis values don't need to be shown? */
if (t->con.mode & CON_APPLY) {
if (t->num.idx_max == 0)
- sprintf(str, "ScaleB: %s%s %s", &tvec[0], t->con.text, t->proptext);
+ sprintf(str, IFACE_("ScaleB: %s%s %s"), &tvec[0], t->con.text, t->proptext);
else
- sprintf(str, "ScaleB: %s : %s : %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN], &tvec[NUM_STR_REP_LEN * 2],
- t->con.text, t->proptext);
+ sprintf(str, IFACE_("ScaleB: %s : %s : %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
+ &tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
}
else {
- sprintf(str, "ScaleB X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[NUM_STR_REP_LEN], &tvec[NUM_STR_REP_LEN * 2],
- t->con.text, t->proptext);
+ sprintf(str, IFACE_("ScaleB X: %s Y: %s Z: %s%s %s"), &tvec[0], &tvec[NUM_STR_REP_LEN],
+ &tvec[NUM_STR_REP_LEN * 2], t->con.text, t->proptext);
}
}
@@ -4866,10 +4876,10 @@ int BoneEnvelope(TransInfo *t, const int UNUSED(mval[2]))
char c[NUM_STR_REP_LEN];
outputNumInput(&(t->num), c);
- sprintf(str, "Envelope: %s", c);
+ sprintf(str, IFACE_("Envelope: %s"), c);
}
else {
- sprintf(str, "Envelope: %3f", ratio);
+ sprintf(str, IFACE_("Envelope: %3f"), ratio);
}
for (i = 0; i < t->total; i++, td++) {
@@ -5922,12 +5932,12 @@ int EdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- BLI_snprintf(str, sizeof(str), "Edge Slide: %s (E)ven: %s, (F)lipped: %s",
- &c[0], !is_proportional ? "ON" : "OFF", flipped ? "ON" : "OFF");
+ BLI_snprintf(str, sizeof(str), IFACE_("Edge Slide: %s (E)ven: %s, (F)lipped: %s"),
+ &c[0], !is_proportional ? IFACE_("ON") : IFACE_("OFF"), flipped ? IFACE_("ON") : IFACE_("OFF"));
}
else {
- BLI_snprintf(str, sizeof(str), "Edge Slide: %.4f (E)ven: %s, (F)lipped: %s",
- final, !is_proportional ? "ON" : "OFF", flipped ? "ON" : "OFF");
+ BLI_snprintf(str, sizeof(str), IFACE_("Edge Slide: %.4f (E)ven: %s, (F)lipped: %s"),
+ final, !is_proportional ? IFACE_("ON") : IFACE_("OFF"), flipped ? IFACE_("ON") : IFACE_("OFF"));
}
CLAMP(final, -1.0f, 1.0f);
@@ -5938,7 +5948,7 @@ int EdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
if (t->customData)
doEdgeSlide(t, final);
else {
- strcpy(str, "Invalid Edge Selection");
+ strcpy(str, IFACE_("Invalid Edge Selection"));
t->state = TRANS_CANCEL;
}
@@ -6054,7 +6064,6 @@ static int createVertSlideVerts(TransInfo *t)
}
sld->is_proportional = true;
- sld->is_clamp = true;
sld->curr_sv_index = 0;
sld->flipped_vtx = false;
@@ -6252,7 +6261,7 @@ int handleEventVertSlide(struct TransInfo *t, struct wmEvent *event)
{
/* use like a modifier key */
if (event->val == KM_PRESS) {
- sld->is_clamp = !sld->is_clamp;
+ t->flag ^= T_ALT_TRANSFORM;
calcVertSlideCustomPoints(t);
return 1;
}
@@ -6278,7 +6287,8 @@ int handleEventVertSlide(struct TransInfo *t, struct wmEvent *event)
case MOUSEMOVE:
{
/* don't recalculat the best edge */
- if (sld->is_clamp) {
+ const bool is_clamp = !(t->flag & T_ALT_TRANSFORM);
+ if (is_clamp) {
calcVertSlideMouseActiveEdges(t, event->mval);
}
calcVertSlideCustomPoints(t);
@@ -6303,6 +6313,7 @@ static void drawVertSlide(const struct bContext *C, TransInfo *t)
const float ctrl_size = UI_GetThemeValuef(TH_FACEDOT_SIZE) + 1.5f;
const float line_size = UI_GetThemeValuef(TH_OUTLINE_WIDTH) + 0.5f;
const int alpha_shade = -30;
+ const bool is_clamp = !(t->flag & T_ALT_TRANSFORM);
int i;
if (v3d && v3d->zbuf)
@@ -6319,7 +6330,7 @@ static void drawVertSlide(const struct bContext *C, TransInfo *t)
glLineWidth(line_size);
UI_ThemeColorShadeAlpha(TH_EDGE_SELECT, 80, alpha_shade);
glBegin(GL_LINES);
- if (sld->is_clamp) {
+ if (is_clamp) {
sv = sld->sv;
for (i = 0; i < sld->totsv; i++, sv++) {
glVertex3fv(sv->co_orig_3d);
@@ -6412,7 +6423,8 @@ int VertSlide(TransInfo *t, const int UNUSED(mval[2]))
VertSlideData *sld = t->customData;
const bool flipped = sld->flipped_vtx;
const bool is_proportional = sld->is_proportional;
- const bool is_constrained = !(sld->is_clamp == false || hasNumInput(&t->num));
+ const bool is_clamp = !(t->flag & T_ALT_TRANSFORM);
+ const bool is_constrained = !(is_clamp == false || hasNumInput(&t->num));
final = t->values[0];
@@ -6425,7 +6437,7 @@ int VertSlide(TransInfo *t, const int UNUSED(mval[2]))
/* header string */
str_p = str;
- str_p += BLI_snprintf(str_p, sizeof(str), "Vert Slide: ");
+ str_p += BLI_snprintf(str_p, sizeof(str), IFACE_("Vert Slide: "));
if (hasNumInput(&t->num)) {
char c[NUM_STR_REP_LEN];
applyNumInput(&t->num, &final);
@@ -6435,24 +6447,22 @@ int VertSlide(TransInfo *t, const int UNUSED(mval[2]))
else {
str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), "%.4f ", final);
}
- str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), "(E)ven: %s, ", !is_proportional ? "ON" : "OFF");
+ str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_("(E)ven: %s, "),
+ !is_proportional ? IFACE_("ON") : IFACE_("OFF"));
if (!is_proportional) {
- str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), "(F)lipped: %s, ", flipped ? "ON" : "OFF");
+ str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_("(F)lipped: %s, "),
+ flipped ? IFACE_("ON") : IFACE_("OFF"));
}
- str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), "(C)lamp: %s", sld->is_clamp ? "ON" : "OFF");
+ str_p += BLI_snprintf(str_p, sizeof(str) - (str_p - str), IFACE_("Alt or (C)lamp: %s"),
+ is_clamp ? IFACE_("ON") : IFACE_("OFF"));
/* done with header string */
- if (is_constrained) {
- CLAMP(final, 0.0f, 1.0f);
- }
-
- t->values[0] = final;
-
/*do stuff here*/
- if (t->customData)
+ if (t->customData) {
doVertSlide(t, final);
+ }
else {
- strcpy(str, "Invalid Vert Selection");
+ strcpy(str, IFACE_("Invalid Vert Selection"));
t->state = TRANS_CANCEL;
}
@@ -6503,12 +6513,12 @@ int BoneRoll(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "Roll: %s", &c[0]);
+ sprintf(str, IFACE_("Roll: %s"), &c[0]);
final = DEG2RADF(final);
}
else {
- sprintf(str, "Roll: %.2f", RAD2DEGF(final));
+ sprintf(str, IFACE_("Roll: %.2f"), RAD2DEGF(final));
}
/* set roll values */
@@ -6574,16 +6584,16 @@ int BakeTime(TransInfo *t, const int mval[2])
outputNumInput(&(t->num), c);
if (time >= 0.0f)
- sprintf(str, "Time: +%s %s", c, t->proptext);
+ sprintf(str, IFACE_("Time: +%s %s"), c, t->proptext);
else
- sprintf(str, "Time: %s %s", c, t->proptext);
+ sprintf(str, IFACE_("Time: %s %s"), c, t->proptext);
}
else {
/* default header print */
if (time >= 0.0f)
- sprintf(str, "Time: +%.3f %s", time, t->proptext);
+ sprintf(str, IFACE_("Time: +%.3f %s"), time, t->proptext);
else
- sprintf(str, "Time: %.3f %s", time, t->proptext);
+ sprintf(str, IFACE_("Time: %.3f %s"), time, t->proptext);
}
for (i = 0; i < t->total; i++, td++) {
@@ -6643,7 +6653,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
t->con.applySize(t, NULL, mat);
}
- sprintf(str, "Mirror%s", t->con.text);
+ sprintf(str, IFACE_("Mirror%s"), t->con.text);
for (i = 0, td = t->data; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
@@ -6677,9 +6687,9 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
if (t->flag & T_2D_EDIT)
- ED_area_headerprint(t->sa, "Select a mirror axis (X, Y)");
+ ED_area_headerprint(t->sa, IFACE_("Select a mirror axis (X, Y)"));
else
- ED_area_headerprint(t->sa, "Select a mirror axis (X, Y, Z)");
+ ED_area_headerprint(t->sa, IFACE_("Select a mirror axis (X, Y, Z)"));
}
return 1;
@@ -6736,7 +6746,7 @@ int Align(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_area_headerprint(t->sa, "Align");
+ ED_area_headerprint(t->sa, IFACE_("Align"));
return 1;
}
@@ -6773,7 +6783,7 @@ static void headerSeqSlide(TransInfo *t, float val[2], char *str, size_t str_len
}
str_p = str;
- str_p += BLI_snprintf(str, str_len, "Sequence Slide: %s%s, (", &tvec[0], t->con.text);
+ str_p += BLI_snprintf(str, str_len, IFACE_("Sequence Slide: %s%s, ("), &tvec[0], t->con.text);
{
wmKeyMapItem *kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE);
@@ -6781,8 +6791,8 @@ static void headerSeqSlide(TransInfo *t, float val[2], char *str, size_t str_len
str_p += WM_keymap_item_to_string(kmi, str_p, str_len - (str_p - str));
}
}
- str_p += BLI_snprintf(str_p, str_len - (str_p - str), " or Alt) Expand to fit %s",
- (t->flag & T_ALT_TRANSFORM) ? "ON" : "OFF");
+ str_p += BLI_snprintf(str_p, str_len - (str_p - str), IFACE_(" or Alt) Expand to fit %s"),
+ (t->flag & T_ALT_TRANSFORM) ? IFACE_("ON") : IFACE_("OFF"));
}
static void applySeqSlide(TransInfo *t, float val[2])
@@ -7047,7 +7057,7 @@ static void headerTimeTranslate(TransInfo *t, char *str)
sprintf(&tvec[0], "%.4f", val);
}
- sprintf(str, "DeltaX: %s", &tvec[0]);
+ sprintf(str, IFACE_("DeltaX: %s"), &tvec[0]);
}
static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
@@ -7188,7 +7198,7 @@ static void headerTimeSlide(TransInfo *t, float sval, char *str)
sprintf(&tvec[0], "%.4f", val);
}
- sprintf(str, "TimeSlide: %s", &tvec[0]);
+ sprintf(str, IFACE_("TimeSlide: %s"), &tvec[0]);
}
static void applyTimeSlide(TransInfo *t, float sval)
@@ -7320,7 +7330,7 @@ static void headerTimeScale(TransInfo *t, char *str)
else
sprintf(&tvec[0], "%.4f", t->values[0]);
- sprintf(str, "ScaleX: %s", &tvec[0]);
+ sprintf(str, IFACE_("ScaleX: %s"), &tvec[0]);
}
static void applyTimeScale(TransInfo *t)
@@ -7389,3 +7399,10 @@ void BIF_TransformSetUndo(const char *UNUSED(str))
// TRANSFORM_FIX_ME
//Trans.undostr = str;
}
+
+
+/* TODO, move to: transform_queries.c */
+bool checkUseLocalCenter_GraphEdit(TransInfo *t)
+{
+ return ((t->around == V3D_LOCAL) && !ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE));
+}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 78f346be2aa..9c57c74a26d 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -239,7 +239,6 @@ typedef struct VertSlideData {
float perc;
bool is_proportional;
- bool is_clamp;
bool flipped_vtx;
int curr_sv_index;
@@ -746,4 +745,8 @@ void projectEdgeSlideData(TransInfo *t, bool is_final);
void freeVertSlideVerts(TransInfo *t);
+
+/* TODO. transform_queries.c */
+bool checkUseLocalCenter_GraphEdit(TransInfo *t);
+
#endif
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 097e4592933..c4d61472f18 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -60,6 +60,8 @@
#include "BLI_utildefines.h"
#include "BLI_string.h"
+#include "BLF_translation.h"
+
#include "UI_resources.h"
#include "transform.h"
@@ -598,24 +600,24 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
case V3D_MANIP_GLOBAL:
{
float mtx[3][3] = MAT3_UNITY;
- BLI_snprintf(text, sizeof(text), ftext, "global");
+ BLI_snprintf(text, sizeof(text), ftext, IFACE_("global"));
setConstraint(t, mtx, mode, text);
}
break;
case V3D_MANIP_LOCAL:
- BLI_snprintf(text, sizeof(text), ftext, "local");
+ BLI_snprintf(text, sizeof(text), ftext, IFACE_("local"));
setLocalConstraint(t, mode, text);
break;
case V3D_MANIP_NORMAL:
- BLI_snprintf(text, sizeof(text), ftext, "normal");
+ BLI_snprintf(text, sizeof(text), ftext, IFACE_("normal"));
setConstraint(t, t->spacemtx, mode, text);
break;
case V3D_MANIP_VIEW:
- BLI_snprintf(text, sizeof(text), ftext, "view");
+ BLI_snprintf(text, sizeof(text), ftext, IFACE_("view"));
setConstraint(t, t->spacemtx, mode, text);
break;
case V3D_MANIP_GIMBAL:
- BLI_snprintf(text, sizeof(text), ftext, "gimbal");
+ BLI_snprintf(text, sizeof(text), ftext, IFACE_("gimbal"));
setConstraint(t, t->spacemtx, mode, text);
break;
default: /* V3D_MANIP_CUSTOM */
@@ -865,11 +867,11 @@ static void setNearestAxis2d(TransInfo *t)
/* no correction needed... just use whichever one is lower */
if (abs(t->mval[0] - t->con.imval[0]) < abs(t->mval[1] - t->con.imval[1]) ) {
t->con.mode |= CON_AXIS1;
- BLI_snprintf(t->con.text, sizeof(t->con.text), " along Y axis");
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along Y axis"));
}
else {
t->con.mode |= CON_AXIS0;
- BLI_snprintf(t->con.text, sizeof(t->con.text), " along X axis");
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along X axis"));
}
}
@@ -920,31 +922,31 @@ static void setNearestAxis3d(TransInfo *t)
if (len[0] <= len[1] && len[0] <= len[2]) {
if (t->modifiers & MOD_CONSTRAINT_PLANE) {
t->con.mode |= (CON_AXIS1 | CON_AXIS2);
- BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s X axis", t->spacename);
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" locking %s X axis"), t->spacename);
}
else {
t->con.mode |= CON_AXIS0;
- BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s X axis", t->spacename);
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along %s X axis"), t->spacename);
}
}
else if (len[1] <= len[0] && len[1] <= len[2]) {
if (t->modifiers & MOD_CONSTRAINT_PLANE) {
t->con.mode |= (CON_AXIS0 | CON_AXIS2);
- BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s Y axis", t->spacename);
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" locking %s Y axis"), t->spacename);
}
else {
t->con.mode |= CON_AXIS1;
- BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s Y axis", t->spacename);
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along %s Y axis"), t->spacename);
}
}
else if (len[2] <= len[1] && len[2] <= len[0]) {
if (t->modifiers & MOD_CONSTRAINT_PLANE) {
t->con.mode |= (CON_AXIS0 | CON_AXIS1);
- BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s Z axis", t->spacename);
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" locking %s Z axis"), t->spacename);
}
else {
t->con.mode |= CON_AXIS2;
- BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s Z axis", t->spacename);
+ BLI_snprintf(t->con.text, sizeof(t->con.text), IFACE_(" along %s Z axis"), t->spacename);
}
}
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 7d62775ae58..5be06188e4e 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -123,6 +123,7 @@
#include "BLO_sys_types.h" // for intptr_t support
+
/* local function prototype - for Object/Bone Constraints */
static short constraints_list_needinv(TransInfo *t, ListBase *list);
@@ -3530,7 +3531,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
int count = 0, i;
float cfra;
float mtx[3][3], smtx[3][3];
- const short use_handle = !(sipo->flag & SIPO_NOHANDLES);
+ const bool use_handle = !(sipo->flag & SIPO_NOHANDLES);
+ const bool use_local_center = checkUseLocalCenter_GraphEdit(t);
+ const short anim_map_flag = ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS;
/* determine what type of data we are operating on */
if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -3662,7 +3665,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
if (fcu->bezt == NULL)
continue;
- ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS);
+ ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, anim_map_flag);
/* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */
for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
@@ -3697,7 +3700,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
}
/* only include main vert if selected */
- if (sel2 && (sipo->around != V3D_LOCAL || ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE))) {
+ if (sel2 && (use_local_center == false)) {
/* move handles relative to center */
if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) {
@@ -3733,6 +3736,13 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
/* Sets handles based on the selection */
testhandles_fcurve(fcu, use_handle);
+
+ /* even though transform values are written back right after during transform,
+ * using individual center's with rotation means the center point wont
+ * be touched again see: [#34303] */
+ if (use_local_center) {
+ ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, anim_map_flag | ANIM_UNITCONV_RESTORE);
+ }
}
/* cleanup temp list */
@@ -4733,6 +4743,7 @@ static void set_trans_object_base_flags(TransInfo *t)
}
/* all recalc flags get flushed to all layers, so a layer flip later on works fine */
+ DAG_scene_relations_update(G.main, t->scene);
DAG_scene_flush_update(G.main, t->scene, -1, 0);
/* and we store them temporal in base (only used for transform code) */
@@ -4810,6 +4821,7 @@ static int count_proportional_objects(TransInfo *t)
/* all recalc flags get flushed to all layers, so a layer flip later on works fine */
+ DAG_scene_relations_update(G.main, t->scene);
DAG_scene_flush_update(G.main, t->scene, -1, 0);
/* and we store them temporal in base (only used for transform code) */
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index ef775ae3128..c2a331f5249 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -56,6 +56,8 @@
#include "BLI_rand.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "RNA_access.h"
#include "BIF_gl.h"
@@ -130,6 +132,7 @@ void getViewVector(TransInfo *t, float coord[3], float vec[3])
/* ************************** GENERICS **************************** */
+
static void clipMirrorModifier(TransInfo *t, Object *ob)
{
ModifierData *md = ob->modifiers.first;
@@ -377,6 +380,8 @@ static void recalcData_graphedit(TransInfo *t)
bAnimListElem *ale;
int dosort = 0;
+
+ const bool use_local_center = checkUseLocalCenter_GraphEdit(t);
/* initialize relevant anim-context 'context' data from TransInfo data */
@@ -405,9 +410,10 @@ static void recalcData_graphedit(TransInfo *t)
/* ignore unselected fcurves */
if (!fcu_test_selected(fcu))
continue;
-
- // fixme: only do this for selected verts...
- ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS | ANIM_UNITCONV_RESTORE);
+
+ ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data,
+ ANIM_UNITCONV_ONLYSEL | ANIM_UNITCONV_SELVERTS | ANIM_UNITCONV_RESTORE |
+ (use_local_center ? ANIM_UNITCONV_SKIPKNOTS : 0));
/* watch it: if the time is wrong: do not correct handles yet */
@@ -805,6 +811,7 @@ static void recalcData_view3d(TransInfo *t)
if (td->extra) {
float vec[3], up_axis[3];
float qrot[4];
+ float roll;
ebo = td->extra;
copy_v3_v3(up_axis, td->axismtx[2]);
@@ -819,7 +826,9 @@ static void recalcData_view3d(TransInfo *t)
mul_m3_v3(t->mat, up_axis);
}
- ebo->roll = ED_rollBoneToVector(ebo, up_axis, TRUE);
+ /* roll has a tendency to flip in certain orientations - [#34283], [#33974] */
+ roll = ED_rollBoneToVector(ebo, up_axis, false);
+ ebo->roll = angle_compat_rad(roll, ebo->roll);
}
}
}
@@ -1761,25 +1770,25 @@ void calculatePropRatio(TransInfo *t)
}
switch (t->prop_mode) {
case PROP_SHARP:
- strcpy(t->proptext, "(Sharp)");
+ strcpy(t->proptext, IFACE_("(Sharp)"));
break;
case PROP_SMOOTH:
- strcpy(t->proptext, "(Smooth)");
+ strcpy(t->proptext, IFACE_("(Smooth)"));
break;
case PROP_ROOT:
- strcpy(t->proptext, "(Root)");
+ strcpy(t->proptext, IFACE_("(Root)"));
break;
case PROP_LIN:
- strcpy(t->proptext, "(Linear)");
+ strcpy(t->proptext, IFACE_("(Linear)"));
break;
case PROP_CONST:
- strcpy(t->proptext, "(Constant)");
+ strcpy(t->proptext, IFACE_("(Constant)"));
break;
case PROP_SPHERE:
- strcpy(t->proptext, "(Sphere)");
+ strcpy(t->proptext, IFACE_("(Sphere)"));
break;
case PROP_RANDOM:
- strcpy(t->proptext, "(Random)");
+ strcpy(t->proptext, IFACE_("(Random)"));
break;
default:
t->proptext[0] = '\0';
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 4bd6496e083..e507d062b0e 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -493,25 +493,25 @@ void initTransformOrientation(bContext *C, TransInfo *t)
switch (t->current_orientation) {
case V3D_MANIP_GLOBAL:
unit_m3(t->spacemtx);
- strcpy(t->spacename, "global");
+ strcpy(t->spacename, IFACE_("global"));
break;
case V3D_MANIP_GIMBAL:
unit_m3(t->spacemtx);
if (gimbal_axis(ob, t->spacemtx)) {
- strcpy(t->spacename, "gimbal");
+ strcpy(t->spacename, IFACE_("gimbal"));
break;
}
/* no gimbal fallthrough to normal */
case V3D_MANIP_NORMAL:
if (obedit || (ob && ob->mode & OB_MODE_POSE)) {
- strcpy(t->spacename, "normal");
+ strcpy(t->spacename, IFACE_("normal"));
ED_getTransformOrientationMatrix(C, t->spacemtx, (v3d->around == V3D_ACTIVE));
break;
}
/* no break we define 'normal' as 'local' in Object mode */
case V3D_MANIP_LOCAL:
- strcpy(t->spacename, "local");
+ strcpy(t->spacename, IFACE_("local"));
if (ob) {
copy_m3_m4(t->spacemtx, ob->obmat);
@@ -528,7 +528,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
RegionView3D *rv3d = t->ar->regiondata;
float mat[3][3];
- strcpy(t->spacename, "view");
+ strcpy(t->spacename, IFACE_("view"));
copy_m3_m4(mat, rv3d->viewinv);
normalize_m3(mat);
copy_m3_m3(t->spacemtx, mat);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 5577619901a..2efd35327c7 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -303,6 +303,9 @@ void applyProject(TransInfo *t)
if (td->flag & TD_SKIP)
continue;
+
+ if ((t->flag & T_PROP_EDIT) && (td->factor == 0.0f))
+ continue;
copy_v3_v3(iloc, td->loc);
if (t->flag & (T_EDIT | T_POSE)) {
diff --git a/source/blender/editors/uvedit/CMakeLists.txt b/source/blender/editors/uvedit/CMakeLists.txt
index 1c69e569aa6..695a7cdd0f6 100644
--- a/source/blender/editors/uvedit/CMakeLists.txt
+++ b/source/blender/editors/uvedit/CMakeLists.txt
@@ -22,6 +22,7 @@ set(INC
../include
../../blenkernel
../../blenlib
+ ../../blenfont
../../blenloader
../../bmesh
../../makesdna
@@ -47,4 +48,8 @@ set(SRC
uvedit_parametrizer.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_uvedit "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/uvedit/SConscript b/source/blender/editors/uvedit/SConscript
index 01316680d5d..dfa15d2de4f 100644
--- a/source/blender/editors/uvedit/SConscript
+++ b/source/blender/editors/uvedit/SConscript
@@ -27,10 +27,15 @@
Import ('env')
+defs = []
+
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs = '../include ../../blenlib ../../blenfont ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../bmesh ../../makesrna #/intern/opennl/extern ../../gpu ../../blenloader'
-env.BlenderLib ( 'bf_editors_uvedit', sources, Split(incs), [], libtype=['core'], priority=[45] )
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_uvedit', sources, Split(incs), defs, libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c
index 1c32c01b8f0..5c188628978 100644
--- a/source/blender/editors/uvedit/uvedit_buttons.c
+++ b/source/blender/editors/uvedit/uvedit_buttons.c
@@ -43,6 +43,8 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_mesh.h"
@@ -152,8 +154,10 @@ static void uvedit_vertex_buttons(const bContext *C, uiBlock *block)
}
uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_UVEDIT_VERTEX, "X:", 10, 10, 145, 19, &uvedit_old_center[0], -10 * imx, 10.0 * imx, step, digits, "");
- uiDefButF(block, NUM, B_UVEDIT_VERTEX, "Y:", 165, 10, 145, 19, &uvedit_old_center[1], -10 * imy, 10.0 * imy, step, digits, "");
+ uiDefButF(block, NUM, B_UVEDIT_VERTEX, IFACE_("X:"), 10, 10, 145, 19, &uvedit_old_center[0],
+ -10 * imx, 10.0 * imx, step, digits, "");
+ uiDefButF(block, NUM, B_UVEDIT_VERTEX, IFACE_("Y:"), 165, 10, 145, 19, &uvedit_old_center[1],
+ -10 * imy, 10.0 * imy, step, digits, "");
uiBlockEndAlign(block);
}
}
@@ -214,7 +218,7 @@ void ED_uvedit_buttons_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype image panel uv");
strcpy(pt->idname, "IMAGE_PT_uv");
- strcpy(pt->label, "UV Vertex");
+ strcpy(pt->label, N_("UV Vertex")); /* XXX C panels are not available through RNA (bpy.types)! */
pt->draw = image_panel_uv;
pt->poll = image_panel_uv_poll;
BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h
index 7faec33ca98..d1893d639bb 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -79,7 +79,7 @@ void uvedit_get_aspect(struct Scene *scene, struct Object *ob, struct BMEditMesh
void UV_OT_average_islands_scale(struct wmOperatorType *ot);
void UV_OT_cube_project(struct wmOperatorType *ot);
void UV_OT_cylinder_project(struct wmOperatorType *ot);
-void UV_OT_from_view(struct wmOperatorType *ot);
+void UV_OT_project_from_view(struct wmOperatorType *ot);
void UV_OT_minimize_stretch(struct wmOperatorType *ot);
void UV_OT_pack_islands(struct wmOperatorType *ot);
void UV_OT_reset(struct wmOperatorType *ot);
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index e158f8843b7..a17d3c20c1c 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -4053,7 +4053,7 @@ void ED_operatortypes_uvedit(void)
WM_operatortype_append(UV_OT_average_islands_scale);
WM_operatortype_append(UV_OT_cube_project);
WM_operatortype_append(UV_OT_cylinder_project);
- WM_operatortype_append(UV_OT_from_view);
+ WM_operatortype_append(UV_OT_project_from_view);
WM_operatortype_append(UV_OT_minimize_stretch);
WM_operatortype_append(UV_OT_pack_islands);
WM_operatortype_append(UV_OT_reset);
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 767003bdd84..bf5fc9a3021 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -709,7 +709,7 @@ static void p_face_restore_uvs(PFace *f)
static PVert *p_vert_add(PHandle *handle, PHashKey key, const float co[3], PEdge *e)
{
- PVert *v = (PVert *)BLI_memarena_alloc(handle->arena, sizeof *v);
+ PVert *v = (PVert *)BLI_memarena_alloc(handle->arena, sizeof(*v));
copy_v3_v3(v->co, co);
v->u.key = key;
v->edge = e;
@@ -732,7 +732,7 @@ static PVert *p_vert_lookup(PHandle *handle, PHashKey key, const float co[3], PE
static PVert *p_vert_copy(PChart *chart, PVert *v)
{
- PVert *nv = (PVert *)BLI_memarena_alloc(chart->handle->arena, sizeof *nv);
+ PVert *nv = (PVert *)BLI_memarena_alloc(chart->handle->arena, sizeof(*nv));
copy_v3_v3(nv->co, v->co);
nv->uv[0] = v->uv[0];
@@ -786,7 +786,7 @@ static int p_face_exists(ParamHandle *phandle, ParamKey *pvkeys, int i1, int i2,
static PChart *p_chart_new(PHandle *handle)
{
- PChart *chart = (PChart *)MEM_callocN(sizeof *chart, "PChart");
+ PChart *chart = (PChart *)MEM_callocN(sizeof(*chart), "PChart");
chart->handle = handle;
return chart;
@@ -904,7 +904,7 @@ static PBool p_edge_connect_pair(PHandle *handle, PEdge *e, PEdge ***stack, PBoo
static int p_connect_pairs(PHandle *handle, PBool impl)
{
- PEdge **stackbase = MEM_mallocN(sizeof *stackbase * phash_size(handle->hash_faces), "Pstackbase");
+ PEdge **stackbase = MEM_mallocN(sizeof(*stackbase) * phash_size(handle->hash_faces), "Pstackbase");
PEdge **stack = stackbase;
PFace *f, *first;
PEdge *e, *e1, *e2;
@@ -999,7 +999,7 @@ static void p_split_vert(PChart *chart, PEdge *e)
static PChart **p_split_charts(PHandle *handle, PChart *chart, int ncharts)
{
- PChart **charts = MEM_mallocN(sizeof *charts * ncharts, "PCharts"), *nchart;
+ PChart **charts = MEM_mallocN(sizeof(*charts) * ncharts, "PCharts"), *nchart;
PFace *f, *nextf;
int i;
@@ -1041,12 +1041,12 @@ static PFace *p_face_add(PHandle *handle)
PEdge *e1, *e2, *e3;
/* allocate */
- f = (PFace *)BLI_memarena_alloc(handle->arena, sizeof *f);
+ f = (PFace *)BLI_memarena_alloc(handle->arena, sizeof(*f));
f->flag = 0; /* init ! */
- e1 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof *e1);
- e2 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof *e2);
- e3 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof *e3);
+ e1 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof(*e1));
+ e2 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof(*e2));
+ e3 = (PEdge *)BLI_memarena_alloc(handle->arena, sizeof(*e3));
/* set up edges */
f->edge = e1;
@@ -3674,7 +3674,7 @@ static PBool p_triangle_inside(SmoothTriangle *t, float co[2])
static SmoothNode *p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, float *bmin, float *bmax, int depth)
{
- SmoothNode *node = BLI_memarena_alloc(arena, sizeof *node);
+ SmoothNode *node = BLI_memarena_alloc(arena, sizeof(*node));
int axis, i, t1size = 0, t2size = 0;
float split, /* mi, */ /* UNUSED */ mx;
SmoothTriangle **t1, **t2, *t;
@@ -4114,7 +4114,7 @@ static void p_smooth(PChart *chart)
ParamHandle *param_construct_begin(void)
{
- PHandle *handle = MEM_callocN(sizeof *handle, "PHandle");
+ PHandle *handle = MEM_callocN(sizeof(*handle), "PHandle");
handle->construction_chart = p_chart_new(handle);
handle->state = PHANDLE_STATE_ALLOCATED;
handle->arena = BLI_memarena_new((1 << 16), "param construct arena");
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 00b82e26a05..4ddf4bd6a5c 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -1387,7 +1387,7 @@ static int uv_from_view_poll(bContext *C)
return (rv3d != NULL);
}
-void UV_OT_from_view(wmOperatorType *ot)
+void UV_OT_project_from_view(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Project From View";