Cleanup: style

This commit is contained in:
2019-03-12 08:21:13 +11:00
parent 815a9df70c
commit fd76b8d825
7 changed files with 20 additions and 11 deletions

View File

@@ -1482,7 +1482,12 @@ static void mesh_calc_modifiers(
}
nextmask.vmask &= ~CD_MASK_ORCO;
CustomData_MeshMasks temp_cddata_masks = {.vmask=CD_MASK_ORIGINDEX, .emask=CD_MASK_ORIGINDEX, .fmask=CD_MASK_ORIGINDEX, .pmask=CD_MASK_ORIGINDEX};
CustomData_MeshMasks temp_cddata_masks = {
.vmask = CD_MASK_ORIGINDEX,
.emask = CD_MASK_ORIGINDEX,
.fmask = CD_MASK_ORIGINDEX,
.pmask = CD_MASK_ORIGINDEX,
};
if (mti->requiredDataMask != NULL) {
mti->requiredDataMask(ob, md, &temp_cddata_masks);
}

View File

@@ -1131,8 +1131,7 @@ BoundBox *BKE_gpencil_boundbox_get(Object *ob)
return NULL;
bGPdata *gpd = (bGPdata *)ob->data;
if ((ob->runtime.bb) && ((gpd->flag & GP_DATA_CACHE_IS_DIRTY) == 0))
{
if ((ob->runtime.bb) && ((gpd->flag & GP_DATA_CACHE_IS_DIRTY) == 0)) {
return ob->runtime.bb;
}

View File

@@ -3614,13 +3614,15 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
}
}
else if (ntree->type == NTREE_COMPOSIT) {
if (ELEM(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
if (ELEM(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT)) {
direct_link_curvemapping(fd, node->storage);
}
else if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_R_LAYERS, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
ImageUser *iuser = node->storage;
iuser->ok = 1;
iuser->scene = NULL;
} else if (node->type == CMP_NODE_CRYPTOMATTE) {
}
else if (node->type == CMP_NODE_CRYPTOMATTE) {
NodeCryptomatte *nc = (NodeCryptomatte *)node->storage;
nc->matte_id = newdataadr(fd, nc->matte_id);
}

View File

@@ -223,8 +223,9 @@ static bool gpencil_draw_poll(bContext *C)
Object *obact = CTX_data_active_object(C);
ScrArea *sa = CTX_wm_area(C);
if ((sa) && (sa->spacetype == SPACE_VIEW3D)) {
if ((obact) && (obact->type == OB_GPENCIL)
&& (obact->mode == OB_MODE_PAINT_GPENCIL)) {
if ((obact) && (obact->type == OB_GPENCIL) &&
(obact->mode == OB_MODE_PAINT_GPENCIL))
{
CTX_wm_operator_poll_msg_set(C,
"Annotation cannot be used in grease pencil draw mode");
return false;

View File

@@ -623,7 +623,7 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
/* Modal numinput active, try to handle numeric inputs first... */
if (etype != EVT_MODAL_MAP && eval == KM_PRESS && has_numinput &&
handleNumInput(C, &opdata->num_input[opdata->value_mode], event))
handleNumInput(C, &opdata->num_input[opdata->value_mode], event))
{
edbm_bevel_numinput_set_value(op);
edbm_bevel_calc(op);

View File

@@ -383,12 +383,14 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
mdiff[0] = opdata->mcenter[0] - event->mval[0];
mdiff[1] = opdata->mcenter[1] - event->mval[1];
if (opdata->modify_depth)
if (opdata->modify_depth) {
amount = opdata->old_depth +
((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) / opdata->max_obj_scale;
else
}
else {
amount = opdata->old_thickness -
((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) / opdata->max_obj_scale;
}
/* Fake shift-transform... */
if (opdata->shift)

View File

@@ -509,7 +509,7 @@ static void *undomesh_from_editmesh(UndoMesh *um, BMEditMesh *em, Key *key)
NULL, em->bm, &um->me, (&(struct BMeshToMeshParams){
/* Undo code should not be manipulating 'G_MAIN->object' hooks/vertex-parent. */
.calc_object_remap = false,
.cd_mask_extra = {.vmask=CD_MASK_SHAPE_KEYINDEX},
.cd_mask_extra = {.vmask = CD_MASK_SHAPE_KEYINDEX},
}));
um->selectmode = em->selectmode;