Bugfix for "ghost feathers" trailing one frame behind the character.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 17 Jan 2008 12:02:15 +0000 (12:02 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 17 Jan 2008 12:02:15 +0000 (12:02 +0000)
The derivedmesh and particle system needed to be evaluated at render
level before creating dupliparticles.

source/blender/blenkernel/intern/object.c
source/blender/render/intern/source/convertblender.c

index de2875c91f427436b27c8ea111cf6a55689e26fb..bfe2b56b289ad121ed72dfcfb59c05e0c45cc9b0 100644 (file)
@@ -2199,6 +2199,7 @@ void object_handle_update(Object *ob)
 
                        if(ob->particlesystem.first) {
                                ParticleSystem *tpsys, *psys;
+                               DerivedMesh *dm;
                                
                                psys= ob->particlesystem.first;
                                while(psys) {
@@ -2215,6 +2216,14 @@ void object_handle_update(Object *ob)
                                        else
                                                psys= psys->next;
                                }
+
+                               if(G.rendering && ob->transflag & OB_DUPLIPARTS) {
+                                       /* this is to make sure we get render level duplis in groups:
+                                        * the derivedmesh must be created before init_render_mesh,
+                                        * since object_duplilist does dupliparticles before that */
+                                       dm = mesh_create_derived_render(ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
+                                       dm->release(dm);
+                               }
                        }
                }
 
index 44db528016530f720875244f5d4a235a65bd8bde..25b5dac2a55a405e30c474092ffa17cb009d859c 100644 (file)
@@ -4136,18 +4136,11 @@ static void dupli_render_particle_set(Render *re, Object *ob, int level, int ena
                return;
        
        if(ob->transflag & OB_DUPLIPARTS) {
-               DerivedMesh *dm;
-
                for(psys=ob->particlesystem.first; psys; psys=psys->next)
                        if(enable)
                                psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy);
                        else
                                psys_render_restore(ob, psys);
-
-               if(enable) {
-                       dm = mesh_create_derived_render(ob,     CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
-                       dm->release(dm);
-               }
        }
 
        if(ob->dup_group==NULL) return;