Fix T60046: crash with Cycles viewport render and particle info node.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 2 Jan 2019 15:32:32 +0000 (16:32 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 2 Jan 2019 16:19:45 +0000 (17:19 +0100)
This code was not correctly ported to 2.8.

intern/cycles/blender/blender_object.cpp

index 0f9994847c062624c6650436d6fee35e0e6a217e..37fea2417ba0e2ad24380d8c2674904865e3ac97 100644 (file)
@@ -490,9 +490,6 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
                        object->dupli_generated = 0.5f*get_float3(b_instance.orco()) - make_float3(0.5f, 0.5f, 0.5f);
                        object->dupli_uv = get_float2(b_instance.uv());
                        object->random_id = b_instance.random_id();
-
-                       /* Sync possible particle data. */
-                       sync_dupli_particle(b_ob, b_instance, object);
                }
                else {
                        object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
@@ -503,6 +500,11 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
                object->tag_update(scene);
        }
 
+       if(is_instance) {
+               /* Sync possible particle data. */
+               sync_dupli_particle(b_parent, b_instance, object);
+       }
+
        return object;
 }