From 4ed5cd6cef341727f230ff2d50feb460773a055d Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 27 Feb 2011 18:03:19 +0000 Subject: == UI icons == * Change ICON_NULL --> ICON_NONE to avoid two #defines with the same meaning. --- .../blender/editors/space_view3d/view3d_buttons.c | 90 +++++++++++----------- .../blender/editors/space_view3d/view3d_header.c | 12 +-- .../blender/editors/space_view3d/view3d_select.c | 4 +- .../blender/editors/space_view3d/view3d_toolbar.c | 4 +- 4 files changed, 55 insertions(+), 55 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 0e4e1ad7266..89081513962 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -779,57 +779,57 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) uiLayoutSetActive(split, !(bone->parent && bone->flag & BONE_CONNECTED)); } colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, ptr, "location", 0, "Location", ICON_NULL); + uiItemR(colsub, ptr, "location", 0, "Location", ICON_NONE); colsub = uiLayoutColumn(split, 1); - uiItemL(colsub, "", ICON_NULL); - uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemL(colsub, "", ICON_NONE); + uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE); split = uiLayoutSplit(layout, 0.8, 0); switch(RNA_enum_get(ptr, "rotation_mode")) { case ROT_MODE_QUAT: /* quaternion */ colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, ptr, "rotation_quaternion", 0, "Rotation", ICON_NULL); + uiItemR(colsub, ptr, "rotation_quaternion", 0, "Rotation", ICON_NONE); colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NULL); + uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NONE); if (RNA_boolean_get(ptr, "lock_rotations_4d")) - uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE); else - uiItemL(colsub, "", ICON_NULL); - uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemL(colsub, "", ICON_NONE); + uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE); break; case ROT_MODE_AXISANGLE: /* axis angle */ colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, ptr, "rotation_axis_angle", 0, "Rotation", ICON_NULL); + uiItemR(colsub, ptr, "rotation_axis_angle", 0, "Rotation", ICON_NONE); colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NULL); + uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NONE); if (RNA_boolean_get(ptr, "lock_rotations_4d")) - uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE); else - uiItemL(colsub, "", ICON_NULL); - uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemL(colsub, "", ICON_NONE); + uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE); break; default: /* euler rotations */ colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, ptr, "rotation_euler", 0, "Rotation", ICON_NULL); + uiItemR(colsub, ptr, "rotation_euler", 0, "Rotation", ICON_NONE); colsub = uiLayoutColumn(split, 1); - uiItemL(colsub, "", ICON_NULL); - uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemL(colsub, "", ICON_NONE); + uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE); break; } - uiItemR(layout, ptr, "rotation_mode", 0, "", ICON_NULL); + uiItemR(layout, ptr, "rotation_mode", 0, "", ICON_NONE); split = uiLayoutSplit(layout, 0.8, 0); colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, ptr, "scale", 0, "Scale", ICON_NULL); + uiItemR(colsub, ptr, "scale", 0, "Scale", ICON_NONE); colsub = uiLayoutColumn(split, 1); - uiItemL(colsub, "", ICON_NULL); - uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemL(colsub, "", ICON_NONE); + uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE); if (ptr->type == &RNA_Object) { Object *ob = ptr->data; if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) - uiItemR(layout, ptr, "dimensions", 0, "Dimensions", ICON_NULL); + uiItemR(layout, ptr, "dimensions", 0, "Dimensions", ICON_NONE); } } @@ -849,7 +849,7 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob) // row= uiLayoutRow(layout, 0); if (!pchan) { - uiItemL(layout, "No Bone Active", ICON_NULL); + uiItemL(layout, "No Bone Active", ICON_NONE); return; } @@ -962,18 +962,18 @@ static void v3d_editarmature_buts(uiLayout *layout, Object *ob) col= uiLayoutColumn(layout, 0); - uiItemR(col, &eboneptr, "head", 0, "Head", ICON_NULL); + uiItemR(col, &eboneptr, "head", 0, "Head", ICON_NONE); if (ebone->parent && ebone->flag & BONE_CONNECTED ) { PointerRNA parptr = RNA_pointer_get(&eboneptr, "parent"); - uiItemR(col, &parptr, "tail_radius", 0, "Radius (Parent)", ICON_NULL); + uiItemR(col, &parptr, "tail_radius", 0, "Radius (Parent)", ICON_NONE); } else { - uiItemR(col, &eboneptr, "head_radius", 0, "Radius", ICON_NULL); + uiItemR(col, &eboneptr, "head_radius", 0, "Radius", ICON_NONE); } - uiItemR(col, &eboneptr, "tail", 0, "Tail", ICON_NULL); - uiItemR(col, &eboneptr, "tail_radius", 0, "Radius", ICON_NULL); + uiItemR(col, &eboneptr, "tail", 0, "Tail", ICON_NONE); + uiItemR(col, &eboneptr, "tail_radius", 0, "Radius", ICON_NONE); - uiItemR(col, &eboneptr, "roll", 0, "Roll", ICON_NULL); + uiItemR(col, &eboneptr, "roll", 0, "Roll", ICON_NONE); } static void v3d_editmetaball_buts(uiLayout *layout, Object *ob) @@ -992,37 +992,37 @@ static void v3d_editmetaball_buts(uiLayout *layout, Object *ob) RNA_pointer_create(&mball->id, &RNA_MetaElement, mball->lastelem, &ptr); col= uiLayoutColumn(layout, 0); - uiItemR(col, &ptr, "co", 0, "Location", ICON_NULL); + uiItemR(col, &ptr, "co", 0, "Location", ICON_NONE); - uiItemR(col, &ptr, "radius", 0, "Radius", ICON_NULL); - uiItemR(col, &ptr, "stiffness", 0, "Stiffness", ICON_NULL); + uiItemR(col, &ptr, "radius", 0, "Radius", ICON_NONE); + uiItemR(col, &ptr, "stiffness", 0, "Stiffness", ICON_NONE); - uiItemR(col, &ptr, "type", 0, "Type", ICON_NULL); + uiItemR(col, &ptr, "type", 0, "Type", ICON_NONE); col= uiLayoutColumn(layout, 1); switch (RNA_enum_get(&ptr, "type")) { case MB_BALL: break; case MB_CUBE: - uiItemL(col, "Size:", ICON_NULL); - uiItemR(col, &ptr, "size_x", 0, "X", ICON_NULL); - uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NULL); - uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NULL); + uiItemL(col, "Size:", ICON_NONE); + uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); + uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE); + uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE); break; case MB_TUBE: - uiItemL(col, "Size:", ICON_NULL); - uiItemR(col, &ptr, "size_x", 0, "X", ICON_NULL); + uiItemL(col, "Size:", ICON_NONE); + uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); break; case MB_PLANE: - uiItemL(col, "Size:", ICON_NULL); - uiItemR(col, &ptr, "size_x", 0, "X", ICON_NULL); - uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NULL); + uiItemL(col, "Size:", ICON_NONE); + uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); + uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE); break; case MB_ELIPSOID: - uiItemL(col, "Size:", ICON_NULL); - uiItemR(col, &ptr, "size_x", 0, "X", ICON_NULL); - uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NULL); - uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NULL); + uiItemL(col, "Size:", ICON_NONE); + uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); + uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE); + uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE); break; } } diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 82605439b33..dd9de6ae4ef 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -455,7 +455,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBlockEndAlign(block); /* Draw type */ - uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); if (obedit==NULL && ((ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)))) { /* Manipulators aren't used in weight paint mode */ @@ -463,13 +463,13 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) PointerRNA meshptr; RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr); - uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); } else { const char *str_menu; row= uiLayoutRow(layout, 1); - uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NULL); - uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); /* NDOF */ /* Not implemented yet @@ -484,7 +484,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) /* Transform widget / manipulators */ row= uiLayoutRow(layout, 1); - uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); block= uiLayoutGetBlock(row); if(v3d->twflag & V3D_USE_MANIPULATOR) { @@ -512,7 +512,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiTemplateLayers(layout, &v3dptr, "layers", &v3dptr, "layers_used", ob_lay); /* Scene lock */ - uiItemR(layout, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY, "", ICON_NULL); + uiItemR(layout, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); } /* selection modus, dont use python for this since it cant do the toggle buttons with shift+click as well as clicking to set one. */ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 4aa64733875..0f8cf5edb25 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -72,7 +72,7 @@ #include "ED_mball.h" #include "UI_interface.h" - +#include "UI_resources.h" #include "view3d_intern.h" // own include @@ -1007,7 +1007,7 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe } else { /* UI */ - uiPopupMenu *pup= uiPupMenuBegin(C, "Select Object", ICON_NULL); + uiPopupMenu *pup= uiPupMenuBegin(C, "Select Object", ICON_NONE); uiLayout *layout= uiPupMenuLayout(pup); uiLayout *split= uiLayoutSplit(layout, 0, 0); uiLayout *column= uiLayoutColumn(split, 0); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index bfe324df51e..6fc68f19bd5 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -94,7 +94,7 @@ static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wm { if(op->type->flag & OPTYPE_MACRO) { for(op= op->macro.first; op; op= op->next) { - uiItemL(pa->layout, op->type->name, ICON_NULL); + uiItemL(pa->layout, op->type->name, ICON_NONE); view3d_panel_operator_redo_operator(C, pa, op); } } @@ -215,7 +215,7 @@ static void view3d_panel_tool_shelf(const bContext *C, Panel *pa) for(ct= st->toolshelf.first; ct; ct= ct->next) { if(0==strncmp(context, ct->context, OP_MAX_TYPENAME)) { col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, ct->opname, NULL, ICON_NULL, NULL, WM_OP_INVOKE_REGION_WIN, 0); + uiItemFullO(col, ct->opname, NULL, ICON_NONE, NULL, WM_OP_INVOKE_REGION_WIN, 0); } } } -- cgit v1.2.3 From 95100afc1210e7f95a97c85b51ec94719db24b94 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 27 Feb 2011 20:29:51 +0000 Subject: doxygen: blender/editors tagged. --- source/blender/editors/space_view3d/drawanimviz.c | 5 +++++ source/blender/editors/space_view3d/drawarmature.c | 5 +++++ source/blender/editors/space_view3d/drawmesh.c | 5 +++++ source/blender/editors/space_view3d/drawobject.c | 5 +++++ source/blender/editors/space_view3d/drawvolume.c | 5 +++++ source/blender/editors/space_view3d/space_view3d.c | 5 +++++ source/blender/editors/space_view3d/view3d_buttons.c | 5 +++++ source/blender/editors/space_view3d/view3d_draw.c | 5 +++++ source/blender/editors/space_view3d/view3d_edit.c | 5 +++++ source/blender/editors/space_view3d/view3d_fly.c | 5 +++++ source/blender/editors/space_view3d/view3d_header.c | 5 +++++ source/blender/editors/space_view3d/view3d_intern.h | 5 +++++ source/blender/editors/space_view3d/view3d_ops.c | 5 +++++ source/blender/editors/space_view3d/view3d_select.c | 5 +++++ source/blender/editors/space_view3d/view3d_snap.c | 5 +++++ source/blender/editors/space_view3d/view3d_toolbar.c | 5 +++++ source/blender/editors/space_view3d/view3d_view.c | 5 +++++ 17 files changed, 85 insertions(+) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 3c72547bd66..ee78fd92b79 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/drawanimviz.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 1f0ee30c9e9..1b154c498d0 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/drawarmature.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 19726f02665..a72f7e224b5 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -25,6 +25,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/drawmesh.c + * \ingroup spview3d + */ + + #include #include diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 031607e3084..bd7b4c711d9 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -25,6 +25,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/drawobject.c + * \ingroup spview3d + */ + + #include #include diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index a2eefa2aad1..acdbcb0d06d 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -25,6 +25,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/drawvolume.c + * \ingroup spview3d + */ + + #include #include diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 96ef339a9b9..5e4a0d30909 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/space_view3d.c + * \ingroup spview3d + */ + + #include #include diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 89081513962..cdbde49eb77 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_buttons.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 4d591645679..9cecc4ce5af 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_draw.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 0a3ecd735f0..ad62799db29 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_edit.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 7a4fb86a4dd..d6dcd67c756 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -22,6 +22,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_fly.c + * \ingroup spview3d + */ + + /* defines VIEW3D_OT_fly modal operator */ #include "DNA_anim_types.h" diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index dd9de6ae4ef..a0a8a332071 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_header.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index a2a8f9afdb8..d66a3b99911 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file blender/editors/space_view3d/view3d_intern.h + * \ingroup spview3d + */ + #ifndef ED_VIEW3D_INTERN_H #define ED_VIEW3D_INTERN_H diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 8906fb6fb8e..eb66608ecd3 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_ops.c + * \ingroup spview3d + */ + + #include #include diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 0f8cf5edb25..5c62119409d 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_select.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 4c007bb1aac..b803d49640e 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_snap.c + * \ingroup spview3d + */ + + #include #include diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 6fc68f19bd5..7fad19f16a6 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_toolbar.c + * \ingroup spview3d + */ + + #include #include #include diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 36485b9e20e..4b290f277b6 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/space_view3d/view3d_view.c + * \ingroup spview3d + */ + + #include "DNA_camera_types.h" #include "DNA_lamp_types.h" #include "DNA_scene_types.h" -- cgit v1.2.3 From 356fb2524c9c3247efa4ebf1ed2eb5f99785799e Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Wed, 2 Mar 2011 17:49:02 +0000 Subject: Tsk! glGetFloatv() gives alpha too for GL_CURRENT_COLOR, so a four long vector is needed! --- source/blender/editors/space_view3d/drawarmature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 1b154c498d0..701e9f8af0d 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1894,7 +1894,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, float vec[3]; unsigned char col[4]; - float col_f[3]; + float col_f[4]; glGetFloatv(GL_CURRENT_COLOR, col_f); /* incase this is not set below */ rgb_float_to_byte(col_f, col); col[3]= 255; -- cgit v1.2.3 From 3c184def72693e319253c31896b385c297183778 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Mar 2011 17:59:04 +0000 Subject: use NULL instead of 0 for pointers, (editors) --- source/blender/editors/space_view3d/drawmesh.c | 4 +- source/blender/editors/space_view3d/drawobject.c | 48 +++++++++++----------- .../blender/editors/space_view3d/view3d_buttons.c | 10 ++--- source/blender/editors/space_view3d/view3d_draw.c | 6 +-- source/blender/editors/space_view3d/view3d_edit.c | 2 +- .../blender/editors/space_view3d/view3d_select.c | 2 +- 6 files changed, 36 insertions(+), 36 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index a72f7e224b5..6c5f093d6f1 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -86,7 +86,7 @@ static void get_marked_edge_info__orFlags(EdgeHash *eh, int v0, int v1, int flag int *flags_p; if (!BLI_edgehash_haskey(eh, v0, v1)) { - BLI_edgehash_insert(eh, v0, v1, 0); + BLI_edgehash_insert(eh, v0, v1, NULL); } flags_p = (int*) BLI_edgehash_lookup_p(eh, v0, v1); @@ -381,7 +381,7 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O Gtexdraw.istex = istex; Gtexdraw.color_profile = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; memcpy(Gtexdraw.obcol, obcol, sizeof(obcol)); - set_draw_settings_cached(1, 0, 0, Gtexdraw.islit, 0, 0, 0); + set_draw_settings_cached(1, 0, NULL, Gtexdraw.islit, NULL, 0, 0); glShadeModel(GL_SMOOTH); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index bd7b4c711d9..82d7cac1a42 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2327,7 +2327,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object glEnable(GL_LIGHTING); glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, 0, 0, GPU_enable_material); + finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, NULL, 0, GPU_enable_material); glFrontFace(GL_CCW); glDisable(GL_LIGHTING); @@ -3136,7 +3136,7 @@ static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, B static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt) { Object *ob= base->object; - ListBase *lb=0; + ListBase *lb=NULL; DispList *dl; Curve *cu; int solid, retval= 0; @@ -3158,7 +3158,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas dl= lb->first; if(dl==NULL) return 1; - if(dl->nors==0) addnormalsDispList(lb); + if(dl->nors==NULL) addnormalsDispList(lb); index3_nors_incr= 0; if( displist_has_faces(lb)==0) { @@ -3173,7 +3173,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas GPU_end_object_materials(); } else if(dt == OB_SHADED) { - if(ob->disp.first==0) shadeDispList(scene, base); + if(ob->disp.first==NULL) shadeDispList(scene, base); drawDispListshaded(lb, ob); } else { @@ -3243,7 +3243,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas } else if(dt == OB_SHADED) { dl= lb->first; - if(dl && dl->col1==0) shadeDispList(scene, base); + if(dl && dl->col1==NULL) shadeDispList(scene, base); drawDispListshaded(lb, ob); } else { @@ -3456,9 +3456,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv ParticleEditSettings *pset = PE_settings(scene); ParticleSettings *part; ParticleData *pars, *pa; - ParticleKey state, *states=0; + ParticleKey state, *states=NULL; ParticleBillboardData bb; - ParticleSimulationData sim= {0}; + ParticleSimulationData sim= {NULL}; ParticleDrawData *pdd = psys->pdd; Material *ma; float vel[3], imat[4][4]; @@ -3473,16 +3473,16 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv unsigned char tcol[4]= {0, 0, 0, 255}; /* 1. */ - if(psys==0) + if(psys==NULL) return; part=psys->part; pars=psys->particles; - if(part==0 || !psys_check_enabled(ob, psys)) + if(part==NULL || !psys_check_enabled(ob, psys)) return; - if(pars==0) return; + if(pars==NULL) return; /* don't draw normal paths in edit mode */ if(psys_in_edit_mode(scene, psys) && (pset->flag & PE_DRAW_PART)==0) @@ -3550,7 +3550,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv totpart=psys->totpart; - cfra=bsystem_time(scene, 0, (float)CFRA, 0.0f); + cfra= bsystem_time(scene, NULL, (float)CFRA, 0.0f); if(draw_as==PART_DRAW_PATH && psys->pathcache==NULL && psys->childcache==NULL) draw_as=PART_DRAW_DOT; @@ -3583,19 +3583,19 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv create_cdata = 1; break; case PART_DRAW_OB: - if(part->dup_ob==0) + if(part->dup_ob==NULL) draw_as=PART_DRAW_DOT; else draw_as=0; break; case PART_DRAW_GR: - if(part->dup_group==0) + if(part->dup_group==NULL) draw_as=PART_DRAW_DOT; else draw_as=0; break; case PART_DRAW_BB: - if(v3d->camera==0 && part->bb_ob==0){ + if(v3d->camera==NULL && part->bb_ob==NULL){ printf("Billboards need an active camera or a target object!\n"); draw_as=part->draw_as=PART_DRAW_DOT; @@ -3784,7 +3784,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv } #endif // XXX old animation system - pa_size=psys_get_child_size(psys,cpa,cfra,0); + pa_size=psys_get_child_size(psys,cpa,cfra,NULL); pa_health = -1.0; @@ -3903,7 +3903,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(draw_as==PART_DRAW_PATH){ ParticleCacheKey **cache, *path; - float *cd2=0,*cdata2=0; + float *cd2=NULL,*cdata2=NULL; /* setup gl flags */ if (1) { //ob_dt > OB_WIRE) { @@ -3971,7 +3971,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(cdata2) MEM_freeN(cdata2); - cd2=cdata2=0; + cd2=cdata2=NULL; glLineWidth(1.0f); @@ -4091,7 +4091,7 @@ static void draw_update_ptcache_edit(Scene *scene, Object *ob, PTCacheEdit *edit PE_update_object(scene, ob, 0); /* create path and child path cache if it doesn't exist already */ - if(edit->pathcache==0) + if(edit->pathcache == NULL) psys_cache_edit_paths(scene, ob, edit, CFRA); } @@ -4107,7 +4107,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) float nosel_col[3]; float *pathcol = NULL, *pcol; - if(edit->pathcache==0) + if(edit->pathcache == NULL) return; PE_hide_keys_time(scene, edit, CFRA); @@ -4166,8 +4166,8 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); if(pset->selectmode==SCE_SELECT_POINT){ - float *pd=0,*pdata=0; - float *cd=0,*cdata=0; + float *pd=NULL,*pdata=NULL; + float *cd=NULL,*cdata=NULL; int totkeys = 0; for (i=0, point=edit->points; itotkey : 0; cd += (timed?4:3) * point->totkey; } - if(pdata) { MEM_freeN(pdata); pd=pdata=0; } - if(cdata) { MEM_freeN(cdata); cd=cdata=0; } + if(pdata) { MEM_freeN(pdata); pd=pdata=NULL; } + if(cdata) { MEM_freeN(cdata); cd=cdata=NULL; } } else if(pset->selectmode == SCE_SELECT_END){ for(i=0, point=edit->points; isoft /*&& flag & OB_SBMOTION*/){ float mrt[3][3],msc[3][3],mtr[3][3]; - SoftBody *sb = 0; + SoftBody *sb= NULL; float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f; if ((sb= ob->soft)){ if(sb->solverflags & SBSO_ESTIMATEIPO){ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index cdbde49eb77..1f123c11a8b 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -292,7 +292,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiBlockBeginAlign(block); if(tot==1) { - uiDefBut(block, LABEL, 0, "Vertex:", 0, 130, 200, 20, 0, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Vertex:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); @@ -325,7 +325,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float } } else { - uiDefBut(block, LABEL, 0, "Median:", 0, 130, 200, 20, 0, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Median:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); @@ -755,7 +755,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); if(dg) { uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + dvert->dw[i].def_nr, dg->name, 0, yco, 180, 20, &dvert->dw[i].weight, 0.0, 1.0, 1, 3, ""); - uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dvert->dw[i].def_nr, "C", 180,yco,20,20, 0, 0, 0, 0, 0, "Copy this groups weight to other selected verts"); + uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dvert->dw[i].def_nr, "C", 180,yco,20,20, NULL, 0, 0, 0, 0, "Copy this groups weight to other selected verts"); yco -= 20; } } @@ -763,8 +763,8 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) uiBlockEndAlign(block); uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, "Normalize", 0, yco,100,20, 0, 0, 0, 0, 0, "Normalize active vertex weights"); - uiDefBut(block, BUT, B_VGRP_PNL_COPY, "Copy", 100,yco,100,20, 0, 0, 0, 0, 0, "Copy active vertex to other seleted verts"); + uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, "Normalize", 0, yco,100,20, NULL, 0, 0, 0, 0, "Normalize active vertex weights"); + uiDefBut(block, BUT, B_VGRP_PNL_COPY, "Copy", 100,yco,100,20, NULL, 0, 0, 0, 0, "Copy active vertex to other seleted verts"); uiBlockEndAlign(block); } } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 9cecc4ce5af..3ca6d39305c 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1908,7 +1908,7 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) /* this needs to be done better .. */ float viewmat[4][4], winmat[4][4]; int drawtype, lay, winsize, flag2=v3d->flag2; - ARegion ar= {0}; + ARegion ar= {NULL}; RegionView3D rv3d= {{{0}}}; drawtype= v3d->drawtype; @@ -2206,8 +2206,8 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in /* creates own 3d views, used by the sequencer */ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype) { - View3D v3d= {0}; - ARegion ar= {0}; + View3D v3d= {NULL}; + ARegion ar= {NULL}; RegionView3D rv3d= {{{0}}}; /* connect data */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index ad62799db29..38888670dc2 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2778,7 +2778,7 @@ static int depth_segment_cb(int x, int y, void *userData) int view_autodist_depth_segment(struct ARegion *ar, short mval_sta[2], short mval_end[2], int margin, float *depth) { - struct { struct ARegion *ar; int margin; float depth; } data = {0}; + struct { struct ARegion *ar; int margin; float depth; } data = {NULL}; int p1[2]; int p2[2]; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 5c62119409d..72061bdbdac 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1263,7 +1263,7 @@ static int mouse_select(bContext *C, short *mval, short extend, short obcenter, } base= base->next; - if(base==0) base= FIRSTBASE; + if(base==NULL) base= FIRSTBASE; if(base==startbase) break; } } -- cgit v1.2.3 From 627c764e3cdd7ce67d9640e5a0c5280953c3728d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 Mar 2011 23:12:12 +0000 Subject: bug [#26329] Project Paint not working we cant ensure that a requested buffer can be allocated so report opengl errors when failing to allocate the buffer (rather then printing to console). this is common enough and generic error isn't too helpful to users. --- source/blender/editors/space_view3d/view3d_draw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 3ca6d39305c..6e286578dad 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2150,7 +2150,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, } /* utility func for ED_view3d_draw_offscreen */ -ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, int sizex, int sizey, unsigned int flag) +ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, int sizex, int sizey, unsigned int flag, char err_out[256]) { RegionView3D *rv3d= ar->regiondata; ImBuf *ibuf; @@ -2160,7 +2160,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in glPushAttrib(GL_LIGHTING_BIT); /* bind */ - ofs= GPU_offscreen_create(&sizex, &sizey); + ofs= GPU_offscreen_create(&sizex, &sizey, err_out); if(ofs == NULL) return NULL; @@ -2204,7 +2204,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in } /* creates own 3d views, used by the sequencer */ -ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype) +ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype, char err_out[256]) { View3D v3d= {NULL}; ARegion ar= {NULL}; @@ -2235,7 +2235,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height mul_m4_m4m4(rv3d.persmat, rv3d.viewmat, rv3d.winmat); invert_m4_m4(rv3d.persinv, rv3d.viewinv); - return ED_view3d_draw_offscreen_imbuf(scene, &v3d, &ar, width, height, flag); + return ED_view3d_draw_offscreen_imbuf(scene, &v3d, &ar, width, height, flag, err_out); // seq_view3d_cb(scene, cfra, render_size, seqrectx, seqrecty); } -- cgit v1.2.3 From 2818add58689b2c126662dc2db056a06a5f937ff Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 7 Mar 2011 14:56:19 +0000 Subject: From the OFTL: Arrows-move-cursor is back! It now works for any running modal operator that doesn't handle own arrow keys. Might need to become more restricted though, some modal ops don't need it. Want to investigate that still where conflicts are. --- source/blender/editors/space_view3d/view3d_select.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 72061bdbdac..9d882f09d02 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -198,26 +198,6 @@ static void EM_backbuf_checkAndSelectTFaces(Mesh *me, int select) } } -#if 0 -void arrows_move_cursor(unsigned short event) -{ - short mval[2]; - - getmouseco_sc(mval); - - if(event==UPARROWKEY) { - warp_pointer(mval[0], mval[1]+1); - } else if(event==DOWNARROWKEY) { - warp_pointer(mval[0], mval[1]-1); - } else if(event==LEFTARROWKEY) { - warp_pointer(mval[0]-1, mval[1]); - } else if(event==RIGHTARROWKEY) { - warp_pointer(mval[0]+1, mval[1]); - } -} -#endif - - /* *********************** GESTURE AND LASSO ******************* */ static int view3d_selectable_data(bContext *C) -- cgit v1.2.3 From ae57e8c8c17cac3a5479990d1592feed9b4096b3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 8 Mar 2011 07:33:26 +0000 Subject: needed removing here too --- source/blender/editors/space_view3d/space_view3d.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 5e4a0d30909..86b15a922a8 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -530,7 +530,6 @@ static void *view3d_main_area_duplicate(void *poin) new->clipbb= MEM_dupallocN(rv3d->clipbb); new->depths= NULL; - new->retopo_view_data= NULL; new->ri= NULL; new->gpd= NULL; new->sms= NULL; -- cgit v1.2.3 From 092c3d8a85dbfb0a5eb41ae2f2ac6a5363cf4c97 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 8 Mar 2011 07:44:30 +0000 Subject: fix bug [#26315] Background and 3D view mistakes The bug is caused by a fix for [#22111], commits r29356, r28545. exiting localview would set the rv3d->view but use the original rv3d->viewquat. --- source/blender/editors/space_view3d/view3d_view.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 4b290f277b6..a1726d8a537 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1179,33 +1179,37 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short #define QUATSET(a, b, c, d, e) a[0]=b; a[1]=c; a[2]=d; a[3]=e; -static void view3d_viewlock(RegionView3D *rv3d) +int ED_view3d_lock(RegionView3D *rv3d) { switch(rv3d->view) { case RV3D_VIEW_BOTTOM : QUATSET(rv3d->viewquat,0.0, -1.0, 0.0, 0.0); break; - + case RV3D_VIEW_BACK: QUATSET(rv3d->viewquat,0.0, 0.0, (float)-cos(M_PI/4.0), (float)-cos(M_PI/4.0)); break; - + case RV3D_VIEW_LEFT: QUATSET(rv3d->viewquat,0.5, -0.5, 0.5, 0.5); break; - + case RV3D_VIEW_TOP: QUATSET(rv3d->viewquat,1.0, 0.0, 0.0, 0.0); break; - + case RV3D_VIEW_FRONT: QUATSET(rv3d->viewquat,(float)cos(M_PI/4.0), (float)-sin(M_PI/4.0), 0.0, 0.0); break; - + case RV3D_VIEW_RIGHT: QUATSET(rv3d->viewquat, 0.5, -0.5, -0.5, -0.5); break; + default: + return FALSE; } + + return TRUE; } /* dont set windows active in in here, is used by renderwin too */ @@ -1224,7 +1228,7 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d) else { /* should be moved to better initialize later on XXX */ if(rv3d->viewlock) - view3d_viewlock(rv3d); + ED_view3d_lock(rv3d); quat_to_mat4( rv3d->viewmat,rv3d->viewquat); if(rv3d->persp==RV3D_PERSP) rv3d->viewmat[3][2]-= rv3d->dist; -- cgit v1.2.3 From ca63b151318d5798bc49a93f5b52de294e8476e5 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 9 Mar 2011 22:10:51 +0000 Subject: Apply [#26364] New Windows keyboard handling Submitted by Alexander Kuznetsov Fixes [#25279] Shift-Numpad Combinations fail to align view to selected and addresses [#26328] Blender uses global keyboard message hook which hurts system responsiveness on Windows A whole new way of handling keyboard input improves greatly both code readability and event handling. Thanks for the great patch, Alexander! --- source/blender/editors/space_view3d/view3d_ops.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index eb66608ecd3..30ca1638d34 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -189,26 +189,6 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELDOWNMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPDOWN); /* active aligned, replaces '*' key in 2.4x */ -#ifdef WIN32 - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_ALT, 0); - RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT); - RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_ALT, 0); - RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_RIGHT); - RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_ALT, 0); - RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_TOP); - RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_ALT|KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BACK); - RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_ALT|KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_LEFT); - RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_ALT|KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BOTTOM); - RNA_boolean_set(kmi->ptr, "align_active", TRUE); -#else kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT); RNA_boolean_set(kmi->ptr, "align_active", TRUE); @@ -227,7 +207,6 @@ void view3d_keymap(wmKeyConfig *keyconf) kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BOTTOM); RNA_boolean_set(kmi->ptr, "align_active", TRUE); -#endif WM_keymap_add_item(keymap, "VIEW3D_OT_localview", PADSLASHKEY, KM_PRESS, 0, 0); -- cgit v1.2.3 From 188c4ae055393aa7495508d59c44870f072279d3 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 10 Mar 2011 12:52:18 +0000 Subject: Bugfix #26442 Very bad crashing in using "Not AA fonts" and drawing length info on EditMesh. This uses the call BLF_draw_ascii() which apparently corruptes then badly. Disabled the call for now, and wait for fix. In the course of testing, added proper strlen storage for draw in this code. Added strlen --- source/blender/editors/space_view3d/drawobject.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 82d7cac1a42..bb298756927 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -575,6 +575,7 @@ typedef struct ViewCachedString { short mval[2]; short xoffs; short flag; + int str_len, pad; /* str is allocated past the end */ } ViewCachedString; @@ -596,6 +597,7 @@ void view3d_cached_text_draw_add(const float co[3], const char *str, short xoffs vos->col.pack= *((int *)col); vos->xoffs= xoffs; vos->flag= flag; + vos->str_len= alloc_len-1; /* allocate past the end */ memcpy(++vos, str, alloc_len); @@ -661,10 +663,10 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa col_pack_prev= vos->col.pack; } if(vos->flag & V3D_CACHE_TEXT_ASCII) { - BLF_draw_default_ascii((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, 65535); /* XXX, use real length */ + BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); } else { - BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, 65535); /* XXX, use real length */ + BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); } } } -- cgit v1.2.3 From 1c3679a5b05db2b4a83f25ad6434106293b2726f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 10 Mar 2011 13:49:46 +0000 Subject: fix [#26442] blender crash when turning off antialiasing fonts ASCII lookup table wasn't being freed when when the rest of the glyphs were. Also found own bug where mesh stat text was using wrong sized array (char[3] as char[4]). --- source/blender/editors/space_view3d/drawobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index bb298756927..bd3c140c647 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -663,7 +663,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa col_pack_prev= vos->col.pack; } if(vos->flag & V3D_CACHE_TEXT_ASCII) { - BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); + BLF_draw_default_ascii((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); } else { BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); @@ -2123,7 +2123,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E float fvec[3]; char val[32]; /* Stores the measurement display text here */ const char *conv_float; /* Use a float conversion matching the grid size */ - unsigned char col[3]; /* color of the text to draw */ + unsigned char col[4]= {0, 0, 0, 255}; /* color of the text to draw */ float area; /* area of the face */ float grid= unit->system ? unit->scale_length : v3d->grid; const int do_split= unit->flag & USER_UNIT_OPT_SPLIT; -- cgit v1.2.3 From 5b75593c239f9db213c07804f41a130751245cb6 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 12 Mar 2011 12:38:11 +0000 Subject: Completely refactored sph fluid particles. Only the very core of the algorithm remains the same, but big changes have happened both on the outside and on the inside. New UI: * The old parameters were quite true to the underlying algorithm, but were quite obscure from a users point of view. Now there are only a few intuitive basic parameters that define the basic fluid behavior. ** By default particle size is now used to determine the interaction radius, rest density and spring rest lengths so that it's easy to get stable simulations by simply emitting particles for a few frames and adjusting the particle size (easy when the particle size is drawn) so that the fluid appears continuous (particles are touching eachother). ** Stiffness - in reality most fluids are very incompressible, but this is a very hard problem to solve with particle based fluid simulation so some compromises have to be made. So the bigger the stiffness parameter is the less the fluid will compress under stress, but the more substeps are needed for stable simulation. ** Viscosity - how much internal friction there is in the fluid. Large viscosities also smooth out instabilities, so less viscous fluids again need more substeps to remain stable. ** Buoancy - with high buoancy low pressure areas inside the fluid start to rise against gravity, and high pressure areas start to come down. * In addition to these basic parameters there are separate advanced parameters that can either be tweaked relative to the basic parameters (or particle size) or defined independently. ** Repulsion - the stiffness parameter tries to keep the fluid density constant, but this can lead to small clumps of particles, so the repulsion keeps the particles better separated. ** Stiff viscosity - the normal viscosity only applies when particles are moving closer to eachother to allow free flowing fluids. Stiff viscosity also applies smoothing to particles that are moving away from eachother. ** Interaction radius - by default this is 4 * particle size. ** Rest density - by default this is a density that the particles have when they're packed densely next to eachother. ** Spring rest length - by default this is 2 * particle size. * There are also new options for 3d view particle coloring in the display panel to show particle velocity and acceleration. These make it easier to see what's happening in the fluid simulations, but can of course be used with other particles as well. * Viscoelastic springs have some new options too. The plasticity can now be set to much higher values for instant deletion of springs as the elastic limit is exeeded. In addition to that there is an option to only create springs for a certain number of frames when a particle is born. These options give new possibilities for breaking viscoelastic fluids. New in the code: * Most of the fluids code is now thread safe, so when particle dynamics go threaded there will be a nice speed boost to fluids as well. * Fluids now use a bvh-tree instead of a kd-tree for the neighbor lookups. The bvh-tree implementation makes the code quite a bit cleaner and should also give a slight speed boost to the simulation too. * Previously only force fields were calculated with the different integration methods, but now the fluid calculations are also done using the selected integration method, so there are again more choices in effecting simulation accuracy and stability. This change also included a nice cleanup of the whole particle integration code. As the internals are pretty stirred up old particle fluid simulations will probably not work correctly straight away, but with some tweaking the same level of control is still available by not using the "relative versions" of the advanced parameters (by default these are not used when loading old files). --- source/blender/editors/space_view3d/drawobject.c | 81 +++++++----------------- 1 file changed, 23 insertions(+), 58 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index bd3c140c647..4979c3c2a2a 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3465,7 +3465,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv Material *ma; float vel[3], imat[4][4]; float timestep, pixsize=1.0, pa_size, r_tilt, r_length; - float pa_time, pa_birthtime, pa_dietime, pa_health; + float pa_time, pa_birthtime, pa_dietime, pa_health, intensity; float cfra; float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f; int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0; @@ -3529,7 +3529,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(v3d->zbuf) glDepthMask(1); - if((ma) && (part->draw&PART_DRAW_MAT_COL)) { + if((ma) && (part->draw_col == PART_DRAW_COL_MAT)) { rgb_float_to_byte(&(ma->r), tcol); ma_r = ma->r; @@ -3630,6 +3630,10 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv normalize_v3(imat[1]); } + if(ELEM3(draw_as, PART_DRAW_DOT, PART_DRAW_CROSS, PART_DRAW_LINE) + && part->draw_col > PART_DRAW_COL_MAT) + create_cdata = 1; + if(!create_cdata && pdd && pdd->cdata) { MEM_freeN(pdd->cdata); pdd->cdata = pdd->cd = NULL; @@ -3672,7 +3676,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(create_cdata && !pdd->cdata) pdd->cdata = MEM_callocN(tot_vec_size, "particle_cdata"); if(create_ndata && !pdd->ndata) - pdd->ndata = MEM_callocN(tot_vec_size, "particle_vdata"); + pdd->ndata = MEM_callocN(tot_vec_size, "particle_ndata"); if(part->draw & PART_DRAW_VEL && draw_as != PART_DRAW_LINE) { if(!pdd->vedata) @@ -3727,65 +3731,26 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv else pa_health = -1.0; -#if 0 // XXX old animation system - if((part->flag&PART_ABS_TIME)==0){ - if(ma && ma->ipo){ - IpoCurve *icu; - - /* correction for lifetime */ - calc_ipo(ma->ipo, 100.0f*pa_time); - - for(icu = ma->ipo->curve.first; icu; icu=icu->next) { - if(icu->adrcode == MA_COL_R) - ma_r = icu->curval; - else if(icu->adrcode == MA_COL_G) - ma_g = icu->curval; - else if(icu->adrcode == MA_COL_B) - ma_b = icu->curval; - } - } - if(part->ipo) { - IpoCurve *icu; - - /* correction for lifetime */ - calc_ipo(part->ipo, 100*pa_time); + r_tilt = 2.0f*(PSYS_FRAND(a + 21) - 0.5f); + r_length = PSYS_FRAND(a + 22); - for(icu = part->ipo->curve.first; icu; icu=icu->next) { - if(icu->adrcode == PART_SIZE) - pa_size = icu->curval; - } + if(part->draw_col > PART_DRAW_COL_MAT) { + switch(part->draw_col) { + case PART_DRAW_COL_VEL: + intensity = len_v3(pa->state.vel)/part->color_vec_max; + break; + case PART_DRAW_COL_ACC: + intensity = len_v3v3(pa->state.vel, pa->prev_state.vel)/((pa->state.time-pa->prev_state.time)*part->color_vec_max); + break; } + CLAMP(intensity, 0.f, 1.f); + weight_to_rgb(intensity, &ma_r, &ma_g, &ma_b); } -#endif // XXX old animation system - - r_tilt = 2.0f*(PSYS_FRAND(a + 21) - 0.5f); - r_length = PSYS_FRAND(a + 22); } else{ ChildParticle *cpa= &psys->child[a-totpart]; pa_time=psys_get_child_time(psys,cpa,cfra,&pa_birthtime,&pa_dietime); - -#if 0 // XXX old animation system - if((part->flag&PART_ABS_TIME)==0) { - if(ma && ma->ipo){ - IpoCurve *icu; - - /* correction for lifetime */ - calc_ipo(ma->ipo, 100.0f*pa_time); - - for(icu = ma->ipo->curve.first; icu; icu=icu->next) { - if(icu->adrcode == MA_COL_R) - ma_r = icu->curval; - else if(icu->adrcode == MA_COL_G) - ma_g = icu->curval; - else if(icu->adrcode == MA_COL_B) - ma_b = icu->curval; - } - } - } -#endif // XXX old animation system - pa_size=psys_get_child_size(psys,cpa,cfra,NULL); pa_health = -1.0; @@ -3911,7 +3876,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if (1) { //ob_dt > OB_WIRE) { glEnableClientState(GL_NORMAL_ARRAY); - if(part->draw&PART_DRAW_MAT_COL) + if(part->draw_col == PART_DRAW_COL_MAT) glEnableClientState(GL_COLOR_ARRAY); glEnable(GL_LIGHTING); @@ -3940,7 +3905,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(1) { //ob_dt > OB_WIRE) { glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); - if(part->draw&PART_DRAW_MAT_COL) + if(part->draw_col == PART_DRAW_COL_MAT) glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); } @@ -3956,7 +3921,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(1) { //ob_dt > OB_WIRE) { glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); - if(part->draw&PART_DRAW_MAT_COL) + if(part->draw_col == PART_DRAW_COL_MAT) glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); } @@ -3966,7 +3931,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* restore & clean up */ if(1) { //ob_dt > OB_WIRE) { - if(part->draw&PART_DRAW_MAT_COL) + if(part->draw_col == PART_DRAW_COL_MAT) glDisable(GL_COLOR_ARRAY); glDisable(GL_COLOR_MATERIAL); } -- cgit v1.2.3 From 6559209dbfddfc1cadb4d3509cee25a3434ef8e7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 13 Mar 2011 02:44:25 +0000 Subject: [#26482] Solidify / Animation Opengl render. no texture. workaround for view3d datamask not being correct on opengl render. --- source/blender/editors/space_view3d/view3d_draw.c | 28 ++++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 6e286578dad..dadc51b89fe 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1943,6 +1943,22 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) /* *********************** customdata **************** */ +CustomDataMask ED_view3d_datamask(Scene *scene, View3D *v3d) +{ + CustomDataMask mask= 0; + if(v3d->drawtype == OB_SHADED) { + /* this includes normals for mesh_create_shadedColors */ + mask |= CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_NORMAL | CD_MASK_ORCO; + } + if((v3d->drawtype == OB_TEXTURE) || ((v3d->drawtype == OB_SOLID) && (v3d->flag2 & V3D_SOLID_TEX))) { + mask |= CD_MASK_MTFACE | CD_MASK_MCOL; + + if(scene->gm.matmode == GAME_MAT_GLSL) + mask |= CD_MASK_ORCO; + } + + return mask; +} /* goes over all modes and view3d settings */ CustomDataMask ED_viewedit_datamask(bScreen *screen) { @@ -1958,17 +1974,7 @@ CustomDataMask ED_viewedit_datamask(bScreen *screen) /* check if we need tfaces & mcols due to view mode */ for(sa = screen->areabase.first; sa; sa = sa->next) { if(sa->spacetype == SPACE_VIEW3D) { - View3D *view = sa->spacedata.first; - if(view->drawtype == OB_SHADED) { - /* this includes normals for mesh_create_shadedColors */ - mask |= CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_NORMAL | CD_MASK_ORCO; - } - if((view->drawtype == OB_TEXTURE) || ((view->drawtype == OB_SOLID) && (view->flag2 & V3D_SOLID_TEX))) { - mask |= CD_MASK_MTFACE | CD_MASK_MCOL; - - if(scene->gm.matmode == GAME_MAT_GLSL) - mask |= CD_MASK_ORCO; - } + mask |= ED_view3d_datamask(scene, (View3D *)sa->spacedata.first); } } -- cgit v1.2.3 From aee5f0e20f1d2d52306e9cdf134a54aa71d11527 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Mar 2011 03:34:57 +0000 Subject: patch [#26495] Adjustable outline width for selected objects --- source/blender/editors/space_view3d/drawobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 4979c3c2a2a..cd37e0315b3 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2455,7 +2455,7 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm) { if(v3d->transp==0) { // not when we draw the transparent pass - glLineWidth(2.0); + glLineWidth(UI_GetThemeValuef(TH_OUTLINE_WIDTH) * 2.0); glDepthMask(0); /* if transparent, we cannot draw the edges for solid select... edges have no material info. -- cgit v1.2.3 From e9005b985ef283d952aaaa7486d42ad6a48fb117 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 19 Mar 2011 05:06:06 +0000 Subject: remove some redundant vars, assignments & checks. --- source/blender/editors/space_view3d/drawobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index cd37e0315b3..c18ec4b617c 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5152,13 +5152,13 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) drawcircball(GL_LINE_LOOP, vec, size*2.0, imat); } else if (pd->forcefield == PFIELD_VORTEX) { - float ffall_val, force_val; + float /*ffall_val,*/ force_val; unit_m4(tmat); //if (has_ipo_code(ob->ipo, OB_PD_FFALL)) // ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra); //else - ffall_val = pd->f_power; + // ffall_val = pd->f_power; //if (has_ipo_code(ob->ipo, OB_PD_FSTR)) // force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); -- cgit v1.2.3 From 074f584cd223648ad5b4168f5127b977a03dc84a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 19 Mar 2011 13:36:36 +0000 Subject: Bugfix #26547 Missing DAG_id_tag_update() on tool "Align Camera to View". --- source/blender/editors/space_view3d/view3d_view.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index a1726d8a537..852801dfc61 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -46,6 +46,7 @@ #include "BKE_anim.h" #include "BKE_action.h" #include "BKE_context.h" +#include "BKE_depsgraph.h" #include "BKE_object.h" #include "BKE_global.h" #include "BKE_main.h" @@ -424,6 +425,7 @@ static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op)) } setcameratoview3d(rv3d, v3d->camera); + DAG_id_tag_update(&v3d->camera->id, OB_RECALC_OB); rv3d->persp = RV3D_CAMOB; WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, v3d->camera); -- cgit v1.2.3 From 5179a0c4775c82f8a94f20a5d9f9dc4dba60edbc Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 19 Mar 2011 16:30:52 +0000 Subject: Code comments only Tried to resolve todo item "Layer change in 3d view header doesn't update dependencies on changed previously visible objects". Code is too much spread around now though, and the 3d view header shares RNA code for changing layers. I'll let this be a "glitch" for now. --- source/blender/editors/space_view3d/view3d_header.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index a0a8a332071..9d7f0313256 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -142,6 +142,11 @@ static void handle_view3d_lock(bContext *C) } } +/* layer code is on three levels actually: +- here for operator +- uiTemplateLayers in interface/ code for buttons +- ED_view3d_scene_layer_set for RNA + */ static int view3d_layers_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); -- cgit v1.2.3 From 9019d3b1f2ae10e88a0a0f430bdca3b7f2f83fb7 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 23 Mar 2011 15:15:42 +0000 Subject: Additonal fix for r35724 (bugfix #26573, #26574 and #26551) Layer visibility code for hotkeys uses different code still, added same new DAG_on_visible_update() in this operator. --- source/blender/editors/space_view3d/view3d_header.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 9d7f0313256..3b6b7257c9c 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -152,8 +152,6 @@ static int view3d_layers_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; - Base *base; - int oldlay= v3d->lay; int nr= RNA_int_get(op->ptr, "nr"); int toggle= RNA_boolean_get(op->ptr, "toggle"); @@ -211,12 +209,7 @@ static int view3d_layers_exec(bContext *C, wmOperator *op) if(v3d->scenelock) handle_view3d_lock(C); - /* XXX new layers might need updates, there is no provision yet to detect if that's needed */ - oldlay= ~oldlay & v3d->lay; - for (base= scene->base.first; base; base= base->next) { - if(base->lay & oldlay) - base->object->recalc= OB_RECALC_OB|OB_RECALC_DATA; - } + DAG_on_visible_update(CTX_data_main(C), FALSE); ED_area_tag_redraw(sa); -- cgit v1.2.3 From a94e9c5955876e7dc3e1fb6c1aef6568b5b1f1e7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 23 Mar 2011 16:05:35 +0000 Subject: fix [#26456] weightpaint mode with armature modifier, armature mode disable bone selection in weightpaint mode when the armature is not in pose mode. --- source/blender/editors/space_view3d/drawarmature.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 701e9f8af0d..a69ad1c7050 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -2460,12 +2460,16 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in /* drawing posemode selection indices or colors only in these cases */ if(!(base->flag & OB_FROMDUPLI)) { if(G.f & G_PICKSEL) { +#if 0 /* nifty but actually confusing to allow bone selection out of posemode */ if(OBACT && (OBACT->mode & OB_MODE_WEIGHT_PAINT)) { if(ob==modifiers_isDeformedByArmature(OBACT)) arm->flag |= ARM_POSEMODE; } - else if(ob->mode & OB_MODE_POSE) + else +#endif + if(ob->mode & OB_MODE_POSE) { arm->flag |= ARM_POSEMODE; + } } else if(ob->mode & OB_MODE_POSE) { if (arm->ghosttype == ARM_GHOST_RANGE) { -- cgit v1.2.3 From 21e0eff89712435708d4c8d931e988777a9f865a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 25 Mar 2011 13:37:50 +0000 Subject: fix [#26600] TexturedSolid + Curve: Specular affecting other materials --- source/blender/editors/space_view3d/drawmesh.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 6c5f093d6f1..d062ca8e25f 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -328,6 +328,7 @@ static int set_draw_settings_cached(int clearcache, int textured, MTFace *texfac glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec); glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); + glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, CLAMPIS(ma->har, 0, 128)); glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); } -- cgit v1.2.3 From 11920f7880062c1efb68a4e141162b7ec060ca29 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 25 Mar 2011 17:11:32 +0000 Subject: Bugfix #26195 When rendering, during processing scene data, drawing in 3d window is now locked. Can get extended to more areas in UI easily. At least this solves all crashes with conflicting memory access in render && 3d drawing. Deleting objects via operators or delete modifiers isn't locked yet. Also fixed: crash on quitting a renderwindow when it was rendering. --- source/blender/editors/space_view3d/space_view3d.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 86b15a922a8..5d75d645695 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1087,6 +1087,7 @@ void ED_spacetype_view3d(void) art->duplicate= view3d_main_area_duplicate; art->listener= view3d_main_area_listener; art->cursor= view3d_main_area_cursor; + art->lock= 1; /* can become flag, see BKE_spacedata_draw_locks */ BLI_addhead(&st->regiontypes, art); /* regions: listview/buttons */ -- cgit v1.2.3 From 617e6a83bc89ca36e18bd06d851a31c010e11db2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Mar 2011 14:59:55 +0000 Subject: object/paint/misc-files: floats were being implicitly promoted to doubles, adjust to use floats. - also UV angle stretching was using radians->deg which wasn't needed. --- source/blender/editors/space_view3d/drawarmature.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index a69ad1c7050..e68e1657096 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1515,7 +1515,7 @@ static void draw_pose_dofs(Object *ob) /* arcs */ if (pchan->ikflag & BONE_IK_ZLIMIT) { /* OpenGL requires rotations in degrees; so we're taking the average angle here */ - theta= 0.5f*(pchan->limitmin[2]+pchan->limitmax[2]) * (float)(180.0f/M_PI); + theta= RAD2DEGF(0.5f * (pchan->limitmin[2]+pchan->limitmax[2])); glRotatef(theta, 0.0f, 0.0f, 1.0f); glColor3ub(50, 50, 255); // blue, Z axis limit @@ -1538,7 +1538,7 @@ static void draw_pose_dofs(Object *ob) if (pchan->ikflag & BONE_IK_XLIMIT) { /* OpenGL requires rotations in degrees; so we're taking the average angle here */ - theta= 0.5f*(pchan->limitmin[0] + pchan->limitmax[0]) * (float)(180.0f/M_PI); + theta= RAD2DEGF(0.5f * (pchan->limitmin[0] + pchan->limitmax[0])); glRotatef(theta, 1.0f, 0.0f, 0.0f); glColor3ub(255, 50, 50); // Red, X axis limit @@ -1596,7 +1596,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* hacky... prevent outline select from drawing dashed helplines */ glGetFloatv(GL_LINE_WIDTH, &tmp); - if (tmp > 1.1) do_dashed &= ~1; + if (tmp > 1.1f) do_dashed &= ~1; if (v3d->flag & V3D_HIDE_HELPLINES) do_dashed &= ~2; /* precalc inverse matrix for drawing screen aligned */ -- cgit v1.2.3 From 4237c0393a9d1f089f01dd7c4b223b1f61b15023 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Mar 2011 15:57:27 +0000 Subject: view3d / object drawing: floats were being implicitly promoted to doubles, adjust to use floats. --- source/blender/editors/space_view3d/drawobject.c | 158 ++++++++++----------- .../blender/editors/space_view3d/view3d_buttons.c | 20 +-- source/blender/editors/space_view3d/view3d_draw.c | 45 +++--- source/blender/editors/space_view3d/view3d_edit.c | 62 ++++---- source/blender/editors/space_view3d/view3d_fly.c | 33 ++--- .../blender/editors/space_view3d/view3d_select.c | 6 +- source/blender/editors/space_view3d/view3d_snap.c | 34 ++--- source/blender/editors/space_view3d/view3d_view.c | 82 +++++------ 8 files changed, 220 insertions(+), 220 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index c18ec4b617c..e656c0ebb91 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -153,16 +153,16 @@ static void view3d_project_short_clip(ARegion *ar, float *vec, short *adr, int l mul_m4_v4(rv3d->persmatob, vec4); /* clipplanes in window space */ - if( vec4[3]>BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */ + if( vec4[3] > (float)BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */ fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]); if( fx>0 && fxwinx) { fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]); - if(fy>0.0 && fy< (float)ar->winy) { - adr[0]= (short)floor(fx); - adr[1]= (short)floor(fy); + if(fy > 0.0f && fy < (float)ar->winy) { + adr[0]= (short)floorf(fx); + adr[1]= (short)floorf(fy); } } } @@ -181,16 +181,16 @@ static void view3d_project_short_noclip(ARegion *ar, float *vec, short *adr) mul_m4_v4(rv3d->persmatob, vec4); - if( vec4[3]>BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */ + if( vec4[3] > (float)BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */ fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]); if( fx>-32700 && fx<32700) { fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]); - if(fy>-32700.0 && fy<32700.0) { - adr[0]= (short)floor(fx); - adr[1]= (short)floor(fy); + if(fy > -32700.0f && fy < 32700.0f) { + adr[0]= (short)floorf(fx); + adr[1]= (short)floorf(fy); } } } @@ -325,7 +325,7 @@ static float cosval[32] ={ static void draw_xyz_wire(const float c[3], float size, int axis) { float v1[3]= {0.f, 0.f, 0.f}, v2[3] = {0.f, 0.f, 0.f}; - float dim = size * 0.1; + float dim = size * 0.1f; float dx[3], dy[3], dz[3]; dx[0]=dim; dx[1]=0.f; dx[2]=0.f; @@ -444,9 +444,9 @@ void drawaxes(float size, char drawtype) /* square pyramid */ glBegin(GL_TRIANGLES); - v2[0]= size*0.035; v2[1] = size*0.035; - v3[0]= size*-0.035; v3[1] = size*0.035; - v2[2]= v3[2]= size*0.75; + v2[0]= size * 0.035f; v2[1] = size * 0.035f; + v3[0]= size * -0.035f; v3[1] = size * 0.035f; + v2[2]= v3[2]= size * 0.75f; for (axis=0; axis<4; axis++) { if (axis % 2 == 1) { @@ -492,18 +492,18 @@ void drawaxes(float size, char drawtype) glVertex3fv(v1); glVertex3fv(v2); - v1[axis]= size*0.85; - v1[arrow_axis]= -size*0.08; + v1[axis]= size*0.85f; + v1[arrow_axis]= -size*0.08f; glVertex3fv(v1); glVertex3fv(v2); - v1[arrow_axis]= size*0.08; + v1[arrow_axis]= size*0.08f; glVertex3fv(v1); glVertex3fv(v2); glEnd(); - v2[axis]+= size*0.125; + v2[axis]+= size*0.125f; draw_xyz_wire(v2, size, axis); @@ -824,7 +824,7 @@ static void spotvolume(float *lvec, float *vvec, float inp) q[3] = 0 ; normalize_v3(&q[1]); - angle = saacos(plane[2])/2.0; + angle = saacos(plane[2])/2.0f; co = cos(angle); si = sqrt(1-co*co); @@ -881,7 +881,7 @@ static void draw_spot_cone(Lamp *la, float x, float z) for(a=0; a<33; a++) { angle= a*M_PI*2/(33-1); - glVertex3f(z*cos(angle), z*sin(angle), 0); + glVertex3f(z*cosf(angle), z*sinf(angle), 0); } } @@ -1001,7 +1001,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, short axis; /* setup a 45 degree rotation matrix */ - vec_rot_to_mat3( mat,imat[2], M_PI/4.0f); + vec_rot_to_mat3(mat, imat[2], (float)M_PI/4.0f); /* vectors */ mul_v3_v3fl(v1, imat[0], circrad * 1.2f); @@ -1048,7 +1048,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, vvec[1]= x*ob->obmat[1][0] + y*ob->obmat[1][1] + z*ob->obmat[1][2]; vvec[2]= x*ob->obmat[2][0] + y*ob->obmat[2][1] + z*ob->obmat[2][2]; - y = cos( M_PI*la->spotsize/360.0 ); + y = cosf(la->spotsize*(float)(M_PI/360.0)); spotvolume(lvec, vvec, y); x = -la->dist; mul_v3_fl(lvec, x); @@ -1061,7 +1061,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, glVertex3fv(lvec); glEnd(); - z = x*sqrt(1.0 - y*y); + z = x*sqrtf(1.0f - y*y); x *= y; /* draw the circle/square at the end of the cone */ @@ -1083,7 +1083,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, glVertex3fv(tvec); glEnd(); } - else circ(0.0, 0.0, fabs(z)); + else circ(0.0, 0.0, fabsf(z)); /* draw the circle/square representing spotbl */ if(la->type==LA_SPOT) { @@ -1091,7 +1091,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, /* hide line if it is zero size or overlaps with outer border, previously it adjusted to always to show it but that seems confusing because it doesn't show the actual blend size */ - if (spotblcirc != 0 && spotblcirc != fabs(z)) + if (spotblcirc != 0 && spotblcirc != fabsf(z)) circ(0.0, 0.0, spotblcirc); } @@ -1165,9 +1165,9 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, } else if(la->type==LA_AREA) { setlinestyle(3); if(la->area_shape==LA_AREA_SQUARE) - fdrawbox(-la->area_size*0.5, -la->area_size*0.5, la->area_size*0.5, la->area_size*0.5); + fdrawbox(-la->area_size*0.5f, -la->area_size*0.5f, la->area_size*0.5f, la->area_size*0.5f); else if(la->area_shape==LA_AREA_RECT) - fdrawbox(-la->area_size*0.5, -la->area_sizey*0.5, la->area_size*0.5, la->area_sizey*0.5); + fdrawbox(-la->area_size*0.5f, -la->area_sizey*0.5f, la->area_size*0.5f, la->area_sizey*0.5f); glBegin(GL_LINE_STRIP); glVertex3f(0.0,0.0,-circrad); @@ -1287,7 +1287,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob if(is_view) { /* fixed depth, variable size (avoids exceeding clipping range) */ - depth = -(cam->clipsta + 0.1); + depth = -(cam->clipsta + 0.1f); fac = depth / (cam->lens/-16.0f * scaz); } else { @@ -1342,15 +1342,15 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob else if (i==1 && (ob == v3d->camera)) glBegin(GL_TRIANGLES); else break; - vec[0][0]= shx + ((-0.7 * drawsize) * scax); - vec[0][1]= shy + ((drawsize * (caspy + 0.1)) * scay); + vec[0][0]= shx + ((-0.7f * drawsize) * scax); + vec[0][1]= shy + ((drawsize * (caspy + 0.1f)) * scay); glVertex3fv(vec[0]); /* left */ - vec[0][0]= shx + ((0.7 * drawsize) * scax); + vec[0][0]= shx + ((0.7f * drawsize) * scax); glVertex3fv(vec[0]); /* right */ vec[0][0]= shx; - vec[0][1]= shy + ((1.1 * drawsize * (caspy + 0.7)) * scay); + vec[0][1]= shy + ((1.1f * drawsize * (caspy + 0.7f)) * scay); glVertex3fv(vec[0]); /* top */ glEnd(); @@ -1939,7 +1939,7 @@ static int draw_dm_creases__setDrawOptions(void *UNUSED(userData), int index) { EditEdge *eed = EM_get_edge_for_index(index); - if (eed->h==0 && eed->crease!=0.0) { + if (eed->h==0 && eed->crease != 0.0f) { UI_ThemeColorBlend(TH_WIRE, TH_EDGE_CREASE, eed->crease); return 1; } else { @@ -1957,7 +1957,7 @@ static int draw_dm_bweights__setDrawOptions(void *UNUSED(userData), int index) { EditEdge *eed = EM_get_edge_for_index(index); - if (eed->h==0 && eed->bweight!=0.0) { + if (eed->h==0 && eed->bweight != 0.0f) { UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, eed->bweight); return 1; } else { @@ -1968,7 +1968,7 @@ static void draw_dm_bweights__mapFunc(void *UNUSED(userData), int index, float * { EditVert *eve = EM_get_vert_for_index(index); - if (eve->h==0 && eve->bweight!=0.0) { + if (eve->h==0 && eve->bweight != 0.0f) { UI_ThemeColorBlend(TH_VERTEX, TH_VERTEX_SELECT, eve->bweight); bglVertex3fv(co); } @@ -2026,8 +2026,8 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, Deriv continue; } - size = (size>2.1?size/2.0:size); - fsize = (fsize>2.1?fsize/2.0:fsize); + size = (size > 2.1f ? size/2.0f:size); + fsize = (fsize > 2.1f ? fsize/2.0f:fsize); col[3] = fcol[3] = 100; } else { col[3] = fcol[3] = 255; @@ -2162,7 +2162,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E bUnit_AsString(val, sizeof(val), len_v3v3(v1, v2)*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); else sprintf(val, conv_float, len_v3v3(v1, v2)); - + view3d_cached_text_draw_add(vmid, val, 0, V3D_CACHE_TEXT_ASCII, col); } } @@ -2231,29 +2231,29 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E if( (e4->f & e1->f & SELECT) || (do_moving && (efa->v1->f & SELECT)) ) { /* Vec 1 */ - sprintf(val,"%.3g", RAD2DEG(angle_v3v3v3(v4, v1, v2))); + sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v4, v1, v2))); interp_v3_v3v3(fvec, efa->cent, efa->v1->co, 0.8f); view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); } if( (e1->f & e2->f & SELECT) || (do_moving && (efa->v2->f & SELECT)) ) { /* Vec 2 */ - sprintf(val,"%.3g", RAD2DEG(angle_v3v3v3(v1, v2, v3))); + sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v1, v2, v3))); interp_v3_v3v3(fvec, efa->cent, efa->v2->co, 0.8f); view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); } if( (e2->f & e3->f & SELECT) || (do_moving && (efa->v3->f & SELECT)) ) { /* Vec 3 */ if(efa->v4) - sprintf(val,"%.3g", RAD2DEG(angle_v3v3v3(v2, v3, v4))); + sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v4))); else - sprintf(val,"%.3g", RAD2DEG(angle_v3v3v3(v2, v3, v1))); + sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v1))); interp_v3_v3v3(fvec, efa->cent, efa->v3->co, 0.8f); view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); } /* Vec 4 */ if(efa->v4) { if( (e3->f & e4->f & SELECT) || (do_moving && (efa->v4->f & SELECT)) ) { - sprintf(val,"%.3g", RAD2DEG(angle_v3v3v3(v3, v4, v1))); + sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v3, v4, v1))); interp_v3_v3v3(fvec, efa->cent, efa->v4->co, 0.8f); view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); } @@ -2455,7 +2455,7 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm) { if(v3d->transp==0) { // not when we draw the transparent pass - glLineWidth(UI_GetThemeValuef(TH_OUTLINE_WIDTH) * 2.0); + glLineWidth(UI_GetThemeValuef(TH_OUTLINE_WIDTH) * 2.0f); glDepthMask(0); /* if transparent, we cannot draw the edges for solid select... edges have no material info. @@ -3184,7 +3184,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas drawDispListsolid(lb, ob, 0); GPU_end_object_materials(); } - if(cu->editnurb && cu->bevobj==NULL && cu->taperobj==NULL && cu->ext1 == 0.0 && cu->ext2 == 0.0) { + if(cu->editnurb && cu->bevobj==NULL && cu->taperobj==NULL && cu->ext1 == 0.0f && cu->ext2 == 0.0f) { cpack(0); draw_index_wire= 0; drawDispListwire(lb); @@ -3577,7 +3577,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pixsize= view3d_pixel_size(rv3d, ob->obmat[3]); if(part->draw_size==0.0) - pixsize*=2.0; + pixsize *= 2.0f; else pixsize*=part->draw_size; @@ -3761,8 +3761,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv drawn = 0; if(part->draw_as == PART_DRAW_REND && part->trail_count > 1) { - float length = part->path_end * (1.0 - part->randlength * r_length); - int trail_count = part->trail_count * (1.0 - part->randlength * r_length); + float length = part->path_end * (1.0f - part->randlength * r_length); + int trail_count = part->trail_count * (1.0f - part->randlength * r_length); float ct = ((part->draw & PART_ABS_PATH_TIME) ? cfra : pa_time) - length; float dt = length / (trail_count ? (float)trail_count : 1.0f); int i=0; @@ -4114,7 +4114,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) if(timed) { for(k=0, pcol=pathcol, pkey=path; kcol); - pcol[3] = 1.0f - fabs((float)CFRA - pkey->time)/(float)pset->fade_frames; + pcol[3] = 1.0f - fabsf((float)(CFRA) - pkey->time)/(float)pset->fade_frames; } glColorPointer(4, GL_FLOAT, 4*sizeof(float), pathcol); @@ -4163,7 +4163,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) } if(timed) - *(cd+3) = 1.0f - fabs((float)CFRA - *key->time)/(float)pset->fade_frames; + *(cd+3) = 1.0f - fabsf((float)CFRA - *key->time)/(float)pset->fade_frames; cd += (timed?4:3); } @@ -4757,7 +4757,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, /* direction vectors for 3d curve paths when at its lowest, dont render normals */ - if(cu->flag & CU_3D && ts->normalsize > 0.0015 && (cu->drawflag & CU_HIDE_NORMALS)==0) { + if(cu->flag & CU_3D && ts->normalsize > 0.0015f && (cu->drawflag & CU_HIDE_NORMALS)==0) { UI_ThemeColor(TH_WIRE); for (bl=cu->bev.first,nu=nurb; nu && bl; bl=bl->next,nu=nu->next) { @@ -4854,7 +4854,7 @@ static void draw_empty_cone (float size) radius = size; glTranslatef(cent,cent, cent); - glScalef(radius, 2.0*size, radius); + glScalef(radius, size * 2.0f, radius); glRotatef(-90., 1.0, 0.0, 0.0); gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); @@ -5083,7 +5083,7 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, ml->selcol2= code; glLoadName(code++); } - drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad*atan(ml->s)/M_PI_2, imat); + drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad*atanf(ml->s)/(float)M_PI_2, imat); } ml= ml->next; @@ -5125,15 +5125,15 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) // force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); //else force_val = pd->f_strength; - force_val*= 0.1; + force_val *= 0.1f; drawcircball(GL_LINE_LOOP, vec, size, tmat); - vec[2]= 0.5*force_val; + vec[2]= 0.5f * force_val; drawcircball(GL_LINE_LOOP, vec, size, tmat); - vec[2]= 1.0*force_val; + vec[2]= 1.0f * force_val; drawcircball(GL_LINE_LOOP, vec, size, tmat); - vec[2]= 1.5*force_val; + vec[2]= 1.5f * force_val; drawcircball(GL_LINE_LOOP, vec, size, tmat); - vec[2] = 0; /* reset vec for max dist circle */ + vec[2] = 0.0f; /* reset vec for max dist circle */ } else if (pd->forcefield == PFIELD_FORCE) { @@ -5146,10 +5146,10 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) UI_ThemeColorBlend(curcol, TH_BACK, 0.5); drawcircball(GL_LINE_LOOP, vec, size, imat); - UI_ThemeColorBlend(curcol, TH_BACK, 0.9 - 0.4 / pow(1.5, (double)ffall_val)); - drawcircball(GL_LINE_LOOP, vec, size*1.5, imat); - UI_ThemeColorBlend(curcol, TH_BACK, 0.9 - 0.4 / pow(2.0, (double)ffall_val)); - drawcircball(GL_LINE_LOOP, vec, size*2.0, imat); + UI_ThemeColorBlend(curcol, TH_BACK, 0.9f - 0.4f / powf(1.5f, ffall_val)); + drawcircball(GL_LINE_LOOP, vec, size * 1.5f, imat); + UI_ThemeColorBlend(curcol, TH_BACK, 0.9f - 0.4f / powf(2.0f, ffall_val)); + drawcircball(GL_LINE_LOOP, vec, size*2.0f, imat); } else if (pd->forcefield == PFIELD_VORTEX) { float /*ffall_val,*/ force_val; @@ -5165,14 +5165,14 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) //else force_val = pd->f_strength; - UI_ThemeColorBlend(curcol, TH_BACK, 0.7); + UI_ThemeColorBlend(curcol, TH_BACK, 0.7f); if (force_val < 0) { - drawspiral(vec, size*1.0, tmat, 1); - drawspiral(vec, size*1.0, tmat, 16); + drawspiral(vec, size, tmat, 1); + drawspiral(vec, size, tmat, 16); } else { - drawspiral(vec, size*1.0, tmat, -1); - drawspiral(vec, size*1.0, tmat, -16); + drawspiral(vec, size, tmat, -1); + drawspiral(vec, size, tmat, -16); } } else if (pd->forcefield == PFIELD_GUIDE && ob->type==OB_CURVE) { @@ -5244,9 +5244,9 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) distance=(pd->flag&PFIELD_USEMAX)?pd->maxdist:0.0f; if(pd->flag & (PFIELD_USEMAX|PFIELD_USEMAXR)){ - drawcone(vec,distance*sin(radius),distance*cos(radius),tmat); + drawcone(vec, distance * sinf(radius),distance * cosf(radius), tmat); if((pd->flag & PFIELD_POSZ)==0) - drawcone(vec,distance*sin(radius),-distance*cos(radius),tmat); + drawcone(vec, distance * sinf(radius),-distance * cosf(radius),tmat); } radius=(pd->flag&PFIELD_USEMINR)?pd->minrad:1.0f; @@ -5254,9 +5254,9 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) distance=(pd->flag&PFIELD_USEMIN)?pd->mindist:0.0f; if(pd->flag & (PFIELD_USEMIN|PFIELD_USEMINR)){ - drawcone(vec,distance*sin(radius),distance*cos(radius),tmat); + drawcone(vec,distance*sinf(radius),distance*cosf(radius),tmat); if((pd->flag & PFIELD_POSZ)==0) - drawcone(vec,distance*sin(radius),-distance*cos(radius),tmat); + drawcone(vec, distance * sinf(radius), -distance * cosf(radius), tmat); } } setlinestyle(0); @@ -5306,13 +5306,13 @@ static void draw_bb_quadric(BoundBox *bb, short type) gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - size[0]= 0.5*fabs(bb->vec[0][0] - bb->vec[4][0]); - size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]); - size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]); + size[0]= 0.5f*fabsf(bb->vec[0][0] - bb->vec[4][0]); + size[1]= 0.5f*fabsf(bb->vec[0][1] - bb->vec[2][1]); + size[2]= 0.5f*fabsf(bb->vec[0][2] - bb->vec[1][2]); - cent[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0; - cent[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0; - cent[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0; + cent[0]= 0.5f*(bb->vec[0][0] + bb->vec[4][0]); + cent[1]= 0.5f*(bb->vec[0][1] + bb->vec[2][1]); + cent[2]= 0.5f*(bb->vec[0][2] + bb->vec[1][2]); glPushMatrix(); if(type==OB_BOUND_SPHERE) { @@ -5323,13 +5323,13 @@ static void draw_bb_quadric(BoundBox *bb, short type) else if(type==OB_BOUND_CYLINDER) { float radius = size[0] > size[1] ? size[0] : size[1]; glTranslatef(cent[0], cent[1], cent[2]-size[2]); - glScalef(radius, radius, 2.0*size[2]); + glScalef(radius, radius, 2.0f * size[2]); gluCylinder(qobj, 1.0, 1.0, 1.0, 8, 1); } else if(type==OB_BOUND_CONE) { float radius = size[0] > size[1] ? size[0] : size[1]; glTranslatef(cent[0], cent[2]-size[2], cent[1]); - glScalef(radius, 2.0*size[2], radius); + glScalef(radius, 2.0f * size[2], radius); glRotatef(-90., 1.0, 0.0, 0.0); gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); } @@ -5838,7 +5838,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) drawDispList(scene, v3d, rv3d, base, dt); } - if (cu->linewidth != 0.0) { + if (cu->linewidth != 0.0f) { cpack(0xff44ff); UI_ThemeColor(TH_WIRE); copy_v3_v3(vec1, ob->orig); @@ -5857,7 +5857,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) setlinestyle(3); for (i=0; itotbox; i++) { - if (cu->tb[i].w != 0.0) { + if (cu->tb[i].w != 0.0f) { if (i == (cu->actbox-1)) UI_ThemeColor(TH_ACTIVE); else diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 1f123c11a8b..4277a7e85e3 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -383,7 +383,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float EditMesh *em = BKE_mesh_get_editmesh(me); /* allow for some rounding error becasue of matrix transform */ - if(len_v3(median) > 0.000001) { + if(len_v3(median) > 0.000001f) { EditVert *eve; for(eve= em->verts.first; eve; eve= eve->next) { @@ -397,7 +397,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float if(median[3] != 0.0f) { EditEdge *eed; - const float fixed_crease= (ve_median[3] <= 0.0f ? 0.0 : (ve_median[3] >= 1.0f ? 1.0 : FLT_MAX)); + const float fixed_crease= (ve_median[3] <= 0.0f ? 0.0f : (ve_median[3] >= 1.0f ? 1.0f : FLT_MAX)); if(fixed_crease != FLT_MAX) { /* simple case */ @@ -414,8 +414,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float float median_orig= ve_median[3] - median[3]; /* previous median value */ /* incase of floating point error */ - CLAMP(median_orig, 0.0, 1.0); - CLAMP(median_new, 0.0, 1.0); + CLAMP(median_orig, 0.0f, 1.0f); + CLAMP(median_new, 0.0f, 1.0f); if(median_new < median_orig) { /* scale down */ @@ -424,7 +424,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float for(eed= em->edges.first; eed; eed= eed->next) { if(eed->f & SELECT) { eed->crease *= sca; - CLAMP(eed->crease, 0.0, 1.0); + CLAMP(eed->crease, 0.0f, 1.0f); } } } @@ -435,7 +435,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float for(eed= em->edges.first; eed; eed= eed->next) { if(eed->f & SELECT) { eed->crease = 1.0f - ((1.0f - eed->crease) * sca); - CLAMP(eed->crease, 0.0, 1.0); + CLAMP(eed->crease, 0.0f, 1.0f); } } } @@ -1090,9 +1090,9 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event if (!pchan) return; /* make a copy to eul[3], to allow TAB on buttons to work */ - eul[0]= M_PI*tfp->ob_eul[0]/180.0; - eul[1]= M_PI*tfp->ob_eul[1]/180.0; - eul[2]= M_PI*tfp->ob_eul[2]/180.0; + eul[0]= (float)M_PI*tfp->ob_eul[0]/180.0f; + eul[1]= (float)M_PI*tfp->ob_eul[1]/180.0f; + eul[2]= (float)M_PI*tfp->ob_eul[2]/180.0f; if (pchan->rotmode == ROT_MODE_AXISANGLE) { float quat[4]; @@ -1237,7 +1237,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa) } */ - lim= 10000.0f*MAX2(1.0, v3d->grid); + lim= 10000.0f * MAX2(1.0f, v3d->grid); block= uiLayoutGetBlock(pa->layout); uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index dadc51b89fe..f5037ca24a1 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -223,7 +223,7 @@ static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, flo v1[1]= 0.0f; v2[1]= (float)ar->winy; - v1[0] = v2[0] = x-dx*floor(x/dx); + v1[0] = v2[0] = x-dx*floorf(x/dx); glBegin(GL_LINES); @@ -236,7 +236,7 @@ static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, flo v1[0]= 0.0f; v2[0]= (float)ar->winx; - v1[1]= v2[1]= y-dx*floor(y/dx); + v1[1]= v2[1]= y-dx*floorf(y/dx); while(v1[1] < ar->winy) { glVertex2fv(v1); @@ -292,7 +292,6 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** * items are less useful when dealing with units */ void *usys; int len, i; - double scalar; float dx_scalar; float blend_fac; @@ -301,7 +300,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** if(usys) { i= len; while(i--) { - scalar= bUnit_GetScaler(usys, i); + float scalar= bUnit_GetScaler(usys, i); dx_scalar = dx * scalar / unit->scale_length; if (dx_scalar < (GRID_MIN_PX*2)) @@ -447,7 +446,7 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) if(usys) { int i= bUnit_GetBaseUnit(usys); *grid_unit= bUnit_GetNameDisplay(usys, i); - grid_scale = (grid_scale * bUnit_GetScaler(usys, i)) / scene->unit.scale_length; + grid_scale = (grid_scale * (float)bUnit_GetScaler(usys, i)) / scene->unit.scale_length; } } @@ -600,7 +599,7 @@ static void draw_view_axis(RegionView3D *rv3d) { const float k = U.rvisize; /* axis size */ const float toll = 0.5; /* used to see when view is quasi-orthogonal */ - const float start = k + 1.0; /* axis center in screen coordinates, x=y */ + const float start = k + 1.0f;/* axis center in screen coordinates, x=y */ float ydisp = 0.0; /* vertical displacement to allow obj info text */ int bright = 25*(float)U.rvibright + 5; /* axis alpha (rvibright has range 0-10) */ @@ -626,7 +625,7 @@ static void draw_view_axis(RegionView3D *rv3d) glVertex2f(start + dx, start + dy + ydisp); glEnd(); - if (fabs(dx) > toll || fabs(dy) > toll) { + if (fabsf(dx) > toll || fabsf(dy) > toll) { BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "x", 1); } @@ -646,7 +645,7 @@ static void draw_view_axis(RegionView3D *rv3d) glVertex2f(start + dx, start + dy + ydisp); glEnd(); - if (fabs(dx) > toll || fabs(dy) > toll) { + if (fabsf(dx) > toll || fabsf(dy) > toll) { BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "y", 1); } @@ -665,7 +664,7 @@ static void draw_view_axis(RegionView3D *rv3d) glVertex2f(start + dx, start + dy + ydisp); glEnd(); - if (fabs(dx) > toll || fabs(dy) > toll) { + if (fabsf(dx) > toll || fabsf(dy) > toll) { BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "z", 1); } @@ -860,7 +859,7 @@ void view3d_viewborder_size_get(Scene *scene, ARegion *ar, float size_r[2]) float winmax= MAX2(ar->winx, ar->winy); float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp); - if(aspect>1.0) { + if(aspect > 1.0f) { size_r[0]= winmax; size_r[1]= winmax/aspect; } else { @@ -887,15 +886,15 @@ void view3d_calc_camera_border(Scene *scene, ARegion *ar, RegionView3D *rv3d, Vi * with multiple keypad presses (ton) */ - zoomfac= (M_SQRT2 + rv3d->camzoom/50.0); - zoomfac= (zoomfac*zoomfac)*0.25; + zoomfac= ((float)M_SQRT2 + rv3d->camzoom/50.0f); + zoomfac= (zoomfac*zoomfac) * 0.25f; size[0]= size[0]*zoomfac; size[1]= size[1]*zoomfac; /* center in window */ - viewborder_r->xmin= 0.5*ar->winx - 0.5*size[0]; - viewborder_r->ymin= 0.5*ar->winy - 0.5*size[1]; + viewborder_r->xmin= 0.5f * ar->winx - 0.5f * size[0]; + viewborder_r->ymin= 0.5f * ar->winy - 0.5f * size[1]; viewborder_r->xmax= viewborder_r->xmin + size[0]; viewborder_r->ymax= viewborder_r->ymin + size[1]; @@ -951,21 +950,21 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) y2i= (int)(y2 + 1.0f); /* passepartout, specified in camera edit buttons */ - if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT) && ca->passepartalpha > 0.000001) { - if (ca->passepartalpha == 1.0) { + if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT) && ca->passepartalpha > 0.000001f) { + if (ca->passepartalpha == 1.0f) { glColor3f(0, 0, 0); } else { glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glEnable(GL_BLEND); glColor4f(0, 0, 0, ca->passepartalpha); } - if (x1i > 0.0) + if (x1i > 0.0f) glRectf(0.0, (float)ar->winy, x1i, 0.0); if (x2i < (float)ar->winx) glRectf(x2i, (float)ar->winy, (float)ar->winx, 0.0); if (y2i < (float)ar->winy) glRectf(x1i, (float)ar->winy, x2i, y2i); - if (y2i > 0.0) + if (y2i > 0.0f) glRectf(x1i, y1i, x2i, 0.0); glDisable(GL_BLEND); @@ -1288,7 +1287,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) initgrabz(rv3d, 0.0, 0.0, 0.0); window_to_3d_delta(ar, vec, 1, 0); fac= MAX3( fabs(vec[0]), fabs(vec[1]), fabs(vec[1]) ); - fac= 1.0/fac; + fac= 1.0f/fac; asp= ( (float)ibuf->y)/(float)ibuf->x; @@ -1344,7 +1343,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) ED_region_pixelspace(ar); glPixelZoom(zoomx, zoomy); - glColor4f(1.0, 1.0, 1.0, 1.0-bgpic->blend); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f-bgpic->blend); glaDrawPixelsTex(x1, y1, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect); glPixelZoom(1.0, 1.0); @@ -2286,13 +2285,13 @@ static void draw_viewport_fps(Scene *scene, ARegion *ar) #endif /* is this more then half a frame behind? */ - if (fps+0.5 < FPS) { + if (fps+0.5f < (float)(FPS)) { UI_ThemeColor(TH_REDALERT); - BLI_snprintf(printable, sizeof(printable), "fps: %.2f", (float)fps); + BLI_snprintf(printable, sizeof(printable), "fps: %.2f", fps); } else { UI_ThemeColor(TH_TEXT_HI); - BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps+0.5)); + BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps+0.5f)); } BLF_draw_default(22, ar->winy-17, 0.0f, printable, sizeof(printable)-1); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 38888670dc2..ca5213e357b 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -313,11 +313,11 @@ static void calctrackballvec(rcti *rect, int mx, int my, float *vec) y/= (float)((rect->ymax - rect->ymin)/2); d = sqrt(x*x + y*y); - if (d < radius*M_SQRT1_2) /* Inside sphere */ + if (d < radius * (float)M_SQRT1_2) /* Inside sphere */ z = sqrt(radius*radius - d*d); else { /* On hyperbola */ - t = radius / M_SQRT2; + t = radius / (float)M_SQRT2; z = t*t / d; } @@ -552,22 +552,22 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) sub_v3_v3v3(dvec, newvec, vod->trackvec); si= sqrt(dvec[0]*dvec[0]+ dvec[1]*dvec[1]+ dvec[2]*dvec[2]); - si/= (2.0*TRACKBALLSIZE); + si /= (float)(2.0 * TRACKBALLSIZE); cross_v3_v3v3(q1+1, vod->trackvec, newvec); normalize_v3(q1+1); /* Allow for rotation beyond the interval * [-pi, pi] */ - while (si > 1.0) - si -= 2.0; + while (si > 1.0f) + si -= 2.0f; /* This relation is used instead of * phi = asin(si) so that the angle * of rotation is linearly proportional * to the distance that the mouse is * dragged. */ - phi = si * M_PI / 2.0; + phi = si * (float)(M_PI / 2.0); q1[0]= cos(phi); mul_v3_fl(q1+1, sin(phi)); @@ -591,12 +591,12 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) float phi, q1[4]; float m[3][3]; float m_inv[3][3]; - float xvec[3] = {1,0,0}; + float xvec[3] = {1.0f, 0.0f, 0.0f}; /* Sensitivity will control how fast the viewport rotates. 0.0035 was obtained experimentally by looking at viewport rotation sensitivities on other modeling programs. */ /* Perhaps this should be a configurable user parameter. */ - const float sensitivity = 0.0035; + const float sensitivity = 0.0035f; /* Get the 3x3 matrix and its inverse from the quaternion */ quat_to_mat3( m,rv3d->viewquat); @@ -652,7 +652,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) invert_qt_qt(viewquat_inv_test, snapquats[i]); mul_qt_v3(viewquat_inv_test, zaxis_test); - if(angle_v3v3(zaxis_test, zaxis) < DEG2RAD(45/3)) { + if(angle_v3v3(zaxis_test, zaxis) < DEG2RADF(45/3)) { /* find the best roll */ float quat_roll[4], quat_final[4], quat_best[4]; float viewquat_align[4]; /* viewquat aligned to zaxis_test */ @@ -675,7 +675,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) float xaxis2[3]={1,0,0}; float quat_final_inv[4]; - axis_angle_to_quat(quat_roll, zaxis_test, j * DEG2RAD(45.0)); + axis_angle_to_quat(quat_roll, zaxis_test, (float)j * DEG2RADF(45.0f)); normalize_qt(quat_roll); mul_qt_qtqt(quat_final, snapquats[i], quat_roll); @@ -891,8 +891,8 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf) static void viewmove_apply(ViewOpsData *vod, int x, int y) { if(vod->rv3d->persp==RV3D_CAMOB) { - float zoomfac= (M_SQRT2 + vod->rv3d->camzoom/50.0); - zoomfac= (zoomfac*zoomfac)*0.5; + float zoomfac= ((float)M_SQRT2 + (float)vod->rv3d->camzoom / 50.0f); + zoomfac= (zoomfac * zoomfac) * 0.5f; vod->rv3d->camdx += (vod->oldx - x)/(vod->ar->winx * zoomfac); vod->rv3d->camdy += (vod->oldy - y)/(vod->ar->winy * zoomfac); @@ -1084,7 +1084,7 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, short viewzoom) float time_step= (float)(time - vod->timer_lastdraw); // oldstyle zoom - zfac = 1.0f + (((float)(vod->origx - x + vod->origy - y)/20.0) * time_step); + zfac = 1.0f + (((float)(vod->origx - x + vod->origy - y) / 20.0f) * time_step); vod->timer_lastdraw= time; } else if(viewzoom==USER_ZOOM_SCALE) { @@ -1113,11 +1113,11 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, short viewzoom) if (U.uiflag & USER_ZOOM_INVERT) SWAP(float, len1, len2); - zfac = vod->dist0 * (2.0*((len2/len1)-1.0) + 1.0) / vod->rv3d->dist; + zfac = vod->dist0 * (2.0f * ((len2/len1)-1.0f) + 1.0f) / vod->rv3d->dist; } - if(zfac != 1.0 && zfac*vod->rv3d->dist > 0.001*vod->grid && - zfac*vod->rv3d->dist < 10.0*vod->far) + if(zfac != 1.0f && zfac*vod->rv3d->dist > 0.001f * vod->grid && + zfac * vod->rv3d->dist < 10.0f * vod->far) view_zoom_mouseloc(vod->ar, zfac, vod->oldx, vod->oldy); @@ -1133,8 +1133,8 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, short viewzoom) add_v3_v3(vod->rv3d->ofs, upvec); } else { /* these limits were in old code too */ - if(vod->rv3d->dist<0.001*vod->grid) vod->rv3d->dist= 0.001*vod->grid; - if(vod->rv3d->dist>10.0*vod->far) vod->rv3d->dist=10.0*vod->far; + if(vod->rv3d->dist<0.001f * vod->grid) vod->rv3d->dist= 0.001f * vod->grid; + if(vod->rv3d->dist>10.0f * vod->far) vod->rv3d->dist=10.0f * vod->far; } // XXX if(vod->rv3d->persp==RV3D_ORTHO || vod->rv3d->persp==RV3D_CAMOB) preview3d_event= 0; @@ -1224,7 +1224,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) rv3d->camzoom-= 10; if(rv3d->camzoom < RV3D_CAMZOOM_MIN) rv3d->camzoom= RV3D_CAMZOOM_MIN; } - else if(rv3d->dist<10.0*v3d->far) { + else if(rv3d->dist < 10.0f * v3d->far) { view_zoom_mouseloc(ar, 1.2f, mx, my); } } @@ -1233,7 +1233,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) rv3d->camzoom+= 10; if(rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom= RV3D_CAMZOOM_MAX; } - else if(rv3d->dist> 0.001*v3d->grid) { + else if(rv3d->dist> 0.001f * v3d->grid) { view_zoom_mouseloc(ar, .83333f, mx, my); } } @@ -1373,7 +1373,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in sub_v3_v3v3(afm, max, min); size= 0.7f*MAX3(afm[0], afm[1], afm[2]); - if(size==0.0) ok= 0; + if(size == 0.0f) ok= 0; if(ok) { float new_dist; @@ -1387,7 +1387,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in // correction for window aspect ratio if(ar->winy>2 && ar->winx>2) { size= (float)ar->winx/(float)ar->winy; - if(size<1.0) size= 1.0f/size; + if(size < 1.0f) size= 1.0f/size; new_dist*= size; } @@ -1651,15 +1651,15 @@ static int render_border_exec(bContext *C, wmOperator *op) scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin); /* actually set border */ - CLAMP(scene->r.border.xmin, 0.0, 1.0); - CLAMP(scene->r.border.ymin, 0.0, 1.0); - CLAMP(scene->r.border.xmax, 0.0, 1.0); - CLAMP(scene->r.border.ymax, 0.0, 1.0); + CLAMP(scene->r.border.xmin, 0.0f, 1.0f); + CLAMP(scene->r.border.ymin, 0.0f, 1.0f); + CLAMP(scene->r.border.xmax, 0.0f, 1.0f); + CLAMP(scene->r.border.ymax, 0.0f, 1.0f); /* drawing a border surrounding the entire camera view switches off border rendering * or the border covers no pixels */ - if ((scene->r.border.xmin <= 0.0 && scene->r.border.xmax >= 1.0 && - scene->r.border.ymin <= 0.0 && scene->r.border.ymax >= 1.0) || + if ((scene->r.border.xmin <= 0.0f && scene->r.border.xmax >= 1.0f && + scene->r.border.ymin <= 0.0f && scene->r.border.ymax >= 1.0f) || (scene->r.border.xmin == scene->r.border.xmax || scene->r.border.ymin == scene->r.border.ymax )) { @@ -1767,7 +1767,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) dvec[2] = p[2]-p_corner[2]; new_dist = len_v3(dvec); - if(new_dist <= v3d->near*1.5) new_dist= v3d->near*1.5; + if(new_dist <= v3d->near * 1.5f) new_dist= v3d->near * 1.5f; new_ofs[0] = -p[0]; new_ofs[1] = -p[1]; @@ -1802,7 +1802,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) scale = (xscale >= yscale)?xscale:yscale; /* zoom in as required, or as far as we can go */ - new_dist = ((new_dist*scale) >= 0.001*v3d->grid)? new_dist*scale:0.001*v3d->grid; + new_dist = ((new_dist*scale) >= 0.001f * v3d->grid)? new_dist*scale:0.001f * v3d->grid; } smooth_view(C, NULL, NULL, new_ofs, NULL, &new_dist, NULL); @@ -1858,7 +1858,7 @@ static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar) view3d_viewborder_size_get(scene, ar, size); - rv3d->camzoom= (sqrt(4.0*im_width/size[0]) - M_SQRT2)*50.0; + rv3d->camzoom= (sqrtf(4.0f * (float)im_width/size[0]) - (float)M_SQRT2) * 50.0f; rv3d->camzoom= CLAMPIS(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX); } diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index d6dcd67c756..4914020fc02 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -204,10 +204,10 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSE mouse can move during fly mode without spinning the view */ float x1, x2, y1, y2; - x1= 0.45*(float)fly->ar->winx; - y1= 0.45*(float)fly->ar->winy; - x2= 0.55*(float)fly->ar->winx; - y2= 0.55*(float)fly->ar->winy; + x1= 0.45f * (float)fly->ar->winx; + y1= 0.45f * (float)fly->ar->winy; + x2= 0.55f * (float)fly->ar->winx; + y2= 0.55f * (float)fly->ar->winy; cpack(0); @@ -440,14 +440,14 @@ static void flyEvent(FlyInfo *fly, wmEvent *event) fly->time_lastwheel = time_currwheel; /*printf("Wheel %f\n", time_wheel);*/ /*Mouse wheel delays range from 0.5==slow to 0.01==fast*/ - time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */ + time_wheel = 1.0f + (10.0f - (20.0f * MIN2(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ if (fly->speed<0.0f) fly->speed= 0.0f; else { if (event->shift) - fly->speed+= fly->grid*time_wheel*0.1; + fly->speed += fly->grid*time_wheel * 0.1f; else - fly->speed+= fly->grid*time_wheel; + fly->speed += fly->grid*time_wheel; } break; } @@ -459,12 +459,12 @@ static void flyEvent(FlyInfo *fly, wmEvent *event) time_currwheel= PIL_check_seconds_timer(); time_wheel = (float)(time_currwheel - fly->time_lastwheel); fly->time_lastwheel = time_currwheel; - time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */ + time_wheel = 1.0f + (10.0f - (20.0f * MIN2(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */ if (fly->speed>0) fly->speed=0; else { if (event->shift) - fly->speed-= fly->grid*time_wheel*0.1; + fly->speed-= fly->grid*time_wheel * 0.1f; else fly->speed-= fly->grid*time_wheel; } @@ -608,18 +608,19 @@ static int flyApply(bContext *C, FlyInfo *fly) if(moffset[0]) { moffset[0] /= ar->winx - (xmargin*2); - moffset[0] *= fabs(moffset[0]); + moffset[0] *= fabsf(moffset[0]); } if(moffset[1]) { moffset[1] /= ar->winy - (ymargin*2); - moffset[1] *= fabs(moffset[1]); + moffset[1] *= fabsf(moffset[1]); } /* Should we redraw? */ if(fly->speed != 0.0f || moffset[0] || moffset[1] || fly->zlock || fly->xlock || dvec[0] || dvec[1] || dvec[2] ) { float dvec_tmp[3]; - double time_current, time_redraw; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */ + double time_current; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */ + float time_redraw; float time_redraw_clamped; time_current= PIL_check_seconds_timer(); @@ -642,12 +643,12 @@ static int flyApply(bContext *C, FlyInfo *fly) dvec_tmp[2]= 0; if (fly->use_precision) { - dvec_tmp[0] *= 0.1; - dvec_tmp[1] *= 0.1; + dvec_tmp[0] *= 0.1f; + dvec_tmp[1] *= 0.1f; } mul_m3_v3(mat, dvec_tmp); - mul_v3_fl(dvec_tmp, time_redraw*200.0 * fly->grid); + mul_v3_fl(dvec_tmp, time_redraw * 200.0f * fly->grid); } else { float roll; /* similar to the angle between the camera's up and the Z-up, but its very rough so just roll*/ @@ -704,7 +705,7 @@ static int flyApply(bContext *C, FlyInfo *fly) 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; upvec[0]=0; /*rotate the view about this axis*/ upvec[1]=0; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 9d882f09d02..bd19112f924 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -296,7 +296,7 @@ int lasso_inside(short mcords[][2], short moves, short sx, short sy) cross= (float)((p1[1]-p2[1])*(p1[0]-sx) + (p2[0]-p1[0])*(p1[1]-sy)); - if(cross<0.0) angletot-= ang; + if(cross<0.0f) angletot-= ang; else angletot+= ang; /* circulate */ @@ -1926,7 +1926,7 @@ static void mesh_circle_select(ViewContext *vc, int select, short *mval, float r int bbsel; struct {ViewContext *vc; short select, mval[2]; float radius; } data; - bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0)); + bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f)); ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ vc->em= ((Mesh *)vc->obedit->data)->edit_mesh; @@ -1974,7 +1974,7 @@ static void paint_facesel_circle_select(ViewContext *vc, int select, short *mval if (me) { em_vertoffs= me->totface+1; /* max index array */ - bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0)); + bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f)); EM_backbuf_checkAndSelectTFaces(me, select==LEFTMOUSE); EM_free_backbuf(); } diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index b803d49640e..f007b46dd95 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -252,7 +252,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) if(eve->f1) { VECCOPY(tv->oldloc, eve->co); tv->loc= eve->co; - if(eve->no[0]!=0.0 || eve->no[1]!=0.0 ||eve->no[2]!=0.0) + if(eve->no[0] != 0.0f || eve->no[1] != 0.0f ||eve->no[2] != 0.0f) tv->nor= eve->no; // note this is a hackish signal (ton) tv->flag= eve->f1 & SELECT; tv++; @@ -436,11 +436,11 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) for(a=0; aflag & SELECT) { add_v3_v3(centroid, tv->oldloc); - total+= 1.0; + total += 1.0f; DO_MINMAX(tv->oldloc, min, max); } } - if(total!=0.0) { + if(total != 0.0f) { mul_v3_fl(centroid, 1.0f/total); } @@ -478,9 +478,9 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) VECCOPY(vec, tv->loc); mul_m3_v3(bmat, vec); add_v3_v3(vec, obedit->obmat[3]); - vec[0]= gridf*floor(.5+ vec[0]/gridf); - vec[1]= gridf*floor(.5+ vec[1]/gridf); - vec[2]= gridf*floor(.5+ vec[2]/gridf); + vec[0]= gridf*floorf(0.5f+ vec[0]/gridf); + vec[1]= gridf*floorf(0.5f+ vec[1]/gridf); + vec[2]= gridf*floorf(0.5f+ vec[2]/gridf); sub_v3_v3(vec, obedit->obmat[3]); mul_m3_v3(imat, vec); @@ -508,9 +508,9 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) /* get nearest grid point to snap to */ VECCOPY(nLoc, pchan->pose_mat[3]); - vec[0]= gridf * (float)(floor(.5+ nLoc[0]/gridf)); - vec[1]= gridf * (float)(floor(.5+ nLoc[1]/gridf)); - vec[2]= gridf * (float)(floor(.5+ nLoc[2]/gridf)); + vec[0]= gridf * (float)(floor(0.5f+ nLoc[0]/gridf)); + vec[1]= gridf * (float)(floor(0.5f+ nLoc[1]/gridf)); + vec[2]= gridf * (float)(floor(0.5f+ nLoc[2]/gridf)); /* get bone-space location of grid point */ armature_loc_pose_to_bone(pchan, vec, vecN); @@ -538,9 +538,9 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) else { ob->recalc |= OB_RECALC_OB; - vec[0]= -ob->obmat[3][0]+gridf*floor(.5+ ob->obmat[3][0]/gridf); - vec[1]= -ob->obmat[3][1]+gridf*floor(.5+ ob->obmat[3][1]/gridf); - vec[2]= -ob->obmat[3][2]+gridf*floor(.5+ ob->obmat[3][2]/gridf); + 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); if(ob->parent) { where_is_object(scene, ob); @@ -723,9 +723,9 @@ static int snap_curs_to_grid(bContext *C, wmOperator *UNUSED(op)) gridf= rv3d->gridview; curs= give_cursor(scene, v3d); - curs[0]= gridf*floor(.5+curs[0]/gridf); - curs[1]= gridf*floor(.5+curs[1]/gridf); - curs[2]= gridf*floor(.5+curs[2]/gridf); + curs[0]= gridf*floorf(0.5f+curs[0]/gridf); + curs[1]= gridf*floorf(0.5f+curs[1]/gridf); + curs[2]= gridf*floorf(0.5f+curs[2]/gridf); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d); // hrm @@ -784,7 +784,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op)) } if(v3d->around==V3D_CENTROID) { - mul_v3_fl(centroid, 1.0/(float)tottrans); + mul_v3_fl(centroid, 1.0f/(float)tottrans); VECCOPY(curs, centroid); } else { @@ -824,7 +824,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op)) } if(count) { if(v3d->around==V3D_CENTROID) { - mul_v3_fl(centroid, 1.0/(float)count); + mul_v3_fl(centroid, 1.0f/(float)count); VECCOPY(curs, centroid); } else { diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 852801dfc61..d6ed9752d03 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -113,9 +113,9 @@ static void object_lens_clip_settings(Object *ob, float *lens, float *clipsta, f Lamp *la = ob->data; if (lens) { float x1, fac; - fac= cos( M_PI*la->spotsize/360.0); + fac= cosf((float)M_PI*la->spotsize/360.0f); x1= saacos(fac); - *lens= 16.0*fac/sin(x1); + *lens= 16.0f*fac/sinf(x1); } if (clipsta) *clipsta= la->clipsta; if (clipend) *clipend= la->clipend; @@ -267,7 +267,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo mul_qt_v3(q2, vec2); /* scale the time allowed by the rotation */ - sms.time_allowed *= angle_v3v3(vec1, vec2) / M_PI; /* 180deg == 1.0 */ + sms.time_allowed *= (double)angle_v3v3(vec1, vec2) / M_PI; /* 180deg == 1.0 */ } /* ensure it shows correct */ @@ -312,14 +312,14 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); struct SmoothViewStore *sms= rv3d->sms; - double step, step_inv; + float step, step_inv; /* escape if not our timer */ if(rv3d->smooth_timer==NULL || rv3d->smooth_timer!=event->customdata) return OPERATOR_PASS_THROUGH; - if(sms->time_allowed != 0.0f) - step = (rv3d->smooth_timer->duration)/sms->time_allowed; + if(sms->time_allowed != 0.0) + step = (float)((rv3d->smooth_timer->duration)/sms->time_allowed); else step = 1.0f; @@ -356,18 +356,18 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent int i; /* ease in/out */ - if (step < 0.5) step = (float)pow(step*2, 2)/2; - else step = (float)1-(pow(2*(1-step),2)/2); + if (step < 0.5f) step = (float)pow(step*2.0f, 2.0)/2.0f; + else step = (float)1.0f-(powf(2.0f*(1.0f-step),2.0f)/2.0f); - step_inv = 1.0-step; + step_inv = 1.0f-step; for (i=0; i<3; i++) - rv3d->ofs[i] = sms->new_ofs[i]*step + sms->orig_ofs[i]*step_inv; + rv3d->ofs[i] = sms->new_ofs[i] * step + sms->orig_ofs[i]*step_inv; interp_qt_qtqt(rv3d->viewquat, sms->orig_quat, sms->new_quat, step); - rv3d->dist = sms->new_dist*step + sms->orig_dist*step_inv; - v3d->lens = sms->new_lens*step + sms->orig_lens*step_inv; + rv3d->dist = sms->new_dist * step + sms->orig_dist*step_inv; + v3d->lens = sms->new_lens * step + sms->orig_lens*step_inv; } if(rv3d->viewlock & RV3D_BOXVIEW) @@ -787,14 +787,14 @@ void project_short(ARegion *ar, float *vec, short *adr) /* clips */ vec4[3]= 1.0; mul_m4_v4(rv3d->persmat, vec4); - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ + if( vec4[3] > (float)BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]); if( fx>0 && fxwinx) { fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]); - if(fy>0.0 && fy< (float)ar->winy) { + if(fy > 0.0f && fy < (float)ar->winy) { adr[0]= (short)floor(fx); adr[1]= (short)floor(fy); } @@ -813,7 +813,7 @@ void project_int(ARegion *ar, float *vec, int *adr) mul_m4_v4(rv3d->persmat, vec4); - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ + if( vec4[3] > (float)BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]); if( fx>-2140000000.0f && fx<2140000000.0f) { @@ -862,14 +862,14 @@ void project_short_noclip(ARegion *ar, float *vec, short *adr) mul_m4_v4(rv3d->persmat, vec4); - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ + if( vec4[3] > (float)BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]); if( fx>-32700 && fx<32700) { fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]); - if(fy>-32700.0 && fy<32700.0) { + if(fy > -32700.0f && fy < 32700.0f) { adr[0]= (short)floor(fx); adr[1]= (short)floor(fy); } @@ -888,9 +888,9 @@ void project_float(ARegion *ar, float *vec, float *adr) mul_m4_v4(rv3d->persmat, vec4); - if( vec4[3]>BL_NEAR_CLIP ) { - adr[0] = (float)(ar->winx/2.0)+(ar->winx/2.0)*vec4[0]/vec4[3]; - adr[1] = (float)(ar->winy/2.0)+(ar->winy/2.0)*vec4[1]/vec4[3]; + if(vec4[3] > (float)BL_NEAR_CLIP) { + adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3]; + adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3]; } } @@ -905,8 +905,8 @@ void project_float_noclip(ARegion *ar, float *vec, float *adr) mul_m4_v4(rv3d->persmat, vec4); if( fabs(vec4[3]) > BL_NEAR_CLIP ) { - adr[0] = (float)(ar->winx/2.0)+(ar->winx/2.0)*vec4[0]/vec4[3]; - adr[1] = (float)(ar->winy/2.0)+(ar->winy/2.0)*vec4[1]/vec4[3]; + adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3]; + adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3]; } else { @@ -965,7 +965,7 @@ int get_view3d_cliprange(View3D *v3d, RegionView3D *rv3d, float *clipsta, float } if(rv3d->persp==RV3D_ORTHO) { - *clipend *= 0.5; // otherwise too extreme low zbuffer quality + *clipend *= 0.5f; // otherwise too extreme low zbuffer quality *clipsta= - *clipend; orth= 1; } @@ -992,10 +992,10 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, Lamp *la; la= v3d->camera->data; - fac= cos( M_PI*la->spotsize/360.0); + fac= cosf(((float)M_PI)*la->spotsize/360.0f); x1= saacos(fac); - lens= 16.0*fac/sin(x1); + lens= 16.0f*fac/sinf(x1); *clipsta= la->clipsta; *clipend= la->clipend; @@ -1018,14 +1018,14 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, else y1= -rv3d->dist; y2= -y1; - *clipend *= 0.5; // otherwise too extreme low zbuffer quality + *clipend *= 0.5f; // otherwise too extreme low zbuffer quality *clipsta= - *clipend; orth= 1; } else { /* fac for zoom, also used for camdx */ if(rv3d->persp==RV3D_CAMOB) { - fac= (1.41421+( (float)rv3d->camzoom )/50.0); + fac= (1.41421f + ( (float)rv3d->camzoom )/50.0f); fac*= fac; } else fac= 2.0; @@ -1033,7 +1033,7 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, /* viewplane size depends... */ if(cam && cam->type==CAM_ORTHO) { /* ortho_scale == 1 means exact 1 to 1 mapping */ - float dfac= 2.0*cam->ortho_scale/fac; + float dfac= 2.0f*cam->ortho_scale/fac; if(winx>winy) x1= -dfac; else x1= -winx*dfac/winy; @@ -1047,8 +1047,8 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, else { float dfac; - if(winx>winy) dfac= 64.0/(fac*winx*lens); - else dfac= 64.0/(fac*winy*lens); + if(winx>winy) dfac= 64.0f/(fac*winx*lens); + else dfac= 64.0f/(fac*winy*lens); x1= - *clipsta * winx*dfac; x2= -x1; @@ -1058,8 +1058,8 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, } /* cam view offset */ if(cam) { - float dx= 0.5*fac*rv3d->camdx*(x2-x1); - float dy= 0.5*fac*rv3d->camdy*(y2-y1); + float dx= 0.5f*fac*rv3d->camdx*(x2-x1); + float dy= 0.5f*fac*rv3d->camdy*(y2-y1); /* shift offset */ if(cam->type==CAM_ORTHO) { @@ -1067,8 +1067,8 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, dy += cam->shifty * cam->ortho_scale; } else { - dx += cam->shiftx * (cam->clipsta / cam->lens) * 32.0; - dy += cam->shifty * (cam->clipsta / cam->lens) * 32.0; + dx += cam->shiftx * (cam->clipsta / cam->lens) * 32.0f; + dy += cam->shifty * (cam->clipsta / cam->lens) * 32.0f; } x1+= dx; @@ -1086,7 +1086,7 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, *pixsize= 1.0f/viewfac; } else { - viewfac= (((winx >= winy)? winx: winy)*lens)/32.0; + viewfac= (((winx >= winy)? winx: winy)*lens)/32.0f; *pixsize= *clipsta/viewfac; } } @@ -1498,7 +1498,7 @@ static void initlocalview(Main *bmain, Scene *scene, ScrArea *sa) box[1]= (max[1]-min[1]); box[2]= (max[2]-min[2]); size= MAX3(box[0], box[1], box[2]); - if(size<=0.01) size= 0.01; + if(size <= 0.01f) size= 0.01f; } if(ok) { @@ -1515,19 +1515,19 @@ static void initlocalview(Main *bmain, Scene *scene, ScrArea *sa) rv3d->localvd= MEM_mallocN(sizeof(RegionView3D), "localview region"); memcpy(rv3d->localvd, rv3d, sizeof(RegionView3D)); - rv3d->ofs[0]= -(min[0]+max[0])/2.0; - rv3d->ofs[1]= -(min[1]+max[1])/2.0; - rv3d->ofs[2]= -(min[2]+max[2])/2.0; + rv3d->ofs[0]= -(min[0]+max[0])/2.0f; + rv3d->ofs[1]= -(min[1]+max[1])/2.0f; + rv3d->ofs[2]= -(min[2]+max[2])/2.0f; rv3d->dist= size; /* perspective should be a bit farther away to look nice */ if(rv3d->persp==RV3D_ORTHO) - rv3d->dist*= 0.7; + rv3d->dist*= 0.7f; // correction for window aspect ratio if(ar->winy>2 && ar->winx>2) { float asp= (float)ar->winx/(float)ar->winy; - if(asp<1.0) asp= 1.0/asp; + if(asp < 1.0f) asp= 1.0f/asp; rv3d->dist*= asp; } -- cgit v1.2.3 From ac1cb5ee055840ba3481b8ad490e3be2a6a49cf2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 Mar 2011 02:34:55 +0000 Subject: - quiet new warnings with gcc 4.6 - use BLI math funcs for normal float/short conversion. - correct some un-intentional float/double promotions. --- source/blender/editors/space_view3d/view3d_buttons.c | 5 +++-- source/blender/editors/space_view3d/view3d_fly.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 4277a7e85e3..b404a7be27c 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1214,7 +1214,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa) View3D *v3d= CTX_wm_view3d(C); //uiBut *bt; Object *ob= OBACT; - TransformProperties *tfp; + // TransformProperties *tfp; // UNUSED PointerRNA obptr; uiLayout *col, *row; float lim; @@ -1222,12 +1222,13 @@ static void view3d_panel_object(const bContext *C, Panel *pa) if(ob==NULL) return; /* make sure we got storage */ + /* if(v3d->properties_storage==NULL) v3d->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties"); tfp= v3d->properties_storage; // XXX uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - /* + if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) { } else { diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 4914020fc02..7d84a47bddf 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -563,7 +563,8 @@ static int flyApply(bContext *C, FlyInfo *fly) moffset[2], /* mouse offset from the views center */ tmp_quat[4]; /* used for rotating the view */ - int cent_orig[2], /* view center */ + int +// cent_orig[2], /* view center */ //XXX- can avoid using // cent[2], /* view center modified */ xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */ unsigned char @@ -582,8 +583,9 @@ static int flyApply(bContext *C, FlyInfo *fly) xmargin= ar->winx/20.0f; ymargin= ar->winy/20.0f; - cent_orig[0]= ar->winrct.xmin + ar->winx/2; - cent_orig[1]= ar->winrct.ymin + ar->winy/2; + // UNUSED + // cent_orig[0]= ar->winrct.xmin + ar->winx/2; + // cent_orig[1]= ar->winrct.ymin + ar->winy/2; { -- cgit v1.2.3 From 713f976918d2ed00fb088430d2e417d7d055b693 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 28 Mar 2011 12:16:20 +0000 Subject: Bugfix, irc report: Entering editmode crashed, missing v3d properties storage, which got accidentally removed. --- source/blender/editors/space_view3d/view3d_buttons.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index b404a7be27c..cd6f8954430 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -137,7 +137,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float { uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL; MDeformVert *dvert=NULL; - TransformProperties *tfp= v3d->properties_storage; + TransformProperties *tfp; float median[6], ve_median[6]; int tot, totw, totweight, totedge, totradius; char defstr[320]; @@ -146,6 +146,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float tot= totw= totweight= totedge= totradius= 0; defstr[0]= 0; + /* make sure we got storage */ + if(v3d->properties_storage==NULL) + v3d->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties"); + tfp= v3d->properties_storage; + if(ob->type==OB_MESH) { Mesh *me= ob->data; EditMesh *em = BKE_mesh_get_editmesh(me); -- cgit v1.2.3 From 859d22467d406d8be9269035e271bd9ad7c935b4 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Mon, 28 Mar 2011 15:01:19 +0000 Subject: 2.5 3D View Properties UI: Show text "Nothing selected" in "Transform" panel (edit mode) rather than only the empty panel. --- source/blender/editors/space_view3d/view3d_buttons.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index cd6f8954430..549a547b846 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -277,8 +277,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float } } - if(tot==0) return; - + if(tot==0) { + uiDefBut(block, LABEL, 0, "Nothing selected",0, 130, 200, 20, NULL, 0, 0, 0, 0, ""); + return; + } median[0] /= (float)tot; median[1] /= (float)tot; median[2] /= (float)tot; -- cgit v1.2.3 From b2ac8ff1e16235ceedb52a65abebf30ff15e21fc Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 28 Mar 2011 18:51:27 +0000 Subject: Maintenance: Gave the report-timer (in top header) an own TIMER define, to not confuse with timers in use for UI. Easier for debugging. :) Also gave better malloc names to regions in 3d window. All this for testing proper buffer drawing in Intel cards... which is still unsolved. --- source/blender/editors/space_view3d/space_view3d.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 5d75d645695..72d7977e132 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1078,7 +1078,7 @@ void ED_spacetype_view3d(void) st->context= view3d_context; /* regions: main window */ - art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); + art= MEM_callocN(sizeof(ARegionType), "spacetype view3d main region"); art->regionid = RGN_TYPE_WINDOW; art->keymapflag= ED_KEYMAP_GPENCIL; art->draw= view3d_main_area_draw; @@ -1091,7 +1091,7 @@ void ED_spacetype_view3d(void) BLI_addhead(&st->regiontypes, art); /* regions: listview/buttons */ - art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); + art= MEM_callocN(sizeof(ARegionType), "spacetype view3d buttons region"); art->regionid = RGN_TYPE_UI; art->prefsizex= 180; // XXX art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; @@ -1103,7 +1103,7 @@ void ED_spacetype_view3d(void) view3d_buttons_register(art); /* regions: tool(bar) */ - art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); + art= MEM_callocN(sizeof(ARegionType), "spacetype view3d tools region"); art->regionid = RGN_TYPE_TOOLS; art->prefsizex= 160; // XXX art->prefsizey= 50; // XXX @@ -1119,7 +1119,7 @@ void ED_spacetype_view3d(void) #endif /* regions: tool properties */ - art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); + art= MEM_callocN(sizeof(ARegionType), "spacetype view3d tool properties region"); art->regionid = RGN_TYPE_TOOL_PROPS; art->prefsizex= 0; art->prefsizey= 120; @@ -1133,7 +1133,7 @@ void ED_spacetype_view3d(void) /* regions: header */ - art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); + art= MEM_callocN(sizeof(ARegionType), "spacetype view3d header region"); art->regionid = RGN_TYPE_HEADER; art->prefsizey= HEADERY; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER; -- cgit v1.2.3 From 4f29bc25948d7f412ccf7c3944bd3550d87bc9a5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 30 Mar 2011 15:28:38 +0000 Subject: fix [#26685] Cannot exit from "edit mode" this does not fix the underlying problem that once in this state you cant exit editmode, only that the layer key bindings dont let the state come about. Looked into fixing properly but its not so simple since currently object mode operators all use "active_object" which is supposed not to be set when in a hidden layer. --- .../blender/editors/space_view3d/view3d_header.c | 35 ++++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 3b6b7257c9c..246ed853cc8 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -147,6 +147,21 @@ static void handle_view3d_lock(bContext *C) - uiTemplateLayers in interface/ code for buttons - ED_view3d_scene_layer_set for RNA */ +static void view3d_layers_editmode_ensure(Scene *scene, View3D *v3d) +{ + /* sanity check - when in editmode disallow switching the editmode layer off since its confusing + * an alternative would be to always draw the editmode object. */ + if(scene->obedit && (scene->obedit->lay & v3d->lay)==0) { + int bit; + for(bit=0; bit<32; bit++) { + if(scene->obedit->lay & (1<lay |= 1<lay == ((1<<20)-1)) { /* return to active layer only */ v3d->lay = v3d->layact; - } else { + + view3d_layers_editmode_ensure(scene, v3d); + } + else { v3d->lay |= (1<<20)-1; } } @@ -181,19 +199,10 @@ static int view3d_layers_exec(bContext *C, wmOperator *op) v3d->lay |= (1<lay = (1<obedit && (scene->obedit->lay & v3d->lay)==0) { - for(bit=0; bit<32; bit++) { - if(scene->obedit->lay & (1<lay |= 1<lay & (1<layact= 1< Date: Fri, 1 Apr 2011 14:14:37 +0000 Subject: fix problem with recent commit [#26717] X-Ray conflict (X-Ray Grease Pencil and Object X-Ray) --- source/blender/editors/space_view3d/view3d_draw.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index f5037ca24a1..1c830b7022a 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2120,6 +2120,11 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, } } + /* must be before xray draw which clears the depth buffer */ + if(v3d->zbuf) glDisable(GL_DEPTH_TEST); + draw_gpencil_view3d_ext(scene, v3d, ar, 1); + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); + /* transp and X-ray afterdraw stuff */ if(v3d->afterdraw_transp.first) view3d_draw_transp(scene, ar, v3d); if(v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used! @@ -2132,8 +2137,6 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, } /* draw grease-pencil stuff */ - draw_gpencil_view3d_ext(scene, v3d, ar, 1); - ED_region_pixelspace(ar); /* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */ @@ -2451,7 +2454,14 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) } // REEB_draw(); - + + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + /* must be before xray draw which clears the depth buffer */ + if(v3d->zbuf) glDisable(GL_DEPTH_TEST); + draw_gpencil_view3d((bContext *)C, 1); + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); + } + /* Transp and X-ray afterdraw stuff */ if(v3d->afterdraw_transp.first) view3d_draw_transp(scene, ar, v3d); if(v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used! @@ -2472,12 +2482,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) v3d->zbuf= FALSE; glDisable(GL_DEPTH_TEST); } - - if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { - /* draw grease-pencil stuff (3d-space strokes) */ - //if (v3d->flag2 & V3D_DISPGP) - draw_gpencil_view3d((bContext *)C, 1); + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { BDR_drawSketch(C); } -- cgit v1.2.3 From 0298d223cc1156df3a32fbb3a97dccf5ddb5ad02 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 Apr 2011 10:04:16 +0000 Subject: quiet various warnings, also disable -Wdouble-promotion with cmake since it gives warnings with variable length args. --- source/blender/editors/space_view3d/view3d_view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index d6ed9752d03..8f8b46d07ad 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1696,7 +1696,7 @@ static void RestoreState(bContext *C, wmWindow *win) } /* was space_set_commmandline_options in 2.4x */ -void game_set_commmandline_options(GameData *gm) +static void game_set_commmandline_options(GameData *gm) { SYS_SystemHandle syshandle; int test; -- cgit v1.2.3 From b3bc0040d8ee88696d14aae9b59673d5f1bc83c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 Apr 2011 22:40:56 +0000 Subject: fix [#26785] Curve shows in 3dview regardless of "Only Render" --- source/blender/editors/space_view3d/drawobject.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index e656c0ebb91..cf7ca95b93c 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3164,9 +3164,11 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas index3_nors_incr= 0; if( displist_has_faces(lb)==0) { - draw_index_wire= 0; - drawDispListwire(lb); - draw_index_wire= 1; + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + draw_index_wire= 0; + drawDispListwire(lb); + draw_index_wire= 1; + } } else { if(draw_glsl_material(scene, ob, v3d, dt)) { -- cgit v1.2.3 From db6ea4d3a5852882cdf8bfac125ca789532b694a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Apr 2011 02:58:19 +0000 Subject: utility function for getting the vector direction the mouse is pointing in a perspective view. --- source/blender/editors/space_view3d/view3d_view.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 8f8b46d07ad..f98b2dc934f 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -677,6 +677,28 @@ void window_to_3d_delta(ARegion *ar, float *vec, short mx, short my) vec[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy); } +/* doesn't rely on initgrabz */ +/* for perspective view, get the vector direction to + * the mouse cursor as a normalized vector */ +void window_to_3d_vector(ARegion *ar, float *vec, short mx, short my) +{ + RegionView3D *rv3d= ar->regiondata; + float dx, dy; + float viewvec[3]; + + dx= 2.0f*mx/ar->winx; + dy= 2.0f*my/ar->winy; + + /* normalize here so vecs are proportional to eachother */ + normalize_v3_v3(viewvec, rv3d->viewinv[2]); + + vec[0]= viewvec[0] - (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy); + vec[1]= viewvec[1] - (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy); + vec[2]= viewvec[2] - (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy); + + normalize_v3(vec); +} + float read_cached_depth(ViewContext *vc, int x, int y) { ViewDepths *vd = vc->rv3d->depths; -- cgit v1.2.3 From 8f4343cb304af865a35c5a02f648fb38a1044a2f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Apr 2011 07:26:22 +0000 Subject: fix for render only drawing wire curves in wire view. --- source/blender/editors/space_view3d/drawobject.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index cf7ca95b93c..ed9d6f77ffa 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3141,9 +3141,9 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas ListBase *lb=NULL; DispList *dl; Curve *cu; - int solid, retval= 0; - - solid= (dt > OB_WIRE); + const short render_only= (v3d->flag2 & V3D_RENDER_OVERRIDE); + const short solid= (dt > OB_WIRE); + int retval= 0; if (drawCurveDerivedMesh(scene, v3d, rv3d, base, dt) == 0) { return 0; @@ -3164,7 +3164,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas index3_nors_incr= 0; if( displist_has_faces(lb)==0) { - if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + if(!render_only) { draw_index_wire= 0; drawDispListwire(lb); draw_index_wire= 1; @@ -3196,9 +3196,11 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas index3_nors_incr= 1; } else { - draw_index_wire= 0; - retval= drawDispListwire(lb); - draw_index_wire= 1; + if(!render_only || (render_only && displist_has_faces(lb))) { + draw_index_wire= 0; + retval= drawDispListwire(lb); + draw_index_wire= 1; + } } break; case OB_SURF: -- cgit v1.2.3 From 5c7bed92d4a124a92c596f2dbe212cc59335925f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Apr 2011 03:02:40 +0000 Subject: fix for cmake glew includes (tested with mingw), also made qtcreator project generator work with mingw again --- source/blender/editors/space_view3d/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt index fc9dd8c9bcc..9744887ed9f 100644 --- a/source/blender/editors/space_view3d/CMakeLists.txt +++ b/source/blender/editors/space_view3d/CMakeLists.txt @@ -33,6 +33,7 @@ set(INC ../../render/extern/include ../../../../intern/guardedalloc ../../../../intern/smoke/extern + ${GLEW_INCLUDE_PATH} ) set(SRC -- cgit v1.2.3 From ba44bf522cd098c8568a8dea4218b91b8d161191 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 7 Apr 2011 15:48:33 +0000 Subject: Bugfix #26812 On anim-render, a click in timeline stopped render completely. The reason for this was a bit wacko code to cope with frame-step feature (steps of multiple frames). I thought of fixing that, but instead decided to block any operator in Blender to change a frame while a render is in progress. Both render engine and UI are accessing (writing to) the same data then, which is a bad conflict. Still a serious weakness of threaded render, but I'll keep trying to allow this as far as possible :) --- source/blender/editors/space_view3d/space_view3d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 72d7977e132..a8cdc99645d 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -214,7 +214,7 @@ static SpaceLink *view3d_new(const bContext *C) v3d->lens= 35.0f; v3d->near= 0.01f; - v3d->far= 500.0f; + v3d->far= 1000.0f; v3d->twflag |= U.tw_flag & V3D_USE_MANIPULATOR; v3d->twtype= V3D_MANIP_TRANSLATE; -- cgit v1.2.3