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 Toenne <lukas.toenne@googlemail.com>2012-08-31 21:27:08 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-08-31 21:27:08 +0400
commitf0d247748408bd10f49c54d3a28a925e37683c4b (patch)
treeb47851a73399e6b30c501550ec9024897d65c186 /intern/cycles/blender/blender_sync.h
parent5ecff7a240514e8f16e17aa163c6f0055b9edaf2 (diff)
Fix for #32184 and redesign of particle storage in Cycles.
The particle data used by the Particle Info node was stored in cycles as a list in each object. This is a problem when the particle emitter mesh is hidden: Objects in cycles are only intended as instances of renderable meshes, so when hiding the emitter mesh the particle data doesn't get stored either. Also the particle data can potentially be copied to multiple instances of the same object, which is a waste of texture space. The solution in this patch is to make a completely separate list of particle systems in the Cycles scene data. This way the particle data can be generated even when the emitter object itself is not visible.
Diffstat (limited to 'intern/cycles/blender/blender_sync.h')
-rw-r--r--intern/cycles/blender/blender_sync.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h
index 6065235a278..f3bd06b3a53 100644
--- a/intern/cycles/blender/blender_sync.h
+++ b/intern/cycles/blender/blender_sync.h
@@ -77,6 +77,7 @@ private:
void sync_world();
void sync_render_layers(BL::SpaceView3D b_v3d, const char *layer);
void sync_shaders();
+ void sync_particle_systems();
void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
Mesh *sync_mesh(BL::Object b_ob, bool object_updated);
@@ -85,14 +86,14 @@ private:
void sync_background_light();
void sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion);
void sync_camera_motion(BL::Object b_ob, int motion);
- void sync_particles(Object *ob, BL::Object b_ob);
+ void sync_particles(BL::Object b_ob, BL::ParticleSystem b_psys);
/* util */
void find_shader(BL::ID id, vector<uint>& used_shaders, int default_shader);
bool BKE_object_is_modified(BL::Object b_ob);
bool object_is_mesh(BL::Object b_ob);
bool object_is_light(BL::Object b_ob);
- bool object_need_particle_update(BL::Object b_ob);
+ bool psys_need_update(BL::ParticleSystem b_psys);
int object_count_particles(BL::Object b_ob);
/* variables */
@@ -103,6 +104,7 @@ private:
id_map<ObjectKey, Object> object_map;
id_map<void*, Mesh> mesh_map;
id_map<ObjectKey, Light> light_map;
+ id_map<ParticleSystemKey, ParticleSystem> particle_system_map;
set<Mesh*> mesh_synced;
void *world_map;
bool world_recalc;