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:
authorCampbell Barton <ideasman42@gmail.com>2019-02-08 07:14:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-08 07:22:15 +0300
commit46ac288a930673af3cf2a253a933f2663566295d (patch)
tree81a88134e8404977ef3d60b2e31f89c74e841600 /source/blender/editors/transform
parentd86894b9e43a44ed7f9d937325e74859f254ebf2 (diff)
Cleanup: rename V3D_MANIP_* -> V3D_ORIENT_*
Wasn't obvious it's related to orientation, also term manipulator is no longer in use.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.c18
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_constraints.c16
-rw-r--r--source/blender/editors/transform/transform_generics.c16
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c22
-rw-r--r--source/blender/editors/transform/transform_gizmo_extrude_3d.c8
-rw-r--r--source/blender/editors/transform/transform_ops.c2
-rw-r--r--source/blender/editors/transform/transform_orientations.c22
8 files changed, 53 insertions, 53 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 6ab8d55abeb..2327ead4770 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -985,7 +985,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
stopConstraint(t);
}
else {
- setUserConstraint(t, V3D_MANIP_GLOBAL, constraint_axis, msg1);
+ setUserConstraint(t, V3D_ORIENT_GLOBAL, constraint_axis, msg1);
}
}
else if (!edit_2d) {
@@ -993,7 +993,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
/* First press, constraint to an axis. */
t->orientation.index = 0;
const short *orientation_ptr = t->orientation.types[t->orientation.index];
- const short orientation = orientation_ptr ? *orientation_ptr : V3D_MANIP_GLOBAL;
+ const short orientation = orientation_ptr ? *orientation_ptr : V3D_ORIENT_GLOBAL;
if (is_plane == false) {
setUserConstraint(t, orientation, constraint_axis, msg2);
}
@@ -1010,7 +1010,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
}
else {
const short *orientation_ptr = t->orientation.types[t->orientation.index];
- const short orientation = orientation_ptr ? *orientation_ptr : V3D_MANIP_GLOBAL;
+ const short orientation = orientation_ptr ? *orientation_ptr : V3D_ORIENT_GLOBAL;
if (is_plane == false) {
setUserConstraint(t, orientation, constraint_axis, msg2);
}
@@ -1153,7 +1153,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
if (ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) {
/* Scale isn't normally very useful after extrude along normals, see T39756 */
- if ((t->con.mode & CON_APPLY) && (t->con.orientation == V3D_MANIP_NORMAL)) {
+ if ((t->con.mode & CON_APPLY) && (t->con.orientation == V3D_ORIENT_NORMAL)) {
stopConstraint(t);
}
@@ -2138,7 +2138,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
if (t->spacetype == SPACE_VIEW3D) {
if ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) &&
!RNA_property_is_set(op->ptr, prop) &&
- (t->orientation.user != V3D_MANIP_CUSTOM_MATRIX))
+ (t->orientation.user != V3D_ORIENT_CUSTOM_MATRIX))
{
TransformOrientationSlot *orient_slot = &t->scene->orientation_slots[SCE_ORIENT_DEFAULT];
orient_slot->type = t->orientation.user;
@@ -2172,20 +2172,20 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
* so use the orientation in the constraint if set */
short orientation = (t->con.mode & CON_APPLY) ? t->con.orientation : t->orientation.user;
- if (orientation == V3D_MANIP_CUSTOM) {
+ if (orientation == V3D_ORIENT_CUSTOM) {
const int orientation_index_custom = BKE_scene_transform_orientation_get_index(
t->scene, t->orientation.custom);
/* Maybe we need a t->con.custom_orientation?
* Seems like it would always match t->orientation.custom. */
- orientation = V3D_MANIP_CUSTOM + orientation_index_custom;
- BLI_assert(orientation >= V3D_MANIP_CUSTOM);
+ orientation = V3D_ORIENT_CUSTOM + orientation_index_custom;
+ BLI_assert(orientation >= V3D_ORIENT_CUSTOM);
}
RNA_float_set_array(op->ptr, "constraint_matrix", &t->spacemtx[0][0]);
/* Use 'constraint_matrix' instead. */
- if (orientation != V3D_MANIP_CUSTOM_MATRIX) {
+ if (orientation != V3D_ORIENT_CUSTOM_MATRIX) {
RNA_enum_set(op->ptr, "constraint_orientation", orientation);
}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 51a69c952c4..e72075dde21 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -611,7 +611,7 @@ typedef struct TransInfo {
short user_alt;
short index;
short *types[2];
- /* this gets used when custom_orientation is V3D_MANIP_CUSTOM */
+ /* this gets used when custom_orientation is V3D_ORIENT_CUSTOM */
TransformOrientation *custom;
} orientation;
/** backup from view3d, to restore on end. */
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 7a67c3cfb32..b0ce411ca23 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -658,7 +658,7 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
char text[256];
switch (orientation) {
- case V3D_MANIP_GLOBAL:
+ case V3D_ORIENT_GLOBAL:
{
float mtx[3][3];
BLI_snprintf(text, sizeof(text), ftext, IFACE_("global"));
@@ -666,11 +666,11 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
setConstraint(t, mtx, mode, text);
break;
}
- case V3D_MANIP_LOCAL:
+ case V3D_ORIENT_LOCAL:
BLI_snprintf(text, sizeof(text), ftext, IFACE_("local"));
setLocalConstraint(t, mode, text);
break;
- case V3D_MANIP_NORMAL:
+ case V3D_ORIENT_NORMAL:
BLI_snprintf(text, sizeof(text), ftext, IFACE_("normal"));
if (checkUseAxisMatrix(t)) {
setAxisMatrixConstraint(t, mode, text);
@@ -679,23 +679,23 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
setConstraint(t, t->spacemtx, mode, text);
}
break;
- case V3D_MANIP_VIEW:
+ case V3D_ORIENT_VIEW:
BLI_snprintf(text, sizeof(text), ftext, IFACE_("view"));
setConstraint(t, t->spacemtx, mode, text);
break;
- case V3D_MANIP_CURSOR:
+ case V3D_ORIENT_CURSOR:
BLI_snprintf(text, sizeof(text), ftext, IFACE_("cursor"));
setConstraint(t, t->spacemtx, mode, text);
break;
- case V3D_MANIP_GIMBAL:
+ case V3D_ORIENT_GIMBAL:
BLI_snprintf(text, sizeof(text), ftext, IFACE_("gimbal"));
setConstraint(t, t->spacemtx, mode, text);
break;
- case V3D_MANIP_CUSTOM_MATRIX:
+ case V3D_ORIENT_CUSTOM_MATRIX:
BLI_snprintf(text, sizeof(text), ftext, IFACE_("custom matrix"));
setConstraint(t, t->spacemtx, mode, text);
break;
- case V3D_MANIP_CUSTOM:
+ case V3D_ORIENT_CUSTOM:
{
char orientation_str[128];
BLI_snprintf(orientation_str, sizeof(orientation_str), "%s \"%s\"",
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 0a8d4ce6fc5..322eb9406c8 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1418,8 +1418,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
NULL);
/* Make second orientation local if both are global. */
- if (t->orientation.user == V3D_MANIP_GLOBAL) {
- t->orientation.user_alt = V3D_MANIP_LOCAL;
+ if (t->orientation.user == V3D_ORIENT_GLOBAL) {
+ t->orientation.user_alt = V3D_ORIENT_LOCAL;
t->orientation.types[0] = &t->orientation.user_alt;
SWAP(short *, t->orientation.types[0], t->orientation.types[1]);
}
@@ -1514,7 +1514,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
RNA_property_is_set(op->ptr, prop)))
{
RNA_property_float_get_array(op->ptr, prop, &t->spacemtx[0][0]);
- t->orientation.user = V3D_MANIP_CUSTOM_MATRIX;
+ t->orientation.user = V3D_ORIENT_CUSTOM_MATRIX;
t->orientation.custom = 0;
}
else if (op && ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) &&
@@ -1523,14 +1523,14 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
short orientation = RNA_property_enum_get(op->ptr, prop);
TransformOrientation *custom_orientation = NULL;
- if (orientation >= V3D_MANIP_CUSTOM) {
- if (orientation >= V3D_MANIP_CUSTOM + BIF_countTransformOrientation(C)) {
- orientation = V3D_MANIP_GLOBAL;
+ if (orientation >= V3D_ORIENT_CUSTOM) {
+ if (orientation >= V3D_ORIENT_CUSTOM + BIF_countTransformOrientation(C)) {
+ orientation = V3D_ORIENT_GLOBAL;
}
else {
custom_orientation = BKE_scene_transform_orientation_find(
- t->scene, orientation - V3D_MANIP_CUSTOM);
- orientation = V3D_MANIP_CUSTOM;
+ t->scene, orientation - V3D_ORIENT_CUSTOM);
+ orientation = V3D_ORIENT_CUSTOM;
}
}
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 5f0cb708eae..be2e2aa68da 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -650,11 +650,11 @@ void ED_transform_calc_orientation_from_type_ex(
bool ok = false;
switch (orientation_type) {
- case V3D_MANIP_GLOBAL:
+ case V3D_ORIENT_GLOBAL:
{
break; /* nothing to do */
}
- case V3D_MANIP_GIMBAL:
+ case V3D_ORIENT_GIMBAL:
{
if (gimbal_axis(ob, r_mat)) {
ok = true;
@@ -663,7 +663,7 @@ void ED_transform_calc_orientation_from_type_ex(
/* if not gimbal, fall through to normal */
ATTR_FALLTHROUGH;
}
- case V3D_MANIP_NORMAL:
+ case V3D_ORIENT_NORMAL:
{
if (obedit || ob->mode & OB_MODE_POSE) {
ED_getTransformOrientationMatrix(C, r_mat, pivot_point);
@@ -673,7 +673,7 @@ void ED_transform_calc_orientation_from_type_ex(
/* no break we define 'normal' as 'local' in Object mode */
ATTR_FALLTHROUGH;
}
- case V3D_MANIP_LOCAL:
+ case V3D_ORIENT_LOCAL:
{
if (ob->mode & OB_MODE_POSE) {
/* each bone moves on its own local axis, but to avoid confusion,
@@ -689,7 +689,7 @@ void ED_transform_calc_orientation_from_type_ex(
ok = true;
break;
}
- case V3D_MANIP_VIEW:
+ case V3D_ORIENT_VIEW:
{
if (rv3d != NULL) {
copy_m3_m4(r_mat, rv3d->viewinv);
@@ -698,13 +698,13 @@ void ED_transform_calc_orientation_from_type_ex(
}
break;
}
- case V3D_MANIP_CURSOR:
+ case V3D_ORIENT_CURSOR:
{
ED_view3d_cursor3d_calc_mat3(scene, r_mat);
ok = true;
break;
}
- case V3D_MANIP_CUSTOM:
+ case V3D_ORIENT_CUSTOM:
{
TransformOrientation *custom_orientation = BKE_scene_transform_orientation_find(
scene, orientation_index_custom);
@@ -1235,7 +1235,7 @@ static void gizmo_xform_message_subscribe(
extern PropertyRNA rna_Scene_cursor_location;
const PropertyRNA *props[] = {
&rna_Scene_transform_orientation_slots,
- ((ts->transform_pivot_point == V3D_AROUND_CURSOR) || (orient_slot->type == V3D_MANIP_CURSOR)) ?
+ ((ts->transform_pivot_point == V3D_AROUND_CURSOR) || (orient_slot->type == V3D_ORIENT_CURSOR)) ?
&rna_Scene_cursor_location : NULL,
};
for (int i = 0; i < ARRAY_SIZE(props); i++) {
@@ -1793,7 +1793,7 @@ static void WIDGETGROUP_gizmo_draw_prepare(const bContext *C, wmGizmoGroup *gzgr
Scene *scene = CTX_data_scene(C);
const TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get(scene, ggd->twtype_init);
switch (orient_slot->type) {
- case V3D_MANIP_VIEW:
+ case V3D_ORIENT_VIEW:
{
WIDGETGROUP_gizmo_refresh(C, gzgroup);
break;
@@ -2076,7 +2076,7 @@ static void WIDGETGROUP_xform_cage_draw_prepare(const bContext *C, wmGizmoGroup
Scene *scene = CTX_data_scene(C);
const TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get(scene, SCE_GIZMO_SHOW_SCALE);
switch (orient_slot->type) {
- case V3D_MANIP_VIEW:
+ case V3D_ORIENT_VIEW:
{
float viewinv_m3[3][3];
copy_m3_m4(viewinv_m3, rv3d->viewinv);
@@ -2240,7 +2240,7 @@ static void WIDGETGROUP_xform_shear_draw_prepare(const bContext *C, wmGizmoGroup
/* Shear is like rotate, use the rotate setting. */
const TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get(scene, SCE_GIZMO_SHOW_ROTATE);
switch (orient_slot->type) {
- case V3D_MANIP_VIEW:
+ case V3D_ORIENT_VIEW:
{
float viewinv_m3[3][3];
copy_m3_m4(viewinv_m3, rv3d->viewinv);
diff --git a/source/blender/editors/transform/transform_gizmo_extrude_3d.c b/source/blender/editors/transform/transform_gizmo_extrude_3d.c
index 784f7236af7..ea5c02f35e8 100644
--- a/source/blender/editors/transform/transform_gizmo_extrude_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_extrude_3d.c
@@ -230,7 +230,7 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup)
ggd->data.orientation_type = scene->orientation_slots[SCE_ORIENT_DEFAULT].type;
const bool use_normal = (
- (ggd->data.orientation_type != V3D_MANIP_NORMAL) ||
+ (ggd->data.orientation_type != V3D_ORIENT_NORMAL) ||
(axis_type == EXTRUDE_AXIS_NORMAL));
const int axis_len_used = use_normal ? 4 : 3;
@@ -240,7 +240,7 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup)
struct TransformBounds tbounds_normal;
if (!ED_transform_calc_gizmo_stats(
C, &(struct TransformCalcParams){
- .orientation_type = V3D_MANIP_NORMAL + 1,
+ .orientation_type = V3D_ORIENT_NORMAL + 1,
}, &tbounds_normal))
{
unit_m3(tbounds_normal.axis);
@@ -353,7 +353,7 @@ static void gizmo_mesh_extrude_draw_prepare(const bContext *C, wmGizmoGroup *gzg
{
GizmoExtrudeGroup *ggd = gzgroup->customdata;
switch (ggd->data.orientation_type) {
- case V3D_MANIP_VIEW:
+ case V3D_ORIENT_VIEW:
{
RegionView3D *rv3d = CTX_wm_region_view3d(C);
float mat[3][3];
@@ -401,7 +401,7 @@ static void gizmo_mesh_extrude_invoke_prepare(const bContext *UNUSED(C), wmGizmo
if (i == 3) {
use_normal_matrix = true;
}
- else if (ggd->data.orientation_type == V3D_MANIP_NORMAL) {
+ else if (ggd->data.orientation_type == V3D_ORIENT_NORMAL) {
use_normal_matrix = true;
}
if (use_normal_matrix) {
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 89e4dbe6a15..8665ccc5f96 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -228,7 +228,7 @@ static bool delete_orientation_poll(bContext *C)
if (ED_operator_areaactive(C) == 0)
return 0;
- return ((scene->orientation_slots[SCE_ORIENT_DEFAULT].type >= V3D_MANIP_CUSTOM) &&
+ return ((scene->orientation_slots[SCE_ORIENT_DEFAULT].type >= V3D_ORIENT_CUSTOM) &&
(scene->orientation_slots[SCE_ORIENT_DEFAULT].index_custom != -1));
}
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index abac0741b01..d75e034a9ad 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -64,8 +64,8 @@ void BIF_clearTransformOrientation(bContext *C)
for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) {
TransformOrientationSlot *orient_slot = &scene->orientation_slots[i];
- if (orient_slot->type == V3D_MANIP_CUSTOM) {
- orient_slot->type = V3D_MANIP_GLOBAL; /* fallback to global */
+ if (orient_slot->type == V3D_ORIENT_CUSTOM) {
+ orient_slot->type = V3D_ORIENT_GLOBAL; /* fallback to global */
orient_slot->index_custom = -1;
}
}
@@ -360,7 +360,7 @@ void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target)
BLI_assert(index != -1);
- scene->orientation_slots[SCE_ORIENT_DEFAULT].type = V3D_MANIP_CUSTOM;
+ scene->orientation_slots[SCE_ORIENT_DEFAULT].type = V3D_ORIENT_CUSTOM;
scene->orientation_slots[SCE_ORIENT_DEFAULT].index_custom = index;
}
@@ -413,26 +413,26 @@ void initTransformOrientation(bContext *C, TransInfo *t)
Object *obedit = CTX_data_active_object(C);
switch (t->orientation.user) {
- case V3D_MANIP_GLOBAL:
+ case V3D_ORIENT_GLOBAL:
unit_m3(t->spacemtx);
BLI_strncpy(t->spacename, IFACE_("global"), sizeof(t->spacename));
break;
- case V3D_MANIP_GIMBAL:
+ case V3D_ORIENT_GIMBAL:
unit_m3(t->spacemtx);
if (ob && gimbal_axis(ob, t->spacemtx)) {
BLI_strncpy(t->spacename, IFACE_("gimbal"), sizeof(t->spacename));
break;
}
ATTR_FALLTHROUGH; /* no gimbal fallthrough to normal */
- case V3D_MANIP_NORMAL:
+ case V3D_ORIENT_NORMAL:
if (obedit || (ob && ob->mode & OB_MODE_POSE)) {
BLI_strncpy(t->spacename, IFACE_("normal"), sizeof(t->spacename));
ED_getTransformOrientationMatrix(C, t->spacemtx, t->around);
break;
}
ATTR_FALLTHROUGH; /* we define 'normal' as 'local' in Object mode */
- case V3D_MANIP_LOCAL:
+ case V3D_ORIENT_LOCAL:
BLI_strncpy(t->spacename, IFACE_("local"), sizeof(t->spacename));
if (ob) {
@@ -445,7 +445,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
break;
- case V3D_MANIP_VIEW:
+ case V3D_ORIENT_VIEW:
if ((t->spacetype == SPACE_VIEW3D) &&
(t->ar->regiontype == RGN_TYPE_WINDOW))
{
@@ -461,17 +461,17 @@ void initTransformOrientation(bContext *C, TransInfo *t)
unit_m3(t->spacemtx);
}
break;
- case V3D_MANIP_CURSOR:
+ case V3D_ORIENT_CURSOR:
{
BLI_strncpy(t->spacename, IFACE_("cursor"), sizeof(t->spacename));
ED_view3d_cursor3d_calc_mat3(t->scene, t->spacemtx);
break;
}
- case V3D_MANIP_CUSTOM_MATRIX:
+ case V3D_ORIENT_CUSTOM_MATRIX:
/* Already set. */
BLI_strncpy(t->spacename, IFACE_("custom"), sizeof(t->spacename));
break;
- case V3D_MANIP_CUSTOM:
+ case V3D_ORIENT_CUSTOM:
BLI_strncpy(t->spacename, t->orientation.custom->name, sizeof(t->spacename));
if (applyTransformOrientation(t->orientation.custom, t->spacemtx, t->spacename)) {