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 /source/blender/blenkernel/intern/editlattice.c | |
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 'source/blender/blenkernel/intern/editlattice.c')
-rw-r--r-- | source/blender/blenkernel/intern/editlattice.c | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/source/blender/blenkernel/intern/editlattice.c b/source/blender/blenkernel/intern/editlattice.c index d5b34b27207..12e737bbaa8 100644 --- a/source/blender/blenkernel/intern/editlattice.c +++ b/source/blender/blenkernel/intern/editlattice.c @@ -37,107 +37,107 @@ void BKE_editlattice_free(Object *ob) { - Lattice *lt = ob->data; - - if (lt->editlatt) { - Lattice *editlt = lt->editlatt->latt; - - if (editlt->def) { - MEM_freeN(editlt->def); - } - if (editlt->dvert) { - BKE_defvert_array_free(editlt->dvert, editlt->pntsu * editlt->pntsv * editlt->pntsw); - } - MEM_freeN(editlt); - MEM_freeN(lt->editlatt); - - lt->editlatt = NULL; - } + Lattice *lt = ob->data; + + if (lt->editlatt) { + Lattice *editlt = lt->editlatt->latt; + + if (editlt->def) { + MEM_freeN(editlt->def); + } + if (editlt->dvert) { + BKE_defvert_array_free(editlt->dvert, editlt->pntsu * editlt->pntsv * editlt->pntsw); + } + MEM_freeN(editlt); + MEM_freeN(lt->editlatt); + + lt->editlatt = NULL; + } } void BKE_editlattice_make(Object *obedit) { - Lattice *lt = obedit->data; - KeyBlock *actkey; - - BKE_editlattice_free(obedit); - - actkey = BKE_keyblock_from_object(obedit); - if (actkey) { - BKE_keyblock_convert_to_lattice(actkey, lt); - } - lt->editlatt = MEM_callocN(sizeof(EditLatt), "editlatt"); - lt->editlatt->latt = MEM_dupallocN(lt); - lt->editlatt->latt->def = MEM_dupallocN(lt->def); - - if (lt->dvert) { - int tot = lt->pntsu * lt->pntsv * lt->pntsw; - lt->editlatt->latt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert"); - BKE_defvert_array_copy(lt->editlatt->latt->dvert, lt->dvert, tot); - } - - if (lt->key) { - lt->editlatt->shapenr = obedit->shapenr; - } + Lattice *lt = obedit->data; + KeyBlock *actkey; + + BKE_editlattice_free(obedit); + + actkey = BKE_keyblock_from_object(obedit); + if (actkey) { + BKE_keyblock_convert_to_lattice(actkey, lt); + } + lt->editlatt = MEM_callocN(sizeof(EditLatt), "editlatt"); + lt->editlatt->latt = MEM_dupallocN(lt); + lt->editlatt->latt->def = MEM_dupallocN(lt->def); + + if (lt->dvert) { + int tot = lt->pntsu * lt->pntsv * lt->pntsw; + lt->editlatt->latt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert"); + BKE_defvert_array_copy(lt->editlatt->latt->dvert, lt->dvert, tot); + } + + if (lt->key) { + lt->editlatt->shapenr = obedit->shapenr; + } } void BKE_editlattice_load(Object *obedit) { - Lattice *lt, *editlt; - KeyBlock *actkey; - BPoint *bp; - float *fp; - int tot; - - lt = obedit->data; - editlt = lt->editlatt->latt; - - if (lt->editlatt->shapenr) { - actkey = BLI_findlink(<->key->block, lt->editlatt->shapenr - 1); - - /* active key: vertices */ - tot = editlt->pntsu * editlt->pntsv * editlt->pntsw; - - if (actkey->data) { - MEM_freeN(actkey->data); - } - - fp = actkey->data = MEM_callocN(lt->key->elemsize * tot, "actkey->data"); - actkey->totelem = tot; - - bp = editlt->def; - while (tot--) { - copy_v3_v3(fp, bp->vec); - fp += 3; - bp++; - } - } - else { - MEM_freeN(lt->def); - - lt->def = MEM_dupallocN(editlt->def); - - lt->flag = editlt->flag; - - lt->pntsu = editlt->pntsu; - lt->pntsv = editlt->pntsv; - lt->pntsw = editlt->pntsw; - - lt->typeu = editlt->typeu; - lt->typev = editlt->typev; - lt->typew = editlt->typew; - lt->actbp = editlt->actbp; - } - - if (lt->dvert) { - BKE_defvert_array_free(lt->dvert, lt->pntsu * lt->pntsv * lt->pntsw); - lt->dvert = NULL; - } - - if (editlt->dvert) { - tot = lt->pntsu * lt->pntsv * lt->pntsw; - - lt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert"); - BKE_defvert_array_copy(lt->dvert, editlt->dvert, tot); - } + Lattice *lt, *editlt; + KeyBlock *actkey; + BPoint *bp; + float *fp; + int tot; + + lt = obedit->data; + editlt = lt->editlatt->latt; + + if (lt->editlatt->shapenr) { + actkey = BLI_findlink(<->key->block, lt->editlatt->shapenr - 1); + + /* active key: vertices */ + tot = editlt->pntsu * editlt->pntsv * editlt->pntsw; + + if (actkey->data) { + MEM_freeN(actkey->data); + } + + fp = actkey->data = MEM_callocN(lt->key->elemsize * tot, "actkey->data"); + actkey->totelem = tot; + + bp = editlt->def; + while (tot--) { + copy_v3_v3(fp, bp->vec); + fp += 3; + bp++; + } + } + else { + MEM_freeN(lt->def); + + lt->def = MEM_dupallocN(editlt->def); + + lt->flag = editlt->flag; + + lt->pntsu = editlt->pntsu; + lt->pntsv = editlt->pntsv; + lt->pntsw = editlt->pntsw; + + lt->typeu = editlt->typeu; + lt->typev = editlt->typev; + lt->typew = editlt->typew; + lt->actbp = editlt->actbp; + } + + if (lt->dvert) { + BKE_defvert_array_free(lt->dvert, lt->pntsu * lt->pntsv * lt->pntsw); + lt->dvert = NULL; + } + + if (editlt->dvert) { + tot = lt->pntsu * lt->pntsv * lt->pntsw; + + lt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert"); + BKE_defvert_array_copy(lt->dvert, editlt->dvert, tot); + } } |