diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /intern/cycles/blender/blender_particles.cpp | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'intern/cycles/blender/blender_particles.cpp')
-rw-r--r-- | intern/cycles/blender/blender_particles.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/intern/cycles/blender/blender_particles.cpp b/intern/cycles/blender/blender_particles.cpp index a733a499826..d74f132ed60 100644 --- a/intern/cycles/blender/blender_particles.cpp +++ b/intern/cycles/blender/blender_particles.cpp @@ -27,66 +27,66 @@ CCL_NAMESPACE_BEGIN /* Utilities */ -bool BlenderSync::sync_dupli_particle(BL::Object& b_ob, - BL::DepsgraphObjectInstance& b_instance, +bool BlenderSync::sync_dupli_particle(BL::Object &b_ob, + BL::DepsgraphObjectInstance &b_instance, Object *object) { - /* test if this dupli was generated from a particle sytem */ - BL::ParticleSystem b_psys = b_instance.particle_system(); - if(!b_psys) - return false; - - object->hide_on_missing_motion = true; - - /* test if we need particle data */ - if(!object->mesh->need_attribute(scene, ATTR_STD_PARTICLE)) - return false; - - /* don't handle child particles yet */ - BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_instance.persistent_id(); - - if(persistent_id[0] >= b_psys.particles.length()) - return false; - - /* find particle system */ - ParticleSystemKey key(b_ob, persistent_id); - ParticleSystem *psys; - - bool first_use = !particle_system_map.is_used(key); - bool need_update = particle_system_map.sync(&psys, b_ob, b_instance.object(), key); - - /* no update needed? */ - if(!need_update && !object->mesh->need_update && !scene->object_manager->need_update) - return true; - - /* first time used in this sync loop? clear and tag update */ - if(first_use) { - psys->particles.clear(); - psys->tag_update(scene); - } - - /* add particle */ - BL::Particle b_pa = b_psys.particles[persistent_id[0]]; - Particle pa; - - pa.index = persistent_id[0]; - pa.age = b_scene.frame_current() - b_pa.birth_time(); - pa.lifetime = b_pa.lifetime(); - pa.location = get_float3(b_pa.location()); - pa.rotation = get_float4(b_pa.rotation()); - pa.size = b_pa.size(); - pa.velocity = get_float3(b_pa.velocity()); - pa.angular_velocity = get_float3(b_pa.angular_velocity()); - - psys->particles.push_back_slow(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; + /* test if this dupli was generated from a particle sytem */ + BL::ParticleSystem b_psys = b_instance.particle_system(); + if (!b_psys) + return false; + + object->hide_on_missing_motion = true; + + /* test if we need particle data */ + if (!object->mesh->need_attribute(scene, ATTR_STD_PARTICLE)) + return false; + + /* don't handle child particles yet */ + BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_instance.persistent_id(); + + if (persistent_id[0] >= b_psys.particles.length()) + return false; + + /* find particle system */ + ParticleSystemKey key(b_ob, persistent_id); + ParticleSystem *psys; + + bool first_use = !particle_system_map.is_used(key); + bool need_update = particle_system_map.sync(&psys, b_ob, b_instance.object(), key); + + /* no update needed? */ + if (!need_update && !object->mesh->need_update && !scene->object_manager->need_update) + return true; + + /* first time used in this sync loop? clear and tag update */ + if (first_use) { + psys->particles.clear(); + psys->tag_update(scene); + } + + /* add particle */ + BL::Particle b_pa = b_psys.particles[persistent_id[0]]; + Particle pa; + + pa.index = persistent_id[0]; + pa.age = b_scene.frame_current() - b_pa.birth_time(); + pa.lifetime = b_pa.lifetime(); + pa.location = get_float3(b_pa.location()); + pa.rotation = get_float4(b_pa.rotation()); + pa.size = b_pa.size(); + pa.velocity = get_float3(b_pa.velocity()); + pa.angular_velocity = get_float3(b_pa.angular_velocity()); + + psys->particles.push_back_slow(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; } CCL_NAMESPACE_END |