FileBrowser: Editable Bookmarks.
[blender.git] / source / blender / blenloader / intern / versioning_270.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * Contributor(s): Blender Foundation
19  *
20  * ***** END GPL LICENSE BLOCK *****
21  *
22  */
23
24 /** \file blender/blenloader/intern/versioning_270.c
25  *  \ingroup blenloader
26  */
27
28 #include "BLI_utildefines.h"
29 #include "BLI_compiler_attrs.h"
30
31 /* for MinGW32 definition of NULL, could use BLI_blenlib.h instead too */
32 #include <stddef.h>
33
34 /* allow readfile to use deprecated functionality */
35 #define DNA_DEPRECATED_ALLOW
36
37 #include "DNA_brush_types.h"
38 #include "DNA_cloth_types.h"
39 #include "DNA_constraint_types.h"
40 #include "DNA_sdna_types.h"
41 #include "DNA_space_types.h"
42 #include "DNA_screen_types.h"
43 #include "DNA_object_types.h"
44 #include "DNA_mesh_types.h"
45 #include "DNA_modifier_types.h"
46 #include "DNA_particle_types.h"
47 #include "DNA_linestyle_types.h"
48 #include "DNA_actuator_types.h"
49
50 #include "DNA_genfile.h"
51
52 #include "BKE_main.h"
53 #include "BKE_node.h"
54 #include "BKE_screen.h"
55
56 #include "BLI_math.h"
57 #include "BLI_listbase.h"
58 #include "BLI_string.h"
59
60 #include "BLO_readfile.h"
61
62 #include "readfile.h"
63
64 #include "MEM_guardedalloc.h"
65
66 static void do_version_constraints_radians_degrees_270_1(ListBase *lb)
67 {
68         bConstraint *con;
69
70         for (con = lb->first; con; con = con->next) {
71                 if (con->type == CONSTRAINT_TYPE_TRANSFORM) {
72                         bTransformConstraint *data = (bTransformConstraint *)con->data;
73                         const float deg_to_rad_f = DEG2RADF(1.0f);
74
75                         if (data->from == TRANS_ROTATION) {
76                                 mul_v3_fl(data->from_min, deg_to_rad_f);
77                                 mul_v3_fl(data->from_max, deg_to_rad_f);
78                         }
79
80                         if (data->to == TRANS_ROTATION) {
81                                 mul_v3_fl(data->to_min, deg_to_rad_f);
82                                 mul_v3_fl(data->to_max, deg_to_rad_f);
83                         }
84                 }
85         }
86 }
87
88 static void do_version_constraints_radians_degrees_270_5(ListBase *lb)
89 {
90         bConstraint *con;
91
92         for (con = lb->first; con; con = con->next) {
93                 if (con->type == CONSTRAINT_TYPE_TRANSFORM) {
94                         bTransformConstraint *data = (bTransformConstraint *)con->data;
95
96                         if (data->from == TRANS_ROTATION) {
97                                 copy_v3_v3(data->from_min_rot, data->from_min);
98                                 copy_v3_v3(data->from_max_rot, data->from_max);
99                         }
100                         else if (data->from == TRANS_SCALE) {
101                                 copy_v3_v3(data->from_min_scale, data->from_min);
102                                 copy_v3_v3(data->from_max_scale, data->from_max);
103                         }
104
105                         if (data->to == TRANS_ROTATION) {
106                                 copy_v3_v3(data->to_min_rot, data->to_min);
107                                 copy_v3_v3(data->to_max_rot, data->to_max);
108                         }
109                         else if (data->to == TRANS_SCALE) {
110                                 copy_v3_v3(data->to_min_scale, data->to_min);
111                                 copy_v3_v3(data->to_max_scale, data->to_max);
112                         }
113                 }
114         }
115 }
116
117 static void do_version_constraints_stretch_to_limits(ListBase *lb)
118 {
119         bConstraint *con;
120
121         for (con = lb->first; con; con = con->next) {
122                 if (con->type == CONSTRAINT_TYPE_STRETCHTO) {
123                         bStretchToConstraint *data = (bStretchToConstraint *)con->data;
124                         data->bulge_min = 1.0f;
125                         data->bulge_max = 1.0f;
126                 }
127         }
128 }
129
130 void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
131 {
132         if (!MAIN_VERSION_ATLEAST(main, 270, 0)) {
133
134                 if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "float", "profile")) {
135                         Object *ob;
136
137                         for (ob = main->object.first; ob; ob = ob->id.next) {
138                                 ModifierData *md;
139                                 for (md = ob->modifiers.first; md; md = md->next) {
140                                         if (md->type == eModifierType_Bevel) {
141                                                 BevelModifierData *bmd = (BevelModifierData *)md;
142                                                 bmd->profile = 0.5f;
143                                                 bmd->val_flags = MOD_BEVEL_AMT_OFFSET;
144                                         }
145                                 }
146                         }
147                 }
148
149                 /* nodes don't use fixed node->id any more, clean up */
150                 FOREACH_NODETREE(main, ntree, id) {
151                         if (ntree->type == NTREE_COMPOSIT) {
152                                 bNode *node;
153                                 for (node = ntree->nodes.first; node; node = node->next) {
154                                         if (ELEM(node->type, CMP_NODE_COMPOSITE, CMP_NODE_OUTPUT_FILE)) {
155                                                 node->id = NULL;
156                                         }
157                                 }
158                         }
159                 } FOREACH_NODETREE_END
160
161                 {
162                         bScreen *screen;
163
164                         for (screen = main->screen.first; screen; screen = screen->id.next) {
165                                 ScrArea *area;
166                                 for (area = screen->areabase.first; area; area = area->next) {
167                                         SpaceLink *space_link;
168                                         for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
169                                                 if (space_link->spacetype == SPACE_CLIP) {
170                                                         SpaceClip *space_clip = (SpaceClip *) space_link;
171                                                         if (space_clip->mode != SC_MODE_MASKEDIT) {
172                                                                 space_clip->mode = SC_MODE_TRACKING;
173                                                         }
174                                                 }
175                                         }
176                                 }
177                         }
178                 }
179
180                 if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingSettings", "float", "default_weight")) {
181                         MovieClip *clip;
182                         for (clip = main->movieclip.first; clip; clip = clip->id.next) {
183                                 clip->tracking.settings.default_weight = 1.0f;
184                         }
185                 }
186         }
187
188         if (!MAIN_VERSION_ATLEAST(main, 270, 1)) {
189                 Scene *sce;
190                 Object *ob;
191
192                 /* Update Transform constraint (another deg -> rad stuff). */
193                 for (ob = main->object.first; ob; ob = ob->id.next) {
194                         do_version_constraints_radians_degrees_270_1(&ob->constraints);
195
196                         if (ob->pose) {
197                                 /* Bones constraints! */
198                                 bPoseChannel *pchan;
199                                 for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
200                                         do_version_constraints_radians_degrees_270_1(&pchan->constraints);
201                                 }
202                         }
203                 }
204
205                 for (sce = main->scene.first; sce; sce = sce->id.next) {
206                         if (sce->r.raytrace_structure == R_RAYSTRUCTURE_BLIBVH) {
207                                 sce->r.raytrace_structure = R_RAYSTRUCTURE_AUTO;
208                         }
209                 }
210         }
211
212         if (!MAIN_VERSION_ATLEAST(main, 270, 2)) {
213                 Mesh *me;
214
215                 /* Mesh smoothresh deg->rad. */
216                 for (me = main->mesh.first; me; me = me->id.next) {
217                         me->smoothresh = DEG2RADF(me->smoothresh);
218                 }
219         }
220
221         if (!MAIN_VERSION_ATLEAST(main, 270, 3)) {
222                 FreestyleLineStyle *linestyle;
223
224                 for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
225                         linestyle->flag |= LS_NO_SORTING;
226                         linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
227                         linestyle->integration_type = LS_INTEGRATION_MEAN;
228                 }
229         }
230
231         if (!MAIN_VERSION_ATLEAST(main, 270, 4)) {
232                 /* ui_previews were not handled correctly when copying areas, leading to corrupted files (see T39847).
233                  * This will always reset situation to a valid state.
234                  */
235                 bScreen *sc;
236
237                 for (sc = main->screen.first; sc; sc = sc->id.next) {
238                         ScrArea *sa;
239                         for (sa = sc->areabase.first; sa; sa = sa->next) {
240                                 SpaceLink *sl;
241
242                                 for (sl = sa->spacedata.first; sl; sl = sl->next) {
243                                         ARegion *ar;
244                                         ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
245
246                                         for (ar = lb->first; ar; ar = ar->next) {
247                                                 BLI_listbase_clear(&ar->ui_previews);
248                                         }
249                                 }
250                         }
251                 }
252         }
253
254         if (!MAIN_VERSION_ATLEAST(main, 270, 5)) {
255                 Object *ob;
256
257                 /* Update Transform constraint (again :|). */
258                 for (ob = main->object.first; ob; ob = ob->id.next) {
259                         do_version_constraints_radians_degrees_270_5(&ob->constraints);
260
261                         if (ob->pose) {
262                                 /* Bones constraints! */
263                                 bPoseChannel *pchan;
264                                 for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
265                                         do_version_constraints_radians_degrees_270_5(&pchan->constraints);
266                                 }
267                         }
268                 }
269         }
270
271         if (!MAIN_VERSION_ATLEAST(main, 271, 0)) {
272                 if (!DNA_struct_elem_find(fd->filesdna, "Material", "int", "mode2")) {
273                         Material *ma;
274
275                         for (ma = main->mat.first; ma; ma = ma->id.next)
276                                 ma->mode2 = MA_CASTSHADOW;
277                 }
278
279                 if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "BakeData", "bake")) {
280                         Scene *sce;
281
282                         for (sce = main->scene.first; sce; sce = sce->id.next) {
283                                 sce->r.bake.flag = R_BAKE_CLEAR;
284                                 sce->r.bake.width = 512;
285                                 sce->r.bake.height = 512;
286                                 sce->r.bake.margin = 16;
287                                 sce->r.bake.normal_space = R_BAKE_SPACE_TANGENT;
288                                 sce->r.bake.normal_swizzle[0] = R_BAKE_POSX;
289                                 sce->r.bake.normal_swizzle[1] = R_BAKE_POSY;
290                                 sce->r.bake.normal_swizzle[2] = R_BAKE_POSZ;
291                                 BLI_strncpy(sce->r.bake.filepath, U.renderdir, sizeof(sce->r.bake.filepath));
292
293                                 sce->r.bake.im_format.planes = R_IMF_PLANES_RGBA;
294                                 sce->r.bake.im_format.imtype = R_IMF_IMTYPE_PNG;
295                                 sce->r.bake.im_format.depth = R_IMF_CHAN_DEPTH_8;
296                                 sce->r.bake.im_format.quality = 90;
297                                 sce->r.bake.im_format.compress = 15;
298                         }
299                 }
300
301                 if (!DNA_struct_elem_find(fd->filesdna, "FreestyleLineStyle", "float", "texstep")) {
302                         FreestyleLineStyle *linestyle;
303
304                         for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
305                                 linestyle->flag |= LS_TEXTURE;
306                                 linestyle->texstep = 1.0;
307                         }
308                 }
309
310                 {
311                         Scene *scene;
312                         for (scene = main->scene.first; scene; scene = scene->id.next) {
313                                 int num_layers = BLI_listbase_count(&scene->r.layers);
314                                 scene->r.actlay = min_ff(scene->r.actlay, num_layers - 1);
315                         }
316                 }
317         }
318
319         if (!MAIN_VERSION_ATLEAST(main, 271, 1)) {
320                 if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "line_col[4]")) {
321                         Material *mat;
322
323                         for (mat = main->mat.first; mat; mat = mat->id.next) {
324                                 mat->line_col[0] = mat->line_col[1] = mat->line_col[2] = 0.0f;
325                                 mat->line_col[3] = mat->alpha;
326                         }
327                 }
328
329                 if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) {
330                         Scene *scene;
331                         for (scene = main->scene.first; scene; scene = scene->id.next) {
332                                 scene->r.preview_start_resolution = 64;
333                         }
334                 }
335         }
336
337         if (!MAIN_VERSION_ATLEAST(main, 271, 2)) {
338                 /* init up & track axis property of trackto actuators */
339                 Object *ob;
340
341                 for (ob = main->object.first; ob; ob = ob->id.next) {
342                         bActuator *act;
343                         for (act = ob->actuators.first; act; act = act->next) {
344                                 if (act->type == ACT_EDIT_OBJECT) {
345                                         bEditObjectActuator *eoact = act->data;
346                                         eoact->trackflag = ob->trackflag;
347                                         /* if trackflag is pointing +-Z axis then upflag should point Y axis.
348                                          * Rest of trackflag cases, upflag should be point z axis */
349                                         if ((ob->trackflag == OB_POSZ) || (ob->trackflag == OB_NEGZ)) {
350                                                 eoact->upflag = 1;
351                                         }
352                                         else {
353                                                 eoact->upflag = 2;
354                                         }
355                                 }
356                         }
357                 }
358         }
359
360         if (!MAIN_VERSION_ATLEAST(main, 271, 3)) {
361                 Brush *br;
362
363                 for (br = main->brush.first; br; br = br->id.next) {
364                         br->fill_threshold = 0.2f;
365                 }
366
367                 if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "int", "mat")) {
368                         Object *ob;
369                         for (ob = main->object.first; ob; ob = ob->id.next) {
370                                 ModifierData *md;
371
372                                 for (md = ob->modifiers.first; md; md = md->next) {
373                                         if (md->type == eModifierType_Bevel) {
374                                                 BevelModifierData *bmd = (BevelModifierData *)md;
375                                                 bmd->mat = -1;
376                                         }
377                                 }
378                         }
379                 }
380         }
381
382         if (!MAIN_VERSION_ATLEAST(main, 271, 6)) {
383                 Object *ob;
384                 for (ob = main->object.first; ob; ob = ob->id.next) {
385                         ModifierData *md;
386
387                         for (md = ob->modifiers.first; md; md = md->next) {
388                                 if (md->type == eModifierType_ParticleSystem) {
389                                         ParticleSystemModifierData *pmd = (ParticleSystemModifierData *)md;
390                                         if (pmd->psys && pmd->psys->clmd) {
391                                                 pmd->psys->clmd->sim_parms->vel_damping = 1.0f;
392                                         }
393                                 }
394                         }
395                 }
396         }
397
398         if (!MAIN_VERSION_ATLEAST(main, 272, 0)) {
399                 if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) {
400                         Scene *scene;
401                         for (scene = main->scene.first; scene; scene = scene->id.next) {
402                                 scene->r.preview_start_resolution = 64;
403                         }
404                 }
405         }
406
407         if (!MAIN_VERSION_ATLEAST(main, 272, 1)) {
408                 Brush *br;
409                 for (br = main->brush.first; br; br = br->id.next) {
410                         if ((br->ob_mode & OB_MODE_SCULPT) && ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK))
411                                 br->alpha = 1.0f;
412                 }
413         }
414
415         if (!MAIN_VERSION_ATLEAST(main, 272, 2)) {
416                 if (!DNA_struct_elem_find(fd->filesdna, "Image", "float", "gen_color")) {
417                         Image *image;
418                         for (image = main->image.first; image != NULL; image = image->id.next) {
419                                 image->gen_color[3] = 1.0f;
420                         }
421                 }
422
423                 if (!DNA_struct_elem_find(fd->filesdna, "bStretchToConstraint", "float", "bulge_min")) {
424                         Object *ob;
425
426                         /* Update Transform constraint (again :|). */
427                         for (ob = main->object.first; ob; ob = ob->id.next) {
428                                 do_version_constraints_stretch_to_limits(&ob->constraints);
429
430                                 if (ob->pose) {
431                                         /* Bones constraints! */
432                                         bPoseChannel *pchan;
433                                         for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
434                                                 do_version_constraints_stretch_to_limits(&pchan->constraints);
435                                         }
436                                 }
437                         }
438                 }
439         }
440
441         if (!MAIN_VERSION_ATLEAST(main, 273, 1)) {
442 #define BRUSH_RAKE (1 << 7)
443 #define BRUSH_RANDOM_ROTATION (1 << 25)
444
445                 Brush *br;
446
447                 for (br = main->brush.first; br; br = br->id.next) {
448                         if (br->flag & BRUSH_RAKE) {
449                                 br->mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
450                                 br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
451                         }
452                         else if (br->flag & BRUSH_RANDOM_ROTATION) {
453                                 br->mtex.brush_angle_mode |= MTEX_ANGLE_RANDOM;
454                                 br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RANDOM;
455                         }
456                         br->mtex.random_angle = 2.0 * M_PI;
457                         br->mask_mtex.random_angle = 2.0 * M_PI;
458                 }
459
460 #undef BRUSH_RAKE
461 #undef BRUSH_RANDOM_ROTATION
462         }
463
464         /* Customizable Safe Areas */
465         if (!MAIN_VERSION_ATLEAST(main, 273, 2)) {
466                 if (!DNA_struct_elem_find(fd->filesdna, "Scene", "DisplaySafeAreas", "safe_areas")) {
467                         Scene *scene;
468
469                         for (scene = main->scene.first; scene; scene = scene->id.next) {
470                                 copy_v2_fl2(scene->safe_areas.title, 3.5f / 100.0f, 3.5f / 100.0f);
471                                 copy_v2_fl2(scene->safe_areas.action, 10.0f / 100.0f, 5.0f / 100.0f);
472                                 copy_v2_fl2(scene->safe_areas.title_center, 17.5f / 100.0f, 5.0f / 100.0f);
473                                 copy_v2_fl2(scene->safe_areas.action_center, 15.0f / 100.0f, 5.0f / 100.0f);
474                         }
475                 }
476         }
477         
478         if (!MAIN_VERSION_ATLEAST(main, 273, 3)) {
479                 ParticleSettings *part;
480                 for (part = main->particle.first; part; part = part->id.next) {
481                         if (part->clumpcurve)
482                                 part->child_flag |= PART_CHILD_USE_CLUMP_CURVE;
483                         if (part->roughcurve)
484                                 part->child_flag |= PART_CHILD_USE_ROUGH_CURVE;
485                 }
486         }
487
488         if (!MAIN_VERSION_ATLEAST(main, 273, 6)) {
489                 if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "float", "bending_damping")) {
490                         Object *ob;
491                         ModifierData *md;
492                         for (ob = main->object.first; ob; ob = ob->id.next) {
493                                 for (md = ob->modifiers.first; md; md = md->next) {
494                                         if (md->type == eModifierType_Cloth) {
495                                                 ClothModifierData *clmd = (ClothModifierData *)md;
496                                                 clmd->sim_parms->bending_damping = 0.5f;
497                                         }
498                                         else if (md->type == eModifierType_ParticleSystem) {
499                                                 ParticleSystemModifierData *pmd = (ParticleSystemModifierData *)md;
500                                                 if (pmd->psys->clmd) {
501                                                         pmd->psys->clmd->sim_parms->bending_damping = 0.5f;
502                                                 }
503                                         }
504                                 }
505                         }
506                 }
507
508                 if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "float", "clump_noise_size")) {
509                         ParticleSettings *part;
510                         for (part = main->particle.first; part; part = part->id.next) {
511                                 part->clump_noise_size = 1.0f;
512                         }
513                 }
514
515                 if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "int", "kink_extra_steps")) {
516                         ParticleSettings *part;
517                         for (part = main->particle.first; part; part = part->id.next) {
518                                 part->kink_extra_steps = 4;
519                         }
520                 }
521
522                 if (!DNA_struct_elem_find(fd->filesdna, "MTex", "float", "kinkampfac")) {
523                         ParticleSettings *part;
524                         for (part = main->particle.first; part; part = part->id.next) {
525                                 int a;
526                                 for (a = 0; a < MAX_MTEX; a++) {
527                                         MTex *mtex = part->mtex[a];
528                                         if (mtex) {
529                                                 mtex->kinkampfac = 1.0f;
530                                         }
531                                 }
532                         }
533                 }
534
535                 if (!DNA_struct_elem_find(fd->filesdna, "HookModifierData", "char", "flag")) {
536                         Object *ob;
537
538                         for (ob = main->object.first; ob; ob = ob->id.next) {
539                                 ModifierData *md;
540                                 for (md = ob->modifiers.first; md; md = md->next) {
541                                         if (md->type == eModifierType_Hook) {
542                                                 HookModifierData *hmd = (HookModifierData *)md;
543                                                 hmd->falloff_type = eHook_Falloff_InvSquare;
544                                         }
545                                 }
546                         }
547                 }
548
549                 if (!DNA_struct_elem_find(fd->filesdna, "NodePlaneTrackDeformData", "char", "flag")) {
550                         FOREACH_NODETREE(main, ntree, id) {
551                                 if (ntree->type == NTREE_COMPOSIT) {
552                                         bNode *node;
553                                         for (node = ntree->nodes.first; node; node = node->next) {
554                                                 if (ELEM(node->type, CMP_NODE_PLANETRACKDEFORM)) {
555                                                         NodePlaneTrackDeformData *data = node->storage;
556                                                         data->flag = 0;
557                                                         data->motion_blur_samples = 16;
558                                                         data->motion_blur_shutter = 0.5f;
559                                                 }
560                                         }
561                                 }
562                         }
563                         FOREACH_NODETREE_END
564                 }
565         }
566
567         if (!MAIN_VERSION_ATLEAST(main, 273, 7)) {
568                 bScreen *scr;
569                 ScrArea *sa;
570                 SpaceLink *sl;
571                 ARegion *ar;
572
573                 for (scr = main->screen.first; scr; scr = scr->id.next) {
574                         /* Remove old deprecated region from filebrowsers */
575                         for (sa = scr->areabase.first; sa; sa = sa->next) {
576                                 for (sl = sa->spacedata.first; sl; sl = sl->next) {
577                                         if (sl->spacetype == SPACE_FILE) {
578                                                 for (ar = sl->regionbase.first; ar; ar = ar->next) {
579                                                         if (ar->regiontype == RGN_TYPE_CHANNELS) {
580                                                                 break;
581                                                         }
582                                                 }
583
584                                                 if (ar) {
585                                                         /* Free old deprecated 'channel' region... */
586                                                         BKE_area_region_free(NULL, ar);
587                                                         BLI_freelinkN(&sl->regionbase, ar);
588                                                 }
589                                         }
590                                 }
591                         }
592                 }
593         }
594 }