Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-22 02:13:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-22 12:48:16 +0300
commit6cc09d006af4a89cea14485e8e3896bd38a80e4b (patch)
treeb16965e08e7576749f47902e8604a9fccac5e2cf /source/blender/blenloader/intern/versioning_260.c
parent6b3bf9e2a86c73fd78452fbdc05785a560a2be9e (diff)
Cleanup: style, use braces for blenloader
Diffstat (limited to 'source/blender/blenloader/intern/versioning_260.c')
-rw-r--r--source/blender/blenloader/intern/versioning_260.c282
1 files changed, 188 insertions, 94 deletions
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 324b3db3038..6c9ec7607a2 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -205,15 +205,19 @@ static void do_versions_nodetree_socket_use_flags_2_62(bNodeTree *ntree)
bNodeLink *link;
for (node = ntree->nodes.first; node; node = node->next) {
- for (sock = node->inputs.first; sock; sock = sock->next)
+ for (sock = node->inputs.first; sock; sock = sock->next) {
sock->flag &= ~SOCK_IN_USE;
- for (sock = node->outputs.first; sock; sock = sock->next)
+ }
+ for (sock = node->outputs.first; sock; sock = sock->next) {
sock->flag &= ~SOCK_IN_USE;
+ }
}
- for (sock = ntree->inputs.first; sock; sock = sock->next)
+ for (sock = ntree->inputs.first; sock; sock = sock->next) {
sock->flag &= ~SOCK_IN_USE;
- for (sock = ntree->outputs.first; sock; sock = sock->next)
+ }
+ for (sock = ntree->outputs.first; sock; sock = sock->next) {
sock->flag &= ~SOCK_IN_USE;
+ }
for (link = ntree->links.first; link; link = link->next) {
link->fromsock->flag |= SOCK_IN_USE;
@@ -296,8 +300,9 @@ static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNo
nodeRemoveSocket(ntree, node, old_image);
nodeRemoveSocket(ntree, node, old_z);
- if (old_data)
+ if (old_data) {
MEM_freeN(old_data);
+ }
}
else if (node->type == CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED) {
NodeImageMultiFile *nimf = node->storage;
@@ -307,8 +312,9 @@ static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNo
node->type = CMP_NODE_OUTPUT_FILE;
/* initialize the node-wide image format from render data, if available */
- if (sce)
+ if (sce) {
nimf->format = sce->r.im_format;
+ }
/* transfer render format toggle to node format toggle */
for (sock = node->inputs.first; sock; sock = sock->next) {
@@ -543,16 +549,20 @@ static void do_versions_nodetree_customnodes(bNodeTree *ntree, int UNUSED(is_gro
node->flag |= NODE_INIT;
/* sockets idname */
- for (sock = node->inputs.first; sock; sock = sock->next)
+ for (sock = node->inputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
- for (sock = node->outputs.first; sock; sock = sock->next)
+ }
+ for (sock = node->outputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
+ }
}
/* tree sockets idname */
- for (sock = ntree->inputs.first; sock; sock = sock->next)
+ for (sock = ntree->inputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
- for (sock = ntree->outputs.first; sock; sock = sock->next)
+ }
+ for (sock = ntree->outputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->idname, node_socket_get_static_idname(sock), sizeof(sock->idname));
+ }
}
/* initialize socket in_out values */
@@ -561,15 +571,19 @@ static void do_versions_nodetree_customnodes(bNodeTree *ntree, int UNUSED(is_gro
bNodeSocket *sock;
for (node = ntree->nodes.first; node; node = node->next) {
- for (sock = node->inputs.first; sock; sock = sock->next)
+ for (sock = node->inputs.first; sock; sock = sock->next) {
sock->in_out = SOCK_IN;
- for (sock = node->outputs.first; sock; sock = sock->next)
+ }
+ for (sock = node->outputs.first; sock; sock = sock->next) {
sock->in_out = SOCK_OUT;
+ }
}
- for (sock = ntree->inputs.first; sock; sock = sock->next)
+ for (sock = ntree->inputs.first; sock; sock = sock->next) {
sock->in_out = SOCK_IN;
- for (sock = ntree->outputs.first; sock; sock = sock->next)
+ }
+ for (sock = ntree->outputs.first; sock; sock = sock->next) {
sock->in_out = SOCK_OUT;
+ }
}
/* initialize socket identifier strings */
@@ -629,15 +643,18 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
/* there are files with invalid audio_channels value, the real cause
* is unknown, but we fix it here anyway to avoid crashes */
- if (sce->r.ffcodecdata.audio_channels == 0)
+ if (sce->r.ffcodecdata.audio_channels == 0) {
sce->r.ffcodecdata.audio_channels = 2;
+ }
- if (sce->nodetree)
+ if (sce->nodetree) {
do_versions_nodetree_image_default_alpha_output(sce->nodetree);
+ }
}
- for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
do_versions_nodetree_image_default_alpha_output(ntree);
+ }
}
{
@@ -648,8 +665,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
part->draw |= PART_DRAW_ROTATE_OB;
- if (part->rotmode == 0)
+ if (part->rotmode == 0) {
part->rotmode = PART_ROT_VEL;
+ }
}
}
}
@@ -665,11 +683,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
Camera *cam;
for (cam = bmain->cameras.first; cam; cam = cam->id.next) {
- if (cam->sensor_x < 0.01f)
+ if (cam->sensor_x < 0.01f) {
cam->sensor_x = DEFAULT_SENSOR_WIDTH;
+ }
- if (cam->sensor_y < 0.01f)
+ if (cam->sensor_y < 0.01f) {
cam->sensor_y = DEFAULT_SENSOR_HEIGHT;
+ }
}
}
}
@@ -701,17 +721,20 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
bNodeTree *ntree;
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
- if (sce->nodetree)
+ if (sce->nodetree) {
do_versions_nodetree_convert_angle(sce->nodetree);
+ }
}
for (mat = bmain->materials.first; mat; mat = mat->id.next) {
- if (mat->nodetree)
+ if (mat->nodetree) {
do_versions_nodetree_convert_angle(mat->nodetree);
+ }
}
- for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
do_versions_nodetree_convert_angle(ntree);
+ }
}
{
@@ -731,13 +754,15 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
v3d->flag2 |= V3D_SHOW_RECONSTRUCTION;
}
- if (v3d->bundle_drawtype == 0)
+ if (v3d->bundle_drawtype == 0) {
v3d->bundle_drawtype = OB_PLAINAXES;
+ }
}
else if (sl->spacetype == SPACE_CLIP) {
SpaceClip *sclip = (SpaceClip *)sl;
- if (sclip->scopes.track_preview_height == 0)
+ if (sclip->scopes.track_preview_height == 0) {
sclip->scopes.track_preview_height = 120;
+ }
}
}
}
@@ -754,19 +779,23 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
clip->proxy.build_tc_flag = IMB_TC_RECORD_RUN | IMB_TC_FREE_RUN |
IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
- if (clip->proxy.build_size_flag == 0)
+ if (clip->proxy.build_size_flag == 0) {
clip->proxy.build_size_flag = IMB_PROXY_25;
+ }
- if (clip->proxy.quality == 0)
+ if (clip->proxy.quality == 0) {
clip->proxy.quality = 90;
+ }
- if (clip->tracking.camera.pixel_aspect < 0.01f)
+ if (clip->tracking.camera.pixel_aspect < 0.01f) {
clip->tracking.camera.pixel_aspect = 1.0f;
+ }
track = clip->tracking.tracks.first;
while (track) {
- if (track->minimum_correlation == 0.0f)
+ if (track->minimum_correlation == 0.0f) {
track->minimum_correlation = 0.75f;
+ }
track = track->next;
}
@@ -828,8 +857,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
Brush *brush;
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
- if (brush->sculpt_tool == SCULPT_TOOL_ROTATE)
+ if (brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
brush->alpha = 1.0f;
+ }
}
}
@@ -843,28 +873,33 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
bNodeTree *ntree;
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
- if (sce->nodetree)
+ if (sce->nodetree) {
do_versions_nodetree_socket_use_flags_2_62(sce->nodetree);
+ }
}
for (mat = bmain->materials.first; mat; mat = mat->id.next) {
- if (mat->nodetree)
+ if (mat->nodetree) {
do_versions_nodetree_socket_use_flags_2_62(mat->nodetree);
+ }
}
for (tex = bmain->textures.first; tex; tex = tex->id.next) {
- if (tex->nodetree)
+ if (tex->nodetree) {
do_versions_nodetree_socket_use_flags_2_62(tex->nodetree);
+ }
}
for (Light *la = bmain->lights.first; la; la = la->id.next) {
- if (la->nodetree)
+ if (la->nodetree) {
do_versions_nodetree_socket_use_flags_2_62(la->nodetree);
+ }
}
for (world = bmain->worlds.first; world; world = world->id.next) {
- if (world->nodetree)
+ if (world->nodetree) {
do_versions_nodetree_socket_use_flags_2_62(world->nodetree);
+ }
}
for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
@@ -881,15 +916,18 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
clip->proxy.build_tc_flag |= IMB_TC_RECORD_RUN_NO_GAPS;
- if (!tracking->settings.object_distance)
+ if (!tracking->settings.object_distance) {
tracking->settings.object_distance = 1.0f;
+ }
- if (BLI_listbase_is_empty(&tracking->objects))
+ if (BLI_listbase_is_empty(&tracking->objects)) {
BKE_tracking_object_add(tracking, "Camera");
+ }
while (tracking_object) {
- if (!tracking_object->scale)
+ if (!tracking_object->scale) {
tracking_object->scale = 1.0f;
+ }
tracking_object = tracking_object->next;
}
@@ -901,8 +939,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (con->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data;
- if (data->invmat[3][3] == 0.0f)
+ if (data->invmat[3][3] == 0.0f) {
unit_m4(data->invmat);
+ }
}
}
}
@@ -938,8 +977,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
tl->len += added;
/* reset cursor position if line was changed */
- if (added && tl == text->curl)
+ if (added && tl == text->curl) {
text->curc = 0;
+ }
}
}
}
@@ -975,8 +1015,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData *)md;
- if (clmd->sim_parms)
+ if (clmd->sim_parms) {
clmd->sim_parms->vel_damping = 1.0f;
+ }
}
}
}
@@ -992,8 +1033,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Fluidsim) {
FluidsimModifierData *fmd = (FluidsimModifierData *)md;
- if (fmd->fss->animRate == 0.0f)
+ if (fmd->fss->animRate == 0.0f) {
fmd->fss->animRate = 1.0f;
+ }
}
}
}
@@ -1005,13 +1047,15 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
bNodeTree *ntree;
for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
- if (sce->nodetree)
+ if (sce->nodetree) {
do_versions_nodetree_multi_file_output_format_2_62_1(sce, sce->nodetree);
+ }
}
/* XXX can't associate with scene for group nodes, image format will stay uninitialized */
- for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree);
+ }
}
/* only swap for pre-release bmesh merge which had MLoopCol red/blue swap */
@@ -1030,8 +1074,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
KeyingSet *ks;
for (ks = scene->keyingsets.first; ks; ks = ks->next) {
- if (!ks->idname[0])
+ if (!ks->idname[0]) {
BLI_strncpy(ks->idname, ks->name, sizeof(ks->idname));
+ }
}
}
}
@@ -1085,11 +1130,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
Scene *sce;
bNodeTree *ntree;
- for (sce = bmain->scenes.first; sce; sce = sce->id.next)
- if (sce->nodetree)
+ for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
+ if (sce->nodetree) {
do_versions_nodetree_multi_file_output_path_2_63_1(sce->nodetree);
- for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
+ }
+ }
+ for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
do_versions_nodetree_multi_file_output_path_2_63_1(ntree);
+ }
}
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 3)) {
@@ -1194,28 +1242,39 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
World *world;
bNodeTree *ntree;
- for (sce = bmain->scenes.first; sce; sce = sce->id.next)
- if (sce->nodetree)
+ for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
+ if (sce->nodetree) {
do_versions_nodetree_frame_2_64_6(sce->nodetree);
+ }
+ }
- for (mat = bmain->materials.first; mat; mat = mat->id.next)
- if (mat->nodetree)
+ for (mat = bmain->materials.first; mat; mat = mat->id.next) {
+ if (mat->nodetree) {
do_versions_nodetree_frame_2_64_6(mat->nodetree);
+ }
+ }
- for (tex = bmain->textures.first; tex; tex = tex->id.next)
- if (tex->nodetree)
+ for (tex = bmain->textures.first; tex; tex = tex->id.next) {
+ if (tex->nodetree) {
do_versions_nodetree_frame_2_64_6(tex->nodetree);
+ }
+ }
- for (Light *la = bmain->lights.first; la; la = la->id.next)
- if (la->nodetree)
+ for (Light *la = bmain->lights.first; la; la = la->id.next) {
+ if (la->nodetree) {
do_versions_nodetree_frame_2_64_6(la->nodetree);
+ }
+ }
- for (world = bmain->worlds.first; world; world = world->id.next)
- if (world->nodetree)
+ for (world = bmain->worlds.first; world; world = world->id.next) {
+ if (world->nodetree) {
do_versions_nodetree_frame_2_64_6(world->nodetree);
+ }
+ }
- for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
do_versions_nodetree_frame_2_64_6(ntree);
+ }
}
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 7)) {
@@ -1366,10 +1425,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
FOREACH_NODETREE_END;
/* keep compatibility for dupliobject particle size */
- for (part = bmain->particles.first; part; part = part->id.next)
- if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR))
- if ((part->draw & PART_DRAW_ROTATE_OB) == 0)
+ for (part = bmain->particles.first; part; part = part->id.next) {
+ if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
+ if ((part->draw & PART_DRAW_ROTATE_OB) == 0) {
part->draw |= PART_DRAW_NO_SCALE_OB;
+ }
+ }
+ }
}
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 17)) {
@@ -1504,9 +1566,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_SHADER) {
bNode *node;
- for (node = ntree->nodes.first; node; node = node->next)
- if (node->type == SH_NODE_TEX_COORD)
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == SH_NODE_TEX_COORD) {
node->flag |= NODE_OPTIONS;
+ }
+ }
}
}
FOREACH_NODETREE_END;
@@ -1724,8 +1788,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
SEQ_END;
- if (scene->r.bake_samples == 0)
+ if (scene->r.bake_samples == 0) {
scene->r.bake_samples = 256;
+ }
}
for (Image *image = bmain->images.first; image; image = image->id.next) {
@@ -1741,8 +1806,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (tex->type == TEX_IMAGE && (tex->imaflag & TEX_USEALPHA) == 0) {
Image *image = blo_do_versions_newlibadr(fd, tex->id.lib, tex->ima);
- if (image && (image->flag & IMA_DO_PREMUL) == 0)
+ if (image && (image->flag & IMA_DO_PREMUL) == 0) {
image->flag |= IMA_IGNORE_ALPHA;
+ }
}
}
@@ -1754,8 +1820,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
Image *image = blo_do_versions_newlibadr(fd, ntree->id.lib, node->id);
if (image) {
- if ((image->flag & IMA_DO_PREMUL) == 0 && image->alpha_mode == IMA_ALPHA_STRAIGHT)
+ if ((image->flag & IMA_DO_PREMUL) == 0 && image->alpha_mode == IMA_ALPHA_STRAIGHT) {
node->custom1 |= CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT;
+ }
}
}
}
@@ -1768,9 +1835,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
* for compatibility all textures assumed it to be enabled */
Tex *tex;
- for (tex = bmain->textures.first; tex; tex = tex->id.next)
- if (tex->type == TEX_IMAGE)
+ for (tex = bmain->textures.first; tex; tex = tex->id.next) {
+ if (tex->type == TEX_IMAGE) {
tex->imaflag |= TEX_USEALPHA;
+ }
+ }
}
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 7)) {
@@ -1895,8 +1964,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
/* Only add interface nodes once.
* In old Blender versions they will be removed automatically due to undefined type */
- if (MAIN_VERSION_OLDER(bmain, 266, 2))
+ if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
ntree->flag |= NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE;
+ }
}
FOREACH_NODETREE_END;
}
@@ -1911,11 +1981,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
bNode *node;
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
- if (id == &ntree->id)
+ if (id == &ntree->id) {
continue; /* already fixed for node groups */
+ }
- for (node = ntree->nodes.first; node; node = node->next)
+ for (node = ntree->nodes.first; node; node = node->next) {
nodeUniqueName(ntree, node);
+ }
}
FOREACH_NODETREE_END;
}
@@ -1938,8 +2010,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
brush->overlay_flags = 0;
- if (brush->flag & BRUSH_TEXTURE_OVERLAY)
+ if (brush->flag & BRUSH_TEXTURE_OVERLAY) {
brush->overlay_flags |= (BRUSH_OVERLAY_PRIMARY | BRUSH_OVERLAY_CURSOR);
+ }
}
#undef BRUSH_TEXTURE_OVERLAY
}
@@ -1983,8 +2056,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
sce->r.unit_line_thickness = 1.0f;
}
for (srl = sce->r.layers.first; srl; srl = srl->next) {
- if (srl->freestyleConfig.mode == 0)
+ if (srl->freestyleConfig.mode == 0) {
srl->freestyleConfig.mode = FREESTYLE_CONTROL_EDITOR_MODE;
+ }
if (srl->freestyleConfig.raycasting_algorithm ==
FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE ||
srl->freestyleConfig.raycasting_algorithm ==
@@ -2024,10 +2098,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
linestyle->thickness_position = LS_THICKNESS_CENTER;
linestyle->thickness_ratio = 0.5f;
}
- if (linestyle->chaining == 0)
+ if (linestyle->chaining == 0) {
linestyle->chaining = LS_CHAINING_PLAIN;
- if (linestyle->rounds == 0)
+ }
+ if (linestyle->rounds == 0) {
linestyle->rounds = 3;
+ }
}
}
@@ -2045,24 +2121,28 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (sl->spacetype == SPACE_NODE) {
SpaceNode *snode = (SpaceNode *)sl;
bNodeTreePath *path = snode->treepath.last;
- if (!path)
+ if (!path) {
continue;
+ }
active_viewer_key = path->parent_key;
break;
}
}
- if (active_viewer_key.value != 0)
+ if (active_viewer_key.value != 0) {
break;
+ }
}
- if (active_viewer_key.value != 0)
+ if (active_viewer_key.value != 0) {
break;
+ }
}
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
/* NB: scene->nodetree is a local ID block, has been direct_link'ed */
- if (scene->nodetree)
+ if (scene->nodetree) {
scene->nodetree->active_viewer_key = active_viewer_key;
+ }
}
}
@@ -2100,12 +2180,15 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
brush->flag &= ~BRUSH_FIXED;
- if (brush->cursor_overlay_alpha < 2)
+ if (brush->cursor_overlay_alpha < 2) {
brush->cursor_overlay_alpha = 33;
- if (brush->texture_overlay_alpha < 2)
+ }
+ if (brush->texture_overlay_alpha < 2) {
brush->texture_overlay_alpha = 33;
- if (brush->mask_overlay_alpha < 2)
+ }
+ if (brush->mask_overlay_alpha < 2) {
brush->mask_overlay_alpha = 33;
+ }
}
#undef BRUSH_FIXED
}
@@ -2119,12 +2202,15 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (con = ob->constraints.first; con; con = con->next) {
if (con->type == CONSTRAINT_TYPE_SHRINKWRAP) {
bShrinkwrapConstraint *data = (bShrinkwrapConstraint *)con->data;
- if (data->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS)
+ if (data->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) {
data->projAxis = OB_POSX;
- else if (data->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS)
+ }
+ else if (data->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) {
data->projAxis = OB_POSY;
- else
+ }
+ else {
data->projAxis = OB_POSZ;
+ }
data->projAxisSpace = CONSTRAINT_SPACE_LOCAL;
}
}
@@ -2177,15 +2263,17 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (sa->spacetype == SPACE_NODE) {
ar = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS);
- if (ar)
+ if (ar) {
continue;
+ }
/* add subdiv level; after header */
ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if (ar == NULL)
+ if (ar == NULL) {
continue;
+ }
arnew = MEM_callocN(sizeof(ARegion), "node tools");
@@ -2304,12 +2392,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
/* this can now be turned off */
ToolSettings *ts = scene->toolsettings;
- if (ts->sculpt)
+ if (ts->sculpt) {
ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE;
+ }
/* 'Increment' mode disabled for nodes, use true grid snapping instead */
- if (scene->toolsettings->snap_node_mode == SCE_SNAP_MODE_INCREMENT)
+ if (scene->toolsettings->snap_node_mode == SCE_SNAP_MODE_INCREMENT) {
scene->toolsettings->snap_node_mode = SCE_SNAP_MODE_GRID;
+ }
#ifdef WITH_FFMPEG
/* Update for removed "sound-only" option in FFMPEG export settings. */
@@ -2404,14 +2494,18 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
};
int symmetry_flags = sd->flags & 7;
- if (symmetry_flags & SCULPT_SYMM_X)
+ if (symmetry_flags & SCULPT_SYMM_X) {
sd->paint.symmetry_flags |= PAINT_SYMM_X;
- if (symmetry_flags & SCULPT_SYMM_Y)
+ }
+ if (symmetry_flags & SCULPT_SYMM_Y) {
sd->paint.symmetry_flags |= PAINT_SYMM_Y;
- if (symmetry_flags & SCULPT_SYMM_Z)
+ }
+ if (symmetry_flags & SCULPT_SYMM_Z) {
sd->paint.symmetry_flags |= PAINT_SYMM_Z;
- if (symmetry_flags & SCULPT_SYMMETRY_FEATHER)
+ }
+ if (symmetry_flags & SCULPT_SYMMETRY_FEATHER) {
sd->paint.symmetry_flags |= PAINT_SYMMETRY_FEATHER;
+ }
}
}
}