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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-07 20:55:58 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-07 20:55:58 +0300
commit4a23c3f9e1aaaefcb7b5586b908c51d2922d71fb (patch)
tree1a686be1348ef5bb334e250bcb49b9ca503c8f87 /source/blender/editors/space_view3d/drawobject.c
parentf8f7f5755768fa745b5dc759974ff38c45261a9c (diff)
Particles: child editing bugfixes
* Make partial update work again for faster editing. * Draw parents over children again, nicer for editing. * Fix crash with remove tools & showing child particles. * Fix children not disappearing always when setting to None. * Fix wrong normal for last point in child path. * Fix a python error in the hair dynamics panel.
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c59
1 files changed, 34 insertions, 25 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index f60f4ad9230..7bc86f6bae7 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -4166,6 +4166,16 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
wmLoadMatrix(rv3d->viewmat);
}
+static void draw_update_ptcache_edit(Scene *scene, Object *ob, PTCacheEdit *edit)
+{
+ if(edit->psys && edit->psys->flag & PSYS_HAIR_UPDATED)
+ PE_update_object(scene, ob, 0);
+
+ /* create path and child path cache if it doesn't exist already */
+ if(edit->pathcache==0)
+ psys_cache_edit_paths(scene, ob, edit, CFRA);
+}
+
static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, PTCacheEdit *edit, int dt)
{
ParticleCacheKey **cache, *path, *pkey;
@@ -4178,14 +4188,6 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obj
float nosel_col[3];
float *pathcol = NULL, *pcol;
-
- if(edit->psys && edit->psys->flag & PSYS_HAIR_UPDATED)
- PE_update_object(scene, ob, 0);
-
- /* create path and child path cache if it doesn't exist already */
- if(edit->pathcache==0)
- psys_cache_edit_paths(scene, ob, edit, CFRA);
-
if(edit->pathcache==0)
return;
@@ -5900,22 +5902,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if(ob->pd && ob->pd->forcefield) draw_forcefield(scene, ob);
- /* particle mode has to be drawn first so that possible child particles get cached in edit mode */
- if( (warning_recursive==0) &&
- (flag & DRAW_PICKING)==0 &&
- (!scene->obedit)
- ) {
-
- if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) {
- PTCacheEdit *edit = PE_get_current(scene, ob);
- if(edit) {
- wmLoadMatrix(rv3d->viewmat);
- draw_ptcache_edit(scene, v3d, rv3d, ob, edit, dt);
- wmMultMatrix(ob->obmat);
- }
- }
- }
-
/* code for new particle system */
if( (warning_recursive==0) &&
(ob->particlesystem.first) &&
@@ -5923,6 +5909,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
(ob!=scene->obedit)
) {
ParticleSystem *psys;
+ PTCacheEdit *edit = PE_get_current(scene, ob);
+
if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */
//glDepthMask(GL_FALSE);
@@ -5930,8 +5918,13 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
view3d_cached_text_draw_begin();
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ for(psys=ob->particlesystem.first; psys; psys=psys->next) {
+ /* run this so that possible child particles get cached */
+ if(edit && edit->psys == psys)
+ draw_update_ptcache_edit(scene, ob, edit);
+
draw_new_particle_system(scene, v3d, rv3d, base, psys, dt);
+ }
view3d_cached_text_draw_end(v3d, ar, 0, NULL);
@@ -5941,6 +5934,22 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if(col) cpack(col);
}
+ /* draw edit particles last so that they can draw over child particles */
+ if( (warning_recursive==0) &&
+ (flag & DRAW_PICKING)==0 &&
+ (!scene->obedit)
+ ) {
+
+ if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) {
+ PTCacheEdit *edit = PE_get_current(scene, ob);
+ if(edit) {
+ wmLoadMatrix(rv3d->viewmat);
+ draw_ptcache_edit(scene, v3d, rv3d, ob, edit, dt);
+ wmMultMatrix(ob->obmat);
+ }
+ }
+ }
+
/* draw code for smoke */
if((md = modifiers_findByType(ob, eModifierType_Smoke)))
{