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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-02-25 21:29:11 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-02-25 21:29:11 +0400
commit0bef196894abd19903b0741ec6250e0558b4f1a4 (patch)
treea65b0078c166fd60c194530ec9bd8435d3c92b15 /intern/cycles/blender/blender_particles.cpp
parentef73d547cc7c663ad180721094c81b3c81482ac3 (diff)
Fix T38811: Cycles particle ids are inconsistent when using multiple particle systems.
Problem is that the particle systems in the cycles database are not stored in a well-defined order. This means the particle_id for dupli objects can not simply be assigned using a global running index during sync. Now the particle index is assigned locally for each particle system. When transferring particle data to the device as a single texture, the particle indices are offset based on the final order of particle systems in the database. Reviewers: brecht Reviewed By: brecht CC: Andreas80 Differential Revision: https://developer.blender.org/D352
Diffstat (limited to 'intern/cycles/blender/blender_particles.cpp')
-rw-r--r--intern/cycles/blender/blender_particles.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_particles.cpp b/intern/cycles/blender/blender_particles.cpp
index ef832ed39c0..5b2782ec2ac 100644
--- a/intern/cycles/blender/blender_particles.cpp
+++ b/intern/cycles/blender/blender_particles.cpp
@@ -76,6 +76,11 @@ bool BlenderSync::sync_dupli_particle(BL::Object b_ob, BL::DupliObject b_dup, Ob
psys->particles.push_back(pa);
+ if (object->particle_index != psys->particles.size() - 1)
+ scene->object_manager->tag_update(scene);
+ object->particle_system = psys;
+ object->particle_index = psys->particles.size() - 1;
+
/* return that this object has particle data */
return true;
}