diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-22 12:31:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-22 12:31:47 +0300 |
commit | 632d66eb89066a3101af2b5c34b95db989074093 (patch) | |
tree | 898d04502a199e192b274013103763f547473fda /source/blender | |
parent | 5d5c6bb5efee9bd03004845f9b1eee9d43883525 (diff) |
Depsgraph: Cleanup, reduce indentation level
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 71 |
1 files changed, 33 insertions, 38 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 0c093c26fc5..a04e59160c8 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -348,46 +348,41 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle, const char *name) { ListBase *effectors = pdInitEffectors(scene, object, NULL, effector_weights, false); - - if (effectors) { - for (EffectorCache *eff = (EffectorCache*)effectors->first; eff; eff = eff->next) { - if (eff->ob != object && eff->pd->forcefield != skip_forcefield) { - DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_TRANSFORM, name); - - if (eff->psys) { - DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_EVAL_PARTICLES, name); - - /* TODO: remove this when/if EVAL_PARTICLES is sufficient - * for up to date particles. - */ - DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_GEOMETRY, name); - } - - if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) { - DEG_add_object_relation(handle, - eff->pd->f_source, - DEG_OB_COMP_TRANSFORM, - "Smoke Force Domain"); - DEG_add_object_relation(handle, - eff->pd->f_source, - DEG_OB_COMP_GEOMETRY, - "Smoke Force Domain"); - } - - if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) { - DEG_add_collision_relations(handle, - scene, - object, - NULL, - eff->ob->lay, - eModifierType_Collision, - NULL, - true, - "Force Absorption"); - } + if (effectors == NULL) { + return; + } + for (EffectorCache *eff = (EffectorCache*)effectors->first; eff; eff = eff->next) { + if (eff->ob != object && eff->pd->forcefield != skip_forcefield) { + DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_TRANSFORM, name); + if (eff->psys) { + DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_EVAL_PARTICLES, name); + /* TODO: remove this when/if EVAL_PARTICLES is sufficient + * for up to date particles. + */ + DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_GEOMETRY, name); + } + if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) { + DEG_add_object_relation(handle, + eff->pd->f_source, + DEG_OB_COMP_TRANSFORM, + "Smoke Force Domain"); + DEG_add_object_relation(handle, + eff->pd->f_source, + DEG_OB_COMP_GEOMETRY, + "Smoke Force Domain"); + } + if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) { + DEG_add_collision_relations(handle, + scene, + object, + NULL, + eff->ob->lay, + eModifierType_Collision, + NULL, + true, + "Force Absorption"); } } } - pdEndEffectors(&effectors); } |