diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-01 10:26:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-01 10:26:48 +0400 |
commit | bcd84ec1071e01d3cfec97a1b8a043317f2f28f6 (patch) | |
tree | 3bdc8b67e2044f4e6feddc00bbb83ae9ebcb71f7 /source | |
parent | a834007a9b9b7adca2e57bf6ff575524bee80804 (diff) |
fix [#29433] Incorrect drawing of Circle/Axes/Cross on Particles when Display set to that AND Size/Vel/Num/Health also selected
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 3 |
2 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2766ddab15b..e12efb72fcc 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -4042,7 +4042,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv ParticleDrawData *pdd = psys->pdd; Material *ma; float vel[3], imat[4][4]; - float timestep, pixsize=1.0, pa_size, r_tilt, r_length; + float timestep, pixsize_scale, pa_size, r_tilt, r_length; float pa_time, pa_birthtime, pa_dietime, pa_health, intensity; float cfra; float ma_col[3]= {0.0f, 0.0f, 0.0f}; @@ -4149,12 +4149,11 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv case PART_DRAW_CROSS: case PART_DRAW_AXIS: /* lets calculate the scale: */ - pixsize= ED_view3d_pixel_size(rv3d, ob->obmat[3]); - if(part->draw_size==0.0) - pixsize *= 2.0f; + if (part->draw_size == 0.0) + pixsize_scale = 2.0f; else - pixsize*=part->draw_size; + pixsize_scale = part->draw_size; if(draw_as==PART_DRAW_AXIS) create_cdata = 1; @@ -4342,6 +4341,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv ct+=dt; for(i=0; i < trail_count; i++, ct += dt) { + float pixsize; + if(part->draw & PART_ABS_PATH_TIME) { if(ct < pa_birthtime || ct > pa_dietime) continue; @@ -4375,6 +4376,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv bb.time = ct; } + pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale; + draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, psys->pdd); totpoint++; @@ -4385,6 +4388,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv { state.time=cfra; if(psys_get_particle_state(&sim,a,&state,0)){ + float pixsize; + if(psys->parent) mul_m4_v3(psys->parent->obmat, state.co); @@ -4408,6 +4413,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv bb.time = pa_time; } + pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale; + draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, pdd); totpoint++; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 05e8cb45611..1a2e8932411 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -969,7 +969,6 @@ void apply_project_float(float persmat[4][4], int winx, int winy, const float ve void project_float(ARegion *ar, const float vec[3], float adr[2]) { RegionView3D *rv3d= ar->regiondata; - float vec4[4]; apply_project_float(rv3d->persmat, ar->winx, ar->winy, vec, adr); } @@ -1898,8 +1897,6 @@ void ED_view3d_operator_properties_viewmat_set(bContext *C, wmOperator *op) void ED_view3d_operator_properties_viewmat_get(wmOperator *op, int *winx, int *winy, float persmat[4][4]) { - float values[16]; - *winx = RNA_int_get(op->ptr, "region_width"); *winy = RNA_int_get(op->ptr, "region_height"); |