Fix T61362: Hair particles does not appear when rendering
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 11 Feb 2019 14:18:12 +0000 (15:18 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 11 Feb 2019 14:24:11 +0000 (15:24 +0100)
Fix T61406: Particles don't render

Consider initial dependency graph evaluation as a file load.

Is still resetting too much, but that we can solve later.

source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc

index 959c631..32212b0 100644 (file)
@@ -58,6 +58,7 @@ extern "C" {
 #include "DNA_anim_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_mesh_types.h"
+#include "DNA_modifier_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
 #include "DNA_particle_types.h"
@@ -579,6 +580,18 @@ void update_particle_system_orig_pointers(const Object *object_orig,
        }
 }
 
+void set_particle_system_modifiers_loaded(Object *object_cow)
+{
+       LISTBASE_FOREACH(ModifierData *, md, &object_cow->modifiers) {
+               if (md->type != eModifierType_ParticleSystem) {
+                       continue;
+               }
+               ParticleSystemModifierData *psmd =
+                       reinterpret_cast<ParticleSystemModifierData*>(md);
+               psmd->flag |= eParticleSystemFlag_file_loaded;
+       }
+}
+
 void update_pose_orig_pointers(const bPose *pose_orig, bPose *pose_cow)
 {
        bPoseChannel *pchan_cow = (bPoseChannel *) pose_cow->chanbase.first;
@@ -621,6 +634,7 @@ void update_special_pointers(const Depsgraph *depsgraph,
                                }
                        }
                        update_particle_system_orig_pointers(object_orig, object_cow);
+                       set_particle_system_modifiers_loaded(object_cow);
                        break;
                }
                case ID_SCE: