diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-06-27 12:11:05 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-06-27 12:11:05 +0400 |
commit | c896fcae7963fb35124ef3fefe0f12679228fa39 (patch) | |
tree | f4435bd39a36228a71c9142e4c26bacd482683f3 /source/blender/editors/space_view3d | |
parent | cb12648656fc001e8c4c6d00df73e52d452f8787 (diff) | |
parent | 93bb6238e0c6b7ea008776f4e1c3958ef5382c09 (diff) |
Merge with trunk r37849
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawanimviz.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 18 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 36 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_intern.h | 2 |
5 files changed, 51 insertions, 23 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index ee78fd92b79..aa3ba1a3062 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -117,7 +117,11 @@ void draw_motion_path_instance(Scene *scene, len = mpath->length; mpv_start= mpath->points; } - + + if(len <= 0) { + return; + } + /* draw curve-line of path */ glShadeModel(GL_SMOOTH); diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 7c66cec5730..02a7ea890f5 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1577,7 +1577,7 @@ static void bone_matrix_translate_y(float mat[][4], float y) } /* assumes object is Armature with pose */ -static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, short ghost) +static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, const short is_ghost, const short is_outline) { RegionView3D *rv3d= ar->regiondata; Object *ob= base->object; @@ -1737,7 +1737,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, } /* prepare colors */ - if(ghost) { + if(is_ghost) { /* 13 October 2009, Disabled this to make ghosting show the right colors (Aligorith) */ } else if (arm->flag & ARM_POSEMODE) @@ -1905,7 +1905,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, draw_pose_dofs(ob); /* finally names and axes */ - if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) { + if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES) && is_outline == 0) { /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */ if ((G.f & G_PICKSEL) == 0) { float vec[3]; @@ -2259,7 +2259,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE); } glDisable(GL_BLEND); if (v3d->zbuf) glEnable(GL_DEPTH_TEST); @@ -2338,7 +2338,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base * BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE); } glDisable(GL_BLEND); if (v3d->zbuf) glEnable(GL_DEPTH_TEST); @@ -2408,7 +2408,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) if (CFRA != cfrao) { BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE); } } @@ -2423,7 +2423,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) if (CFRA != cfrao) { BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE); } } } @@ -2444,7 +2444,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) /* ********************************** Armature Drawing - Main ************************* */ /* called from drawobject.c, return 1 if nothing was drawn */ -int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag) +int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline) { Object *ob= base->object; bArmature *arm= ob->data; @@ -2510,7 +2510,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in } } } - draw_pose_bones(scene, v3d, ar, base, dt, FALSE); + draw_pose_bones(scene, v3d, ar, base, dt, FALSE, is_outline); arm->flag &= ~ARM_POSEMODE; if(ob->mode & OB_MODE_POSE) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index b99f4f81f21..5af4846bfb5 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3663,8 +3663,6 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv bb.align = part->bb_align; bb.anim = part->bb_anim; bb.lock = part->draw & PART_DRAW_BB_LOCK; - bb.offset[0] = part->bb_offset[0]; - bb.offset[1] = part->bb_offset[1]; break; case PART_DRAW_PATH: break; @@ -3834,7 +3832,20 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* create actiual particle data */ if(draw_as == PART_DRAW_BB) { - bb.size = pa_size; + bb.offset[0] = part->bb_offset[0]; + bb.offset[1] = part->bb_offset[1]; + bb.size[0] = part->bb_size[0] * pa_size; + if (part->bb_align==PART_BB_VEL) { + float pa_vel = len_v3(state.vel); + float head = part->bb_vel_head*pa_vel; + float tail = part->bb_vel_tail*pa_vel; + bb.size[1] = part->bb_size[1]*pa_size + head + tail; + /* use offset to adjust the particle center. this is relative to size, so need to divide! */ + if (bb.size[1] > 0.0f) + bb.offset[1] += (head-tail) / bb.size[1]; + } + else + bb.size[1] = part->bb_size[1] * pa_size; bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); bb.time = ct; } @@ -3854,7 +3865,20 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* create actiual particle data */ if(draw_as == PART_DRAW_BB) { - bb.size = pa_size; + bb.offset[0] = part->bb_offset[0]; + bb.offset[1] = part->bb_offset[1]; + bb.size[0] = part->bb_size[0] * pa_size; + if (part->bb_align==PART_BB_VEL) { + float pa_vel = len_v3(state.vel); + float head = part->bb_vel_head*pa_vel; + float tail = part->bb_vel_tail*pa_vel; + bb.size[1] = part->bb_size[1]*pa_size + head + tail; + /* use offset to adjust the particle center. this is relative to size, so need to divide! */ + if (bb.size[1] > 0.0f) + bb.offset[1] += (head-tail) / bb.size[1]; + } + else + bb.size[1] = part->bb_size[1] * pa_size; bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); bb.time = pa_time; } @@ -5491,7 +5515,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base) } else if(ob->type==OB_ARMATURE) { if(!(ob->mode & OB_MODE_POSE)) - draw_armature(scene, v3d, ar, base, OB_WIRE, 0); + draw_armature(scene, v3d, ar, base, OB_WIRE, FALSE, TRUE); } glLineWidth(1.0); @@ -6027,7 +6051,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) case OB_ARMATURE: if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { if(dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material - empty_object= draw_armature(scene, v3d, ar, base, dt, flag); + empty_object= draw_armature(scene, v3d, ar, base, dt, flag, FALSE); if(dt>OB_WIRE) GPU_disable_material(); } break; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d316ef50679..0ed62f3953f 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -627,7 +627,7 @@ static void draw_view_axis(RegionView3D *rv3d) glEnd(); if (fabsf(dx) > toll || fabsf(dy) > toll) { - BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "x", 1); + BLF_draw_default_ascii(start + dx + 2, start + dy + ydisp + 2, 0.0f, "x", 1); } /* BLF_draw_default disables blending */ @@ -647,7 +647,7 @@ static void draw_view_axis(RegionView3D *rv3d) glEnd(); if (fabsf(dx) > toll || fabsf(dy) > toll) { - BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "y", 1); + BLF_draw_default_ascii(start + dx + 2, start + dy + ydisp + 2, 0.0f, "y", 1); } glEnable(GL_BLEND); @@ -666,7 +666,7 @@ static void draw_view_axis(RegionView3D *rv3d) glEnd(); if (fabsf(dx) > toll || fabsf(dy) > toll) { - BLF_draw_default(start + dx + 2, start + dy + ydisp + 2, 0.0f, "z", 1); + BLF_draw_default_ascii(start + dx + 2, start + dy + ydisp + 2, 0.0f, "z", 1); } /* restore line-width */ @@ -757,7 +757,7 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d) if (name) { UI_ThemeColor(TH_TEXT_HI); - BLF_draw_default(22, ar->winy-17, 0.0f, name, sizeof(tmpstr)); + BLF_draw_default_ascii(22, ar->winy-17, 0.0f, name, sizeof(tmpstr)); } } @@ -2422,7 +2422,7 @@ static void draw_viewport_fps(Scene *scene, ARegion *ar) BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps+0.5f)); } - BLF_draw_default(22, ar->winy-17, 0.0f, printable, sizeof(printable)-1); + BLF_draw_default_ascii(22, ar->winy-17, 0.0f, printable, sizeof(printable)-1); } /* warning: this function has duplicate drawing in ED_view3d_draw_offscreen() */ @@ -2644,7 +2644,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) BLI_snprintf(tstr, sizeof(tstr), "%s x %.4g", grid_unit, v3d->grid); } - BLF_draw_default(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, tstr[0]?tstr : grid_unit, sizeof(tstr)); /* XXX, use real length */ + BLF_draw_default_ascii(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, tstr[0]?tstr : grid_unit, sizeof(tstr)); /* XXX, use real length */ } ob= OBACT; diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 6e0e1f337dd..b99849b5a87 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -124,7 +124,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa #define V3D_CACHE_TEXT_ASCII (1<<2) /* drawarmature.c */ -int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag); +int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline); /* drawmesh.c */ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, struct DerivedMesh *dm, int faceselect); |