forked from bartvdbraak/blender
style cleanup
This commit is contained in:
parent
3a947cf537
commit
8e01b8959e
@ -193,8 +193,8 @@ set(SRC
|
||||
BKE_lamp.h
|
||||
BKE_lattice.h
|
||||
BKE_library.h
|
||||
BKE_mask.h
|
||||
BKE_main.h
|
||||
BKE_mask.h
|
||||
BKE_material.h
|
||||
BKE_mball.h
|
||||
BKE_mesh.h
|
||||
|
@ -534,10 +534,12 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
|
||||
mul_m4_v3(imat, h2);
|
||||
|
||||
/* if next bone is B-bone too, use average handle direction */
|
||||
if (next->bone->segments > 1)
|
||||
;
|
||||
else
|
||||
if (next->bone->segments > 1) {
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
h2[1] -= length;
|
||||
}
|
||||
normalize_v3(h2);
|
||||
|
||||
/* find the next roll to interpolate as well */
|
||||
|
@ -101,13 +101,15 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (rule->type == eBoidRuleType_Goal && eob == bpa->ground)
|
||||
; /* skip current object */
|
||||
else if (rule->type == eBoidRuleType_Goal && eob == bpa->ground) {
|
||||
/* skip current object */
|
||||
}
|
||||
else if (pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f && get_effector_data(cur, &cur_efd, &epoint, 0)) {
|
||||
float temp = mul * pd->f_strength * effector_falloff(cur, &cur_efd, &epoint, bbd->part->effector_weights);
|
||||
|
||||
if (temp == 0.0f)
|
||||
; /* do nothing */
|
||||
if (temp == 0.0f) {
|
||||
/* do nothing */
|
||||
}
|
||||
else if (temp > priority) {
|
||||
priority = temp;
|
||||
eff = cur;
|
||||
|
@ -1013,10 +1013,12 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
|
||||
if (efd.falloff > 0.0f)
|
||||
efd.falloff *= eff_calc_visibility(colliders, eff, &efd, point);
|
||||
|
||||
if (efd.falloff <= 0.0f)
|
||||
; /* don't do anything */
|
||||
else if (eff->pd->forcefield == PFIELD_TEXTURE)
|
||||
if (efd.falloff <= 0.0f) {
|
||||
/* don't do anything */
|
||||
}
|
||||
else if (eff->pd->forcefield == PFIELD_TEXTURE) {
|
||||
do_texture_effector(eff, &efd, point, force);
|
||||
}
|
||||
else {
|
||||
float temp1[3]={0, 0, 0}, temp2[3];
|
||||
copy_v3_v3(temp1, force);
|
||||
|
@ -3328,8 +3328,9 @@ void BKE_ptcache_load_external(PTCacheID *pid)
|
||||
cache->endframe = end;
|
||||
cache->totpoint = 0;
|
||||
|
||||
if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
|
||||
; /*necessary info in every file*/
|
||||
if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN) {
|
||||
/* necessary info in every file */
|
||||
}
|
||||
/* read totpoint from info file (frame 0) */
|
||||
else if (info) {
|
||||
pf= ptcache_file_open(pid, PTCACHE_FILE_READ, 0);
|
||||
|
@ -4319,10 +4319,12 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
|
||||
if (smd->domain->ptcaches[1].first || smd->domain->point_cache[1]) {
|
||||
if (smd->domain->point_cache[1]) {
|
||||
PointCache *cache = newdataadr(fd, smd->domain->point_cache[1]);
|
||||
if (cache->flag & PTCACHE_FAKE_SMOKE)
|
||||
; /* Smoke was already saved in "new format" and this cache is a fake one. */
|
||||
else
|
||||
if (cache->flag & PTCACHE_FAKE_SMOKE) {
|
||||
/* Smoke was already saved in "new format" and this cache is a fake one. */
|
||||
}
|
||||
else {
|
||||
printf("High resolution smoke cache not available due to pointcache update. Please reset the simulation.\n");
|
||||
}
|
||||
BKE_ptcache_free(cache);
|
||||
}
|
||||
smd->domain->ptcaches[1].first = NULL;
|
||||
|
@ -730,8 +730,9 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
|
||||
write_curvemapping(wd, node->storage);
|
||||
else if (ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) )
|
||||
write_curvemapping(wd, node->storage);
|
||||
else if (ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION)
|
||||
/* pass */;
|
||||
else if (ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION) {
|
||||
/* pass */
|
||||
}
|
||||
else
|
||||
writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage);
|
||||
}
|
||||
|
@ -1528,7 +1528,9 @@ void ui_set_but_val(uiBut *but, double value)
|
||||
* so leave this unset */
|
||||
value = UI_BUT_VALUE_UNSET;
|
||||
}
|
||||
else if (but->pointype == 0) ;
|
||||
else if (but->pointype == 0) {
|
||||
/* pass */
|
||||
}
|
||||
else if (but->type == HSVSLI) {
|
||||
float *fp, hsv[3];
|
||||
|
||||
@ -1721,8 +1723,9 @@ void ui_get_but_string(uiBut *but, char *str, size_t maxlen)
|
||||
BLI_strncpy(str, but->poin, maxlen);
|
||||
return;
|
||||
}
|
||||
else if (ui_but_anim_expression_get(but, str, maxlen))
|
||||
; /* driver expression */
|
||||
else if (ui_but_anim_expression_get(but, str, maxlen)) {
|
||||
/* driver expression */
|
||||
}
|
||||
else {
|
||||
/* number editing */
|
||||
double value;
|
||||
@ -2480,7 +2483,9 @@ static void ui_block_do_align_but(uiBut *first, short nr)
|
||||
if (rows > 0) {
|
||||
uiBut *bt = but;
|
||||
while (bt && bt->alignnr == nr) {
|
||||
if (bt->next && bt->next->alignnr == nr && buts_are_horiz(bt, bt->next) == 0) break;
|
||||
if (bt->next && bt->next->alignnr == nr && buts_are_horiz(bt, bt->next) == 0) {
|
||||
break;
|
||||
}
|
||||
bt = bt->next;
|
||||
}
|
||||
if (bt == NULL || bt->alignnr != nr) flag = UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT;
|
||||
@ -2714,9 +2719,8 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
||||
}
|
||||
|
||||
/* keep track of UI_interface.h */
|
||||
if (ELEM7(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM)) ;
|
||||
else if (ELEM(but->type, SCROLL, SEPR /* , FTPREVIEW */ )) ;
|
||||
else if (but->type >= SEARCH_MENU) ;
|
||||
if (ELEM9(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM, SCROLL, SEPR /* , FTPREVIEW */)) {}
|
||||
else if (but->type >= SEARCH_MENU) {}
|
||||
else but->flag |= UI_BUT_UNDO;
|
||||
|
||||
BLI_addtail(&block->buttons, but);
|
||||
@ -2750,7 +2754,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
||||
|
||||
|
||||
static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str,
|
||||
int x, int y, short width, short height,
|
||||
int x, int y, short width, short height,
|
||||
PointerRNA *ptr, PropertyRNA *prop, int index,
|
||||
float min, float max, float a1, float a2, const char *tip)
|
||||
{
|
||||
|
@ -6621,7 +6621,9 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
|
||||
}
|
||||
}
|
||||
|
||||
if (menu->menuretval) ;
|
||||
if (menu->menuretval) {
|
||||
/* pass */
|
||||
}
|
||||
else if (event->type == ESCKEY && event->val == KM_PRESS) {
|
||||
/* esc cancels this and all preceding menus */
|
||||
menu->menuretval = UI_RETURN_CANCEL;
|
||||
|
@ -2674,14 +2674,18 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
|
||||
ds = BLI_dynstr_new();
|
||||
|
||||
for (report = reports->list.first; report; report = report->next) {
|
||||
if (report->type < reports->printlevel)
|
||||
; /* pass */
|
||||
else if (report->type >= RPT_ERROR)
|
||||
if (report->type < reports->printlevel) {
|
||||
/* pass */
|
||||
}
|
||||
else if (report->type >= RPT_ERROR) {
|
||||
BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message);
|
||||
else if (report->type >= RPT_WARNING)
|
||||
}
|
||||
else if (report->type >= RPT_WARNING) {
|
||||
BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message);
|
||||
else if (report->type >= RPT_INFO)
|
||||
}
|
||||
else if (report->type >= RPT_INFO) {
|
||||
BLI_dynstr_appendf(ds, "Info %%i%d%%t|%s", ICON_INFO, report->message);
|
||||
}
|
||||
}
|
||||
|
||||
str = BLI_dynstr_get_cstring(ds);
|
||||
|
@ -207,7 +207,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
* user-prefs exception - campbell */
|
||||
if (RNA_struct_find_property(op->ptr, "relative_path")) {
|
||||
if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
|
||||
/* annoying exception!, if were dealign with the user prefs, default relative to be off */
|
||||
/* annoying exception!, if were dealing with the user prefs, default relative to be off */
|
||||
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
|
||||
}
|
||||
}
|
||||
|
@ -1274,12 +1274,15 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
|
||||
else {
|
||||
if (datalevel == TSE_ANIM_DATA)
|
||||
WM_operator_name_call(C, "OUTLINER_OT_animdata_operation", WM_OP_INVOKE_REGION_WIN, NULL);
|
||||
else if (datalevel == TSE_DRIVER_BASE)
|
||||
/* do nothing... no special ops needed yet */;
|
||||
else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS))
|
||||
/*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/;
|
||||
else
|
||||
else if (datalevel == TSE_DRIVER_BASE) {
|
||||
/* do nothing... no special ops needed yet */
|
||||
}
|
||||
else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)) {
|
||||
/*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/
|
||||
}
|
||||
else {
|
||||
WM_operator_name_call(C, "OUTLINER_OT_data_operation", WM_OP_INVOKE_REGION_WIN, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1305,7 +1308,9 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *even
|
||||
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval + 1);
|
||||
|
||||
for (te = soops->tree.first; te; te = te->next) {
|
||||
if (do_outliner_operation_event(C, scene, ar, soops, te, event, fmval)) break;
|
||||
if (do_outliner_operation_event(C, scene, ar, soops, te, event, fmval)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -888,9 +888,10 @@ static void view3d_lasso_select(bContext *C, ViewContext *vc,
|
||||
do_lasso_select_paintface(vc, mcords, moves, extend, select);
|
||||
else if (paint_vertsel_test(ob))
|
||||
do_lasso_select_paintvert(vc, mcords, moves, extend, select);
|
||||
else if (ob && ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))
|
||||
;
|
||||
else if (ob && ob->mode & OB_MODE_PARTICLE_EDIT)
|
||||
else if (ob && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) {
|
||||
/* pass */
|
||||
}
|
||||
else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT))
|
||||
PE_lasso_select(C, mcords, moves, extend, select);
|
||||
else {
|
||||
do_lasso_select_objects(vc, mcords, moves, extend, select);
|
||||
|
@ -772,13 +772,15 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i
|
||||
BM_ITER_ELEM (l, &iter, efa, BM_LOOPS_OF_FACE) {
|
||||
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
|
||||
|
||||
if (i == id1)
|
||||
if (i == id1) {
|
||||
uv1 = luv->uv;
|
||||
else if (i == id)
|
||||
; /* uv2 = luv->uv; */ /* UNUSED */
|
||||
else if (i == id2)
|
||||
}
|
||||
else if (i == id) {
|
||||
/* uv2 = luv->uv; */ /* UNUSED */
|
||||
}
|
||||
else if (i == id2) {
|
||||
uv3 = luv->uv;
|
||||
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -780,7 +780,9 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
|
||||
}
|
||||
}
|
||||
|
||||
if (mat->scene->gm.flag & GAME_GLSL_NO_SHADERS);
|
||||
if (mat->scene->gm.flag & GAME_GLSL_NO_SHADERS) {
|
||||
/* pass */
|
||||
}
|
||||
else if (!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) &&
|
||||
(GPU_link_changed(shi->spec) || ma->spec != 0.0f))
|
||||
{
|
||||
|
@ -1094,7 +1094,9 @@ static int make_structDNA(char *baseDirectory, FILE *file)
|
||||
int a;
|
||||
|
||||
fp = fopen("padding.c", "w");
|
||||
if (fp == NULL) ;
|
||||
if (fp == NULL) {
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
|
||||
/* add all include files defined in the global array */
|
||||
|
@ -1102,8 +1102,8 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
|
||||
return NULL;
|
||||
|
||||
/* only supported in case of standard next functions */
|
||||
if (strcmp(nextfunc, "rna_iterator_array_next") == 0) ;
|
||||
else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) ;
|
||||
if (strcmp(nextfunc, "rna_iterator_array_next") == 0) {}
|
||||
else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) {}
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
@ -1372,9 +1372,12 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
|
||||
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
|
||||
const char *nextfunc = (const char *)cprop->next;
|
||||
|
||||
if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) ;
|
||||
else if (dp->dnalengthname || dp->dnalengthfixed)
|
||||
if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) {
|
||||
/* pass */
|
||||
}
|
||||
else if (dp->dnalengthname || dp->dnalengthfixed) {
|
||||
cprop->length = (void *)rna_def_property_length_func(f, srna, prop, dp, (const char *)cprop->length);
|
||||
}
|
||||
|
||||
/* test if we can allow raw array access, if it is using our standard
|
||||
* array get/next function, we can be sure it is an actual array */
|
||||
|
@ -3606,7 +3606,7 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int
|
||||
/* copy string, taking into account escaped ] */
|
||||
if (bracket) {
|
||||
for (p = *path, i = 0, j = 0; i < len; i++, p++) {
|
||||
if (*p == '\\' && *(p + 1) == quote) ;
|
||||
if (*p == '\\' && *(p + 1) == quote) {}
|
||||
else buf[j++] = *p;
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ static void waveModifier_do(WaveModifierData *md,
|
||||
const float falloff = wmd->falloff;
|
||||
float falloff_fac = 1.0f; /* when falloff == 0.0f this stays at 1.0f */
|
||||
|
||||
if (wmd->flag & MOD_WAVE_NORM && ob->type == OB_MESH)
|
||||
if ((wmd->flag & MOD_WAVE_NORM) && (ob->type == OB_MESH))
|
||||
mvert = dm->getVertArray(dm);
|
||||
|
||||
if (wmd->objectcenter) {
|
||||
|
@ -382,8 +382,12 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
|
||||
|
||||
while (TRUE) {
|
||||
|
||||
if (x < 0 || y < 0 || x >= oc->ocres || y >= oc->ocres) ;
|
||||
else ocface[oc->ocres * x + y] = 1;
|
||||
if (x < 0 || y < 0 || x >= oc->ocres || y >= oc->ocres) {
|
||||
/* pass*/
|
||||
}
|
||||
else {
|
||||
ocface[oc->ocres * x + y] = 1;
|
||||
}
|
||||
|
||||
labdao = labda;
|
||||
if (labdax == labday) {
|
||||
|
@ -4712,10 +4712,12 @@ void RE_Database_Free(Render *re)
|
||||
static int allow_render_object(Render *re, Object *ob, int nolamps, int onlyselected, Object *actob)
|
||||
{
|
||||
/* override not showing object when duplis are used with particles */
|
||||
if (ob->transflag & OB_DUPLIPARTS)
|
||||
; /* let particle system(s) handle showing vs. not showing */
|
||||
else if ((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES))
|
||||
if (ob->transflag & OB_DUPLIPARTS) {
|
||||
/* pass */ /* let particle system(s) handle showing vs. not showing */
|
||||
}
|
||||
else if ((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* don't add non-basic meta objects, ends up having renderobjects with no geometry */
|
||||
if (ob->type == OB_MBALL && ob!=BKE_mball_basis_find(re->scene, ob))
|
||||
|
@ -887,8 +887,9 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
|
||||
wm_operator_reports(C, op, retval, (reports != NULL));
|
||||
}
|
||||
|
||||
if (retval & OPERATOR_HANDLED)
|
||||
; /* do nothing, wm_operator_exec() has been called somewhere */
|
||||
if (retval & OPERATOR_HANDLED) {
|
||||
/* do nothing, wm_operator_exec() has been called somewhere */
|
||||
}
|
||||
else if (retval & OPERATOR_FINISHED) {
|
||||
if (!is_nested_call) { /* not called by py script */
|
||||
WM_operator_last_properties_store(op);
|
||||
|
@ -254,12 +254,18 @@ bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const
|
||||
{
|
||||
bool dolights = false;
|
||||
|
||||
if (m_flag & RAS_BLENDERMAT)
|
||||
dolights = (m_flag &RAS_MULTILIGHT)!=0;
|
||||
else if (rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID);
|
||||
else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW);
|
||||
else
|
||||
if (m_flag & RAS_BLENDERMAT) {
|
||||
dolights = (m_flag & RAS_MULTILIGHT) != 0;
|
||||
}
|
||||
else if (rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID) {
|
||||
/* pass */
|
||||
}
|
||||
else if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW) {
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
dolights = m_light;
|
||||
}
|
||||
|
||||
return dolights;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user