From f8ecc3fd2fd11a40f5cea3a23b3c83b9861762cc Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sun, 30 May 2010 14:53:26 +0000 Subject: Some cleanup of particle path drawing logic: * Path drawing now works for non hair particles. * Should fix the following bugs too: [#21316] Hair weight drawing is wrong [#21923] Consistent Crash When Rendering Particle Scene. [#21950] Path rendering option for particles causes crash --- source/blender/editors/space_view3d/drawobject.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_view3d/drawobject.c') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 89a82e51cd8..d3b70f4553a 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3466,12 +3466,11 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv select=1; } + psys_update_children(&sim); + psys->flag|=PSYS_DRAWING; - if(part->type==PART_HAIR && !psys->childcache) - totchild=0; - else - totchild=psys->totchild*part->disp/100; + totchild=psys->totchild*part->disp/100; ma= give_current_material(ob,part->omat); @@ -3506,11 +3505,18 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv totpart=psys->totpart; - //if(part->flag&PART_GLOB_TIME) cfra=bsystem_time(scene, 0, (float)CFRA, 0.0f); - if(draw_as==PART_DRAW_PATH && psys->pathcache==NULL && psys->childcache==NULL) - draw_as=PART_DRAW_DOT; + if(draw_as==PART_DRAW_PATH) { + if(psys->pathcache==NULL && psys->childcache==NULL) + psys_update_path_cache(&sim, cfra); + + /* can't create pathcache for some reason*/ + if(psys->pathcache==NULL && psys->childcache==NULL) + draw_as=PART_DRAW_DOT; + else if(psys->childcache==NULL) + totchild = 0; + } /* 3. */ switch(draw_as){ @@ -3862,7 +3868,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv UI_ThemeColor(TH_WIRE); }*/ - if(totchild && (part->draw&PART_DRAW_PARENT)==0) + if(totchild && ((part->draw&PART_DRAW_PARENT)==0 || psys_in_edit_mode(scene, psys))) totpart=0; else if(psys->pathcache==NULL) totpart=0; -- cgit v1.2.3