diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-12 15:01:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-12 15:01:29 +0400 |
commit | a9f6e5438443e6b35db1e22f6c595d31804af9b6 (patch) | |
tree | c196cb64ba0c687bf1ed9f568a710b7ee865b230 /source/blender/makesrna/intern/rna_lattice.c | |
parent | 68e27b749ec0ebcde549cf2bc442a17f829c87ee (diff) |
style cleanup: mostly whitespace in rna
Diffstat (limited to 'source/blender/makesrna/intern/rna_lattice.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_lattice.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index d919406a14d..a50389f01c1 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -51,27 +51,27 @@ static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) { - Lattice *lt = (Lattice*)ptr->id.data; - BPoint *bp = (BPoint*)ptr->data; + Lattice *lt = (Lattice *)ptr->id.data; + BPoint *bp = (BPoint *)ptr->data; int a = bp - lt->def; int x = a % lt->pntsu; - int y = (a/lt->pntsu) % lt->pntsv; - int z = (a/(lt->pntsu*lt->pntsv)); + int y = (a / lt->pntsu) % lt->pntsv; + int z = (a / (lt->pntsu * lt->pntsv)); - values[0] = lt->fu + x*lt->du; - values[1] = lt->fv + y*lt->dv; - values[2] = lt->fw + z*lt->dw; + values[0] = lt->fu + x * lt->du; + values[1] = lt->fv + y * lt->dv; + values[2] = lt->fw + z * lt->dw; } static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->id.data; + Lattice *lt = (Lattice *)ptr->id.data; if (lt->dvert) { - BPoint *bp = (BPoint*)ptr->data; - MDeformVert *dvert = lt->dvert + (bp-lt->def); + BPoint *bp = (BPoint *)ptr->data; + MDeformVert *dvert = lt->dvert + (bp - lt->def); - rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); + rna_iterator_array_begin(iter, (void *)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); } else rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); @@ -79,13 +79,13 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->data; - int tot = lt->pntsu*lt->pntsv*lt->pntsw; + Lattice *lt = (Lattice *)ptr->data; + int tot = lt->pntsu * lt->pntsv * lt->pntsw; if (lt->editlatt && lt->editlatt->latt->def) - rna_iterator_array_begin(iter, (void*)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL); + rna_iterator_array_begin(iter, (void *)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL); else if (lt->def) - rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, 0, NULL); + rna_iterator_array_begin(iter, (void *)lt->def, sizeof(BPoint), tot, 0, NULL); else rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); } @@ -95,7 +95,7 @@ static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), P ID *id = ptr->id.data; DAG_id_tag_update(id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -105,9 +105,9 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) int newu, newv, neww; /* we don't modify the actual pnts, but go through opnts instead */ - newu = (lt->opntsu > 0)? lt->opntsu: lt->pntsu; - newv = (lt->opntsv > 0)? lt->opntsv: lt->pntsv; - neww = (lt->opntsw > 0)? lt->opntsw: lt->pntsw; + newu = (lt->opntsu > 0) ? lt->opntsu : lt->pntsu; + newv = (lt->opntsv > 0) ? lt->opntsv : lt->pntsv; + neww = (lt->opntsw > 0) ? lt->opntsw : lt->pntsw; /* BKE_lattice_resize needs an object, any object will have the same result */ for (ob = bmain->object.first; ob; ob = ob->id.next) { @@ -148,28 +148,28 @@ static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value) static int rna_Lattice_size_editable(PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; return lt->key == NULL; } static void rna_Lattice_points_u_set(PointerRNA *ptr, int value) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; lt->opntsu = CLAMPIS(value, 1, 64); } static void rna_Lattice_points_v_set(PointerRNA *ptr, int value) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; lt->opntsv = CLAMPIS(value, 1, 64); } static void rna_Lattice_points_w_set(PointerRNA *ptr, int value) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; lt->opntsw = CLAMPIS(value, 1, 64); } @@ -187,7 +187,7 @@ static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value) /* annoying, but is a consequence of RNA structures... */ static char *rna_LatticePoint_path(PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->id.data; + Lattice *lt = (Lattice *)ptr->id.data; void *point = ptr->data; BPoint *points = NULL; @@ -197,7 +197,7 @@ static char *rna_LatticePoint_path(PointerRNA *ptr) points = lt->def; if (points && point) { - int tot = lt->pntsu*lt->pntsv*lt->pntsw; + int tot = lt->pntsu * lt->pntsv * lt->pntsw; /* only return index if in range */ if ((point >= (void *)points) && (point < (void *)(points + tot))) { @@ -252,7 +252,8 @@ static void rna_def_lattice(BlenderRNA *brna) {KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""}, {KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""}, {KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Lattice", "ID"); RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects"); |