diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-12 06:41:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-12 06:41:12 +0300 |
commit | 63018144badeb10c858504c918a3f66047c068b0 (patch) | |
tree | 5982ba549aa3e23a68a412877f51d100ae1bb920 /source/blender/editors/space_view3d | |
parent | 21fc4cabaff9b1caa476af9d700195fb239a07c6 (diff) |
remove redundant assignments & unused vars.
also minor functional changes
- OBJECT_OT_make_links_data() type property is now assigned to the operator property (so popup menu can find it)
- removing BG image now returns cancelled if no image is removed.
Diffstat (limited to 'source/blender/editors/space_view3d')
5 files changed, 13 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 18a83e16ca1..901aaba2cb1 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -630,15 +630,15 @@ static float co[16] ={ /* smat, imat = mat & imat to draw screenaligned */ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel *pchan, EditBone *ebone) { - float head, tail, length, dist; + float head, tail, dist /*, length*/; float *headvec, *tailvec, dirvec[3]; /* figure out the sizes of spheres */ if (ebone) { /* this routine doesn't call get_matrix_editbone() that calculates it */ ebone->length = len_v3v3(ebone->head, ebone->tail); - - length= ebone->length; + + /*length= ebone->length;*/ /*UNUSED*/ tail= ebone->rad_tail; dist= ebone->dist; if (ebone->parent && (ebone->flag & BONE_CONNECTED)) @@ -649,7 +649,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel tailvec= ebone->tail; } else { - length= pchan->bone->length; + /*length= pchan->bone->length;*/ /*UNUSED*/ tail= pchan->bone->rad_tail; dist= pchan->bone->dist; if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index c6cbfe44df4..caac8d1d9fe 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -93,13 +93,10 @@ static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me) EdgeHash *eh = BLI_edgehash_new(); int i; MFace *mf; - MTFace *tf = NULL; for (i=0; i<me->totface; i++) { mf = &me->mface[i]; - if (me->mtface) - tf = &me->mtface[i]; - + if (mf->v3) { if (!(mf->flag&ME_HIDE)) { unsigned int flags = eEdge_Visible; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 19353e9f29e..26445c4d742 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3448,7 +3448,6 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, ParticleSystem *psys, int ob_dt) { Object *ob=base->object; - ParticleSystemModifierData *psmd; ParticleEditSettings *pset = PE_settings(scene); ParticleSettings *part; ParticleData *pars, *pa; @@ -3460,7 +3459,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv 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 cfra= bsystem_time(scene, ob,(float)CFRA,0.0); + 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; int select=ob->flag&SELECT, create_cdata=0, need_v=0; @@ -3496,7 +3495,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv sim.scene= scene; sim.ob= ob; sim.psys= psys; - sim.psmd = psmd = psys_get_modifier(ob,psys); + sim.psmd = psys_get_modifier(ob,psys); if(part->phystype==PART_PHYS_KEYED){ if(psys->flag&PSYS_KEYED){ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 35cddda5362..4eeacd6f05f 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2314,20 +2314,21 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot) /* ***** remove image operator ******* */ static int background_image_remove_exec(bContext *C, wmOperator *op) { - BGpic *bgpic_rem = CTX_data_pointer_get_type(C, "bgpic", &RNA_BackgroundImage).data; View3D *vd = CTX_wm_view3d(C); int index = RNA_int_get(op->ptr, "index"); + BGpic *bgpic_rem= BLI_findlink(&vd->bgpicbase, index); - bgpic_rem = BLI_findlink(&vd->bgpicbase, index); if(bgpic_rem) { BLI_remlink(&vd->bgpicbase, bgpic_rem); if(bgpic_rem->ima) bgpic_rem->ima->id.us--; MEM_freeN(bgpic_rem); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd); + return OPERATOR_FINISHED; + } + else { + return OPERATOR_CANCELLED; } - WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd); - - return OPERATOR_FINISHED; } void VIEW3D_OT_background_image_remove(wmOperatorType *ot) diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index a259e29e9a0..2f7a24d600f 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1743,7 +1743,6 @@ int ED_view3d_context_activate(bContext *C) bScreen *sc= CTX_wm_screen(C); ScrArea *sa= CTX_wm_area(C); ARegion *ar; - RegionView3D *rv3d; /* sa can be NULL when called from python */ if(sa==NULL || sa->spacetype != SPACE_VIEW3D) @@ -1764,7 +1763,6 @@ int ED_view3d_context_activate(bContext *C) // bad context switch .. CTX_wm_area_set(C, sa); CTX_wm_region_set(C, ar); - rv3d= ar->regiondata; return 1; } |