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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/curve/editcurve.c89
-rw-r--r--source/blender/editors/curve/editfont.c4
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c47
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c10
-rw-r--r--source/blender/editors/include/ED_curve.h2
-rw-r--r--source/blender/editors/interface/interface_style.c10
-rw-r--r--source/blender/editors/mesh/bmesh_select.c32
-rw-r--r--source/blender/editors/mesh/bmesh_tools.c29
-rw-r--r--source/blender/editors/mesh/bmeshutils.c13
-rw-r--r--source/blender/editors/mesh/editbmesh_add.c6
-rw-r--r--source/blender/editors/mesh/editbmesh_bvh.c1
-rw-r--r--source/blender/editors/mesh/mesh_data.c2
-rw-r--r--source/blender/editors/metaball/mball_edit.c4
-rw-r--r--source/blender/editors/screen/screen_edit.c4
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c64
15 files changed, 159 insertions, 158 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 18276a5c825..e937417c857 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -951,7 +951,7 @@ static void calc_shapeKeys(Object *obedit)
++i;
}
- fp+= 3; curofp+= 3; /* alphas */
+ fp+= 3; /* alphas */
} else {
for (j= 0; j < 3; ++j, ++i) {
VECCOPY(fp, bezt->vec[j]);
@@ -1234,7 +1234,6 @@ void make_editNurb(Object *obedit)
Nurb *nu, *newnu, *nu_act= NULL;
KeyBlock *actkey;
- if(obedit==NULL) return;
set_actNurb(obedit, NULL);
@@ -1591,7 +1590,7 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
BPoint *bp, *bpn, *newbp;
int a, b, newu, newv, sel;
- if(obedit && obedit->type==OB_SURF);
+ if(obedit->type==OB_SURF);
else return OPERATOR_CANCELLED;
cu->lastsel= NULL;
@@ -2855,7 +2854,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
int a, b, sel, amount, *usel, *vsel, i;
float factor;
- // printf("*** subdivideNurb: entering subdivide\n");
+ // printf("*** subdivideNurb: entering subdivide\n");
for(nu= editnurb->nurbs.first; nu; nu= nu->next) {
amount= 0;
@@ -3031,7 +3030,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
/* This is a very strange test ... */
/**
Subdivide NURB surfaces - nzc 30-5-'00 -
-
+
Subdivision of a NURB curve can be effected by adding a
control point (insertion of a knot), or by raising the
degree of the functions used to build the NURB. The
@@ -3231,8 +3230,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
MEM_freeN(nu->bp);
nu->bp= bpnew;
nu->pntsu+= sel;
- nurbs_knot_calc_u(nu); /* shift knots
- forward */
+ nurbs_knot_calc_u(nu); /* shift knots forward */
}
}
}
@@ -3581,7 +3579,7 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot)
/* identifiers */
ot->name= "Set Spline Type";
- ot->description = "Set type of actibe spline";
+ ot->description = "Set type of active spline";
ot->idname= "CURVE_OT_spline_type_set";
/* api callbacks */
@@ -4171,7 +4169,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
/***************** pick select from 3d view **********************/
-int mouse_nurb(bContext *C, short mval[2], int extend)
+int mouse_nurb(bContext *C, const short mval[2], int extend)
{
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
@@ -4413,11 +4411,10 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
Nurb *nu, *newnu= NULL;
BezTriple *bezt, *newbezt = NULL;
BPoint *bp, *newbp = NULL;
- float mat[3][3],imat[3][3], temp[3];
+ float imat[4][4], temp[3];
int ok= 0;
- copy_m3_m4(mat, obedit->obmat);
- invert_m3_m3(imat,mat);
+ invert_m4_m4(imat, obedit->obmat);
findselectedNurbvert(&editnurb->nurbs, &nu, &bezt, &bp);
@@ -4451,10 +4448,14 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
temp[0] = 1;
temp[1] = 0;
temp[2] = 0;
+
copy_v3_v3(newbezt->vec[1], location);
- sub_v3_v3(newbezt->vec[1], obedit->obmat[3]);
- sub_v3_v3v3(newbezt->vec[0], newbezt->vec[1],temp);
- add_v3_v3v3(newbezt->vec[2], newbezt->vec[1],temp);
+ sub_v3_v3v3(newbezt->vec[0], newbezt->vec[1], temp);
+ add_v3_v3v3(newbezt->vec[2], newbezt->vec[1], temp);
+
+ mul_m4_v3(imat, newbezt->vec[0]);
+ mul_m4_v3(imat, newbezt->vec[1]);
+ mul_m4_v3(imat, newbezt->vec[2]);
ok= 1;
nu= newnu;
@@ -4473,9 +4474,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
newnu->orderu= 2;
newnu->pntsu= 1;
- copy_v3_v3(newbp->vec, location);
- sub_v3_v3(newbp->vec, obedit->obmat[3]);
- mul_m3_v3(imat,newbp->vec);
+ mul_v3_m4v3(newbp->vec, imat, location);
newbp->vec[3]= 1.0;
newnu->knotsu= newnu->knotsv= NULL;
@@ -4555,9 +4554,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
copy_v3_v3(newbezt->vec[2], bezt->vec[2]);
}
else {
- copy_v3_v3(newbezt->vec[1], location);
- sub_v3_v3(newbezt->vec[1], obedit->obmat[3]);
- mul_m3_v3(imat,newbezt->vec[1]);
+ mul_v3_m4v3(newbezt->vec[1], imat, location);
sub_v3_v3v3(temp, newbezt->vec[1],temp);
add_v3_v3v3(newbezt->vec[0], bezt->vec[0],temp);
add_v3_v3v3(newbezt->vec[2], bezt->vec[2],temp);
@@ -4622,9 +4619,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
copy_v3_v3(newbp->vec, bp->vec);
}
else {
- copy_v3_v3(newbp->vec, location);
- sub_v3_v3(newbp->vec, obedit->obmat[3]);
- mul_m3_v3(imat,newbp->vec);
+ mul_v3_m4v3(newbp->vec, imat, location);
newbp->vec[3]= 1.0;
if(!newnu && nu->orderu<4 && nu->orderu<=nu->pntsu)
@@ -4666,13 +4661,33 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
- ViewContext vc;
- float location[3] = {0.0f, 0.0f, 0.0f};
- short mval[2];
if(rv3d && !RNA_property_is_set(op->ptr, "location")) {
+ Curve *cu;
+ ViewContext vc;
+ float location[3];
+ short mval[2];
+
+ Nurb *nu;
+ BezTriple *bezt;
+ BPoint *bp;
+
view3d_set_viewcontext(C, &vc);
+ cu= vc.obedit->data;
+
+ findselectedNurbvert(&cu->editnurb->nurbs, &nu, &bezt, &bp);
+
+ if(bezt) {
+ mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
+ }
+ else if (bp) {
+ mul_v3_m4v3(location, vc.obedit->obmat, bp->vec);
+ }
+ else {
+ copy_v3_v3(location, give_cursor(vc.scene, vc.v3d));
+ }
+
mval[0]= event->x - vc.ar->winrct.xmin;
mval[1]= event->y - vc.ar->winrct.ymin;
@@ -4980,8 +4995,8 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
int a, location[2], deselect;
deselect= RNA_boolean_get(op->ptr, "deselect");
- location[0]= event->x - ar->winrct.xmin;
- location[1]= event->y - ar->winrct.ymin;
+ location[0]= event->x - ar->winrct.xmin;
+ location[1]= event->y - ar->winrct.ymin;
view3d_operator_needs_opengl(C);
view3d_set_viewcontext(C, &vc);
@@ -5622,7 +5637,7 @@ static int duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CURVE_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate";
+ ot->name= "Duplicate Curve";
ot->description = "Duplicate selected control points and segments between them";
ot->idname= "CURVE_OT_duplicate";
@@ -5646,7 +5661,7 @@ static int delete_exec(bContext *C, wmOperator *op)
Curve *cu= obedit->data;
EditNurb *editnurb= cu->editnurb;
ListBase *nubase= &editnurb->nurbs;
- Nurb *nu, *next, *nu1;
+ Nurb *nu, *nu1;
BezTriple *bezt, *bezt1, *bezt2;
BPoint *bp, *bp1, *bp2;
int a, cut= 0, type= RNA_enum_get(op->ptr, "type");
@@ -5671,6 +5686,7 @@ static int delete_exec(bContext *C, wmOperator *op)
if(type==0) {
/* first loop, can we remove entire pieces? */
+ Nurb *next;
nu= nubase->first;
while(nu) {
next= nu->next;
@@ -5799,7 +5815,6 @@ static int delete_exec(bContext *C, wmOperator *op)
nu1= NULL;
nuindex= 0;
for(nu= nubase->first; nu; nu= nu->next) {
- next= nu->next;
if(nu->type == CU_BEZIER) {
bezt= nu->bezt;
for(a=0; a<nu->pntsu-1; a++) {
@@ -6542,12 +6557,12 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
ListBase *editnurb;
Nurb *nu;
int newob= 0;
- int enter_editmode;
+ int enter_editmode, is_aligned;
unsigned int layer;
float loc[3], rot[3];
float mat[4][4];
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &is_aligned))
return OPERATOR_CANCELLED;
if (!isSurf) { /* adding curve */
@@ -6647,7 +6662,7 @@ static int add_primitive_bezier_circle_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Circle";
+ ot->name= "Add Bezier Circle";
ot->description= "Construct a Bezier Circle";
ot->idname= "CURVE_OT_primitive_bezier_circle_add";
@@ -6940,7 +6955,7 @@ static void *undo_check_lastsel(void *lastsel, Nurb *nu, Nurb *newnu)
return NULL;
}
-static void undoCurve_to_editCurve(void *ucu, void *obe, void *obdata)
+static void undoCurve_to_editCurve(void *ucu, void *edata, void *obe)
{
Object *obedit= obe;
Curve *cu= (Curve*)obedit->data;
@@ -6990,7 +7005,7 @@ static void undoCurve_to_editCurve(void *ucu, void *obe, void *obdata)
ED_curve_updateAnimPaths(obedit);
}
-static void *editCurve_to_undoCurve(void *obe, void *cue)
+static void *editCurve_to_undoCurve(void *edata, void *obe)
{
Object *obedit= obe;
Curve *cu= (Curve*)obedit->data;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 37cc135a6a8..f5b9ed39664 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -1769,7 +1769,7 @@ void FONT_OT_unlink(wmOperatorType *ot)
/* **************** undo for font object ************** */
-static void undoFont_to_editFont(void *strv, void *ecu, void *obdata)
+static void undoFont_to_editFont(void *strv, void *ecu, void *UNUSED(obdata))
{
Curve *cu= (Curve *)ecu;
EditFont *ef= cu->editfont;
@@ -1786,7 +1786,7 @@ static void undoFont_to_editFont(void *strv, void *ecu, void *obdata)
update_string(cu);
}
-static void *editFont_to_undoFont(void *ecu, void *obdata)
+static void *editFont_to_undoFont(void *ecu, void *UNUSED(obdata))
{
Curve *cu= (Curve *)ecu;
EditFont *ef= cu->editfont;
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 598c0e5fa26..1a9ef4be70f 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -75,14 +75,16 @@
/* ----- General Defines ------ */
/* flags for sflag */
-enum {
+typedef enum eDrawStrokeFlags {
GP_DRAWDATA_NOSTATUS = (1<<0), /* don't draw status info */
GP_DRAWDATA_ONLY3D = (1<<1), /* only draw 3d-strokes */
GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */
GP_DRAWDATA_ONLYI2D = (1<<3), /* only draw 'image' strokes */
GP_DRAWDATA_IEDITHACK = (1<<4), /* special hack for drawing strokes in Image Editor (weird coordinates) */
GP_DRAWDATA_NO_XRAY = (1<<5), /* dont draw xray in 3D view (which is default) */
-};
+} eDrawStrokeFlags;
+
+
/* thickness above which we should use special drawing */
#define GP_DRAWTHICKNESS_SPECIAL 3
@@ -152,7 +154,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
/* ----- Existing Strokes Drawing (3D and Point) ------ */
/* draw a given stroke - just a single dot (only one point) */
-static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy)
+static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short dflag, short sflag, int offsx, int offsy, int winx, int winy)
{
/* draw point */
if (sflag & GP_STROKE_3DSPACE) {
@@ -161,7 +163,6 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sfl
glEnd();
}
else {
- // int spacetype= 0; // XXX make local gpencil state var?
float co[2];
/* get coordinates of point */
@@ -181,12 +182,8 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sfl
/* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple dot looks ok
* - also mandatory in if Image Editor 'image-based' dot
*/
-#if 0
if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) ||
- ((spacetype==SPACE_IMAGE) && (sflag & GP_STROKE_2DSPACE)) )
-#else
- if(1) /* when spacetype is back uncomment the check above */
-#endif
+ ((dflag & GP_DRAWDATA_IEDITHACK) && (sflag & GP_STROKE_2DSPACE)) )
{
glBegin(GL_POINTS);
glVertex2fv(co);
@@ -510,15 +507,16 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
/* check which stroke-drawer to use */
if (gps->totpoints == 1)
- gp_draw_stroke_point(gps->points, lthick, gps->flag, offsx, offsy, winx, winy);
+ gp_draw_stroke_point(gps->points, lthick, dflag, gps->flag, offsx, offsy, winx, winy);
else if (dflag & GP_DRAWDATA_ONLY3D) {
const int no_xray= (dflag & GP_DRAWDATA_NO_XRAY);
- int mask_orig;
- if(no_xray) {
+ int mask_orig = 0;
+
+ if (no_xray) {
glGetIntegerv(GL_DEPTH_WRITEMASK, &mask_orig);
glDepthMask(0);
glEnable(GL_DEPTH_TEST);
-
+
/* first arg is normally rv3d->dist, but this isnt available here and seems to work quite well without */
bglPolygonOffset(1.0f, 1.0f);
/*
@@ -526,13 +524,13 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
glPolygonOffset(-1.0f, -1.0f);
*/
}
-
+
gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, debug);
-
- if(no_xray) {
+
+ if (no_xray) {
glDepthMask(mask_orig);
glDisable(GL_DEPTH_TEST);
-
+
bglPolygonOffset(0.0, 0.0);
/*
glDisable(GL_POLYGON_OFFSET_LINE);
@@ -549,7 +547,6 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
{
bGPDlayer *gpl;
- // bGPDlayer *actlay=NULL; // UNUSED
/* reset line drawing style (in case previous user didn't reset) */
setlinestyle(0);
@@ -573,10 +570,6 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
if (gpl->flag & GP_LAYER_HIDE)
continue;
- /* if layer is active one, store pointer to it */
- // if (gpl->flag & GP_LAYER_ACTIVE)
- // actlay= gpl;
-
/* get frame to draw */
gpf= gpencil_layer_getframe(gpl, cfra, 0);
if (gpf == NULL)
@@ -588,11 +581,11 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
QUATCOPY(tcolor, gpl->color); // additional copy of color (for ghosting)
glColor4f(color[0], color[1], color[2], color[3]);
glPointSize((float)(gpl->thickness + 2));
-
+
/* apply xray layer setting */
- if(gpl->flag & GP_LAYER_NO_XRAY) dflag |= GP_DRAWDATA_NO_XRAY;
+ if (gpl->flag & GP_LAYER_NO_XRAY) dflag |= GP_DRAWDATA_NO_XRAY;
else dflag &= ~GP_DRAWDATA_NO_XRAY;
-
+
/* draw 'onionskins' (frame left + right) */
if (gpl->flag & GP_LAYER_ONIONSKIN) {
/* drawing method - only immediately surrounding (gstep = 0), or within a frame range on either side (gstep > 0)*/
@@ -791,11 +784,11 @@ void draw_gpencil_view3d_ext (Scene *scene, View3D *v3d, ARegion *ar, short only
/* check that we have grease-pencil stuff to draw */
gpd= gpencil_data_get_active_v3d(scene); // XXX
- if(gpd == NULL) return;
+ if (gpd == NULL) return;
/* when rendering to the offscreen buffer we dont want to
* deal with the camera border, otherwise map the coords to the camera border. */
- if(rv3d->persp == RV3D_CAMOB && !(G.f & G_RENDER_OGL)) {
+ if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
rctf rectf;
view3d_calc_camera_border(scene, ar, rv3d, v3d, &rectf, -1); /* negative shift */
BLI_copy_rcti_rctf(&rect, &rectf);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 96e7cedf18a..17e7c0c221b 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -933,8 +933,8 @@ static tGPsdata *gp_session_initpaint (bContext *C)
/* supported views first */
case SPACE_VIEW3D:
{
- View3D *v3d= curarea->spacedata.first;
- RegionView3D *rv3d= ar->regiondata;
+ // View3D *v3d= curarea->spacedata.first;
+ // RegionView3D *rv3d= ar->regiondata;
/* set current area
* - must verify that region data is 3D-view (and not something else)
@@ -949,12 +949,6 @@ static tGPsdata *gp_session_initpaint (bContext *C)
return p;
}
- /* for camera view set the subrect */
- if(rv3d->persp == RV3D_CAMOB) {
- view3d_calc_camera_border(p->scene, p->ar, NULL, v3d, &p->subrect_data, 1);
- p->subrect= &p->subrect_data;
- }
-
#if 0 // XXX will this sort of antiquated stuff be restored?
/* check that gpencil data is allowed to be drawn */
if ((v3d->flag2 & V3D_DISPGP)==0) {
diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h
index 08a63a470c1..cfafd38ed15 100644
--- a/source/blender/editors/include/ED_curve.h
+++ b/source/blender/editors/include/ED_curve.h
@@ -66,7 +66,7 @@ void free_editNurb (struct Object *obedit);
void free_curve_editNurb (struct Curve *cu);
-int mouse_nurb (struct bContext *C, short mval[2], int extend);
+int mouse_nurb (struct bContext *C, const short mval[2], int extend);
struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob);
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 7be089fdf32..2e4106b3c04 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -153,10 +153,16 @@ void uiStyleFontDrawExt(uiFontStyle *fs, rcti *rect, const char *str,
height= BLF_height(fs->uifont_id, "2"); /* correct offset is on baseline, the j is below that */
yofs= floor( 0.5f*(rect->ymax - rect->ymin - height));
- if(fs->align==UI_STYLE_TEXT_CENTER)
+ if(fs->align==UI_STYLE_TEXT_CENTER) {
xofs= floor( 0.5f*(rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str)));
- else if(fs->align==UI_STYLE_TEXT_RIGHT)
+ /* don't center text if it chops off the start of the text, 2 gives some margin */
+ if(xofs < 2) {
+ xofs= 2;
+ }
+ }
+ else if(fs->align==UI_STYLE_TEXT_RIGHT) {
xofs= rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str) - 1;
+ }
/* clip is very strict, so we give it some space */
BLF_clipping(fs->uifont_id, rect->xmin-1, rect->ymin-4, rect->xmax+1, rect->ymax+4);
diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/bmesh_select.c
index 0c7ca31a152..20474e2fba0 100644
--- a/source/blender/editors/mesh/bmesh_select.c
+++ b/source/blender/editors/mesh/bmesh_select.c
@@ -120,7 +120,6 @@ void EDBM_select_mirrored(Object *obedit, BMEditMesh *em)
void EDBM_automerge(Scene *scene, Object *obedit, int update)
{
BMEditMesh *em;
- int len;
if ((scene->toolsettings->automerge) &&
(obedit && obedit->type==OB_MESH) &&
@@ -453,7 +452,7 @@ float labda_PdistVL2Dfl( float *v1, float *v2, float *v3)
}
/* note; uses v3d, so needs active 3d window */
-static void findnearestedge__doClosest(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
+static void findnearestedge__doClosest(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
{
struct { ViewContext vc; float mval[2]; int dist; BMEdge *closest; } *data = userData;
float v1[2], v2[2];
@@ -525,7 +524,7 @@ BMEdge *EDBM_findnearestedge(ViewContext *vc, int *dist)
}
}
-static void findnearestface__getDistance(void *userData, BMFace *efa, int x, int y, int index)
+static void findnearestface__getDistance(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
{
struct { short mval[2]; int dist; BMFace *toFace; } *data = userData;
@@ -690,7 +689,6 @@ static EnumPropertyItem prop_similar_types[] = {
static int similar_face_select_exec(bContext *C, wmOperator *op)
{
- Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh;
BMOperator bmop;
@@ -731,7 +729,6 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
/* wrap the above function but do selection flushing edge to face */
static int similar_edge_select_exec(bContext *C, wmOperator *op)
{
- Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh;
BMOperator bmop;
@@ -778,7 +775,6 @@ VERT GROUP
static int similar_vert_select_exec(bContext *C, wmOperator *op)
{
- Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh;
BMOperator bmop;
@@ -824,7 +820,7 @@ static int select_similar_exec(bContext *C, wmOperator *op)
return similar_face_select_exec(C, op);
}
-static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *ptr, int *free)
+static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free)
{
Object *obedit = CTX_data_edit_object(C);
EnumPropertyItem *item= NULL;
@@ -899,7 +895,7 @@ static void walker_select(BMEditMesh *em, int walkercode, void *start, int selec
BMW_End(&walker);
}
-static int loop_multiselect(bContext *C, wmOperator *op)
+static int loop_multiselect(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0 //BMESH_TODO
Object *obedit= CTX_data_edit_object(C);
@@ -1056,7 +1052,7 @@ void MESH_OT_loop_select(wmOperatorType *ot)
/* ******************* mesh shortest path select, uses prev-selected edge ****************** */
/* since you want to create paths with multiple selects, it doesn't have extend option */
-static void mouse_mesh_shortest_path(bContext *C, short mval[2])
+static void mouse_mesh_shortest_path(bContext *UNUSED(C), short UNUSED(mval[2]))
{
#if 0 //BMESH_TODO
ViewContext vc;
@@ -1125,7 +1121,7 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2])
}
-static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
view3d_operator_needs_opengl(C);
@@ -1306,7 +1302,6 @@ void EDBM_selectmode_set(BMEditMesh *em)
void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
{
- BMVert *eve;
BMEdge *eed;
BMFace *efa;
BMIter iter;
@@ -1392,7 +1387,7 @@ void EDBM_select_swap(BMEditMesh *em) /* exported for UV */
// if (EM_texFaceCheck())
}
-static int select_inverse_mesh_exec(bContext *C, wmOperator *op)
+static int select_inverse_mesh_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
@@ -1429,9 +1424,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
BMVert *eve;
BMEdge *e, *eed;
BMFace *efa;
- short done=1, toggle=0;
int sel= !RNA_boolean_get(op->ptr, "deselect");
- int limit= RNA_boolean_get(op->ptr, "limit");
/* unified_finednearest needs ogl */
view3d_operator_needs_opengl(C);
@@ -1501,7 +1494,7 @@ void MESH_OT_select_linked_pick(wmOperatorType *ot)
}
-static int select_linked_exec(bContext *C, wmOperator *op)
+static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
@@ -1875,9 +1868,9 @@ void em_deselect_nth_vert(EditMesh *em, int nth, EditVert *eve_act)
}
#endif
-int EM_deselect_nth(EditMesh *em, int nth)
+int EM_deselect_nth(BMEditMesh *em, int nth)
{
-#if 0
+#if 0 //BMESH_TODO
EditSelection *ese;
ese = ((EditSelection*)em->selected.last);
if(ese) {
@@ -1933,7 +1926,6 @@ static int select_sharp_edges_exec(bContext *C, wmOperator *op)
BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
BMIter iter;
BMEdge *e;
- BLI_array_declare(stack);
BMLoop *l1, *l2;
float sharp = RNA_float_get(op->ptr, "sharpness"), angle;
@@ -2170,7 +2162,7 @@ void MESH_OT_select_random(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "extend", 0, "Extend Selection", "Extend selection instead of deselecting everything first.");
}
-static int select_next_loop(bContext *C, wmOperator *op)
+static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
BMEditMesh *em= (((Mesh *)obedit->data))->edit_btmesh;
@@ -2220,7 +2212,7 @@ void MESH_OT_select_next_loop(wmOperatorType *ot)
}
-static int region_to_loop(bContext *C, wmOperator *op)
+static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;
diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c
index ec8b5ffa47a..ee829ac473c 100644
--- a/source/blender/editors/mesh/bmesh_tools.c
+++ b/source/blender/editors/mesh/bmesh_tools.c
@@ -377,7 +377,7 @@ short EDBM_Extrude_edges_indiv(BMEditMesh *em, short flag, float *nor)
#endif
/* extrudes individual vertices */
-short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, short flag, float *nor)
+short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, short flag, float *UNUSED(nor))
{
BMOperator bmop;
@@ -3806,12 +3806,14 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
return 1;
}
-static int mesh_separate_material(Main *bmain, Scene *scene, Base *editbase, wmOperator *wmop)
+//BMESH_TODO
+static int mesh_separate_material(Main *UNUSED(bmain), Scene *UNUSED(scene), Base *UNUSED(editbase), wmOperator *UNUSED(wmop))
{
return 0;
}
-static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOperator *wmop)
+//BMESH_TODO
+static int mesh_separate_loose(Main *UNUSED(bmain), Scene *UNUSED(scene), Base *UNUSED(editbase), wmOperator *UNUSED(wmop))
{
return 0;
}
@@ -4010,7 +4012,7 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot)
}
-static int edge_flip_exec(bContext *C, wmOperator *op)
+static int edge_flip_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@@ -4040,7 +4042,8 @@ void MESH_OT_edge_flip(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static int split_mesh(bContext *C, wmOperator *op)
+//BMESH_TODO
+static int split_mesh(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@@ -4079,7 +4082,7 @@ void MESH_OT_split(wmOperatorType *ot)
}
-static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float degr, int dupli )
+static int spin_mesh(bContext *UNUSED(C), wmOperator *UNUSED(op), float *UNUSED(dvec), int UNUSED(steps), float UNUSED(degr), int UNUSED(dupli) )
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@@ -4164,7 +4167,7 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float
return OPERATOR_CANCELLED;
}
-static int spin_mesh_exec(bContext *C, wmOperator *op)
+static int spin_mesh_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@@ -4183,7 +4186,7 @@ static int spin_mesh_exec(bContext *C, wmOperator *op)
}
/* get center and axis, in global coords */
-static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
#if 0
Scene *scene = CTX_data_scene(C);
@@ -4221,7 +4224,7 @@ void MESH_OT_spin(wmOperatorType *ot)
}
-static int screw_mesh_exec(bContext *C, wmOperator *op)
+static int screw_mesh_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@@ -4295,7 +4298,7 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
}
/* get center and axis, in global coords */
-static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
#if 0
Scene *scene = CTX_data_scene(C);
@@ -4330,7 +4333,7 @@ void MESH_OT_screw(wmOperatorType *ot)
RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
}
-int select_by_number_vertices_exec(bContext *C, wmOperator *op)
+int select_by_number_vertices_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@@ -4490,7 +4493,7 @@ static void xsortvert_flag__doSetX(void *userData, EditVert *UNUSED(eve), int x,
}
/* all verts with (flag & 'flag') are sorted */
-static void xsortvert_flag(bContext *C, int flag)
+static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag))
{
#if 0 //hrm, geometry isn't in linked lists anymore. . .
ViewContext vc;
@@ -4814,7 +4817,7 @@ static int mesh_export_obj_exec(bContext *C, wmOperator *op)
MPoly *mpoly, *mp;
MTexPoly *mtexpoly;
MLoopUV *luv, *mloopuv;
- MLoopCol *lcol, *mloopcol;
+ MLoopCol *mloopcol;
FILE *file, *matfile;
int *face_mat_group;
struct {Material *mat; MTexPoly poly; int end;} **matlists;
diff --git a/source/blender/editors/mesh/bmeshutils.c b/source/blender/editors/mesh/bmeshutils.c
index 853903f9a44..06ebf1e9df0 100644
--- a/source/blender/editors/mesh/bmeshutils.c
+++ b/source/blender/editors/mesh/bmeshutils.c
@@ -146,7 +146,7 @@ int EDBM_InitOpf(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
/*returns 0 on error, 1 on success. executes and finishes a bmesh operator*/
int EDBM_FinishOp(BMEditMesh *em, BMOperator *bmop, wmOperator *op, int report) {
- char *errmsg;
+ const char *errmsg;
BMO_Finish_Op(em->bm, bmop);
@@ -262,10 +262,9 @@ void EDBM_selectmode_to_scene(Scene *scene, Object *obedit)
scene->toolsettings->selectmode = em->selectmode;
}
-void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *scene, Object *ob)
+void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
{
Mesh *me = ob->data;
- EditMesh *em;
BMesh *bm;
if (!me->mpoly && me->totface) {
@@ -418,7 +417,7 @@ void EDBM_select_flush(BMEditMesh *em, int selectmode)
}
/*BMESH_TODO*/
-void EDBM_deselect_flush(BMEditMesh *em)
+void EDBM_deselect_flush(BMEditMesh *UNUSED(em))
{
}
@@ -588,7 +587,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
return me;
}
-static void undoMesh_to_editbtMesh(void *umv, void *emv, void *obdata)
+static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata))
{
BMEditMesh *em = emv, *em2;
Object *ob;
@@ -823,8 +822,8 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em)
em->mirr_free_arrays = 1;
}
- if (!CustomData_get_layer_named(&em->bm->vdata, CD_PROP_INT, "__mirror_index")) {
- BM_add_data_layer_named(em->bm, &em->bm->vdata, CD_PROP_INT, "__mirror_index");
+ if (!CustomData_get_layer_named(&em->bm->vdata, CD_PROP_INT, (char*)"__mirror_index")) {
+ BM_add_data_layer_named(em->bm, &em->bm->vdata, CD_PROP_INT, (char*)"__mirror_index");
}
li = CustomData_get_named_layer_index(&em->bm->vdata, CD_PROP_INT, "__mirror_index");
diff --git a/source/blender/editors/mesh/editbmesh_add.c b/source/blender/editors/mesh/editbmesh_add.c
index 7d44fd17c3a..dfb242d7144 100644
--- a/source/blender/editors/mesh/editbmesh_add.c
+++ b/source/blender/editors/mesh/editbmesh_add.c
@@ -300,7 +300,7 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 3, 500);
RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
- RNA_def_enum(ot->srna, "fill_type", &fill_type_items, 0, "Fill Type", "");
+ RNA_def_enum(ot->srna, "fill_type", fill_type_items, 0, "Fill Type", "");
ED_object_add_generic_props(ot, TRUE);
}
@@ -355,7 +355,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500);
RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
- RNA_def_enum(ot->srna, "end_fill_type", &fill_type_items, 1, "Cap Fill Type", "");
+ RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Cap Fill Type", "");
ED_object_add_generic_props(ot, TRUE);
}
@@ -411,7 +411,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
RNA_def_float(ot->srna, "radius1", 1.0f, 0.0, FLT_MAX, "Radius 1", "", 0.001, 100.00);
RNA_def_float(ot->srna, "radius2", 0.0f, 0.0, FLT_MAX, "Radius 2", "", 0.001, 100.00);
RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
- RNA_def_enum(ot->srna, "end_fill_type", &fill_type_items, 1, "Base Fill Type", "");
+ RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Base Fill Type", "");
ED_object_add_generic_props(ot, TRUE);
}
diff --git a/source/blender/editors/mesh/editbmesh_bvh.c b/source/blender/editors/mesh/editbmesh_bvh.c
index ada81617084..d7ab294d877 100644
--- a/source/blender/editors/mesh/editbmesh_bvh.c
+++ b/source/blender/editors/mesh/editbmesh_bvh.c
@@ -663,7 +663,6 @@ void scale_point(float *c1, float *p, float s)
int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Object *obedit)
{
BMFace *f;
- RegionView3D *rv3d = ar->regiondata;
float co1[3], co2[3], co3[3], dir1[4], dir2[4], dir3[4];
float origin[3], invmat[4][4];
float epsilon = 0.01f;
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 640fcd55d3a..96512600dda 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -249,7 +249,7 @@ int ED_mesh_uv_texture_remove(bContext *C, Object *ob, Mesh *me)
return 1;
}
-int ED_mesh_color_add(bContext *C, Scene *scene, Object *ob, Mesh *me, const char *name, int active_set)
+int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mesh *me, const char *name, int active_set)
{
BMEditMesh *em;
MLoopCol *mcol;
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index c766f05cac9..e8b4f0a1bdc 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -556,7 +556,7 @@ static void freeMetaElemlist(ListBase *lb)
}
-static void undoMball_to_editMball(void *lbu, void *lbe, void *obdata)
+static void undoMball_to_editMball(void *lbu, void *lbe, void *obe)
{
ListBase *lb= lbu;
ListBase *editelems= lbe;
@@ -574,7 +574,7 @@ static void undoMball_to_editMball(void *lbu, void *lbe, void *obdata)
}
-static void *editMball_to_undoMball(void *lbe, void *obdata)
+static void *editMball_to_undoMball(void *lbe, void *obe)
{
ListBase *editelems= lbe;
ListBase *lb;
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 2467140bde4..39da86b1962 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1455,8 +1455,8 @@ void ED_screen_set_scene(bContext *C, Scene *scene)
if(rv3d->persp==RV3D_CAMOB)
rv3d->persp= RV3D_PERSP;
- }
- }
+ }
+ }
}
}
}
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 98bf1e9877f..e68e1657096 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -1319,36 +1319,36 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
switch (con->type) {
case CONSTRAINT_TYPE_KINEMATIC:
{
- bKinematicConstraint *data = (bKinematicConstraint*)con->data;
- int segcount= 0;
-
- /* if only_temp, only draw if it is a temporary ik-chain */
- if ((only_temp) && !(data->flag & CONSTRAINT_IK_TEMP))
- continue;
-
- setlinestyle(3);
- glBegin(GL_LINES);
-
- /* exclude tip from chain? */
- if ((data->flag & CONSTRAINT_IK_TIP)==0)
- parchan= pchan->parent;
- else
- parchan= pchan;
-
- glVertex3fv(parchan->pose_tail);
-
- /* Find the chain's root */
- while (parchan->parent) {
- segcount++;
- if(segcount==data->rootbone || segcount>255) break; // 255 is weak
- parchan= parchan->parent;
+ bKinematicConstraint *data = (bKinematicConstraint*)con->data;
+ int segcount= 0;
+
+ /* if only_temp, only draw if it is a temporary ik-chain */
+ if ((only_temp) && !(data->flag & CONSTRAINT_IK_TEMP))
+ continue;
+
+ setlinestyle(3);
+ glBegin(GL_LINES);
+
+ /* exclude tip from chain? */
+ if ((data->flag & CONSTRAINT_IK_TIP)==0)
+ parchan= pchan->parent;
+ else
+ parchan= pchan;
+
+ glVertex3fv(parchan->pose_tail);
+
+ /* Find the chain's root */
+ while (parchan->parent) {
+ segcount++;
+ if(segcount==data->rootbone || segcount>255) break; // 255 is weak
+ parchan= parchan->parent;
+ }
+ if (parchan)
+ glVertex3fv(parchan->pose_head);
+
+ glEnd();
+ setlinestyle(0);
}
- if (parchan)
- glVertex3fv(parchan->pose_head);
-
- glEnd();
- setlinestyle(0);
- }
break;
case CONSTRAINT_TYPE_SPLINEIK:
{
@@ -1367,7 +1367,7 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
// FIXME: revise the breaking conditions
if(segcount==data->chainlen || segcount>255) break; // 255 is weak
parchan= parchan->parent;
- }
+ }
if (parchan) // XXX revise the breaking conditions to only stop at the tail?
glVertex3fv(parchan->pose_head);
@@ -1826,9 +1826,9 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
glLoadName(index & 0xFFFF);
pchan_draw_IK_root_lines(pchan, !(do_dashed & 2));
- }
+ }
}
- }
+ }
}
glPushMatrix();