Fix Cycles to mostly work with render layer / depsgraph changes.
[blender.git] / intern / cycles / blender / blender_object.cpp
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "render/camera.h"
18 #include "render/integrator.h"
19 #include "render/graph.h"
20 #include "render/light.h"
21 #include "render/mesh.h"
22 #include "render/object.h"
23 #include "render/scene.h"
24 #include "render/nodes.h"
25 #include "render/particles.h"
26 #include "render/shader.h"
27
28 #include "blender/blender_object_cull.h"
29 #include "blender/blender_sync.h"
30 #include "blender/blender_util.h"
31
32 #include "util/util_foreach.h"
33 #include "util/util_hash.h"
34 #include "util/util_logging.h"
35
36 CCL_NAMESPACE_BEGIN
37
38 /* Utilities */
39
40 bool BlenderSync::BKE_object_is_modified(BL::Object& b_ob)
41 {
42         /* test if we can instance or if the object is modified */
43         if(b_ob.type() == BL::Object::type_META) {
44                 /* multi-user and dupli metaballs are fused, can't instance */
45                 return true;
46         }
47         else if(ccl::BKE_object_is_modified(b_ob, b_scene, preview)) {
48                 /* modifiers */
49                 return true;
50         }
51         else {
52                 /* object level material links */
53                 BL::Object::material_slots_iterator slot;
54                 for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot)
55                         if(slot->link() == BL::MaterialSlot::link_OBJECT)
56                                 return true;
57         }
58
59         return false;
60 }
61
62 bool BlenderSync::object_is_mesh(BL::Object& b_ob)
63 {
64         BL::ID b_ob_data = b_ob.data();
65
66         if(!b_ob_data) {
67                 return false;
68         }
69
70         if(b_ob.type() == BL::Object::type_CURVE) {
71                 /* Skip exporting curves without faces, overhead can be
72                  * significant if there are many for path animation. */
73                 BL::Curve b_curve(b_ob.data());
74
75                 return (b_curve.bevel_object() ||
76                         b_curve.extrude() != 0.0f ||
77                         b_curve.bevel_depth() != 0.0f ||
78                         b_curve.dimensions() == BL::Curve::dimensions_2D ||
79                         b_ob.modifiers.length());
80         }
81         else {
82                 return (b_ob_data.is_a(&RNA_Mesh) ||
83                         b_ob_data.is_a(&RNA_Curve) ||
84                         b_ob_data.is_a(&RNA_MetaBall));
85         }
86 }
87
88 bool BlenderSync::object_is_light(BL::Object& b_ob)
89 {
90         BL::ID b_ob_data = b_ob.data();
91
92         return (b_ob_data && b_ob_data.is_a(&RNA_Lamp));
93 }
94
95 static uint object_ray_visibility(BL::Object& b_ob)
96 {
97         PointerRNA cvisibility = RNA_pointer_get(&b_ob.ptr, "cycles_visibility");
98         uint flag = 0;
99
100         flag |= get_boolean(cvisibility, "camera")? PATH_RAY_CAMERA: 0;
101         flag |= get_boolean(cvisibility, "diffuse")? PATH_RAY_DIFFUSE: 0;
102         flag |= get_boolean(cvisibility, "glossy")? PATH_RAY_GLOSSY: 0;
103         flag |= get_boolean(cvisibility, "transmission")? PATH_RAY_TRANSMIT: 0;
104         flag |= get_boolean(cvisibility, "shadow")? PATH_RAY_SHADOW: 0;
105         flag |= get_boolean(cvisibility, "scatter")? PATH_RAY_VOLUME_SCATTER: 0;
106
107         return flag;
108 }
109
110 /* Light */
111
112 void BlenderSync::sync_light(BL::Object& b_parent,
113                              int persistent_id[OBJECT_PERSISTENT_ID_SIZE],
114                              BL::Object& b_ob,
115                              BL::Object& b_ob_instance,
116                              int random_id,
117                              Transform& tfm,
118                              bool *use_portal)
119 {
120         /* test if we need to sync */
121         Light *light;
122         ObjectKey key(b_parent, persistent_id, b_ob_instance);
123
124         if(!light_map.sync(&light, b_ob, b_parent, key)) {
125                 if(light->is_portal)
126                         *use_portal = true;
127                 return;
128         }
129         
130         BL::Lamp b_lamp(b_ob.data());
131
132         /* type */
133         switch(b_lamp.type()) {
134                 case BL::Lamp::type_POINT: {
135                         BL::PointLamp b_point_lamp(b_lamp);
136                         light->size = b_point_lamp.shadow_soft_size();
137                         light->type = LIGHT_POINT;
138                         break;
139                 }
140                 case BL::Lamp::type_SPOT: {
141                         BL::SpotLamp b_spot_lamp(b_lamp);
142                         light->size = b_spot_lamp.shadow_soft_size();
143                         light->type = LIGHT_SPOT;
144                         light->spot_angle = b_spot_lamp.spot_size();
145                         light->spot_smooth = b_spot_lamp.spot_blend();
146                         break;
147                 }
148                 case BL::Lamp::type_HEMI: {
149                         light->type = LIGHT_DISTANT;
150                         light->size = 0.0f;
151                         break;
152                 }
153                 case BL::Lamp::type_SUN: {
154                         BL::SunLamp b_sun_lamp(b_lamp);
155                         light->size = b_sun_lamp.shadow_soft_size();
156                         light->type = LIGHT_DISTANT;
157                         break;
158                 }
159                 case BL::Lamp::type_AREA: {
160                         BL::AreaLamp b_area_lamp(b_lamp);
161                         light->size = 1.0f;
162                         light->axisu = transform_get_column(&tfm, 0);
163                         light->axisv = transform_get_column(&tfm, 1);
164                         light->sizeu = b_area_lamp.size();
165                         if(b_area_lamp.shape() == BL::AreaLamp::shape_RECTANGLE)
166                                 light->sizev = b_area_lamp.size_y();
167                         else
168                                 light->sizev = light->sizeu;
169                         light->type = LIGHT_AREA;
170                         break;
171                 }
172         }
173
174         /* location and (inverted!) direction */
175         light->co = transform_get_column(&tfm, 3);
176         light->dir = -transform_get_column(&tfm, 2);
177         light->tfm = tfm;
178
179         /* shader */
180         vector<Shader*> used_shaders;
181         find_shader(b_lamp, used_shaders, scene->default_light);
182         light->shader = used_shaders[0];
183
184         /* shadow */
185         PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
186         PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles");
187         light->cast_shadow = get_boolean(clamp, "cast_shadow");
188         light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling");
189         
190         int samples = get_int(clamp, "samples");
191         if(get_boolean(cscene, "use_square_samples"))
192                 light->samples = samples * samples;
193         else
194                 light->samples = samples;
195
196         light->max_bounces = get_int(clamp, "max_bounces");
197
198         if(b_ob != b_ob_instance) {
199                 light->random_id = random_id;
200         }
201         else {
202                 light->random_id = hash_int_2d(hash_string(b_ob.name().c_str()), 0);
203         }
204
205         if(light->type == LIGHT_AREA)
206                 light->is_portal = get_boolean(clamp, "is_portal");
207         else
208                 light->is_portal = false;
209
210         if(light->is_portal)
211                 *use_portal = true;
212
213         /* visibility */
214         uint visibility = object_ray_visibility(b_ob);
215         light->use_diffuse = (visibility & PATH_RAY_DIFFUSE) != 0;
216         light->use_glossy = (visibility & PATH_RAY_GLOSSY) != 0;
217         light->use_transmission = (visibility & PATH_RAY_TRANSMIT) != 0;
218         light->use_scatter = (visibility & PATH_RAY_VOLUME_SCATTER) != 0;
219
220         /* tag */
221         light->tag_update(scene);
222 }
223
224 void BlenderSync::sync_background_light(bool use_portal)
225 {
226         BL::World b_world = b_scene.world();
227
228         if(b_world) {
229                 PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
230                 PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
231                 bool sample_as_light = get_boolean(cworld, "sample_as_light");
232
233                 if(sample_as_light || use_portal) {
234                         /* test if we need to sync */
235                         Light *light;
236                         ObjectKey key(b_world, 0, b_world);
237
238                         if(light_map.sync(&light, b_world, b_world, key) ||
239                             world_recalc ||
240                             b_world.ptr.data != world_map)
241                         {
242                                 light->type = LIGHT_BACKGROUND;
243                                 light->map_resolution  = get_int(cworld, "sample_map_resolution");
244                                 light->shader = scene->default_background;
245                                 light->use_mis = sample_as_light;
246                                 light->max_bounces = get_int(cworld, "max_bounces");
247
248                                 int samples = get_int(cworld, "samples");
249                                 if(get_boolean(cscene, "use_square_samples"))
250                                         light->samples = samples * samples;
251                                 else
252                                         light->samples = samples;
253
254                                 light->tag_update(scene);
255                                 light_map.set_recalc(b_world);
256                         }
257                 }
258         }
259
260         world_map = b_world.ptr.data;
261         world_recalc = false;
262 }
263
264 /* Object */
265
266 Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
267                                  BL::Depsgraph::duplis_iterator& b_dupli_iter,
268                                  uint layer_flag,
269                                  float motion_time,
270                                  bool hide_tris,
271                                  BlenderObjectCulling& culling,
272                                  bool *use_portal)
273 {
274         const bool is_instance = b_dupli_iter->is_instance();
275         BL::Object b_ob = b_dupli_iter->object();
276         BL::Object b_parent = is_instance ? b_dupli_iter->parent()
277                                           : b_dupli_iter->object();
278         BL::Object b_ob_instance = is_instance ? b_dupli_iter->instance_object()
279                                                : b_ob;
280         const bool motion = motion_time != 0.0f;
281         /*const*/ Transform tfm = get_transform(b_ob.matrix_world());
282         int *persistent_id = NULL;
283         BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id_array;
284         if(is_instance) {
285                 persistent_id_array = b_dupli_iter->persistent_id();
286                 persistent_id = persistent_id_array.data;
287         }
288
289         /* light is handled separately */
290         if(object_is_light(b_ob)) {
291                 /* don't use lamps for excluded layers used as mask layer */
292                 if(!motion && !((layer_flag & view_layer.holdout_layer) &&
293                                 (layer_flag & view_layer.exclude_layer)))
294                 {
295                         sync_light(b_parent,
296                                    persistent_id,
297                                    b_ob,
298                                    b_ob_instance,
299                                    is_instance ? b_dupli_iter->random_id() : 0,
300                                    tfm,
301                                    use_portal);
302                 }
303
304                 return NULL;
305         }
306
307         /* only interested in object that we can create meshes from */
308         if(!object_is_mesh(b_ob)) {
309                 return NULL;
310         }
311
312         /* Perform object culling. */
313         if(culling.test(scene, b_ob, tfm)) {
314                 return NULL;
315         }
316
317         /* Visibility flags for both parent and child. */
318         PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
319         bool use_holdout = (layer_flag & view_layer.holdout_layer) != 0 ||
320                            get_boolean(cobject, "is_holdout");
321         uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
322
323         if(b_parent.ptr.data != b_ob.ptr.data) {
324                 visibility &= object_ray_visibility(b_parent);
325         }
326
327         /* Make holdout objects on excluded layer invisible for non-camera rays. */
328         if(use_holdout && (layer_flag & view_layer.exclude_layer)) {
329                 visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
330         }
331
332         /* Hide objects not on render layer from camera rays. */
333         if(!(layer_flag & view_layer.layer)) {
334                 visibility &= ~PATH_RAY_CAMERA;
335         }
336
337         /* Don't export completely invisible objects. */
338         if(visibility == 0) {
339                 return NULL;
340         }
341
342         /* key to lookup object */
343         ObjectKey key(b_parent, persistent_id, b_ob_instance);
344         Object *object;
345
346         /* motion vector case */
347         if(motion) {
348                 object = object_map.find(key);
349
350                 if(object && (scene->need_motion() == Scene::MOTION_PASS ||
351                               object_use_motion(b_parent, b_ob)))
352                 {
353                         /* object transformation */
354                         if(tfm != object->tfm) {
355                                 VLOG(1) << "Object " << b_ob.name() << " motion detected.";
356                                 if(motion_time == -1.0f || motion_time == 1.0f) {
357                                         object->use_motion = true;
358                                 }
359                         }
360
361                         if(motion_time == -1.0f) {
362                                 object->motion.pre = tfm;
363                         }
364                         else if(motion_time == 1.0f) {
365                                 object->motion.post = tfm;
366                         }
367
368                         /* mesh deformation */
369                         if(object->mesh)
370                                 sync_mesh_motion(b_depsgraph, b_ob, object, motion_time);
371                 }
372
373                 return object;
374         }
375
376         /* test if we need to sync */
377         bool object_updated = false;
378
379         if(object_map.sync(&object, b_ob, b_parent, key))
380                 object_updated = true;
381         
382         /* mesh sync */
383         object->mesh = sync_mesh(b_depsgraph, b_ob, b_ob_instance, object_updated, hide_tris);
384
385         /* special case not tracked by object update flags */
386
387         /* holdout */
388         if(use_holdout != object->use_holdout) {
389                 object->use_holdout = use_holdout;
390                 scene->object_manager->tag_update(scene);
391                 object_updated = true;
392         }
393
394         if(visibility != object->visibility) {
395                 object->visibility = visibility;
396                 object_updated = true;
397         }
398
399         bool is_shadow_catcher = get_boolean(cobject, "is_shadow_catcher");
400         if(is_shadow_catcher != object->is_shadow_catcher) {
401                 object->is_shadow_catcher = is_shadow_catcher;
402                 object_updated = true;
403         }
404
405         /* object sync
406          * transform comparison should not be needed, but duplis don't work perfect
407          * in the depsgraph and may not signal changes, so this is a workaround */
408         if(object_updated || (object->mesh && object->mesh->need_update) || tfm != object->tfm) {
409                 object->name = b_ob.name().c_str();
410                 object->pass_id = b_ob.pass_index();
411                 object->tfm = tfm;
412                 object->motion.pre = transform_empty();
413                 object->motion.post = transform_empty();
414                 object->use_motion = false;
415
416                 /* motion blur */
417                 if(scene->need_motion() == Scene::MOTION_BLUR && object->mesh) {
418                         Mesh *mesh = object->mesh;
419
420                         mesh->use_motion_blur = false;
421
422                         if(object_use_motion(b_parent, b_ob)) {
423                                 if(object_use_deform_motion(b_parent, b_ob)) {
424                                         mesh->motion_steps = object_motion_steps(b_ob);
425                                         mesh->use_motion_blur = true;
426                                 }
427
428                                 vector<float> times = object->motion_times();
429                                 foreach(float time, times)
430                                         motion_times.insert(time);
431                         }
432                 }
433
434                 /* dupli texture coordinates and random_id */
435                 if(is_instance) {
436                         object->dupli_generated = 0.5f*get_float3(b_dupli_iter->orco()) - make_float3(0.5f, 0.5f, 0.5f);
437                         object->dupli_uv = get_float2(b_dupli_iter->uv());
438                         object->random_id = b_dupli_iter->random_id();
439                 }
440                 else {
441                         object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
442                         object->dupli_uv = make_float2(0.0f, 0.0f);
443                         object->random_id =  hash_int_2d(hash_string(object->name.c_str()), 0);
444                 }
445
446                 object->tag_update(scene);
447         }
448
449         return object;
450 }
451
452 static bool object_render_hide_original(BL::Object::type_enum ob_type,
453                                         BL::Object::dupli_type_enum dupli_type)
454 {
455         /* metaball exception, they duplicate self */
456         if(ob_type == BL::Object::type_META)
457                 return false;
458
459         return (dupli_type == BL::Object::dupli_type_VERTS ||
460                 dupli_type == BL::Object::dupli_type_FACES ||
461                 dupli_type == BL::Object::dupli_type_FRAMES);
462 }
463
464 static bool object_render_hide(BL::Object& b_ob,
465                                bool top_level,
466                                bool parent_hide,
467                                bool& hide_triangles)
468 {
469         /* check if we should render or hide particle emitter */
470         BL::Object::particle_systems_iterator b_psys;
471
472         bool hair_present = false;
473         bool has_particles = false;
474         bool show_emitter = false;
475         bool hide_emitter = false;
476         bool hide_as_dupli_parent = false;
477         bool hide_as_dupli_child_original = false;
478
479         for(b_ob.particle_systems.begin(b_psys); b_psys != b_ob.particle_systems.end(); ++b_psys) {
480                 if((b_psys->settings().render_type() == BL::ParticleSettings::render_type_PATH) &&
481                    (b_psys->settings().type()==BL::ParticleSettings::type_HAIR))
482                         hair_present = true;
483                 has_particles = true;
484         }
485
486         if(has_particles) {
487                 show_emitter = b_ob.show_duplicator_for_render();
488                 hide_emitter = !show_emitter;
489         } else if(b_ob.is_duplicator()) {
490                 if(top_level || b_ob.show_duplicator_for_render()) {
491                         hide_as_dupli_parent = true;
492                 }
493         }
494
495         /* hide original object for duplis */
496         BL::Object parent = b_ob.parent();
497         while(parent) {
498                 if(object_render_hide_original(b_ob.type(),
499                                                parent.dupli_type()))
500                 {
501                         if(parent_hide) {
502                                 hide_as_dupli_child_original = true;
503                                 break;
504                         }
505                 }
506                 parent = parent.parent();
507         }
508         
509         hide_triangles = hide_emitter;
510
511         if(show_emitter) {
512                 return false;
513         }
514         else if(hair_present) {
515                 return hide_as_dupli_child_original;
516         }
517         else {
518                 return (hide_as_dupli_parent || hide_as_dupli_child_original);
519         }
520 }
521
522 /* Object Loop */
523
524 void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
525 {
526         /* layer data */
527         bool motion = motion_time != 0.0f;
528         
529         if(!motion) {
530                 /* prepare for sync */
531                 light_map.pre_sync();
532                 mesh_map.pre_sync();
533                 object_map.pre_sync();
534                 particle_system_map.pre_sync();
535                 motion_times.clear();
536         }
537         else {
538                 mesh_motion_synced.clear();
539         }
540
541         /* initialize culling */
542         BlenderObjectCulling culling(scene, b_scene);
543
544         /* object loop */
545         bool cancel = false;
546         bool use_portal = false;
547
548         BL::Depsgraph::duplis_iterator b_dupli_iter;
549         for(b_depsgraph.duplis.begin(b_dupli_iter);
550             b_dupli_iter != b_depsgraph.duplis.end() && !cancel;
551             ++b_dupli_iter)
552         {
553                 BL::Object b_ob = b_dupli_iter->object();
554                 if(!b_ob.is_visible()) {
555                         continue;
556                 }
557
558                 progress.set_sync_status("Synchronizing object", b_ob.name());
559
560                 /* load per-object culling data */
561                 culling.init_object(scene, b_ob);
562
563                 /* test if object needs to be hidden */
564                 bool hide_tris;
565
566                  if(!object_render_hide(b_ob, true, true, hide_tris)) {
567                         /* object itself */
568                         sync_object(b_depsgraph,
569                                     b_dupli_iter,
570                                     ~(0), /* until we get rid of layers */
571                                     motion_time,
572                                     hide_tris,
573                                     culling,
574                                     &use_portal);
575                  }
576
577                 cancel = progress.get_cancel();
578         }
579
580         progress.set_sync_status("");
581
582         if(!cancel && !motion) {
583                 sync_background_light(use_portal);
584
585                 /* handle removed data and modified pointers */
586                 if(light_map.post_sync())
587                         scene->light_manager->tag_update(scene);
588                 if(mesh_map.post_sync())
589                         scene->mesh_manager->tag_update(scene);
590                 if(object_map.post_sync())
591                         scene->object_manager->tag_update(scene);
592                 if(particle_system_map.post_sync())
593                         scene->particle_system_manager->tag_update(scene);
594         }
595
596         if(motion)
597                 mesh_motion_synced.clear();
598 }
599
600 void BlenderSync::sync_motion(BL::RenderSettings& b_render,
601                               BL::Depsgraph& b_depsgraph,
602                               BL::Object& b_override,
603                               int width, int height,
604                               void **python_thread_state)
605 {
606         if(scene->need_motion() == Scene::MOTION_NONE)
607                 return;
608
609         /* get camera object here to deal with camera switch */
610         BL::Object b_cam = b_scene.camera();
611         if(b_override)
612                 b_cam = b_override;
613
614         Camera prevcam = *(scene->camera);
615
616         int frame_center = b_scene.frame_current();
617         float subframe_center = b_scene.frame_subframe();
618         float frame_center_delta = 0.0f;
619
620         if(scene->need_motion() != Scene::MOTION_PASS &&
621            scene->camera->motion_position != Camera::MOTION_POSITION_CENTER)
622         {
623                 float shuttertime = scene->camera->shuttertime;
624                 if(scene->camera->motion_position == Camera::MOTION_POSITION_END) {
625                         frame_center_delta = -shuttertime * 0.5f;
626                 }
627                 else {
628                         assert(scene->camera->motion_position == Camera::MOTION_POSITION_START);
629                         frame_center_delta = shuttertime * 0.5f;
630                 }
631
632                 /* TODO: move frame on depsgraph. */
633                 float time = frame_center + subframe_center + frame_center_delta;
634                 int frame = (int)floorf(time);
635                 float subframe = time - frame;
636                 python_thread_state_restore(python_thread_state);
637                 b_engine.frame_set(frame, subframe);
638                 python_thread_state_save(python_thread_state);
639                 sync_camera_motion(b_render, b_cam, width, height, 0.0f);
640                 sync_objects(b_depsgraph, 0.0f);
641         }
642
643         /* always sample these times for camera motion */
644         motion_times.insert(-1.0f);
645         motion_times.insert(1.0f);
646
647         /* note iteration over motion_times set happens in sorted order */
648         foreach(float relative_time, motion_times) {
649                 VLOG(1) << "Synchronizing motion for the relative time "
650                         << relative_time << ".";
651
652                 /* fixed shutter time to get previous and next frame for motion pass */
653                 float shuttertime = scene->motion_shutter_time();
654
655                 /* compute frame and subframe time */
656                 float time = frame_center + subframe_center + frame_center_delta + relative_time * shuttertime * 0.5f;
657                 int frame = (int)floorf(time);
658                 float subframe = time - frame;
659
660                 /* TODO: move frame on depsgraph. */
661                 /* change frame */
662                 python_thread_state_restore(python_thread_state);
663                 b_engine.frame_set(frame, subframe);
664                 python_thread_state_save(python_thread_state);
665
666                 /* sync camera, only supports two times at the moment */
667                 if(relative_time == -1.0f || relative_time == 1.0f) {
668                         sync_camera_motion(b_render,
669                                            b_cam,
670                                            width, height,
671                                            relative_time);
672                 }
673
674                 /* sync object */
675                 sync_objects(b_depsgraph, relative_time);
676         }
677
678         /* we need to set the python thread state again because this
679          * function assumes it is being executed from python and will
680          * try to save the thread state */
681         python_thread_state_restore(python_thread_state);
682         b_engine.frame_set(frame_center, subframe_center);
683         python_thread_state_save(python_thread_state);
684
685         /* tag camera for motion update */
686         if(scene->camera->motion_modified(prevcam))
687                 scene->camera->tag_update();
688 }
689
690 CCL_NAMESPACE_END
691