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:
authorJoerg Mueller <nexyon@gmail.com>2011-08-23 00:31:46 +0400
committerJoerg Mueller <nexyon@gmail.com>2011-08-23 00:31:46 +0400
commitf0d5abfcb2b54f6fd7a24220e81e0c88a914d87f (patch)
tree328a631d447ea7c7be2a757d092065c721090f82 /source/blender/editors/space_view3d
parent1d529d83a0693693878749110a05d8b0fa929d0f (diff)
parent6a374d266d8213629f74a9f4c9a4984ddf59ef4c (diff)
Merging trunk up to r39637.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c15
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c54
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c10
6 files changed, 56 insertions, 37 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 75cd250d831..2ab33669e4a 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2414,7 +2414,20 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
}
}
}
-
+
+ /* useful for debugging index vs shape key index */
+#if 0
+ {
+ EditVert *eve;
+ int j;
+ UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
+ for(eve= em->verts.first, j= 0; eve; eve= eve->next, j++) {
+ sprintf(val, "%d:%d", j, eve->keyindex);
+ view3d_cached_text_draw_add(eve->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
+ }
+ }
+#endif
+
if(v3d->zbuf) {
glEnable(GL_DEPTH_TEST);
bglPolygonOffset(rv3d->dist, 0.0f);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 7cf95261211..f8837594ddb 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -721,7 +721,7 @@ static void draw_rotation_guide(RegionView3D *rv3d)
{
#define ROT_AXIS_DETAIL 13
const float s = 0.05f * scale;
- const float step = 2.f * M_PI / ROT_AXIS_DETAIL;
+ const float step = 2.f * (float)(M_PI / ROT_AXIS_DETAIL);
float angle;
int i;
@@ -1041,7 +1041,7 @@ static void drawviewborder_triangle(float x1, float x2, float y1, float y2, cons
glBegin(GL_LINES);
if(w > h) {
if(golden) {
- ofs = w * (1.0f-(1.0f/1.61803399));
+ ofs = w * (1.0f-(1.0f/1.61803399f));
}
else {
ofs = h * (h / w);
@@ -1059,7 +1059,7 @@ static void drawviewborder_triangle(float x1, float x2, float y1, float y2, cons
}
else {
if(golden) {
- ofs = h * (1.0f-(1.0f/1.61803399));
+ ofs = h * (1.0f-(1.0f/1.61803399f));
}
else {
ofs = w * (w / h);
@@ -1203,7 +1203,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
if (ca->dtx & CAM_DTX_GOLDEN) {
UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
- drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399));
+ drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399f));
}
if (ca->dtx & CAM_DTX_GOLDEN_TRI_A) {
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 3e6bbc13334..979a602b4f5 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1697,7 +1697,7 @@ void VIEW3D_OT_zoom(wmOperatorType *ot)
static void view_dolly_mouseloc(ARegion *ar, float orig_ofs[3], float dvec[3], float dfac)
{
RegionView3D *rv3d= ar->regiondata;
- madd_v3_v3v3fl(rv3d->ofs, orig_ofs, dvec, -(1.0 - dfac));
+ madd_v3_v3v3fl(rv3d->ofs, orig_ofs, dvec, -(1.0f - dfac));
}
static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_invert)
@@ -1718,7 +1718,7 @@ static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_inv
if (zoom_invert)
SWAP(float, len1, len2);
- zfac = 1.0 + ((len2 - len1) * 0.01 * vod->rv3d->dist);
+ zfac = 1.0f + ((len2 - len1) * 0.01f * vod->rv3d->dist);
}
if(zfac != 1.0f)
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index 046037a092f..30d1a508888 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -867,7 +867,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
upvec[2]=1;
mul_m3_v3(mat, upvec);
/*make sure we have some z rolling*/
- if (fabs(upvec[2]) > 0.00001f) {
+ if (fabsf(upvec[2]) > 0.00001f) {
roll= upvec[2] * -5.0f;
upvec[0]= 1.0f; /*rotate the view about this axis*/
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 5b95ae63e56..78dcf6c9a5c 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -281,31 +281,32 @@ static char *view3d_modeselect_pup(Scene *scene)
str += sprintf(str, formatstr, "Object Mode", OB_MODE_OBJECT, ICON_OBJECT_DATA);
if(ob==NULL || ob->data==NULL) return string;
- if(ob->id.lib || ((ID *)ob->data)->lib) return string;
+ if(ob->id.lib) return string;
- /* if active object is editable */
- if ( ((ob->type == OB_MESH)
- || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
- || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
-
- str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
- }
- else if (ob->type == OB_ARMATURE) {
- if (ob->mode & OB_MODE_POSE)
- str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
- else
+ if(!((ID *)ob->data)->lib) {
+ /* if active object is editable */
+ if ( ((ob->type == OB_MESH)
+ || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
+ || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
+
str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
- }
+ }
+ else if (ob->type == OB_ARMATURE) {
+ if (ob->mode & OB_MODE_POSE)
+ str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
+ else
+ str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
+ }
- if (ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
- str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
- str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
- str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
- str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
+ str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
+ str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
+ str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
+ str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
+ }
}
-
-
+
/* if active object is an armature */
if (ob->type==OB_ARMATURE) {
str += sprintf(str, formatstr, "Pose Mode", OB_MODE_POSE, ICON_POSE_HLT);
@@ -465,6 +466,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
Object *ob= OBACT;
Object *obedit = CTX_data_edit_object(C);
uiBlock *block;
+ uiBut *but;
uiLayout *row;
const float dpi_fac= UI_DPI_FAC;
@@ -512,9 +514,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
block= uiLayoutGetBlock(row);
if(v3d->twflag & V3D_USE_MANIPULATOR) {
- uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode");
- uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode");
- uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode");
+ but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode");
+ uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
+ but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode");
+ uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
+ but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode");
+ uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
}
if (v3d->twmode > (BIF_countTransformOrientation(C) - 1) + V3D_MANIP_CUSTOM) {
@@ -522,7 +527,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
}
str_menu = BIF_menustringTransformOrientation(C, "Orientation");
- uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
+ but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
+ uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
MEM_freeN((void *)str_menu);
}
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index c6835b0cad3..86112a42d99 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1335,9 +1335,9 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
if(oldbasact != basact) {
ED_base_object_activate(C, basact); /* adds notifier */
}
-
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
+
+ WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
return retval;
@@ -1841,8 +1841,8 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
int retval = 0;
view3d_operator_needs_opengl(C);
-
- if(obedit) {
+
+ if(obedit && center==FALSE) {
if(obedit->type==OB_MESH)
retval = mouse_mesh(C, event->mval, extend);
else if(obedit->type==OB_ARMATURE)
@@ -1889,7 +1889,7 @@ void VIEW3D_OT_select(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
- RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting (object mode only).");
+ RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection.");
RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only).");
}