Merged changes in the trunk up to revision 41768.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 12 Nov 2011 23:12:30 +0000 (23:12 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 12 Nov 2011 23:12:30 +0000 (23:12 +0000)
Conflicts resolved:
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_enum_types.h
source/blender/render/intern/source/shadeinput.c
source/blenderplayer/bad_level_call_stubs/stubs.c

Additional changes:

* source/blender/makesrna/intern/rna_linestyle.c: Fixed white
space issues that generated a number of compiler errors.  The
problem was that two string literals for enumerating MA_RAMP_SOFT
and MA_RAMP_LINEAR contained a space.  The string literals are
supposed to represent a valid C identifier because of their use
for automatic code generation.

* Stroke transparency has been temporarily disabled due to a
functionality conflict with some merged changes.  A fix of this
issue is planned.

718 files changed:
CMakeLists.txt
SConstruct
build_files/buildbot/config/user-config-i686.py
build_files/buildbot/config/user-config-player-i686.py
build_files/buildbot/config/user-config-player-x86_64.py
build_files/buildbot/config/user-config-x86_64.py
build_files/cmake/Modules/FindOpenImageIO.cmake [new file with mode: 0644]
build_files/cmake/cmake_consistency_check.py
build_files/cmake/cmake_netbeans_project.py
build_files/cmake/config/blender_lite.cmake
build_files/cmake/macros.cmake
build_files/scons/config/darwin-config.py
build_files/scons/config/linux-config.py
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
build_files/scons/tools/mstoolkit.py
intern/CMakeLists.txt
intern/SConscript
intern/audaspace/CMakeLists.txt
intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
intern/audaspace/intern/AUD_ConverterReader.cpp
intern/boolop/intern/BOP_Face2Face.cpp
intern/boolop/intern/BOP_Interface.cpp
intern/boolop/intern/BOP_Mesh.cpp
intern/bsp/intern/CSG_BooleanOps.cpp
intern/container/CTR_UHeap.h
intern/cycles/CMakeLists.txt [new file with mode: 0644]
intern/cycles/SConscript [new file with mode: 0644]
intern/cycles/app/CMakeLists.txt [new file with mode: 0644]
intern/cycles/app/cycles_server.cpp [new file with mode: 0644]
intern/cycles/app/cycles_test.cpp [new file with mode: 0644]
intern/cycles/app/cycles_xml.cpp [new file with mode: 0644]
intern/cycles/app/cycles_xml.h [new file with mode: 0644]
intern/cycles/blender/CMakeLists.txt [new file with mode: 0644]
intern/cycles/blender/addon/__init__.py [new file with mode: 0644]
intern/cycles/blender/addon/engine.py [new file with mode: 0644]
intern/cycles/blender/addon/enums.py [new file with mode: 0644]
intern/cycles/blender/addon/presets.py [new file with mode: 0644]
intern/cycles/blender/addon/properties.py [new file with mode: 0644]
intern/cycles/blender/addon/ui.py [new file with mode: 0644]
intern/cycles/blender/addon/xml.py [new file with mode: 0644]
intern/cycles/blender/blender_camera.cpp [new file with mode: 0644]
intern/cycles/blender/blender_mesh.cpp [new file with mode: 0644]
intern/cycles/blender/blender_object.cpp [new file with mode: 0644]
intern/cycles/blender/blender_python.cpp [new file with mode: 0644]
intern/cycles/blender/blender_session.cpp [new file with mode: 0644]
intern/cycles/blender/blender_session.h [new file with mode: 0644]
intern/cycles/blender/blender_shader.cpp [new file with mode: 0644]
intern/cycles/blender/blender_sync.cpp [new file with mode: 0644]
intern/cycles/blender/blender_sync.h [new file with mode: 0644]
intern/cycles/blender/blender_util.h [new file with mode: 0644]
intern/cycles/bvh/CMakeLists.txt [new file with mode: 0644]
intern/cycles/bvh/bvh.cpp [new file with mode: 0644]
intern/cycles/bvh/bvh.h [new file with mode: 0644]
intern/cycles/bvh/bvh_build.cpp [new file with mode: 0644]
intern/cycles/bvh/bvh_build.h [new file with mode: 0644]
intern/cycles/bvh/bvh_node.cpp [new file with mode: 0644]
intern/cycles/bvh/bvh_node.h [new file with mode: 0644]
intern/cycles/bvh/bvh_params.h [new file with mode: 0644]
intern/cycles/bvh/bvh_sort.cpp [new file with mode: 0644]
intern/cycles/bvh/bvh_sort.h [new file with mode: 0644]
intern/cycles/cmake/external_libs.cmake [new file with mode: 0644]
intern/cycles/device/CMakeLists.txt [new file with mode: 0644]
intern/cycles/device/device.cpp [new file with mode: 0644]
intern/cycles/device/device.h [new file with mode: 0644]
intern/cycles/device/device_cpu.cpp [new file with mode: 0644]
intern/cycles/device/device_cuda.cpp [new file with mode: 0644]
intern/cycles/device/device_intern.h [new file with mode: 0644]
intern/cycles/device/device_memory.h [new file with mode: 0644]
intern/cycles/device/device_multi.cpp [new file with mode: 0644]
intern/cycles/device/device_network.cpp [new file with mode: 0644]
intern/cycles/device/device_network.h [new file with mode: 0644]
intern/cycles/device/device_opencl.cpp [new file with mode: 0644]
intern/cycles/doc/CMakeLists.txt [new file with mode: 0644]
intern/cycles/doc/license/Apache_2.0.txt [new file with mode: 0644]
intern/cycles/doc/license/Blender.txt [new file with mode: 0644]
intern/cycles/doc/license/Boost.txt [new file with mode: 0644]
intern/cycles/doc/license/CMakeLists.txt [new file with mode: 0644]
intern/cycles/doc/license/GPL.txt [new file with mode: 0644]
intern/cycles/doc/license/ILM.txt [new file with mode: 0644]
intern/cycles/doc/license/NVidia.txt [new file with mode: 0644]
intern/cycles/doc/license/OSL.txt [new file with mode: 0644]
intern/cycles/doc/license/Sobol.txt [new file with mode: 0644]
intern/cycles/doc/license/readme.txt [new file with mode: 0644]
intern/cycles/kernel/CMakeLists.txt [new file with mode: 0644]
intern/cycles/kernel/kernel.cl [new file with mode: 0644]
intern/cycles/kernel/kernel.cpp [new file with mode: 0644]
intern/cycles/kernel/kernel.cu [new file with mode: 0644]
intern/cycles/kernel/kernel.h [new file with mode: 0644]
intern/cycles/kernel/kernel_bvh.h [new file with mode: 0644]
intern/cycles/kernel/kernel_camera.h [new file with mode: 0644]
intern/cycles/kernel/kernel_compat_cpu.h [new file with mode: 0644]
intern/cycles/kernel/kernel_compat_cuda.h [new file with mode: 0644]
intern/cycles/kernel/kernel_compat_opencl.h [new file with mode: 0644]
intern/cycles/kernel/kernel_differential.h [new file with mode: 0644]
intern/cycles/kernel/kernel_displace.h [new file with mode: 0644]
intern/cycles/kernel/kernel_emission.h [new file with mode: 0644]
intern/cycles/kernel/kernel_film.h [new file with mode: 0644]
intern/cycles/kernel/kernel_globals.h [new file with mode: 0644]
intern/cycles/kernel/kernel_light.h [new file with mode: 0644]
intern/cycles/kernel/kernel_math.h [new file with mode: 0644]
intern/cycles/kernel/kernel_mbvh.h [new file with mode: 0644]
intern/cycles/kernel/kernel_montecarlo.h [new file with mode: 0644]
intern/cycles/kernel/kernel_object.h [new file with mode: 0644]
intern/cycles/kernel/kernel_path.h [new file with mode: 0644]
intern/cycles/kernel/kernel_qbvh.h [new file with mode: 0644]
intern/cycles/kernel/kernel_random.h [new file with mode: 0644]
intern/cycles/kernel/kernel_shader.h [new file with mode: 0644]
intern/cycles/kernel/kernel_textures.h [new file with mode: 0644]
intern/cycles/kernel/kernel_triangle.h [new file with mode: 0644]
intern/cycles/kernel/kernel_types.h [new file with mode: 0644]
intern/cycles/kernel/osl/CMakeLists.txt [new file with mode: 0644]
intern/cycles/kernel/osl/background.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_diffuse.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_microfacet.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_reflection.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_refraction.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_transparent.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_ward.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bsdf_westin.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/bssrdf.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/debug.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/emissive.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/CMakeLists.txt [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_add_closure.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_attribute.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_background.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_blend_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_blend_weight.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_bump.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_clouds_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_color.h [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_convert_from_color.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_convert_from_float.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_convert_from_normal.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_convert_from_point.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_convert_from_vector.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_diffuse_bsdf.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_distorted_noise_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_emission.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_environment_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_fresnel.h [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_fresnel.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_geometry.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_glossy_bsdf.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_holdout.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_image_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_light_path.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_magic_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_mapping.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_marble_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_math.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_mix.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_mix_closure.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_noise_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_output_displacement.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_output_surface.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_output_volume.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_sky_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_stucci_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_texture.h [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_texture_coordinate.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_translucent_bsdf.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_transparent_bsdf.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_value.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_vector_math.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_velvet_bsdf.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_voronoi_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_ward_bsdf.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/node_wood_texture.osl [new file with mode: 0644]
intern/cycles/kernel/osl/nodes/stdosl.h [new file with mode: 0644]
intern/cycles/kernel/osl/osl_closures.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/osl_closures.h [new file with mode: 0644]
intern/cycles/kernel/osl/osl_globals.h [new file with mode: 0644]
intern/cycles/kernel/osl/osl_services.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/osl_services.h [new file with mode: 0644]
intern/cycles/kernel/osl/osl_shader.cpp [new file with mode: 0644]
intern/cycles/kernel/osl/osl_shader.h [new file with mode: 0644]
intern/cycles/kernel/osl/vol_subsurface.cpp [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_ashikhmin_velvet.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_diffuse.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_microfacet.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_reflection.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_refraction.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_transparent.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_ward.h [new file with mode: 0644]
intern/cycles/kernel/svm/bsdf_westin.h [new file with mode: 0644]
intern/cycles/kernel/svm/emissive.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_attribute.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_bsdf.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_closure.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_convert.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_displace.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_fresnel.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_geometry.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_gradient.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_image.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_light_path.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_magic.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_mapping.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_math.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_mix.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_musgrave.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_noise.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_noisetex.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_sky.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_tex_coord.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_texture.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_types.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_value.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_voronoi.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_wave.h [new file with mode: 0644]
intern/cycles/kernel/svm/volume.h [new file with mode: 0644]
intern/cycles/render/CMakeLists.txt [new file with mode: 0644]
intern/cycles/render/attribute.cpp [new file with mode: 0644]
intern/cycles/render/attribute.h [new file with mode: 0644]
intern/cycles/render/background.cpp [new file with mode: 0644]
intern/cycles/render/background.h [new file with mode: 0644]
intern/cycles/render/buffers.cpp [new file with mode: 0644]
intern/cycles/render/buffers.h [new file with mode: 0644]
intern/cycles/render/camera.cpp [new file with mode: 0644]
intern/cycles/render/camera.h [new file with mode: 0644]
intern/cycles/render/film.cpp [new file with mode: 0644]
intern/cycles/render/film.h [new file with mode: 0644]
intern/cycles/render/filter.cpp [new file with mode: 0644]
intern/cycles/render/filter.h [new file with mode: 0644]
intern/cycles/render/graph.cpp [new file with mode: 0644]
intern/cycles/render/graph.h [new file with mode: 0644]
intern/cycles/render/image.cpp [new file with mode: 0644]
intern/cycles/render/image.h [new file with mode: 0644]
intern/cycles/render/integrator.cpp [new file with mode: 0644]
intern/cycles/render/integrator.h [new file with mode: 0644]
intern/cycles/render/light.cpp [new file with mode: 0644]
intern/cycles/render/light.h [new file with mode: 0644]
intern/cycles/render/mesh.cpp [new file with mode: 0644]
intern/cycles/render/mesh.h [new file with mode: 0644]
intern/cycles/render/mesh_displace.cpp [new file with mode: 0644]
intern/cycles/render/nodes.cpp [new file with mode: 0644]
intern/cycles/render/nodes.h [new file with mode: 0644]
intern/cycles/render/object.cpp [new file with mode: 0644]
intern/cycles/render/object.h [new file with mode: 0644]
intern/cycles/render/osl.cpp [new file with mode: 0644]
intern/cycles/render/osl.h [new file with mode: 0644]
intern/cycles/render/scene.cpp [new file with mode: 0644]
intern/cycles/render/scene.h [new file with mode: 0644]
intern/cycles/render/session.cpp [new file with mode: 0644]
intern/cycles/render/session.h [new file with mode: 0644]
intern/cycles/render/shader.cpp [new file with mode: 0644]
intern/cycles/render/shader.h [new file with mode: 0644]
intern/cycles/render/sobol.cpp [new file with mode: 0644]
intern/cycles/render/sobol.h [new file with mode: 0644]
intern/cycles/render/svm.cpp [new file with mode: 0644]
intern/cycles/render/svm.h [new file with mode: 0644]
intern/cycles/render/tile.cpp [new file with mode: 0644]
intern/cycles/render/tile.h [new file with mode: 0644]
intern/cycles/subd/CMakeLists.txt [new file with mode: 0644]
intern/cycles/subd/subd_build.cpp [new file with mode: 0644]
intern/cycles/subd/subd_build.h [new file with mode: 0644]
intern/cycles/subd/subd_dice.cpp [new file with mode: 0644]
intern/cycles/subd/subd_dice.h [new file with mode: 0644]
intern/cycles/subd/subd_edge.h [new file with mode: 0644]
intern/cycles/subd/subd_face.h [new file with mode: 0644]
intern/cycles/subd/subd_mesh.cpp [new file with mode: 0644]
intern/cycles/subd/subd_mesh.h [new file with mode: 0644]
intern/cycles/subd/subd_patch.cpp [new file with mode: 0644]
intern/cycles/subd/subd_patch.h [new file with mode: 0644]
intern/cycles/subd/subd_ring.cpp [new file with mode: 0644]
intern/cycles/subd/subd_ring.h [new file with mode: 0644]
intern/cycles/subd/subd_split.cpp [new file with mode: 0644]
intern/cycles/subd/subd_split.h [new file with mode: 0644]
intern/cycles/subd/subd_stencil.cpp [new file with mode: 0644]
intern/cycles/subd/subd_stencil.h [new file with mode: 0644]
intern/cycles/subd/subd_vert.h [new file with mode: 0644]
intern/cycles/util/CMakeLists.txt [new file with mode: 0644]
intern/cycles/util/util_algorithm.h [new file with mode: 0644]
intern/cycles/util/util_args.h [new file with mode: 0644]
intern/cycles/util/util_boundbox.h [new file with mode: 0644]
intern/cycles/util/util_cache.cpp [new file with mode: 0644]
intern/cycles/util/util_cache.h [new file with mode: 0644]
intern/cycles/util/util_color.h [new file with mode: 0644]
intern/cycles/util/util_cuda.cpp [new file with mode: 0644]
intern/cycles/util/util_cuda.h [new file with mode: 0644]
intern/cycles/util/util_debug.h [new file with mode: 0644]
intern/cycles/util/util_dynlib.cpp [new file with mode: 0644]
intern/cycles/util/util_dynlib.h [new file with mode: 0644]
intern/cycles/util/util_foreach.h [new file with mode: 0644]
intern/cycles/util/util_function.h [new file with mode: 0644]
intern/cycles/util/util_hash.h [new file with mode: 0644]
intern/cycles/util/util_image.h [new file with mode: 0644]
intern/cycles/util/util_list.h [new file with mode: 0644]
intern/cycles/util/util_map.h [new file with mode: 0644]
intern/cycles/util/util_math.h [new file with mode: 0644]
intern/cycles/util/util_md5.cpp [new file with mode: 0644]
intern/cycles/util/util_md5.h [new file with mode: 0644]
intern/cycles/util/util_memarena.cpp [new file with mode: 0644]
intern/cycles/util/util_memarena.h [new file with mode: 0644]
intern/cycles/util/util_opencl.c [new file with mode: 0755]
intern/cycles/util/util_opencl.h [new file with mode: 0755]
intern/cycles/util/util_opengl.h [new file with mode: 0644]
intern/cycles/util/util_param.h [new file with mode: 0644]
intern/cycles/util/util_path.cpp [new file with mode: 0644]
intern/cycles/util/util_path.h [new file with mode: 0644]
intern/cycles/util/util_progress.h [new file with mode: 0644]
intern/cycles/util/util_set.h [new file with mode: 0644]
intern/cycles/util/util_string.cpp [new file with mode: 0644]
intern/cycles/util/util_string.h [new file with mode: 0644]
intern/cycles/util/util_system.cpp [new file with mode: 0644]
intern/cycles/util/util_system.h [new file with mode: 0644]
intern/cycles/util/util_thread.h [new file with mode: 0644]
intern/cycles/util/util_time.cpp [new file with mode: 0644]
intern/cycles/util/util_time.h [new file with mode: 0644]
intern/cycles/util/util_transform.cpp [new file with mode: 0644]
intern/cycles/util/util_transform.h [new file with mode: 0644]
intern/cycles/util/util_types.h [new file with mode: 0644]
intern/cycles/util/util_vector.h [new file with mode: 0644]
intern/cycles/util/util_view.cpp [new file with mode: 0644]
intern/cycles/util/util_view.h [new file with mode: 0644]
intern/cycles/util/util_xml.h [new file with mode: 0644]
intern/decimation/intern/LOD_QSDecimator.cpp
intern/ghost/GHOST_ISystem.h
intern/ghost/GHOST_ISystemPaths.h
intern/ghost/intern/GHOST_DisplayManagerCarbon.cpp
intern/ghost/intern/GHOST_System.h
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemPaths.h
intern/ghost/intern/GHOST_SystemPathsCocoa.h
intern/ghost/intern/GHOST_SystemPathsWin32.h
intern/ghost/intern/GHOST_SystemPathsX11.h
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/test/gears/GHOST_Test.cpp
intern/memutil/MEM_CacheLimiter.h
release/datafiles/fonts/droidsans.ttf.gz
release/plugins/sequence/dnr.c
release/plugins/sequence/gamma.c
release/scripts/presets/cycles/integrator/direct_light.py [new file with mode: 0644]
release/scripts/presets/cycles/integrator/full_global_illumination.py [new file with mode: 0644]
release/scripts/presets/cycles/integrator/limited_global_illumination.py [new file with mode: 0644]
release/scripts/startup/bl_operators/add_mesh_torus.py
release/scripts/startup/bl_operators/presets.py
release/scripts/startup/bl_operators/uvcalc_follow_active.py
release/scripts/startup/bl_operators/uvcalc_lightmap.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_data_camera.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_data_speaker.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_material.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_physics_cloth.py
release/scripts/startup/bl_ui/properties_physics_common.py
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py [new file with mode: 0644]
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/properties_physics_fluid.py
release/scripts/startup/bl_ui/properties_physics_smoke.py
release/scripts/startup/bl_ui/properties_physics_softbody.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_graph.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_nla.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_time.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/CMakeLists.txt
source/blender/SConscript
source/blender/avi/intern/avi.c
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/intern/blf_translation.c
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_anim.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_bmfont.h
source/blender/blenkernel/BKE_bvhutils.h
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/BKE_dynamicpaint.h [new file with mode: 0644]
source/blender/blenkernel/BKE_fluidsim.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/BKE_pointcache.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/dynamicpaint.c [new file with mode: 0644]
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/BLI_fnmatch.h
source/blender/blenlib/BLI_math_geom.h
source/blender/blenlib/BLI_pbvh.h
source/blender/blenlib/BLI_threads.h
source/blender/blenlib/BLI_vfontdata.h
source/blender/blenlib/intern/BLI_heap.c
source/blender/blenlib/intern/edgehash.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/pbvh.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/threads.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/ArmatureImporter.h
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/poseobject.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/curve_intern.h
source/blender/editors/curve/editcurve.c
source/blender/editors/datafiles/blender_icons.png.c
source/blender/editors/include/ED_image.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_sculpt.h
source/blender/editors/include/ED_uvedit.h
source/blender/editors/include/UI_icons.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_lib.c
source/blender/editors/mesh/editmesh_loop.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/CMakeLists.txt
source/blender/editors/physics/dynamicpaint_ops.c [new file with mode: 0644]
source/blender/editors/physics/physics_intern.h
source/blender/editors/physics/physics_ops.c
source/blender/editors/screen/screen_context.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_buttons/CMakeLists.txt
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_intern.h
source/blender/editors/space_buttons/buttons_texture.c [new file with mode: 0644]
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_graph_ops.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_graph/graph_select.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_select.c
source/blender/editors/space_node/CMakeLists.txt
source/blender/editors/space_node/SConscript
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_text/text_intern.h
source/blender/editors/space_time/space_time.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/intern/gpu_shader_material.glsl
source/blender/gpu/intern/gpu_shader_material.glsl.c
source/blender/ikplugin/intern/iksolver_plugin.c
source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/intern/IMB_indexer.h
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/png.c
source/blender/imbuf/intern/scaling.c
source/blender/imbuf/intern/thumbs_blend.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_dynamicpaint_types.h [new file with mode: 0644]
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_object_force.h
source/blender/makesdna/DNA_sensor_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_animviz.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_dynamicpaint.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_lamp.c
source/blender/makesrna/intern/rna_linestyle.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_meta.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_movieclip.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/MOD_modifiertypes.h
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_dynamicpaint.c [new file with mode: 0644]
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_smooth.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_util.h
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/nodes/CMakeLists.txt
source/blender/nodes/NOD_composite.h
source/blender/nodes/NOD_shader.h
source/blender/nodes/SConscript
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
source/blender/nodes/composite/nodes/node_composite_blur.c
source/blender/nodes/composite/nodes/node_composite_channelMatte.c
source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
source/blender/nodes/composite/nodes/node_composite_colorMatte.c
source/blender/nodes/composite/nodes/node_composite_colorbalance.c
source/blender/nodes/composite/nodes/node_composite_curves.c
source/blender/nodes/composite/nodes/node_composite_defocus.c
source/blender/nodes/composite/nodes/node_composite_diffMatte.c
source/blender/nodes/composite/nodes/node_composite_directionalblur.c
source/blender/nodes/composite/nodes/node_composite_displace.c
source/blender/nodes/composite/nodes/node_composite_gamma.c
source/blender/nodes/composite/nodes/node_composite_glare.c
source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
source/blender/nodes/composite/nodes/node_composite_huecorrect.c
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/nodes/composite/nodes/node_composite_invert.c
source/blender/nodes/composite/nodes/node_composite_levels.c
source/blender/nodes/composite/nodes/node_composite_mapUV.c
source/blender/nodes/composite/nodes/node_composite_math.c
source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
source/blender/nodes/composite/nodes/node_composite_rotate.c
source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/nodes/shader/node_shader_util.c
source/blender/nodes/shader/node_shader_util.h
source/blender/nodes/shader/nodes/node_shader_add_shader.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_attribute.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_background.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_emission.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_fresnel.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_geom.c
source/blender/nodes/shader/nodes/node_shader_geometry.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_holdout.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_layer_weight.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_light_path.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_mapping.c
source/blender/nodes/shader/nodes/node_shader_math.c
source/blender/nodes/shader/nodes/node_shader_mixRgb.c
source/blender/nodes/shader/nodes/node_shader_mix_shader.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_output_lamp.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_output_material.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_output_world.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_rgb.c
source/blender/nodes/shader/nodes/node_shader_tex_coord.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_environment.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_gradient.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_image.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_magic.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_noise.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_sky.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_tex_wave.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_valToRgb.c
source/blender/nodes/shader/nodes/node_shader_value.c
source/blender/nodes/shader/nodes/node_shader_vectMath.c
source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c [new file with mode: 0644]
source/blender/nodes/shader/nodes/node_shader_volume_transparent.c [new file with mode: 0644]
source/blender/nodes/texture/node_texture_tree.c
source/blender/python/SConscript
source/blender/python/generic/noise_py_api.c
source/blender/python/intern/CMakeLists.txt
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_rna.c
source/blender/python/mathutils/mathutils_Quaternion.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/quicktime/apple/qtkit_import.m
source/blender/quicktime/apple/quicktime_export.c
source/blender/quicktime/apple/quicktime_import.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/extern/include/RE_render_ext.h
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/include/pointdensity.h
source/blender/render/intern/include/texture.h
source/blender/render/intern/include/voxeldata.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/pointdensity.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/voxeldata.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Expressions/IntValue.h
source/gameengine/GameLogic/SCA_MouseSensor.h
source/gameengine/GamePlayer/common/GPC_Canvas.cpp
source/gameengine/Ketsji/BL_Action.cpp
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/KX_Dome.cpp
source/gameengine/Ketsji/KX_IpoActuator.h
source/gameengine/Ketsji/KX_MouseFocusSensor.h
source/gameengine/Ketsji/KX_NearSensor.h
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/VideoTexture/Texture.h

index 43f52eff0091d719be1ec1e0721ac9d9f97c6407..36ef022f3c10291f19fe091d00563cd0ae744a45 100644 (file)
@@ -213,6 +213,12 @@ if(UNIX AND NOT APPLE)
 endif()
 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
 
+# Cycles
+option(WITH_CYCLES                                     "Enable cycles Render Engine" ON)
+option(WITH_CYCLES_TEST                                "Build cycles test application" OFF)
+option(WITH_CYCLES_CUDA_BINARIES       "Build cycles CUDA binaries" OFF)
+set(CYCLES_CUDA_BINARIES_ARCH          sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build binaries for")
+
 # disable for now, but plan to support on all platforms eventually
 option(WITH_MEM_JEMALLOC   "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
 mark_as_advanced(WITH_MEM_JEMALLOC)
@@ -284,6 +290,12 @@ if(WITH_PYTHON_MODULE)
        set(WITH_HEADLESS ON)
 endif()
 
+# auto enable openimageio and boost for cycles
+if(WITH_CYCLES)
+       set(WITH_OPENIMAGEIO ON)
+       set(WITH_BOOST ON)
+endif()
+
 TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
 
 # don't store paths to libs for portable distrobution
@@ -349,6 +361,19 @@ if(UNIX AND NOT APPLE)
                set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
        endif()
 
+       # set lib directory if it exists
+       if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+               if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+                       set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/linux64)
+               else()
+                       set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/linux)
+               endif()
+
+               if(NOT EXISTS ${LIBDIR})
+                       unset(LIBDIR)
+               endif()
+       endif()
+
        find_package(JPEG REQUIRED)
        find_package(PNG REQUIRED)
        find_package(ZLIB REQUIRED)
@@ -423,10 +448,17 @@ if(UNIX AND NOT APPLE)
        endif()
 
        if(WITH_CODEC_FFMPEG)
-               set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
+               # use lib dir if available and nothing else specified
+               if(LIBDIR AND NOT FFMPEG)
+                       set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
+                       set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale dirac_encoder mp3lame ogg orc-0.4 schroedinger-1.0 theora theoraenc theoradec vorbis vorbisenc vpx x264 xvidcore faad asound CACHE STRING "FFMPEG Libraries")
+               else()
+                       set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
+                       set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
+               endif()
+
                mark_as_advanced(FFMPEG)
                set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
-               set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
                mark_as_advanced(FFMPEG_LIBRARIES)
                set(FFMPEG_LIBPATH ${FFMPEG}/lib)
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
@@ -492,12 +524,17 @@ if(UNIX AND NOT APPLE)
        endif()
 
        if(WITH_BOOST)
-               set(BOOST "/usr" CACHE PATH "Boost Directory")
-
+               # uses in build instructions to override include and library variables
                if(NOT BOOST_CUSTOM)
-                       set(BOOST_ROOT ${BOOST})
-                       set(Boost_USE_MULTITHREADED ON)
-                       find_package(Boost 1.34 REQUIRED COMPONENTS filesystem regex system thread)
+                       # use lib dir if available and nothing else specified
+                       if(LIBDIR AND NOT BOOST_ROOT)
+                               set(BOOST_ROOT ${LIBDIR}/boost)
+                               set(Boost_USE_MULTITHREADED OFF)
+                       else()
+                               set(Boost_USE_MULTITHREADED ON)
+                       endif()
+                       find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
+                       mark_as_advanced(Boost_DIR)  # why doesnt boost do this?
                endif()
 
                set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
@@ -507,10 +544,12 @@ if(UNIX AND NOT APPLE)
        endif()
 
        if(WITH_OPENIMAGEIO)
-               set(OPENIMAGEIO "/usr" CACHE PATH "OpenImageIO Directory")
+               # use lib dir if available and nothing else specified
+               if(LIBDIR AND NOT OPENIMAGEIO_ROOT_DIR)
+                       set(OPENIMAGEIO_ROOT_DIR ${LIBDIR}/oiio)
+               endif()
 
-               set(OPENIMAGEIO_ROOT_DIR ${OPENIMAGEIO})
-               find_package(OpenImageIO REQUIRED)
+               find_package(OpenImageIO)
 
                set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES})
                set(OPENIMAGEIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
@@ -518,6 +557,8 @@ if(UNIX AND NOT APPLE)
 
                if(NOT OPENIMAGEIO_FOUND)
                        set(WITH_OPENIMAGEIO OFF)
+                       set(WITH_CYCLES OFF)
+                       message(STATUS "OpenImageIO not found, disabling WITH_CYCLES")
                endif()
        endif()
 
@@ -843,7 +884,7 @@ elseif(WIN32)
        else()
                # keep GCC specific stuff here
                if(CMAKE_COMPILER_IS_GNUCC)
-                       set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32")
+                       set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi")
                        set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
 
                        add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
@@ -942,26 +983,26 @@ elseif(WIN32)
                if(WITH_BOOST)
                        set(BOOST ${LIBDIR}/boost)
                        set(BOOST_INCLUDE_DIR ${BOOST}/include)
-                       set(BOOST_POSTFIX "vc90-mt-s-1_46_1")
-                       set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_46_1")
+                       set(BOOST_POSTFIX "mgw45-mt-s-1_47")
+                       set(BOOST_DEBUG_POSTFIX "mgw45-mt-sd-1_47")
                        set(BOOST_LIBRARIES
-                               optimized libboost_date_time-${BOOST_POSTFIX} libboost_filesystem-${BOOST_POSTFIX}
-                               libboost_regex-${BOOST_POSTFIX} libboost_system-${BOOST_POSTFIX} libboost_thread-${BOOST_POSTFIX}
-                               debug libboost_date_time-${BOOST_DEBUG_POSTFIX} libboost_filesystem-${BOOST_DEBUG_POSTFIX}
-                               libboost_regex-${BOOST_DEBUG_POSTFIX} libboost_system-${BOOST_DEBUG_POSTFIX} libboost_thread-${BOOST_DEBUG_POSTFIX})
-                       set(BOOST_LIBPATH ${BOOST}/lib)
-                       set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
+                               optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX}
+                               boost_regex-${BOOST_POSTFIX} boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
+                               debug boost_date_time-${BOOST_DEBUG_POSTFIX} boost_filesystem-${BOOST_DEBUG_POSTFIX}
+                               boost_regex-${BOOST_DEBUG_POSTFIX} boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
+                       set(BOOST_LIBPATH ${BOOST}/lib/gcc)
+                       set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
                endif()
                        
                if(WITH_OPENIMAGEIO)
-                       set(OPENIMAGEIO ${LIBDIR}/openimageio)
+                       set(OPENIMAGEIO ${LIBDIR}/gcc/openimageio)
                        set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
                        set(OPENIMAGEIO_LIBRARIES OpenImageIO)
                        set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
 
-               set(PLATFORM_LINKFLAGS "--stack,2097152")
+               set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
 
        endif()
 
@@ -1480,6 +1521,7 @@ if(FIRST_RUN)
        info_cfg_option(WITH_FFTW3)
        info_cfg_option(WITH_INTERNATIONAL)
        info_cfg_option(WITH_INPUT_NDOF)
+       info_cfg_option(WITH_CYCLES)
 
        info_cfg_text("Compiler Options:")
        info_cfg_option(WITH_BUILDINFO)
index 16ce8ca4b32237dc169a6a9f9fc39a93845c3e45..161bbbc03785efa94c849a0d9372f321ef8cdabf 100644 (file)
@@ -162,7 +162,7 @@ if cxx:
 
 if sys.platform=='win32':
     if env['CC'] in ['cl', 'cl.exe']:
-         platform = 'win64-vc' if bitness == 64 else 'win32-vc'
+        platform = 'win64-vc' if bitness == 64 else 'win32-vc'
     elif env['CC'] in ['gcc']:
         platform = 'win32-mingw'
 
@@ -435,12 +435,12 @@ B.init_lib_dict()
 
 Export('env')
 
+BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
+SConscript(B.root_build_dir+'/source/SConscript')
 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
 SConscript(B.root_build_dir+'/intern/SConscript')
 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
 SConscript(B.root_build_dir+'/extern/SConscript')
-BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
-SConscript(B.root_build_dir+'/source/SConscript')
 
 # now that we have read all SConscripts, we know what
 # libraries will be built. Create list of
@@ -526,6 +526,50 @@ if env['OURPLATFORM']!='darwin':
                 if len(source)==0:
                     env.Execute(Mkdir(dir))
                 scriptinstall.append(env.Install(dir=dir,source=source))
+        if env['WITH_BF_CYCLES']:
+            # cycles python code
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles')
+            source=os.listdir('intern/cycles/blender/addon')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source=['intern/cycles/blender/addon/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
+
+            # cycles kernel code
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel')
+            source=os.listdir('intern/cycles/kernel')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source.remove('kernel.cpp')
+            source.remove('CMakeLists.txt')
+            source.remove('svm')
+            source.remove('osl')
+            source=['intern/cycles/kernel/'+s for s in source]
+            source.append('intern/cycles/util/util_color.h')
+            source.append('intern/cycles/util/util_math.h')
+            source.append('intern/cycles/util/util_transform.h')
+            source.append('intern/cycles/util/util_types.h')
+            scriptinstall.append(env.Install(dir=dir,source=source))
+            # svm
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel', 'svm')
+            source=os.listdir('intern/cycles/kernel/svm')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source=['intern/cycles/kernel/svm/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
+
+            # licenses
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'license')
+            source=os.listdir('intern/cycles/doc/license')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source.remove('CMakeLists.txt')
+            source=['intern/cycles/doc/license/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
     
     if env['WITH_BF_INTERNATIONAL']:
         internationalpaths=['release' + os.sep + 'datafiles']
@@ -696,6 +740,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
         dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll') 
     dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
 
+    if env['WITH_BF_OIIO']:
+        dllsources.append('${LCGDIR}/openimageio/bin/OpenImageIO.dll')
+
     dllsources.append('#source/icons/blender.exe.manifest')
 
     windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
index 080fd8d61236b79e1d9d592aaf8cd4e198a84e19..eb3e321140f5e4393dafe85edf77e22b7a7a3580 100644 (file)
@@ -34,7 +34,7 @@ BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/
 
 # Don't depend on system's libstdc++
 WITH_BF_STATICCXX = True
-BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.3.2/libstdc++.a'
+BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a'
 
 WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = True
@@ -92,9 +92,24 @@ WITH_BF_STATICFFTW3 = True
 # JACK
 WITH_BF_JACK = True
 
+# Cycles
+WITH_BF_CYCLES = True
+
+WITH_BF_OIIO = True
+WITH_BF_STATICOIIO = True
+BF_OIIO = '/opt/oiio'
+BF_OIIO_INC = '${BF_OIIO}/include'
+BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a'
+BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+
+WITH_BF_BOOST = True
+WITH_BF_STATICBOOST = True
+BF_BOOST = '/opt/boost'
+BF_BOOST_INC = '${BF_BOOST}/include'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
+
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = []
-REL_CXXFLAGS = []
-REL_CCFLAGS = ['-O2']  # C & C++
+REL_CCFLAGS = ['-O2', '-msse', '-msse2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32']
index 204732376fac4432a78196d474d68bb3fa07782d..fc875831223454e081831631de8a275b065ba3d0 100644 (file)
@@ -28,7 +28,7 @@ BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/
 
 # Don't depend on system's libstdc++
 WITH_BF_STATICCXX = True
-BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.3.2/libstdc++.a'
+BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a'
 
 WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = True
@@ -83,9 +83,10 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
 # JACK
 WITH_BF_JACK = True
 
+# Motion Tracking
+WITH_BF_LIBMV = False
+
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = []
-REL_CXXFLAGS = []
-REL_CCFLAGS = ['-O2']  # C & C++
+REL_CCFLAGS = ['-O2', '-msse', '-msse2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32']
index cc0ba209a44877dd900689ac2b840c7b9d757cc5..64dc93608d9ed91ba13b7a524a991bcb3f68a843 100644 (file)
@@ -28,7 +28,7 @@ BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/
 
 # Don't depend on system's libstdc++
 WITH_BF_STATICCXX = True
-BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a'
+BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.3.4/libstdc++.a'
 
 WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = True
@@ -83,9 +83,10 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
 # JACK
 WITH_BF_JACK = True
 
+# Motion Tracking
+WITH_BF_LIBMV = False
+
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = []
-REL_CXXFLAGS = []
-REL_CCFLAGS = ['-O2']  # C & C++
+REL_CCFLAGS = ['-O2', '-msse', '-msse2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64']
index 4698ffdce158b18b54f9c443065e62668f1e1395..e7667b6c2cace3781447e825b890633474814fb8 100644 (file)
@@ -34,7 +34,7 @@ BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/
 
 # Don't depend on system's libstdc++
 WITH_BF_STATICCXX = True
-BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a'
+BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.3.4/libstdc++.a'
 
 WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = True
@@ -92,9 +92,24 @@ WITH_BF_STATICFFTW3 = True
 # JACK
 WITH_BF_JACK = True
 
+# Cycles
+WITH_BF_CYCLES = True
+
+WITH_BF_OIIO = True
+WITH_BF_STATICOIIO = True
+BF_OIIO = '/opt/oiio'
+BF_OIIO_INC = '${BF_OIIO}/include'
+BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a'
+BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+
+WITH_BF_BOOST = True
+WITH_BF_STATICBOOST = True
+BF_BOOST = '/opt/boost'
+BF_BOOST_INC = '${BF_BOOST}/include'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
+
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = []
-REL_CXXFLAGS = []
-REL_CCFLAGS = ['-O2']  # C & C++
+REL_CCFLAGS = ['-O2', '-msse', '-msse2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64']
diff --git a/build_files/cmake/Modules/FindOpenImageIO.cmake b/build_files/cmake/Modules/FindOpenImageIO.cmake
new file mode 100644 (file)
index 0000000..7512b93
--- /dev/null
@@ -0,0 +1,70 @@
+# - Find OpenImageIO library
+# Find the native OpenImageIO includes and library
+# This module defines
+#  OPENIMAGEIO_INCLUDE_DIRS, where to find openimageio.h, Set when
+#                            OPENIMAGEIO_INCLUDE_DIR is found.
+#  OPENIMAGEIO_LIBRARIES, libraries to link against to use OpenImageIO.
+#  OPENIMAGEIO_ROOT_DIR, The base directory to search for OpenImageIO.
+#                        This can also be an environment variable.
+#  OPENIMAGEIO_FOUND, If false, do not try to use OpenImageIO.
+#
+# also defined, but not for general use are
+#  OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library.
+
+#=============================================================================
+# Copyright 2011 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# If OPENIMAGEIO_ROOT_DIR was defined in the environment, use it.
+IF(NOT OPENIMAGEIO_ROOT_DIR AND NOT $ENV{OPENIMAGEIO_ROOT_DIR} STREQUAL "")
+  SET(OPENIMAGEIO_ROOT_DIR $ENV{OPENIMAGEIO_ROOT_DIR})
+ENDIF()
+
+SET(_openimageio_SEARCH_DIRS
+  ${OPENIMAGEIO_ROOT_DIR}
+  /usr/local
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+)
+
+FIND_PATH(OPENIMAGEIO_INCLUDE_DIR
+  NAMES
+    OpenImageIO/imageio.h
+  HINTS
+    ${_openimageio_SEARCH_DIRS}
+  PATH_SUFFIXES
+    include
+)
+
+FIND_LIBRARY(OPENIMAGEIO_LIBRARY
+  NAMES
+    OpenImageIO
+  HINTS
+    ${_openimageio_SEARCH_DIRS}
+  PATH_SUFFIXES
+    lib64 lib
+  )
+
+# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO DEFAULT_MSG
+    OPENIMAGEIO_LIBRARY OPENIMAGEIO_INCLUDE_DIR)
+
+IF(OPENIMAGEIO_FOUND)
+  SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
+  SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
+ENDIF(OPENIMAGEIO_FOUND)
+
+MARK_AS_ADVANCED(
+  OPENIMAGEIO_INCLUDE_DIR
+  OPENIMAGEIO_LIBRARY
+)
index b1fc88bfe266a0390fd9ce15aa75631e074c90c1..be68455a113e7fa39337e8254b5b8ec62ef3307a 100755 (executable)
@@ -93,6 +93,9 @@ def cmake_get_src(f):
     # print(f)
 
     def is_definition(l, f, i, name):
+        if l.startswith("unset("):
+            return False
+
         if ('set(%s' % name) in l or ('set(' in l and l.endswith(name)):
             if len(l.split()) > 1:
                 raise Exception("strict formatting not kept 'set(%s*' %s:%d" % (name, f, i))
@@ -172,6 +175,12 @@ def cmake_get_src(f):
                                 pass
                             elif new_file.endswith(".def"):
                                 pass
+                            elif new_file.endswith(".cl"):  # opencl
+                                pass
+                            elif new_file.endswith(".cu"):  # cuda
+                                pass
+                            elif new_file.endswith(".osl"):  # open shading language
+                                pass
                             else:
                                 raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file))
 
index 769b4adb37ba1b807f4840a2497e78a6ba9dc5ae..45c19adff36be1b51da34bf6a2e83bd4e825ac24 100755 (executable)
@@ -39,6 +39,7 @@ from project_info import (SIMPLE_PROJECTFILE,
                           # is_py,
                           cmake_advanced_info,
                           cmake_compiler_defines,
+                          project_name_get,
                           )
 
 
@@ -59,7 +60,11 @@ def create_nb_project_main():
         includes = list(set(includes) | set(dirname(f) for f in files if is_c_header(f)))
         includes.sort()
 
-        PROJECT_NAME = "Blender"
+        if 0:
+            PROJECT_NAME = "Blender"
+        else:
+            # be tricky, get the project name from SVN if we can!
+            PROJECT_NAME = project_name_get(SOURCE_DIR)
 
         # --------------- NB spesific
         defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines]
index 0da28a943ebc3ed30fe71b16c0c274dbc7e89527..4f04960d5e347837a62756a621edc462c7b3f9fe 100644 (file)
@@ -12,6 +12,7 @@ set(WITH_BUILTIN_GLEW        OFF CACHE FORCE BOOL)
 set(WITH_BULLET              OFF CACHE FORCE BOOL)
 set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
 set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
+set(WITH_CYCLES              OFF CACHE FORCE BOOL)
 set(WITH_FFTW3               OFF CACHE FORCE BOOL)
 set(WITH_LIBMV               OFF CACHE FORCE BOOL)
 set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
index c9a04f87148280fd97d9360c0d0a05f3b6d1a1c5..c6a834050d04fd563e1bef3b7a8b5abe3dfe1b74 100644 (file)
@@ -272,7 +272,7 @@ macro(setup_liblinks
                target_link_libraries(${target} ${BOOST_LIBRARIES})
        endif()
        if(WITH_IMAGE_OPENEXR)
-               if(WIN32 AND NOT UNIX)
+               if(WIN32 AND NOT UNIX AND NOT CMAKE_COMPILER_IS_GNUCC)
                        file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
                        target_link_libraries_debug(${target} "${OPENEXR_LIBRARIES_DEBUG}")
                        target_link_libraries_optimized(${target} "${OPENEXR_LIBRARIES}")
index 38c8dca6cd21e569bcfc59533c49eb635713df79..02beb80b5b1aac24be553ef26685a1a51eca8edd 100644 (file)
@@ -282,6 +282,21 @@ BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
 #BF_EXPAT_LIB = 'expat'
 #BF_EXPAT_LIBPATH = '/usr/lib'
 
+#Cycles
+WITH_BF_CYCLES = True 
+
+WITH_BF_OIIO = True
+BF_OIIO = LIBDIR + '/openimageio'
+BF_OIIO_INC = BF_OIIO + '/include'
+BF_OIIO_LIB = 'OpenImageIO'
+BF_OIIO_LIBPATH = BF_OIIO + '/lib'
+
+WITH_BF_BOOST = True
+BF_BOOST = LIBDIR + '/boost'
+BF_BOOST_INC = BF_BOOST + '/include'
+BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt'
+BF_BOOST_LIBPATH = BF_BOOST + '/lib'
+
 #Ray trace optimization
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386':
     WITH_BF_RAYOPTIMIZATION = True
index 91f86ae7e806e3e37eda63f3835e756b0e7334f2..655054706f550df88aa7e058da95c9e9e168c2f1 100644 (file)
@@ -1,5 +1,12 @@
-LCGDIR = '../lib/linux'
-LIBDIR = "${LCGDIR}"
+# find library directory
+import platform
+import os
+bitness = platform.architecture()[0]
+if bitness == '64bit':
+    LCGDIR = '../lib/linux64'
+else:
+    LCGDIR = '../lib/linux'
+LIBDIR = "#${LCGDIR}"
 
 BF_PYTHON_ABI_FLAGS = 'm'  # Most common for linux distros
 BF_PYTHON = '/usr'
@@ -113,7 +120,18 @@ WITH_BF_BINRELOC = True
 
 # enable ffmpeg  support
 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
-BF_FFMPEG = '/usr'
+BF_FFMPEG = LIBDIR + '/ffmpeg'
+if os.path.exists(LCGDIR + '/ffmpeg'):
+    WITH_BF_STATICFFMPEG = True
+    BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
+        '${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
+        '${BF_FFMPEG_LIBPATH}/libxvidcore.a ${BF_FFMPEG_LIBPATH}/libx264.a ${BF_FFMPEG_LIBPATH}/libmp3lame.a ' + \
+        '${BF_FFMPEG_LIBPATH}/libvpx.a ${BF_FFMPEG_LIBPATH}/libvorbis.a ${BF_FFMPEG_LIBPATH}/libogg.a ' + \
+        '${BF_FFMPEG_LIBPATH}/libvorbisenc.a ${BF_FFMPEG_LIBPATH}/libtheora.a ' + \
+        '${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a ' + \
+        '${BF_FFMPEG_LIBPATH}/libfaad.a'
+else:
+    BF_FFMPEG = '/usr'
 BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
@@ -178,6 +196,26 @@ BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
 BF_JEMALLOC_LIB = 'jemalloc'
 BF_JEMALLOC_LIB_STATIC = '${BF_JEMALLOC_LIBPATH}/libjemalloc.a'
 
+WITH_BF_OIIO = True 
+BF_OIIO = LIBDIR + '/oiio'
+if not os.path.exists(LCGDIR + '/oiio'):
+    WITH_BF_OIIO = False
+    BF_OIIO = '/usr'
+BF_OIIO_INC = BF_OIIO + '/include'
+BF_OIIO_LIB = 'OpenImageIO'
+BF_OIIO_LIBPATH = BF_OIIO + '/lib'
+
+WITH_BF_BOOST = True
+BF_BOOST = LIBDIR + '/boost'
+if not os.path.exists(LCGDIR + '/boost'):
+    WITH_BF_BOOST = False
+    BF_BOOST = '/usr'
+BF_BOOST_INC = BF_BOOST + '/include'
+BF_BOOST_LIB = 'boost_date_time boost_filesystem boost_regex boost_system boost_thread'
+BF_BOOST_LIBPATH = BF_BOOST + '/lib'
+
+WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST
+
 WITH_BF_OPENMP = True
 
 #Ray trace optimization
index f210ab436b5a349a09918fc972b9dd1a029bf06f..e224c08d35459fa4f8c7df65a2861ce29a6faea4 100644 (file)
@@ -17,7 +17,7 @@ BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'wrap_oal'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
-WITH_BF_FFMPEG = False
+WITH_BF_FFMPEG = True
 BF_FFMPEG_LIB = 'avformat-53 avcodec-53 avdevice-53 avutil-51 swscale-2'
 BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
 BF_FFMPEG_INC =  LIBDIR + '/ffmpeg/include'
@@ -46,11 +46,11 @@ BF_PTHREADS_INC = '${BF_PTHREADS}/include'
 BF_PTHREADS_LIB = 'pthreadGC2'
 BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
 
-WITH_BF_OPENEXR = False  # TODO, gives linking problems for the moment.
+WITH_BF_OPENEXR = True
 WITH_BF_STATICOPENEXR = False
 BF_OPENEXR = LIBDIR + '/gcc/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
-BF_OPENEXR_LIB = ' Half IlmImf Iex IlmThread '
+BF_OPENEXR_LIB = 'Half IlmImf Imath IlmThread Iex'
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
 # Warning, this static lib configuration is untested! users of this OS please confirm.
 BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
@@ -100,8 +100,8 @@ BF_FFTW3_INC = '${BF_FFTW3}/include'
 BF_FFTW3_LIB = 'fftw3'
 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
 
-WITH_BF_GAMEENGINE = False
-WITH_BF_PLAYER = False
+WITH_BF_GAMEENGINE = True
+WITH_BF_PLAYER = True
 
 WITH_BF_BULLET = True
 BF_BULLET = '#extern/bullet2/src'
@@ -140,7 +140,7 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
              '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
              '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
 
-WITH_BF_COLLADA = False  # TODO, gives linking problems at the moment.
+WITH_BF_COLLADA = True
 BF_COLLADA = '#source/blender/collada'
 BF_COLLADA_INC = '${BF_COLLADA}'
 BF_COLLADA_LIB = 'bf_collada'
@@ -150,8 +150,23 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa'
 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
 
+#Cycles
+WITH_BF_CYCLES = True 
+
+WITH_BF_OIIO = True
+BF_OIIO = LIBDIR + '/gcc/openimageio'
+BF_OIIO_INC = '#../lib/windows/gcc/openimageio/include'
+BF_OIIO_LIB = 'OpenImageIO'
+BF_OIIO_LIBPATH = '#../lib/windows/gcc/openimageio/lib'
+
+WITH_BF_BOOST = True
+BF_BOOST = LIBDIR + '/boost'
+BF_BOOST_INC = '#../lib/windows/boost/include'
+BF_BOOST_LIB = 'boost_date_time-mgw45-mt-s-1_47 boost_filesystem-mgw45-mt-s-1_47 boost_regex-mgw45-mt-s-1_47 boost_system-mgw45-mt-s-1_47 boost_thread-mgw45-mt-s-1_47'
+BF_BOOST_LIBPATH = '#../lib/windows/boost/lib/gcc'
+
 #Ray trace optimization
-WITH_BF_RAYOPTIMIZATION = False
+WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
 
 ##
@@ -161,7 +176,7 @@ CXX = 'g++'
 CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 CXXFLAGS = []
 
-CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE']
+CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC']
 REL_CFLAGS = []
 REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG',  '-O2']
@@ -170,9 +185,9 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
 
 CC_WARN = [ '-Wall' ]
 
-LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32']
+LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi']
 
-PLATFORM_LINKFLAGS = ['--stack,2097152']
+PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
 
 BF_DEBUG = False
 BF_DEBUG_CCFLAGS= ['-g', '-D_DEBUG']
index 1e4821180d619cce355691316af23c77503b36dc..0440093b41a90348a98c77b63720b97ca55029e4 100644 (file)
@@ -149,19 +149,20 @@ WITH_BF_3DMOUSE = True
 
 WITH_BF_OPENMP = True
 
-'''
+#Cycles
+WITH_BF_CYCLES = True 
+
 WITH_BF_OIIO = True
-BF_OIIO = LIBDIR + '/openimageio'
+BF_OIIO = '${LIBDIR}/openimageio'
 BF_OIIO_INC = '${BF_OIIO}/include'
 BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 
 WITH_BF_BOOST = True
-BF_BOOST = LIBDIR + '/boost'
+BF_BOOST = '${LIBDIR}/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_46_1 libboost_filesystem-vc90-mt-s-1_46_1 libboost_regex-vc90-mt-s-1_46_1 libboost_system-vc90-mt-s-1_46_1 libboost_thread-vc90-mt-s-1_46_1'
+BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_47 libboost_filesystem-vc90-mt-s-1_47 libboost_regex-vc90-mt-s-1_47 libboost_system-vc90-mt-s-1_47 libboost_thread-vc90-mt-s-1_47'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
-'''
 
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
index 0920d9375ae33c5a43795dbff8caf2d7f58065aa..8c2956666a91d82b309609ffa798fff806dff7af 100644 (file)
@@ -153,19 +153,20 @@ WITH_BF_3DMOUSE = True
 
 WITH_BF_OPENMP = True
 
-'''
+WITH_BF_CYCLES = True
+
 WITH_BF_OIIO = True
-BF_OIIO = LIBDIR + '/openimageio'
+BF_OIIO = '${LIBDIR}/openimageio'
 BF_OIIO_INC = '${BF_OIIO}/include'
 BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 
 WITH_BF_BOOST = True
-BF_BOOST = LIBDIR + '/boost'
+BF_BOOST = '${LIBDIR}/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
-BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_45 libboost_filesystem-vc90-mt-s-1_45 libboost_regex-vc90-mt-s-1_45 libboost_system-vc90-mt-s-1_45 libboost_thread-vc90-mt-s-1_45'
+BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_47 libboost_filesystem-vc90-mt-s-1_47 libboost_regex-vc90-mt-s-1_47 libboost_system-vc90-mt-s-1_47 libboost_thread-vc90-mt-s-1_47'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
-'''
 
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
index ae2d5298298e60cb6407b94353803b58888d0a24..9e967ac5a4da08da349890d541ba0fa651c80796 100644 (file)
@@ -195,8 +195,13 @@ def setup_staticlibs(lenv):
             
     if lenv['WITH_BF_OIIO']:
         libincs += Split(lenv['BF_OIIO_LIBPATH'])
+        if lenv['WITH_BF_STATICOIIO']:
+            statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
+
     if lenv['WITH_BF_BOOST']:
         libincs += Split(lenv['BF_BOOST_LIBPATH'])
+        if lenv['WITH_BF_STATICBOOST']:
+            statlibs += Split(lenv['BF_BOOST_LIB_STATIC'])
 
     # setting this last so any overriding of manually libs could be handled
     if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
@@ -216,11 +221,7 @@ def setup_staticlibs(lenv):
     return statlibs, libincs
 
 def setup_syslibs(lenv):
-    syslibs = [
-        
-        lenv['BF_JPEG_LIB'],
-        lenv['BF_PNG_LIB'],
-        ]
+    syslibs = []
 
     if not lenv['WITH_BF_FREETYPE_STATIC']:
         syslibs += Split(lenv['BF_FREETYPE_LIB'])
@@ -241,6 +242,10 @@ def setup_syslibs(lenv):
             syslibs += ['gomp']
     if lenv['WITH_BF_ICONV']:
         syslibs += Split(lenv['BF_ICONV_LIB'])
+    if lenv['WITH_BF_OIIO']:
+        if not lenv['WITH_BF_STATICOIIO']:
+            syslibs += Split(lenv['BF_OIIO_LIB'])
+
     if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']:
         syslibs += Split(lenv['BF_OPENEXR_LIB'])
     if lenv['WITH_BF_TIFF'] and not lenv['WITH_BF_STATICTIFF']:
@@ -279,12 +284,13 @@ def setup_syslibs(lenv):
         if lenv['WITH_BF_3DMOUSE']:
             if not lenv['WITH_BF_STATIC3DMOUSE']:
                 syslibs += Split(lenv['BF_3DMOUSE_LIB'])
-
-    if lenv['WITH_BF_OIIO']:
-        syslibs += Split(lenv['BF_OIIO_LIB'])
-    if lenv['WITH_BF_BOOST']:
+                
+    if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
         syslibs += Split(lenv['BF_BOOST_LIB'])
 
+    syslibs += Split(lenv['BF_JPEG_LIB'])
+    syslibs += Split(lenv['BF_PNG_LIB'])
+       
     syslibs += lenv['LLIBS']
 
     return syslibs
@@ -550,10 +556,6 @@ def AppIt(target=None, source=None, env=None):
     bldroot = env.Dir('.').abspath
     binary = env['BINARYKIND']
      
-    if b=='verse':
-        print bc.OKBLUE+"no bundle for verse"+bc.ENDC 
-        return 0
-    
     sourcedir = bldroot + '/source/darwin/%s.app'%binary
     sourceinfo = bldroot + "/source/darwin/%s.app/Contents/Info.plist"%binary
     targetinfo = installdir +'/' + "%s.app/Contents/Info.plist"%binary
@@ -582,6 +584,23 @@ def AppIt(target=None, source=None, env=None):
         cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
         commands.getoutput(cmd)
 
+        if env['WITH_BF_CYCLES']:
+            croot = '%s/intern/cycles' % (bldroot)
+            cinstalldir = '%s/%s.app/Contents/MacOS/%s/scripts/addons/cycles' % (installdir,binary,VERSION)
+
+            cmd = 'mkdir %s' % (cinstalldir)
+            commands.getoutput(cmd)
+            cmd = 'mkdir %s/kernel' % (cinstalldir)
+            commands.getoutput(cmd)
+            cmd = 'cp -R %s/blender/addon/*.py %s/' % (croot, cinstalldir)
+            commands.getoutput(cmd)
+            cmd = 'cp -R %s/doc/license %s/license' % (croot, cinstalldir)
+            commands.getoutput(cmd)
+            cmd = 'cp -R %s/kernel/*.h %s/kernel/*.cl %s/kernel/*.cu %s/kernel/' % (croot, croot, croot, cinstalldir)
+            commands.getoutput(cmd)
+            cmd = 'cp -R %s/kernel/svm %s/util/util_color.h %s/util/util_math.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, cinstalldir)
+            commands.getoutput(cmd)
+
     if env['WITH_OSX_STATICPYTHON']:
         cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
         commands.getoutput(cmd)
index 5c78dc646bb1980a50290d858fe5aae16d2fd6f5..417bbcc48bad136952cc4c87cc71cc0852daecf0 100644 (file)
@@ -156,8 +156,9 @@ def validate_arguments(args, bc):
             'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
             'BUILDBOT_BRANCH',
             'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
-            'WITH_BF_OIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIBPATH',
-            'WITH_BF_BOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIBPATH'
+            'WITH_BF_CYCLES', 'WITH_BF_CYCLES_BINARIES' 'BF_CYCLES_BINARIES_ARCH',
+            'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
+            'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH'
             ]
     
     # Have options here that scons expects to be lists
@@ -239,6 +240,7 @@ def read_opts(env, cfg, args):
     localopts = Variables.Variables(cfg, args)
     localopts.AddVariables(
         ('LCGDIR', 'location of cvs lib dir'),
+        ('LIBDIR', 'root dir of libs'),
         (BoolVariable('WITH_BF_PYTHON', 'Compile with python', True)),
         (BoolVariable('WITH_BF_PYTHON_SAFETY', 'Internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency)', False)),
         ('BF_PYTHON', 'Base path for python', ''),
@@ -536,16 +538,26 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)),
 
         ('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
-        
+    ) # end of opts.AddOptions()
+
+    localopts.AddVariables(
+        (BoolVariable('WITH_BF_CYCLES', 'Build with the Cycles engine', True)),
+
         (BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
+        (BoolVariable('WITH_BF_STATICOIIO', 'Staticly link to OpenImageIO', False)),
+        ('BF_OIIO', 'OIIO root path', ''),
         ('BF_OIIO_INC', 'OIIO include path', ''),
         ('BF_OIIO_LIB', 'OIIO library', ''),
         ('BF_OIIO_LIBPATH', 'OIIO library path', ''),
-        
+        ('BF_OIIO_LIB_STATIC', 'OIIO static library', ''),
+
         (BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)),
+        (BoolVariable('WITH_BF_STATICBOOST', 'Staticly link to boost', False)),
+        ('BF_BOOST', 'Boost root path', ''),
         ('BF_BOOST_INC', 'Boost include path', ''),
         ('BF_BOOST_LIB', 'Boost library', ''),
-        ('BF_BOOST_LIBPATH', 'Boost library path', '')
+        ('BF_BOOST_LIBPATH', 'Boost library path', ''),
+        ('BF_BOOST_LIB_STATIC', 'Boost static library', '')
     ) # end of opts.AddOptions()
 
     return localopts
index 4eeefa5ed9d3d0e9fc9cdd654e569f0ea08b3499..68e8c4b64753110e4a3087d0023d1e2346429666 100644 (file)
@@ -49,198 +49,198 @@ CSuffixes = ['.c', '.C']
 CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
 
 def get_msvctoolkit_paths():
-        """Return a 4-tuple of (INCLUDE, LIB, PATH, TOOLKIT) as the values of those
-        three environment variables that should be set in order to execute
-        the MSVC .NET tools properly, if the information wasn't available
-        from the registry."""
-
-        MSToolkitDir = None
-        paths = {}
-        exe_path = ''
-        lib_path = ''
-        include_path = ''
-
-        # First, we get the shell folder for this user:
-        if not SCons.Util.can_read_reg:
-                raise SCons.Errors.InternalError, "No Windows registry module was found"
-
-        # look for toolkit
-        if os.environ.has_key('VCToolkitInstallDir'):
-                MSToolkitDir = os.path.normpath(os.environ['VCToolkitInstallDir'])
-        else:
-                # last resort -- default install location
-                MSToolkitDir = r'C:\Program Files\Microsoft Visual C++ Toolkit 2003'
-
-        # look for platform sdk
-        if os.environ.has_key('MSSdk'):
-                PlatformSDKDir = os.path.normpath(os.environ['MSSdk'])
-        else:
-                try:
-                        PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir')[0]
-                        PlatformSDKDir = str(PlatformSDKDir)
-                except SCons.Util.RegError:
-                        raise SCons.Errors.InternalError, "The Platform SDK directory was not found in the registry or in the `MSSdk` environment variable."
-
-        # look for DX Sdk (expecting DX9)
-        # dxsdk docs have a directory key, look for it, extract path
-        #dxsdkdocs = ""
-        DXsdkDir = ""
-        #try:
-        #        dxsdkdocs = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\DirectX SDK\DX9SDK Doc Path')
-        #except SCons.Util.RegError:
-        #        raise SCons.Errors.InternalError, "The DXSDK directory was not found in the registry."
-        if os.environ.has_key('DXSDK_DIR'):
-                DXsdkDir = os.path.normpath(os.environ['DXSDK_DIR'])
-
-        #DXsdkDir = os.path.split(dxsdkdocs[0])[0]
-        DXsdkDir = os.path.split(DXsdkDir)[0]
-
-        include_path = r'%s\include;%s\include;%s\include' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
-        lib_path = r'%s\lib;%s\lib;%s\lib' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
-        exe_path = r'%s\bin;%s\bin\win95;%s\bin' % (MSToolkitDir, PlatformSDKDir, PlatformSDKDir)
-        return (include_path, lib_path, exe_path, PlatformSDKDir)
+    """Return a 4-tuple of (INCLUDE, LIB, PATH, TOOLKIT) as the values of those
+    three environment variables that should be set in order to execute
+    the MSVC .NET tools properly, if the information wasn't available
+    from the registry."""
+
+    MSToolkitDir = None
+    paths = {}
+    exe_path = ''
+    lib_path = ''
+    include_path = ''
+
+    # First, we get the shell folder for this user:
+    if not SCons.Util.can_read_reg:
+        raise SCons.Errors.InternalError, "No Windows registry module was found"
+
+    # look for toolkit
+    if os.environ.has_key('VCToolkitInstallDir'):
+        MSToolkitDir = os.path.normpath(os.environ['VCToolkitInstallDir'])
+    else:
+        # last resort -- default install location
+        MSToolkitDir = r'C:\Program Files\Microsoft Visual C++ Toolkit 2003'
+
+    # look for platform sdk
+    if os.environ.has_key('MSSdk'):
+        PlatformSDKDir = os.path.normpath(os.environ['MSSdk'])
+    else:
+        try:
+            PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir')[0]
+            PlatformSDKDir = str(PlatformSDKDir)
+        except SCons.Util.RegError:
+            raise SCons.Errors.InternalError, "The Platform SDK directory was not found in the registry or in the `MSSdk` environment variable."
+
+    # look for DX Sdk (expecting DX9)
+    # dxsdk docs have a directory key, look for it, extract path
+    #dxsdkdocs = ""
+    DXsdkDir = ""
+    #try:
+    #   dxsdkdocs = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\DirectX SDK\DX9SDK Doc Path')
+    #except SCons.Util.RegError:
+    #   raise SCons.Errors.InternalError, "The DXSDK directory was not found in the registry."
+    if os.environ.has_key('DXSDK_DIR'):
+        DXsdkDir = os.path.normpath(os.environ['DXSDK_DIR'])
+
+    #DXsdkDir = os.path.split(dxsdkdocs[0])[0]
+    DXsdkDir = os.path.split(DXsdkDir)[0]
+
+    include_path = r'%s\include;%s\include;%s\include' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
+    lib_path = r'%s\lib;%s\lib;%s\lib' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
+    exe_path = r'%s\bin;%s\bin\win95;%s\bin' % (MSToolkitDir, PlatformSDKDir, PlatformSDKDir)
+    return (include_path, lib_path, exe_path, PlatformSDKDir)
 
 def validate_vars(env):
-        """Validate the PDB, PCH, and PCHSTOP construction variables."""
-        if env.has_key('PCH') and env['PCH']:
-                if not env.has_key('PCHSTOP'):
-                        raise SCons.Errors.UserError, "The PCHSTOP construction must be defined if PCH is defined."
-                if not SCons.Util.is_String(env['PCHSTOP']):
-                        raise SCons.Errors.UserError, "The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']
+    """Validate the PDB, PCH, and PCHSTOP construction variables."""
+    if env.has_key('PCH') and env['PCH']:
+        if not env.has_key('PCHSTOP'):
+            raise SCons.Errors.UserError, "The PCHSTOP construction must be defined if PCH is defined."
+        if not SCons.Util.is_String(env['PCHSTOP']):
+            raise SCons.Errors.UserError, "The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']
 
 def pch_emitter(target, source, env):
-        """Sets up the PDB dependencies for a pch file, and adds the object
-        file target."""
+    """Sets up the PDB dependencies for a pch file, and adds the object
+    file target."""
 
-        validate_vars(env)
+    validate_vars(env)
 
-        pch = None
-        obj = None
+    pch = None
+    obj = None
 
-        for t in target:
-                if SCons.Util.splitext(str(t))[1] == '.pch':
-                        pch = t
-                if SCons.Util.splitext(str(t))[1] == '.obj':
-                        obj = t
+    for t in target:
+        if SCons.Util.splitext(str(t))[1] == '.pch':
+            pch = t
+        if SCons.Util.splitext(str(t))[1] == '.obj':
+            obj = t
 
-        if not obj:
-                obj = SCons.Util.splitext(str(pch))[0]+'.obj'
+    if not obj:
+        obj = SCons.Util.splitext(str(pch))[0]+'.obj'
 
-        target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work
+    target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work
 
-        if env.has_key('PDB') and env['PDB']:
-                env.SideEffect(env['PDB'], target)
-                env.Precious(env['PDB'])
+    if env.has_key('PDB') and env['PDB']:
+        env.SideEffect(env['PDB'], target)
+        env.Precious(env['PDB'])
 
-        return (target, source)
+    return (target, source)
 
 def object_emitter(target, source, env, parent_emitter):
-        """Sets up the PDB and PCH dependencies for an object file."""
+    """Sets up the PDB and PCH dependencies for an object file."""
 
-        validate_vars(env)
+    validate_vars(env)
 
-        parent_emitter(target, source, env)
+    parent_emitter(target, source, env)
 
-        if env.has_key('PDB') and env['PDB']:
-                env.SideEffect(env['PDB'], target)
-                env.Precious(env['PDB'])
+    if env.has_key('PDB') and env['PDB']:
+        env.SideEffect(env['PDB'], target)
+        env.Precious(env['PDB'])
 
-        if env.has_key('PCH') and env['PCH']:
-                env.Depends(target, env['PCH'])
+    if env.has_key('PCH') and env['PCH']:
+        env.Depends(target, env['PCH'])
 
-        return (target, source)
+    return (target, source)
 
 def static_object_emitter(target, source, env):
-        return object_emitter(target, source, env,
-                                                  SCons.Defaults.StaticObjectEmitter)
+    return object_emitter(target, source, env,
+                          SCons.Defaults.StaticObjectEmitter)
 
 def shared_object_emitter(target, source, env):
-        return object_emitter(target, source, env,
-                                                  SCons.Defaults.SharedObjectEmitter)
+    return object_emitter(target, source, env,
+                          SCons.Defaults.SharedObjectEmitter)
 
 pch_builder = SCons.Builder.Builder(action='$PCHCOM', suffix='.pch', emitter=pch_emitter)
 res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res')
 
 def pdbGenerator(env, target, source, for_signature):
-        if target and env.has_key('PDB') and env['PDB']:
-                return ['/PDB:%s'%target[0].File(env['PDB']).get_string(for_signature),
-                                '/DEBUG']
+    if target and env.has_key('PDB') and env['PDB']:
+        return ['/PDB:%s'%target[0].File(env['PDB']).get_string(for_signature),
+                '/DEBUG']
 
 def win32ShlinkTargets(target, source, env, for_signature):
-        listCmd = []
-        dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
-        if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
+    listCmd = []
+    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+    if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
 
-        implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
-        if implib: listCmd.append("/implib:%s"%implib.get_string(for_signature))
+    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
+    if implib: listCmd.append("/implib:%s"%implib.get_string(for_signature))
 
-        return listCmd
+    return listCmd
 
 def win32ShlinkSources(target, source, env, for_signature):
-        listCmd = []
-
-        deffile = env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX")
-        for src in source:
-                if src == deffile:
-                        # Treat this source as a .def file.
-                        listCmd.append("/def:%s" % src.get_string(for_signature))
-                else:
-                        # Just treat it as a generic source file.
-                        listCmd.append(src)
-        return listCmd
+    listCmd = []
+
+    deffile = env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX")
+    for src in source:
+        if src == deffile:
+            # Treat this source as a .def file.
+            listCmd.append("/def:%s" % src.get_string(for_signature))
+        else:
+            # Just treat it as a generic source file.
+            listCmd.append(src)
+    return listCmd
 
 def win32LibEmitter(target, source, env):
-        # SCons.Tool.msvc.validate_vars(env)
+    # SCons.Tool.msvc.validate_vars(env)
 
-        dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
-        no_import_lib = env.get('no_import_lib', 0)
+    dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
+    no_import_lib = env.get('no_import_lib', 0)
 
-        if not dll:
-                raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
+    if not dll:
+        raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
 
-        if env.get("WIN32_INSERT_DEF", 0) and \
-           not env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX"):
+    if env.get("WIN32_INSERT_DEF", 0) and \
+       not env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX"):
 
-                # append a def file to the list of sources
-                source.append(env.ReplaceIxes(dll,
-                                                                          "SHLIBPREFIX", "SHLIBSUFFIX",
-                                                                          "WIN32DEFPREFIX", "WIN32DEFSUFFIX"))
+        # append a def file to the list of sources
+        source.append(env.ReplaceIxes(dll,
+                                      "SHLIBPREFIX", "SHLIBSUFFIX",
+                                      "WIN32DEFPREFIX", "WIN32DEFSUFFIX"))
 
-        if env.has_key('PDB') and env['PDB']:
-                env.SideEffect(env['PDB'], target)
-                env.Precious(env['PDB'])
+    if env.has_key('PDB') and env['PDB']:
+        env.SideEffect(env['PDB'], target)
+        env.Precious(env['PDB'])
 
-        if not no_import_lib and \
-           not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
-                # Append an import library to the list of targets.
-                target.append(env.ReplaceIxes(dll,
-                                                                          "SHLIBPREFIX", "SHLIBSUFFIX",
-                                                                          "LIBPREFIX", "LIBSUFFIX"))
-                # and .exp file is created if there are exports from a DLL
-                target.append(env.ReplaceIxes(dll,
-                                                                          "SHLIBPREFIX", "SHLIBSUFFIX",
-                                                                          "WIN32EXPPREFIX", "WIN32EXPSUFFIX"))
+    if not no_import_lib and \
+       not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
+        # Append an import library to the list of targets.
+        target.append(env.ReplaceIxes(dll,
+                                      "SHLIBPREFIX", "SHLIBSUFFIX",
+                                      "LIBPREFIX", "LIBSUFFIX"))
+        # and .exp file is created if there are exports from a DLL
+        target.append(env.ReplaceIxes(dll,
+                                      "SHLIBPREFIX", "SHLIBSUFFIX",
+                                      "WIN32EXPPREFIX", "WIN32EXPSUFFIX"))
 
-        return (target, source)
+    return (target, source)
 
 def prog_emitter(target, source, env):
-        #SCons.Tool.msvc.validate_vars(env)
+    #SCons.Tool.msvc.validate_vars(env)
 
-        if env.has_key('PDB') and env['PDB']:
-                env.SideEffect(env['PDB'], target)
-                env.Precious(env['PDB'])
+    if env.has_key('PDB') and env['PDB']:
+        env.SideEffect(env['PDB'], target)
+        env.Precious(env['PDB'])
 
-        return (target,source)
+    return (target,source)
 
 def RegServerFunc(target, source, env):
-        if env.has_key('register') and env['register']:
-                ret = regServerAction([target[0]], [source[0]], env)
-                if ret:
-                        raise SCons.Errors.UserError, "Unable to register %s" % target[0]
-                else:
-                        print "Registered %s sucessfully" % target[0]
-                return ret
-        return 0
+    if env.has_key('register') and env['register']:
+        ret = regServerAction([target[0]], [source[0]], env)
+        if ret:
+            raise SCons.Errors.UserError, "Unable to register %s" % target[0]
+        else:
+            print "Registered %s sucessfully" % target[0]
+        return ret
+    return 0
 
 regServerAction = SCons.Action.Action("$REGSVRCOM")
 regServerCheck = SCons.Action.Action(RegServerFunc, None)
@@ -248,106 +248,106 @@ shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK
 compositeLinkAction = shlibLinkAction + regServerCheck
 
 def generate(env):
-        """Add Builders and construction variables for MSVC++ to an Environment."""
-        static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
-
-        for suffix in CSuffixes:
-                static_obj.add_action(suffix, SCons.Defaults.CAction)
-                shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
-
-        for suffix in CXXSuffixes:
-                static_obj.add_action(suffix, SCons.Defaults.CXXAction)
-                shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
-
-        SCons.Tool.createStaticLibBuilder(env)
-        SCons.Tool.createSharedLibBuilder(env)
-        SCons.Tool.createProgBuilder(env)
-
-        env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s"%File(PDB)) or ""}'])
-        env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
-        env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS'
-        env['CC']                 = 'cl'
-        env['CCFLAGS']    = SCons.Util.CLVar('/nologo')
-        env['CCCOM']      = '$CC $CCFLAGS $CCCOMFLAGS'
-        env['SHCC']               = '$CC'
-        env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')
-        env['SHCCCOM']    = '$SHCC $SHCCFLAGS $CCCOMFLAGS'
-        env['CXX']                = '$CC'
-        env['CXXFLAGS']   = SCons.Util.CLVar('$CCFLAGS $( /TP $)')
-        env['CXXCOM']     = '$CXX $CXXFLAGS $CCCOMFLAGS'
-        env['SHCXX']      = '$CXX'
-        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
-        env['SHCXXCOM']   = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'
-        env['CPPDEFPREFIX']  = '/D'
-        env['CPPDEFSUFFIX']  = ''
-        env['INCPREFIX']  = '/I'
-        env['INCSUFFIX']  = ''
-        env['OBJEMITTER'] = static_object_emitter
-        env['SHOBJEMITTER'] = shared_object_emitter
-        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
-
-        env['RC'] = 'rc'
-        env['RCFLAGS'] = SCons.Util.CLVar('')
-        env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
-        CScan = env.get_scanner('.c')
-        if CScan:
-                CScan.add_skey('.rc')
-        env['BUILDERS']['RES'] = res_builder
-
-        include_path, lib_path, exe_path, sdk_path = get_msvctoolkit_paths()
-        env.PrependENVPath('INCLUDE', include_path)
-        env.PrependENVPath('LIB', lib_path)
-        env.PrependENVPath('PATH', exe_path)
-
-        env['ENV']['CPU'] = 'i386'
-        env['ENV']['MSSDK'] = sdk_path
-        env['ENV']['BkOffice'] = sdk_path
-        env['ENV']['Basemake'] = sdk_path + "\\Include\\BKOffice.Mak"
-        env['ENV']['INETSDK'] = sdk_path
-        env['ENV']['MSSDK'] = sdk_path
-        env['ENV']['MSTOOLS'] = sdk_path
-        env['ENV']['TARGETOS'] = 'WINNT'
-        env['ENV']['APPVER'] = '5.0'
-
-        env['CFILESUFFIX'] = '.c'
-        env['CXXFILESUFFIX'] = '.cc'
-
-        env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS'
-        env['BUILDERS']['PCH'] = pch_builder
-
-        env['AR']          = 'lib.exe' #'"' +sdk_path + '\\bin\\Win64\\lib.exe"'
-        env['ARFLAGS']     = SCons.Util.CLVar('/nologo')
-        env['ARCOM']       = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
-
-        env['SHLINK']      = '$LINK'
-        env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
-        env['_SHLINK_TARGETS'] = win32ShlinkTargets
-        env['_SHLINK_SOURCES'] = win32ShlinkSources
-        env['SHLINKCOM']   =  compositeLinkAction
-        env['SHLIBEMITTER']= win32LibEmitter
-        env['LINK'] =  'link.exe' #'"' +sdk_path + '\\bin\\Win64\\' + 'link.exe"'
-        env['LINKFLAGS']   = SCons.Util.CLVar('/nologo')
-        env['_PDB'] = pdbGenerator
-        env["TEMPFILE"] = SCons.Platform.win32.TempFileMunge
-        env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES")}'
-        env['PROGEMITTER'] = prog_emitter
-        env['LIBDIRPREFIX']='/LIBPATH:'
-        env['LIBDIRSUFFIX']=''
-        env['LIBLINKPREFIX']=''
-        env['LIBLINKSUFFIX']='$LIBSUFFIX'
-
-        env['WIN32DEFPREFIX']        = ''
-        env['WIN32DEFSUFFIX']        = '.def'
-        env['WIN32_INSERT_DEF']      = 0
-
-        env['WIN32EXPPREFIX']        = ''
-        env['WIN32EXPSUFFIX']        = '.exp'
-
-        env['REGSVRACTION'] = regServerCheck
-        env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
-        env['REGSVRFLAGS'] = '/s '
-        env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET'
+    """Add Builders and construction variables for MSVC++ to an Environment."""
+    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+    for suffix in CSuffixes:
+        static_obj.add_action(suffix, SCons.Defaults.CAction)
+        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
+
+    for suffix in CXXSuffixes:
+        static_obj.add_action(suffix, SCons.Defaults.CXXAction)
+        shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
+
+    SCons.Tool.createStaticLibBuilder(env)
+    SCons.Tool.createSharedLibBuilder(env)
+    SCons.Tool.createProgBuilder(env)
+
+    env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s"%File(PDB)) or ""}'])
+    env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
+    env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS'
+    env['CC']        = 'cl'
+    env['CCFLAGS']    = SCons.Util.CLVar('/nologo')
+    env['CCCOM']      = '$CC $CCFLAGS $CCCOMFLAGS'
+    env['SHCC']        = '$CC'
+    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')
+    env['SHCCCOM']    = '$SHCC $SHCCFLAGS $CCCOMFLAGS'
+    env['CXX']      = '$CC'
+    env['CXXFLAGS']   = SCons.Util.CLVar('$CCFLAGS $( /TP $)')
+    env['CXXCOM']     = '$CXX $CXXFLAGS $CCCOMFLAGS'
+    env['SHCXX']      = '$CXX'
+    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+    env['SHCXXCOM']   = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'
+    env['CPPDEFPREFIX']  = '/D'
+    env['CPPDEFSUFFIX']  = ''
+    env['INCPREFIX']  = '/I'
+    env['INCSUFFIX']  = ''
+    env['OBJEMITTER'] = static_object_emitter
+    env['SHOBJEMITTER'] = shared_object_emitter
+    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+
+    env['RC'] = 'rc'
+    env['RCFLAGS'] = SCons.Util.CLVar('')
+    env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
+    CScan = env.get_scanner('.c')
+    if CScan:
+        CScan.add_skey('.rc')
+    env['BUILDERS']['RES'] = res_builder
+
+    include_path, lib_path, exe_path, sdk_path = get_msvctoolkit_paths()
+    env.PrependENVPath('INCLUDE', include_path)
+    env.PrependENVPath('LIB', lib_path)
+    env.PrependENVPath('PATH', exe_path)
+
+    env['ENV']['CPU'] = 'i386'
+    env['ENV']['MSSDK'] = sdk_path
+    env['ENV']['BkOffice'] = sdk_path
+    env['ENV']['Basemake'] = sdk_path + "\\Include\\BKOffice.Mak"
+    env['ENV']['INETSDK'] = sdk_path
+    env['ENV']['MSSDK'] = sdk_path
+    env['ENV']['MSTOOLS'] = sdk_path
+    env['ENV']['TARGETOS'] = 'WINNT'
+    env['ENV']['APPVER'] = '5.0'
+
+    env['CFILESUFFIX'] = '.c'
+    env['CXXFILESUFFIX'] = '.cc'
+
+    env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS'
+    env['BUILDERS']['PCH'] = pch_builder
+
+    env['AR']     = 'lib.exe' #'"' +sdk_path + '\\bin\\Win64\\lib.exe"'
+    env['ARFLAGS']     = SCons.Util.CLVar('/nologo')
+    env['ARCOM']       = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
+
+    env['SHLINK']      = '$LINK'
+    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
+    env['_SHLINK_TARGETS'] = win32ShlinkTargets
+    env['_SHLINK_SOURCES'] = win32ShlinkSources
+    env['SHLINKCOM']   =  compositeLinkAction
+    env['SHLIBEMITTER']= win32LibEmitter
+    env['LINK'] =  'link.exe' #'"' +sdk_path + '\\bin\\Win64\\' + 'link.exe"'
+    env['LINKFLAGS']   = SCons.Util.CLVar('/nologo')
+    env['_PDB'] = pdbGenerator
+    env["TEMPFILE"] = SCons.Platform.win32.TempFileMunge
+    env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES")}'
+    env['PROGEMITTER'] = prog_emitter
+    env['LIBDIRPREFIX']='/LIBPATH:'
+    env['LIBDIRSUFFIX']=''
+    env['LIBLINKPREFIX']=''
+    env['LIBLINKSUFFIX']='$LIBSUFFIX'
+
+    env['WIN32DEFPREFIX']   = ''
+    env['WIN32DEFSUFFIX']   = '.def'
+    env['WIN32_INSERT_DEF']      = 0
+
+    env['WIN32EXPPREFIX']   = ''
+    env['WIN32EXPSUFFIX']   = '.exp'
+
+    env['REGSVRACTION'] = regServerCheck
+    env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
+    env['REGSVRFLAGS'] = '/s '
+    env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET'
 
 
 def exists(env):
-        return env.Detect('cl')
+    return env.Detect('cl')
index 7a663ec9335dbdbf3d0b17fd093dc4cfcbe6fd57..0f7672595d75058c99bcdbae220a06b2ef144b6b 100644 (file)
@@ -57,3 +57,8 @@ endif()
 if(WITH_IK_ITASC)
        add_subdirectory(itasc)
 endif()
+
+if(WITH_CYCLES)
+       add_subdirectory(cycles)
+endif()
+
index da245c78776a5f503bf9faab684be47485f64887..c13714543cbeee9518c5bd88023a8898036948eb 100644 (file)
@@ -24,6 +24,9 @@ NEW_CSG='false'
 
 if env['WITH_BF_FLUID']:
     SConscript(['elbeem/SConscript'])
+    
+if env['WITH_BF_CYCLES']:
+    SConscript(['cycles/SConscript'])
 
 if NEW_CSG=='false':
     SConscript(['bsp/SConscript'])
index 0c4df1ce392956ae7b108d6bca1e0cb292861207..c3a4c130f88516d09d5b90b8b1f2839ad58db6d7 100644 (file)
@@ -98,7 +98,6 @@ set(SRC
        intern/AUD_IWriter.h
        intern/AUD_JOSResampleFactory.cpp
        intern/AUD_JOSResampleFactory.h
-       intern/AUD_JOSResampleReaderCoeff.cpp
        intern/AUD_JOSResampleReader.cpp
        intern/AUD_JOSResampleReader.h
        intern/AUD_LinearResampleFactory.cpp
index 0c550ce3b60aef2b5092919ae5a1163a67793e9f..6553073c54ea178427869cde36dcec9c2dcf62a3 100644 (file)
@@ -395,7 +395,7 @@ void AUD_FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
        {
                data_size = AUD_MIN(pkgbuf_pos, left * sample_size);
                m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(),
-                                 data_size / AUD_FORMAT_SIZE(m_specs.format));
+                         data_size / AUD_FORMAT_SIZE(m_specs.format));
                buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
                left -= data_size/sample_size;
        }
index 14bb46f3b3821d0b736e00a8673caa7f38aa0fc3..63178f316b2ffde3026f8ecc81cd4f20d95da485 100644 (file)
@@ -73,5 +73,5 @@ void AUD_ConverterReader::read(int& length, bool& eos, sample_t* buffer)
        m_reader->read(length, eos, m_buffer.getBuffer());
 
        m_convert((data_t*)buffer, (data_t*)m_buffer.getBuffer(),
-                         length * specs.channels);
+                 length * specs.channels);
 }
index 332b70550ed073f3a9615033a73068d3d704befd..de9fa7b85086da76c7997e7412fbfda098ed4056 100644 (file)
@@ -167,39 +167,41 @@ void BOP_Face2Face(BOP_Mesh *mesh, BOP_Faces *facesA, BOP_Faces *facesB)
                MT_Point3 p2 = mesh->getVertex(faceA->getVertex(1))->getPoint();
                MT_Point3 p3 = mesh->getVertex(faceA->getVertex(2))->getPoint();
 
-       /* get (or create) bounding box for face A */
+               /* get (or create) bounding box for face A */
                if( faceA->getBBox() == NULL )
-               faceA->setBBox(p1,p2,p3);
+                       faceA->setBBox(p1,p2,p3);
                BOP_BBox *boxA = faceA->getBBox();
 
        /* start checking B faces with the previously stored split index */
 
                for(unsigned int idxFaceB=faceA->getSplit();
-                       idxFaceB<facesB->size() && (faceA->getTAG() != BROKEN) && (faceA->getTAG() != PHANTOM);) {
+                   idxFaceB<facesB->size() && (faceA->getTAG() != BROKEN) && (faceA->getTAG() != PHANTOM);) {
                        BOP_Face *faceB = (*facesB)[idxFaceB];
                        faceA->setSplit(idxFaceB);
                        if ((faceB->getTAG() != BROKEN) && (faceB->getTAG() != PHANTOM)) {
 
-       /* get (or create) bounding box for face B */
-                               if( faceB->getBBox() == NULL )
-                               faceB->setBBox(mesh->getVertex(faceB->getVertex(0))->getPoint(),
-                    mesh->getVertex(faceB->getVertex(1))->getPoint(),
-                    mesh->getVertex(faceB->getVertex(2))->getPoint());
-                         BOP_BBox *boxB = faceB->getBBox();
+                               /* get (or create) bounding box for face B */
+                               if( faceB->getBBox() == NULL ) {
+                                       faceB->setBBox(mesh->getVertex(faceB->getVertex(0))->getPoint(),
+                                                      mesh->getVertex(faceB->getVertex(1))->getPoint(),
+                                                      mesh->getVertex(faceB->getVertex(2))->getPoint());
+                               }
+                               BOP_BBox *boxB = faceB->getBBox();
 
-                         if (boxA->intersect(*boxB)) {
-                           MT_Plane3 planeB = faceB->getPlane();
-                           if (BOP_containsPoint(planeB,p1) && 
-                               BOP_containsPoint(planeB,p2) && 
-                               BOP_containsPoint(planeB,p3)) {
-                             if (BOP_orientation(planeB,planeA)>0) {
-                                   BOP_intersectCoplanarFaces(mesh,facesB,faceA,faceB,false);
-                             }
-                           }
-                           else {
-                             BOP_intersectNonCoplanarFaces(mesh,facesA,facesB,faceA,faceB);
-                           }
-                         }                       
+                               if (boxA->intersect(*boxB)) {
+                                       MT_Plane3 planeB = faceB->getPlane();
+                                       if (BOP_containsPoint(planeB,p1) &&
+                                               BOP_containsPoint(planeB,p2) &&
+                                               BOP_containsPoint(planeB,p3))
+                                       {
+                                               if (BOP_orientation(planeB,planeA)>0) {
+                                                       BOP_intersectCoplanarFaces(mesh,facesB,faceA,faceB,false);
+                                               }
+                                       }
+                                       else {
+                                               BOP_intersectNonCoplanarFaces(mesh,facesA,facesB,faceA,faceB);
+                                       }
+                               }
                        }
                        idxFaceB++;
                }
@@ -656,16 +658,16 @@ void BOP_mergeSort(MT_Point3 *points, unsigned int *face, unsigned int &size, bo
  * @param invert indicates if faceA has priority over faceB
  * @param segmemts array of the output x-segments
  */
- void BOP_createXS(BOP_Mesh*    mesh, 
-        BOP_Face*    faceA, 
-        BOP_Face*    faceB, 
-        BOP_Segment  sA, 
-        BOP_Segment  sB, 
-        bool         invert, 
-        BOP_Segment* segments) {    
-        BOP_createXS(mesh, faceA, faceB, faceA->getPlane(), faceB->getPlane(),
-                sA, sB, invert, segments);
- }
+void BOP_createXS(BOP_Mesh*    mesh,
+                  BOP_Face*    faceA,
+                  BOP_Face*    faceB,
+                  BOP_Segment  sA,
+                  BOP_Segment  sB,
+                  bool         invert,
+                  BOP_Segment* segments) {
+       BOP_createXS(mesh, faceA, faceB, faceA->getPlane(), faceB->getPlane(),
+                    sA, sB, invert, segments);
+}
 
 /**
  * Computes the x-segment of two segments (the shared interval). The segments needs to have sA.m_cfg1 > 0 && sB.m_cfg1 > 0 .
@@ -1169,7 +1171,7 @@ BOP_Face *BOP_getOppositeFace(BOP_Mesh*  mesh,
 void BOP_removeOverlappedFaces(BOP_Mesh *mesh,  BOP_Faces *facesA,  BOP_Faces *facesB)
 {
        for(unsigned int i=0;i<facesA->size();i++) {
-               BOP_Face *faceI = (*facesA)[i];       
+               BOP_Face *faceI = (*facesA)[i];
                if (faceI->getTAG()==BROKEN) continue;
                bool overlapped = false;
                MT_Point3 p1 = mesh->getVertex(faceI->getVertex(0))->getPoint();
@@ -1178,21 +1180,23 @@ void BOP_removeOverlappedFaces(BOP_Mesh *mesh,  BOP_Faces *facesA,  BOP_Faces *f
                for(unsigned int j=0;j<facesB->size();) {
                        BOP_Face *faceJ = (*facesB)[j];
                        if (faceJ->getTAG()!=BROKEN) {
-                         MT_Plane3 planeJ = faceJ->getPlane();
-                         if (BOP_containsPoint(planeJ,p1) && BOP_containsPoint(planeJ,p2) 
-                             && BOP_containsPoint(planeJ,p3)) {
-                           MT_Point3 q1 = mesh->getVertex(faceJ->getVertex(0))->getPoint();
-                           MT_Point3 q2 = mesh->getVertex(faceJ->getVertex(1))->getPoint();
-                           MT_Point3 q3 = mesh->getVertex(faceJ->getVertex(2))->getPoint();
-                           if (BOP_overlap(MT_Vector3(planeJ.x(),planeJ.y(),planeJ.z()),
-                                           p1,p2,p3,q1,q2,q3)) {
-                             facesB->erase(facesB->begin()+j,facesB->begin()+(j+1));
-                             faceJ->setTAG(BROKEN);
-                             overlapped = true;
-                           }
-                           else j++;
-                         }
-                         else j++;
+                               MT_Plane3 planeJ = faceJ->getPlane();
+                               if (BOP_containsPoint(planeJ,p1) && BOP_containsPoint(planeJ,p2)
+                                       && BOP_containsPoint(planeJ,p3))
+                               {
+                                       MT_Point3 q1 = mesh->getVertex(faceJ->getVertex(0))->getPoint();
+                                       MT_Point3 q2 = mesh->getVertex(faceJ->getVertex(1))->getPoint();
+                                       MT_Point3 q3 = mesh->getVertex(faceJ->getVertex(2))->getPoint();
+                                       if (BOP_overlap(MT_Vector3(planeJ.x(),planeJ.y(),planeJ.z()),
+                                                       p1,p2,p3,q1,q2,q3))
+                                       {
+                                               facesB->erase(facesB->begin()+j,facesB->begin()+(j+1));
+                                               faceJ->setTAG(BROKEN);
+                                               overlapped = true;
+                                       }
+                                       else j++;
+                               }
+                               else j++;
                        }else j++;
                }
                if (overlapped) faceI->setTAG(OVERLAPPED);
index 8b88c18f1513463041f17f2980b6b9a236c1ae20..f11c4eaffae2ae80e5637d67b73278500eb49753 100644 (file)
 #endif
 
 BoolOpState BOP_intersectionBoolOp(BOP_Mesh*  meshC,
-                                                                  BOP_Faces* facesA,
-                                                                  BOP_Faces* facesB,
-                                                                  bool       invertMeshA,
-                                                                  bool       invertMeshB);
+                                   BOP_Faces* facesA,
+                                   BOP_Faces* facesB,
+                                   bool       invertMeshA,
+                                   bool       invertMeshB);
 BOP_Face3* BOP_createFace(BOP_Mesh* mesh, 
-                                                 BOP_Index vertex1, 
-                                                 BOP_Index vertex2, 
-                                                 BOP_Index vertex3, 
-                                                 BOP_Index origFace);
+                          BOP_Index vertex1,
+                          BOP_Index vertex2,
+                          BOP_Index vertex3,
+                          BOP_Index origFace);
 void BOP_addMesh(BOP_Mesh*                     mesh,
-                                BOP_Faces*                    meshFacesId,
-                                CSG_FaceIteratorDescriptor&   face_it,
-                                CSG_VertexIteratorDescriptor& vertex_it,
-                                bool                          invert);
+                 BOP_Faces*                    meshFacesId,
+                 CSG_FaceIteratorDescriptor&   face_it,
+                 CSG_VertexIteratorDescriptor& vertex_it,
+                 bool                          invert);
 BSP_CSGMesh* BOP_newEmptyMesh();
 BSP_CSGMesh* BOP_exportMesh(BOP_Mesh*                  inputMesh, 
-                                                       bool                       invert);
+                            bool                       invert);
 void BOP_meshFilter(BOP_Mesh* meshC, BOP_Faces* faces, BOP_BSPTree* bsp);
 void BOP_simplifiedMeshFilter(BOP_Mesh* meshC, BOP_Faces* faces, BOP_BSPTree* bsp, bool inverted);
 void BOP_meshClassify(BOP_Mesh* meshC, BOP_Faces* faces, BOP_BSPTree* bsp);
index 5ea9872467d64eb4bd2b406287cdc3a522da7cd6..e35b5437f68a169bd8e3f5789c25e6e5e8abceb0 100644 (file)
@@ -788,20 +788,20 @@ BOP_Index BOP_Mesh::replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex)
 
 bool BOP_Mesh::isClosedMesh()
 {
-        for(unsigned int i=0; i<m_edges.size(); i++) {
-                        BOP_Edge *edge = m_edges[i];
-                        BOP_Indexs faces = edge->getFaces();
-                        unsigned int count = 0;
-                        const BOP_IT_Indexs facesEnd = faces.end();
-                        for(BOP_IT_Indexs it = faces.begin();it!=facesEnd;it++) {
-                                        if (m_faces[*it]->getTAG()!=BROKEN)
-                                                        count++;
-                        }
-
-                        if ((count%2)!=0) return false;
-        }
-
-        return true;
+       for(unsigned int i=0; i<m_edges.size(); i++) {
+               BOP_Edge *edge = m_edges[i];
+               BOP_Indexs faces = edge->getFaces();
+               unsigned int count = 0;
+               const BOP_IT_Indexs facesEnd = faces.end();
+               for(BOP_IT_Indexs it = faces.begin();it!=facesEnd;it++) {
+                       if (m_faces[*it]->getTAG()!=BROKEN)
+                               count++;
+               }
+
+               if ((count%2)!=0) return false;
+       }
+
+       return true;
 }
 
 
index 91523bad48398dd4e01ec132d703037fd4e162a0..df1374ef10be26f469ea97fc2227491dcedf9665 100644 (file)
@@ -91,14 +91,14 @@ CSG_PerformBooleanOperation(
        
        switch( op_type ) {
        case e_csg_union:
-         boolType = BOP_UNION;
-         break;
+               boolType = BOP_UNION;
+               break;
        case e_csg_difference:
-         boolType = BOP_DIFFERENCE;
-         break;
+               boolType = BOP_DIFFERENCE;
+               break;
        default:
-         boolType = BOP_INTERSECTION;
-         break;
+               boolType = BOP_INTERSECTION;
+               break;
        }
 
        BoolOpState boolOpResult;
index e1cd2755263a3cdc21e55d36118ba1c96ea84416..11813c4833105fbb75af6b7a553faff73ac5b359 100644 (file)
@@ -229,13 +229,13 @@ private:
        Parent(
                unsigned int i
        ) {
-                return (i-1) >> 1; 
+               return (i-1) >> 1;
        }
                int 
        Left(
                int i
        ) {
-               return (i<<1)+1; 
+               return (i<<1)+1;
        }
 
                int 
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d1ee5e0
--- /dev/null
@@ -0,0 +1,84 @@
+
+set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
+set(WITH_CYCLES_BLENDER ON)
+
+# External Libraries
+
+include(cmake/external_libs.cmake)
+
+# Build Flags
+
+if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
+       set(GCC_OPTIM_FLAGS "-ffast-math -msse -msse2 -msse3")
+endif()
+
+if(APPLE)
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
+       set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+endif()
+
+if(WIN32)
+       if(MSVC)
+               set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox /Ot /arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast")
+               set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+       elseif(CMAKE_COMPILER_IS_GNUCC)
+               set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
+               set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+       endif()
+endif()
+
+if(UNIX AND NOT APPLE)
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
+       set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+endif()
+
+# not needed yet, is for open shading language
+set(RTTI_DISABLE_FLAGS "")
+
+# Definitions and Includes
+
+add_definitions(${BOOST_DEFINITIONS} ${OPENIMAGEIO_DEFINITIONS})
+
+add_definitions(-DCCL_NAMESPACE_BEGIN=namespace\ ccl\ {)
+add_definitions(-DCCL_NAMESPACE_END=})
+
+if(WITH_CYCLES_NETWORK)
+  add_definitions(-DWITH_NETWORK)
+endif()
+
+if(WITH_CYCLES_OSL)
+  add_definitions(-DWITH_OSL)
+endif()
+
+if(WITH_CYCLES_PARTIO)
+  add_definitions(-DWITH_PARTIO)
+endif()
+
+if(WITH_CYCLES_CUDA_BINARIES)
+  add_definitions(-DWITH_CUDA_BINARIES)
+endif()
+
+add_definitions(-DWITH_OPENCL)
+add_definitions(-DWITH_CUDA)
+add_definitions(-DWITH_MULTI)
+
+include_directories(
+       ${BOOST_INCLUDE_DIR}
+       ${OPENIMAGEIO_INCLUDE_DIRS}
+       ${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO)
+
+# Subdirectories
+
+if(WITH_CYCLES_BLENDER)
+       add_subdirectory(blender)
+endif(WITH_CYCLES_BLENDER)
+
+add_subdirectory(app)
+add_subdirectory(bvh)
+add_subdirectory(device)
+add_subdirectory(doc)
+add_subdirectory(kernel)
+add_subdirectory(render)
+add_subdirectory(subd)
+add_subdirectory(util)
+
diff --git a/intern/cycles/SConscript b/intern/cycles/SConscript
new file mode 100644 (file)
index 0000000..e2c81ed
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/python
+from os import path
+Import('env')
+
+cycles = env.Clone()
+
+cycles.Depends('../../source/blender/makesrna/intern/RNA_blender_cpp.h', 'makesrna')
+
+sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + cycles.Glob('kernel/*.cpp') + cycles.Glob('render/*.cpp') + cycles.Glob('subd/*.cpp') + cycles.Glob('util/*.cpp') + cycles.Glob('util/*.c') + cycles.Glob('blender/*.cpp')
+
+sources.remove(path.join('util', 'util_view.cpp'))
+sources.remove(path.join('render', 'film_response.cpp'))
+
+incs = [] 
+defs = []
+ccflags = []
+cxxflags = []
+
+defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
+defs.append('CCL_NAMESPACE_END=}')
+
+defs.append('WITH_OPENCL')
+defs.append('WITH_MULTI')
+defs.append('WITH_CUDA')
+
+if env['OURPLATFORM'] in ('win32-mingw'):
+    if env['WITH_BF_RAYOPTIMIZATION']:
+        cxxflags.append('-ffast-math -msse -msse2 -msse3'.split())
+        ccflags.append('-ffast-math -msse -msse2 -msse3'.split())
+    # not needed yet, is for open shading language
+    # cxxflags.append('-fno-rtti'.split())
+    # defs.append('BOOST_NO_RTTI BOOST_NO_TYPEID'.split())
+
+incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split())
+incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna'.split())
+incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split())
+incs.extend('#extern/glew/include'.split())
+incs.append(cycles['BF_OIIO_INC'])
+incs.append(cycles['BF_BOOST_INC'])
+incs.append(cycles['BF_PYTHON_INC'])
+
+cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], compileflags=[None], cc_compileflags=ccflags, cxx_compileflags=cxxflags)
+
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2e2897d
--- /dev/null
@@ -0,0 +1,69 @@
+
+set(INC
+       .
+       ../device
+       ../kernel
+       ../kernel/svm
+       ../bvh
+       ../util
+       ../render
+       ../subd
+)
+
+set(LIBRARIES
+       cycles_device
+       cycles_kernel
+       cycles_render
+       cycles_bvh
+       cycles_subd
+       cycles_util
+       ${BOOST_LIBRARIES}
+       ${OPENGL_LIBRARIES}
+       ${CYCLES_GLEW_LIBRARY}
+       ${OPENIMAGEIO_LIBRARIES}
+)
+
+link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH})
+
+if(WITH_CYCLES_TEST)
+       list(APPEND LIBRARIES ${GLUT_LIBRARIES})
+endif()
+
+if(WITH_CYCLES_OSL)
+       list(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES})
+endif()
+
+if(WITH_CYCLES_PARTIO)
+       list(APPEND LIBRARIES ${PARTIO_LIBRARIES})
+endif()
+
+include_directories(${INC})
+
+if(WITH_CYCLES_TEST)
+       set(SRC
+               cycles_test.cpp
+               cycles_xml.cpp
+               cycles_xml.h
+       )
+       add_executable(cycles_test ${SRC})
+       target_link_libraries(cycles_test ${LIBRARIES})
+
+       if(UNIX AND NOT APPLE)
+               set_target_properties(cycles_test PROPERTIES INSTALL_RPATH $ORIGIN/lib)
+       endif()
+       unset(SRC)
+endif()
+
+if(WITH_CYCLES_NETWORK)
+       set(SRC
+               cycles_server.cpp
+       )
+       add_executable(cycles_server ${SRC})
+       target_link_libraries(cycles_server ${LIBRARIES})
+
+       if(UNIX AND NOT APPLE)
+               set_target_properties(cycles_server PROPERTIES INSTALL_RPATH $ORIGIN/lib)
+       endif()
+       unset(SRC)
+endif()
+
diff --git a/intern/cycles/app/cycles_server.cpp b/intern/cycles/app/cycles_server.cpp
new file mode 100644 (file)
index 0000000..bcf4d3e
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <stdio.h>
+
+#include "device.h"
+
+#include "util_args.h"
+#include "util_foreach.h"
+#include "util_path.h"
+#include "util_string.h"
+
+using namespace ccl;
+
+int main(int argc, const char **argv)
+{
+       path_init();
+
+       /* device types */
+       string devices = "";
+       string devicename = "cpu";
+
+       vector<DeviceType> types = Device::available_types();
+
+       foreach(DeviceType type, types) {
+               if(devices != "")
+                       devices += ", ";
+
+               devices += Device::string_from_type(type);
+       }
+
+       /* parse options */
+       ArgParse ap;
+
+       ap.options ("Usage: cycles_server [options]",
+               "--device %s", &devicename, ("Devices to use: " + devices).c_str(),
+               NULL);
+
+       if(ap.parse(argc, argv) < 0) {
+               fprintf(stderr, "%s\n", ap.error_message().c_str());
+               ap.usage();
+               exit(EXIT_FAILURE);
+       }
+
+       DeviceType dtype = Device::type_from_string(devicename.c_str());
+
+       while(1) {
+               Device *device = Device::create(dtype);
+               printf("Cycles Server with device: %s\n", device->description().c_str());
+               device->server_run();
+               delete device;
+       }
+
+       return 0;
+}
+
diff --git a/intern/cycles/app/cycles_test.cpp b/intern/cycles/app/cycles_test.cpp
new file mode 100644 (file)
index 0000000..27e53de
--- /dev/null
@@ -0,0 +1,307 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <stdio.h>
+
+#include "buffers.h"
+#include "camera.h"
+#include "device.h"
+#include "scene.h"
+#include "session.h"
+
+#include "util_args.h"
+#include "util_foreach.h"
+#include "util_function.h"
+#include "util_path.h"
+#include "util_progress.h"
+#include "util_string.h"
+#include "util_time.h"
+#include "util_view.h"
+
+#include "cycles_xml.h"
+
+CCL_NAMESPACE_BEGIN
+
+struct Options {
+       Session *session;
+       Scene *scene;
+       string filepath;
+       int width, height;
+       SceneParams scene_params;
+       SessionParams session_params;
+       bool quiet;
+} options;
+
+static void session_print(const string& str)
+{
+       /* print with carriage return to overwrite previous */
+       printf("\r%s", str.c_str());
+
+       /* add spaces to overwrite longer previous print */
+       static int maxlen = 0;
+       int len = str.size();
+       maxlen = max(len, maxlen);
+
+       for(int i = len; i < maxlen; i++)
+               printf(" ");
+
+       /* flush because we don't write an end of line */
+       fflush(stdout);
+}
+
+static void session_print_status()
+{
+       int sample;
+       double total_time, sample_time;
+       string status, substatus;
+
+       /* get status */
+       options.session->progress.get_sample(sample, total_time, sample_time);
+       options.session->progress.get_status(status, substatus);
+
+       if(substatus != "")
+               status += ": " + substatus;
+
+       /* print status */
+       status = string_printf("Sample %d   %s", sample, status.c_str());
+       session_print(status);
+}
+
+static void session_init()
+{
+       options.session = new Session(options.session_params);
+       options.session->reset(options.width, options.height, options.session_params.samples);
+       options.session->scene = options.scene;
+       
+       if(options.session_params.background && !options.quiet)
+               options.session->progress.set_update_callback(function_bind(&session_print_status));
+       else
+               options.session->progress.set_update_callback(function_bind(&view_redraw));
+
+       options.session->start();
+
+       options.scene = NULL;
+}
+
+static void scene_init()
+{
+       options.scene = new Scene(options.scene_params);
+       xml_read_file(options.scene, options.filepath.c_str());
+       options.width = options.scene->camera->width;
+       options.height = options.scene->camera->height;
+}
+
+static void session_exit()
+{
+       if(options.session) {
+               delete options.session;
+               options.session = NULL;
+       }
+       if(options.scene) {
+               delete options.scene;
+               options.scene = NULL;
+       }
+
+       if(options.session_params.background && !options.quiet) {
+               session_print("Finished Rendering.");
+               printf("\n");
+       }
+}
+
+static void display_info(Progress& progress)
+{
+       static double latency = 0.0;
+       static double last = 0;
+       double elapsed = time_dt();
+       string str;
+
+       latency = (elapsed - last);
+       last = elapsed;
+
+       int sample;
+       double total_time, sample_time;
+       string status, substatus;
+
+       progress.get_sample(sample, total_time, sample_time);
+       progress.get_status(status, substatus);
+
+       if(substatus != "")
+               status += ": " + substatus;
+
+       str = string_printf("latency: %.4f        sample: %d        total: %.4f        average: %.4f        %s",
+               latency, sample, total_time, sample_time, status.c_str());
+
+       view_display_info(str.c_str());
+}
+
+static void display()
+{
+       options.session->draw(options.width, options.height);
+
+       display_info(options.session->progress);
+}
+
+static void resize(int width, int height)
+{
+       options.width= width;
+       options.height= height;
+
+       if(options.session)
+               options.session->reset(options.width, options.height, options.session_params.samples);
+}
+
+void keyboard(unsigned char key)
+{
+       if(key == 'r')
+               options.session->reset(options.width, options.height, options.session_params.samples);
+       else if(key == 27) // escape
+               options.session->progress.set_cancel("Cancelled");
+}
+
+static int files_parse(int argc, const char *argv[])
+{
+       if(argc > 0)
+               options.filepath = argv[0];
+
+       return 0;
+}
+
+static void options_parse(int argc, const char **argv)
+{
+       options.width= 1024;
+       options.height= 512;
+       options.filepath = "";
+       options.session = NULL;
+       options.quiet = false;
+
+       /* devices */
+       string devices = "";
+       string devicename = "cpu";
+
+       vector<DeviceType> types = Device::available_types();
+
+       foreach(DeviceType type, types) {
+               if(devices != "")
+                       devices += ", ";
+
+               devices += Device::string_from_type(type);
+       }
+
+       /* shading system */
+       string ssname = "svm";
+       string shadingsystems = "Shading system to use: svm";
+
+#ifdef WITH_OSL
+       shadingsystems += ", osl"; 
+#endif
+
+       /* parse options */
+       ArgParse ap;
+       bool help = false;
+
+       ap.options ("Usage: cycles_test [options] file.xml",
+               "%*", files_parse, "",
+               "--device %s", &devicename, ("Devices to use: " + devices).c_str(),
+               "--shadingsys %s", &ssname, "Shading system to use: svm, osl",
+               "--background", &options.session_params.background, "Render in background, without user interface",
+               "--quiet", &options.quiet, "In background mode, don't print progress messages",
+               "--samples %d", &options.session_params.samples, "Number of samples to render",
+               "--output %s", &options.session_params.output_path, "File path to write output image",
+               "--threads %d", &options.session_params.threads, "CPU Rendering Threads",
+               "--help", &help, "Print help message",
+               NULL);
+       
+       if(ap.parse(argc, argv) < 0) {
+               fprintf(stderr, "%s\n", ap.error_message().c_str());
+               ap.usage();
+               exit(EXIT_FAILURE);
+       }
+       else if(help || options.filepath == "") {
+               ap.usage();
+               exit(EXIT_SUCCESS);
+       }
+
+       options.session_params.device_type = Device::type_from_string(devicename.c_str());
+
+       if(ssname == "osl")
+               options.scene_params.shadingsystem = SceneParams::OSL;
+       else if(ssname == "svm")
+               options.scene_params.shadingsystem = SceneParams::SVM;
+
+       /* handle invalid configurations */
+       bool type_available = false;
+
+       foreach(DeviceType dtype, types)
+               if(options.session_params.device_type == dtype)
+                       type_available = true;
+
+       if(options.session_params.device_type == DEVICE_NONE || !type_available) {
+               fprintf(stderr, "Unknown device: %s\n", devicename.c_str());
+               exit(EXIT_FAILURE);
+       }
+#ifdef WITH_OSL
+       else if(!(ssname == "osl" || ssname == "svm")) {
+#else
+       else if(!(ssname == "svm")) {
+#endif
+               fprintf(stderr, "Unknown shading system: %s\n", ssname.c_str());
+               exit(EXIT_FAILURE);
+       }
+       else if(options.scene_params.shadingsystem == SceneParams::OSL && options.session_params.device_type != DEVICE_CPU) {
+               fprintf(stderr, "OSL shading system only works with CPU device\n");
+               exit(EXIT_FAILURE);
+       }
+       else if(options.session_params.samples < 0) {
+               fprintf(stderr, "Invalid number of samples: %d\n", options.session_params.samples);
+               exit(EXIT_FAILURE);
+       }
+       else if(options.filepath == "") {
+               fprintf(stderr, "No file path specified\n");
+               exit(EXIT_FAILURE);
+       }
+
+       /* load scene */
+       scene_init();
+}
+
+CCL_NAMESPACE_END
+
+using namespace ccl;
+
+int main(int argc, const char **argv)
+{
+       path_init("../build/bin/2.59/scripts/addons/cycles/");
+
+       options_parse(argc, argv);
+
+       if(options.session_params.background) {
+               session_init();
+               options.session->wait();
+               session_exit();
+       }
+       else {
+               string title = "Cycles: " + path_filename(options.filepath);
+
+               /* init/exit are callback so they run while GL is initialized */
+               view_main_loop(title.c_str(), options.width, options.height,
+                       session_init, session_exit, resize, display, keyboard);
+       }
+
+       return 0;
+}
+
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
new file mode 100644 (file)
index 0000000..5f9e1d7
--- /dev/null
@@ -0,0 +1,942 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <stdio.h>
+
+#include <sstream>
+#include <algorithm>
+#include <iterator>
+
+#include "camera.h"
+#include "film.h"
+#include "graph.h"
+#include "integrator.h"
+#include "light.h"
+#include "mesh.h"
+#include "nodes.h"
+#include "object.h"
+#include "shader.h"
+#include "scene.h"
+
+#include "subd_mesh.h"
+#include "subd_patch.h"
+#include "subd_split.h"
+
+#include "util_debug.h"
+#include "util_foreach.h"
+#include "util_path.h"
+#include "util_transform.h"
+#include "util_xml.h"
+
+#include "cycles_xml.h"
+
+CCL_NAMESPACE_BEGIN
+
+/* XML reading state */
+
+struct XMLReadState {
+       Scene *scene;           /* scene pointer */
+       Transform tfm;          /* current transform state */
+       bool smooth;            /* smooth normal state */
+       int shader;                     /* current shader */
+       string base;            /* base path to current file*/
+       float dicing_rate;      /* current dicing rate */
+       Mesh::DisplacementMethod displacement_method;
+};
+
+/* Attribute Reading */
+
+static bool xml_read_bool(bool *value, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               *value = (string_iequals(attr.value(), "true")) || (atoi(attr.value()) != 0);
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_int(int *value, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               *value = atoi(attr.value());
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_int_array(vector<int>& value, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               vector<string> tokens;
+               string_split(tokens, attr.value());
+
+               foreach(const string& token, tokens)
+                       value.push_back(atoi(token.c_str()));
+
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_float(float *value, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               *value = atof(attr.value());
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_float_array(vector<float>& value, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               vector<string> tokens;
+               string_split(tokens, attr.value());
+
+               foreach(const string& token, tokens)
+                       value.push_back(atof(token.c_str()));
+
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_float3(float3 *value, pugi::xml_node node, const char *name)
+{
+       vector<float> array;
+
+       if(xml_read_float_array(array, node, name) && array.size() == 3) {
+               *value = make_float3(array[0], array[1], array[2]);
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_float3_array(vector<float3>& value, pugi::xml_node node, const char *name)
+{
+       vector<float> array;
+
+       if(xml_read_float_array(array, node, name)) {
+               for(size_t i = 0; i < array.size(); i += 3)
+                       value.push_back(make_float3(array[i+0], array[i+1], array[i+2]));
+
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_float4(float4 *value, pugi::xml_node node, const char *name)
+{
+       vector<float> array;
+
+       if(xml_read_float_array(array, node, name) && array.size() == 4) {
+               *value = make_float4(array[0], array[1], array[2], array[3]);
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_string(string *str, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               *str = attr.value();
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_read_ustring(ustring *str, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               *str = ustring(attr.value());
+               return true;
+       }
+
+       return false;
+}
+
+static bool xml_equal_string(pugi::xml_node node, const char *name, const char *value)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr)
+               return string_iequals(attr.value(), value);
+       
+       return false;
+}
+
+static bool xml_read_enum(ustring *str, ShaderEnum& enm, pugi::xml_node node, const char *name)
+{
+       pugi::xml_attribute attr = node.attribute(name);
+
+       if(attr) {
+               ustring ustr(attr.value());
+
+               if(enm.exists(ustr)) {
+                       *str = ustr;
+                       return true;
+               }
+               else
+                       fprintf(stderr, "Unknown value \"%s\" for attribute \"%s\".\n", ustr.c_str(), name);
+       }
+
+       return false;
+}
+
+/* Film */
+
+static void xml_read_film(const XMLReadState& state, pugi::xml_node node)
+{
+       Camera *cam = state.scene->camera;
+
+       xml_read_int(&cam->width, node, "width");
+       xml_read_int(&cam->height, node, "height");
+
+       float aspect = (float)cam->width/(float)cam->height;
+
+       if(cam->width >= cam->height) {
+               cam->left = -aspect;
+               cam->right = aspect;
+               cam->bottom = -1.0f;
+               cam->top = 1.0f;
+       }
+       else {
+               cam->left = -1.0f;
+               cam->right = 1.0f;
+               cam->bottom = -1.0f/aspect;
+               cam->top = 1.0f/aspect;
+       }
+
+       cam->need_update = true;
+       cam->update();
+}
+
+/* Integrator */
+
+static void xml_read_integrator(const XMLReadState& state, pugi::xml_node node)
+{
+       Integrator *integrator = state.scene->integrator;
+
+       xml_read_int(&integrator->min_bounce, node, "min_bounce");
+       xml_read_int(&integrator->max_bounce, node, "max_bounce");
+       xml_read_bool(&integrator->no_caustics, node, "no_caustics");
+       xml_read_float(&integrator->blur_caustics, node, "blur_caustics");
+}
+
+/* Camera */
+
+static void xml_read_camera(const XMLReadState& state, pugi::xml_node node)
+{
+       Camera *cam = state.scene->camera;
+
+       if(xml_read_float(&cam->fov, node, "fov"))
+               cam->fov *= M_PI/180.0f;
+
+       xml_read_float(&cam->nearclip, node, "nearclip");
+       xml_read_float(&cam->farclip, node, "farclip");
+       xml_read_float(&cam->aperturesize, node, "aperturesize"); // 0.5*focallength/fstop
+       xml_read_float(&cam->focaldistance, node, "focaldistance");
+       xml_read_float(&cam->shutteropen, node, "shutteropen");
+       xml_read_float(&cam->shutterclose, node, "shutterclose");
+
+       if(xml_equal_string(node, "type", "orthographic"))
+               cam->ortho = true;
+       else if(xml_equal_string(node, "type", "perspective"))
+               cam->ortho = false;
+
+       cam->matrix = state.tfm;
+
+       cam->need_update = true;
+       cam->update();
+}
+
+/* Shader */
+
+static string xml_socket_name(const char *name)
+{
+       string sname = name;
+       size_t i;
+
+       while((i = sname.find(" ")) != string::npos)
+               sname.replace(i, 1, "");
+       
+       return sname;
+}
+
+static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pugi::xml_node graph_node)
+{
+       ShaderGraph *graph = new ShaderGraph();
+
+       map<string, ShaderNode*> nodemap;
+
+       nodemap["output"] = graph->output();
+
+       for(pugi::xml_node node = graph_node.first_child(); node; node = node.next_sibling()) {
+               ShaderNode *snode = NULL;
+
+               if(string_iequals(node.name(), "image_texture")) {
+                       ImageTextureNode *img = new ImageTextureNode();
+
+                       xml_read_string(&img->filename, node, "src");
+                       img->filename = path_join(state.base, img->filename);
+
+                       snode = img;
+               }
+               else if(string_iequals(node.name(), "environment_texture")) {
+                       EnvironmentTextureNode *env = new EnvironmentTextureNode();
+
+                       xml_read_string(&env->filename, node, "src");
+                       env->filename = path_join(state.base, env->filename);
+
+                       snode = env;
+               }
+               else if(string_iequals(node.name(), "sky_texture")) {
+                       SkyTextureNode *sky = new SkyTextureNode();
+
+                       xml_read_float3(&sky->sun_direction, node, "sun_direction");
+                       xml_read_float(&sky->turbidity, node, "turbidity");
+                       
+                       snode = sky;
+               }
+               else if(string_iequals(node.name(), "noise_texture")) {
+                       snode = new NoiseTextureNode();
+               }
+               else if(string_iequals(node.name(), "blend_texture")) {
+                       BlendTextureNode *blend = new BlendTextureNode();
+                       xml_read_enum(&blend->progression, BlendTextureNode::progression_enum, node, "progression");
+                       xml_read_enum(&blend->axis, BlendTextureNode::axis_enum, node, "axis");
+                       snode = blend;
+               }
+               else if(string_iequals(node.name(), "clouds_texture")) {
+                       CloudsTextureNode *clouds = new CloudsTextureNode();
+                       xml_read_bool(&clouds->hard, node, "hard");
+                       xml_read_int(&clouds->depth, node, "depth");
+                       xml_read_enum(&clouds->basis, CloudsTextureNode::basis_enum, node, "basis");
+                       snode = clouds;
+               }
+               else if(string_iequals(node.name(), "voronoi_texture")) {
+                       VoronoiTextureNode *voronoi = new VoronoiTextureNode();
+                       xml_read_enum(&voronoi->distance_metric, VoronoiTextureNode::distance_metric_enum, node, "distance_metric");
+                       xml_read_enum(&voronoi->coloring, VoronoiTextureNode::coloring_enum, node, "coloring");
+                       snode = voronoi;
+               }
+               else if(string_iequals(node.name(), "musgrave_texture")) {
+                       MusgraveTextureNode *musgrave = new MusgraveTextureNode();
+                       xml_read_enum(&musgrave->type, MusgraveTextureNode::type_enum, node, "type");
+                       xml_read_enum(&musgrave->basis, MusgraveTextureNode::basis_enum, node, "basis");
+                       snode = musgrave;
+               }
+               else if(string_iequals(node.name(), "marble_texture")) {
+                       MarbleTextureNode *marble = new MarbleTextureNode();
+                       xml_read_enum(&marble->type, MarbleTextureNode::type_enum, node, "type");
+                       xml_read_enum(&marble->wave, MarbleTextureNode::wave_enum, node, "wave");
+                       xml_read_enum(&marble->basis, MarbleTextureNode::basis_enum, node, "basis");
+                       xml_read_bool(&marble->hard, node, "hard");
+                       xml_read_int(&marble->depth, node, "depth");
+                       snode = marble;
+               }
+               else if(string_iequals(node.name(), "magic_texture")) {
+                       MagicTextureNode *magic = new MagicTextureNode();
+                       xml_read_int(&magic->depth, node, "depth");
+                       snode = magic;
+               }
+               else if(string_iequals(node.name(), "stucci_texture")) {
+                       StucciTextureNode *stucci = new StucciTextureNode();
+                       xml_read_enum(&stucci->type, StucciTextureNode::type_enum, node, "type");
+                       xml_read_enum(&stucci->basis, StucciTextureNode::basis_enum, node, "basis");
+                       xml_read_bool(&stucci->hard, node, "hard");
+                       snode = stucci;
+               }
+               else if(string_iequals(node.name(), "distorted_noise_texture")) {
+                       DistortedNoiseTextureNode *dist = new DistortedNoiseTextureNode();
+                       xml_read_enum(&dist->basis, DistortedNoiseTextureNode::basis_enum, node, "basis");
+                       xml_read_enum(&dist->distortion_basis, DistortedNoiseTextureNode::basis_enum, node, "distortion_basis");
+                       snode = dist;
+               }
+               else if(string_iequals(node.name(), "wood_texture")) {
+                       WoodTextureNode *wood = new WoodTextureNode();
+                       xml_read_enum(&wood->type, WoodTextureNode::type_enum, node, "type");
+                       xml_read_enum(&wood->wave, WoodTextureNode::wave_enum, node, "wave");
+                       xml_read_enum(&wood->basis, WoodTextureNode::basis_enum, node, "basis");
+                       xml_read_bool(&wood->hard, node, "hard");
+                       snode = wood;
+               }
+               else if(string_iequals(node.name(), "mapping")) {
+                       snode = new MappingNode();
+               }
+               else if(string_iequals(node.name(), "ward_bsdf")) {
+                       snode = new WardBsdfNode();
+               }
+               else if(string_iequals(node.name(), "diffuse_bsdf")) {
+                       snode = new DiffuseBsdfNode();
+               }
+               else if(string_iequals(node.name(), "translucent_bsdf")) {
+                       snode = new TranslucentBsdfNode();
+               }
+               else if(string_iequals(node.name(), "transparent_bsdf")) {
+                       snode = new TransparentBsdfNode();
+               }
+               else if(string_iequals(node.name(), "velvet_bsdf")) {
+                       snode = new VelvetBsdfNode();
+               }
+               else if(string_iequals(node.name(), "glossy_bsdf")) {
+                       GlossyBsdfNode *glossy = new GlossyBsdfNode();
+                       xml_read_enum(&glossy->distribution, GlossyBsdfNode::distribution_enum, node, "distribution");
+                       snode = glossy;
+               }
+               else if(string_iequals(node.name(), "glass_bsdf")) {
+                       GlassBsdfNode *diel = new GlassBsdfNode();
+                       xml_read_enum(&diel->distribution, GlassBsdfNode::distribution_enum, node, "distribution");
+                       snode = diel;
+               }
+               else if(string_iequals(node.name(), "emission")) {
+                       EmissionNode *emission = new EmissionNode();
+                       xml_read_bool(&emission->total_power, node, "total_power");
+                       snode = emission;
+               }
+               else if(string_iequals(node.name(), "background")) {
+                       snode = new BackgroundNode();
+               }
+               else if(string_iequals(node.name(), "transparent_volume")) {
+                       snode = new TransparentVolumeNode();
+               }
+               else if(string_iequals(node.name(), "isotropic_volume")) {
+                       snode = new IsotropicVolumeNode();
+               }
+               else if(string_iequals(node.name(), "geometry")) {
+                       snode = new GeometryNode();
+               }
+               else if(string_iequals(node.name(), "texture_coordinate")) {
+                       snode = new TextureCoordinateNode();
+               }
+               else if(string_iequals(node.name(), "lightPath")) {
+                       snode = new LightPathNode();
+               }
+               else if(string_iequals(node.name(), "value")) {
+                       ValueNode *value = new ValueNode();
+                       xml_read_float(&value->value, node, "value");
+                       snode = value;
+               }
+               else if(string_iequals(node.name(), "color")) {
+                       ColorNode *color = new ColorNode();
+                       xml_read_float3(&color->value, node, "value");
+                       snode = color;
+               }
+               else if(string_iequals(node.name(), "mix_closure")) {
+                       snode = new MixClosureNode();
+               }
+               else if(string_iequals(node.name(), "add_closure")) {
+                       snode = new AddClosureNode();
+               }
+               else if(string_iequals(node.name(), "mix")) {
+                       MixNode *mix = new MixNode();
+                       xml_read_enum(&mix->type, MixNode::type_enum, node, "type");
+                       snode = mix;
+               }
+               else if(string_iequals(node.name(), "attribute")) {
+                       AttributeNode *attr = new AttributeNode();
+                       xml_read_ustring(&attr->attribute, node, "attribute");
+                       snode = attr;
+               }
+               else if(string_iequals(node.name(), "fresnel")) {
+                       snode = new FresnelNode();
+               }
+               else if(string_iequals(node.name(), "math")) {
+                       MathNode *math = new MathNode();
+                       xml_read_enum(&math->type, MathNode::type_enum, node, "type");
+                       snode = math;
+               }
+               else if(string_iequals(node.name(), "vector_math")) {
+                       VectorMathNode *vmath = new VectorMathNode();
+                       xml_read_enum(&vmath->type, VectorMathNode::type_enum, node, "type");
+                       snode = vmath;
+               }
+               else if(string_iequals(node.name(), "connect")) {
+                       /* connect nodes */
+                       vector<string> from_tokens, to_tokens;
+
+                       string_split(from_tokens, node.attribute("from").value());
+                       string_split(to_tokens, node.attribute("to").value());
+
+                       if(from_tokens.size() == 2 && to_tokens.size() == 2) {
+                               /* find nodes and sockets */
+                               ShaderOutput *output = NULL;
+                               ShaderInput *input = NULL;
+
+                               if(nodemap.find(from_tokens[0]) != nodemap.end()) {
+                                       ShaderNode *fromnode = nodemap[from_tokens[0]];
+
+                                       foreach(ShaderOutput *out, fromnode->outputs)
+                                               if(string_iequals(xml_socket_name(out->name), from_tokens[1]))
+                                                       output = out;
+
+                                       if(!output)
+                                               fprintf(stderr, "Unknown output socket name \"%s\" on \"%s\".\n", from_tokens[1].c_str(), from_tokens[0].c_str());
+                               }
+                               else
+                                       fprintf(stderr, "Unknown shader node name \"%s\".\n", from_tokens[0].c_str());
+
+                               if(nodemap.find(to_tokens[0]) != nodemap.end()) {
+                                       ShaderNode *tonode = nodemap[to_tokens[0]];
+
+                                       foreach(ShaderInput *in, tonode->inputs)
+                                               if(string_iequals(xml_socket_name(in->name), to_tokens[1]))
+                                                       input = in;
+
+                                       if(!input)
+                                               fprintf(stderr, "Unknown input socket name \"%s\" on \"%s\".\n", to_tokens[1].c_str(), to_tokens[0].c_str());
+                               }
+                               else
+                                       fprintf(stderr, "Unknown shader node name \"%s\".\n", to_tokens[0].c_str());
+
+                               /* connect */
+                               if(output && input)
+                                       graph->connect(output, input);
+                       }
+                       else
+                               fprintf(stderr, "Invalid from or to value for connect node.\n");
+               }
+               else
+                       fprintf(stderr, "Unknown shader node \"%s\".\n", node.name());
+
+               if(snode) {
+                       /* add to graph */
+                       graph->add(snode);
+
+                       /* add to map for name lookups */
+                       string name = "";
+                       xml_read_string(&name, node, "name");
+
+                       nodemap[name] = snode;
+
+                       /* read input values */
+                       for(pugi::xml_attribute attr = node.first_attribute(); attr; attr = attr.next_attribute()) {
+                               foreach(ShaderInput *in, snode->inputs) {
+                                       if(string_iequals(in->name, attr.name())) {
+                                               switch(in->type) {
+                                                       case SHADER_SOCKET_FLOAT:
+                                                               xml_read_float(&in->value.x, node, attr.name());
+                                                               break;
+                                                       case SHADER_SOCKET_COLOR:
+                                                       case SHADER_SOCKET_VECTOR:
+                                                       case SHADER_SOCKET_POINT:
+                                                       case SHADER_SOCKET_NORMAL:
+                                                               xml_read_float3(&in->value, node, attr.name());
+                                                               break;
+                                                       default:
+                                                               break;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+       shader->set_graph(graph);
+       shader->tag_update(state.scene);
+}
+
+static void xml_read_shader(const XMLReadState& state, pugi::xml_node node)
+{
+       Shader *shader = new Shader();
+       xml_read_string(&shader->name, node, "name");
+       xml_read_shader_graph(state, shader, node);
+       state.scene->shaders.push_back(shader);
+}
+
+/* Background */
+
+static void xml_read_background(const XMLReadState& state, pugi::xml_node node)
+{
+       Shader *shader = state.scene->shaders[state.scene->default_background];
+
+       xml_read_shader_graph(state, shader, node);
+}
+
+/* Mesh */
+
+static Mesh *xml_add_mesh(Scene *scene, const Transform& tfm)
+{
+       /* create mesh */
+       Mesh *mesh = new Mesh();
+       scene->meshes.push_back(mesh);
+
+       /* create object*/
+       Object *object = new Object();
+       object->mesh = mesh;
+       object->tfm = tfm;
+       scene->objects.push_back(object);
+
+       return mesh;
+}
+
+static void xml_read_mesh(const XMLReadState& state, pugi::xml_node node)
+{
+       /* add mesh */
+       Mesh *mesh = xml_add_mesh(state.scene, state.tfm);
+       mesh->used_shaders.push_back(state.shader);
+
+       /* read state */
+       int shader = state.shader;
+       bool smooth = state.smooth;
+
+       mesh->displacement_method = state.displacement_method;
+
+       /* read vertices and polygons, RIB style */
+       vector<float3> P;
+       vector<int> verts, nverts;
+
+       xml_read_float3_array(P, node, "P");
+       xml_read_int_array(verts, node, "verts");
+       xml_read_int_array(nverts, node, "nverts");
+
+       if(xml_equal_string(node, "subdivision", "catmull-clark")) {
+               /* create subd mesh */
+               SubdMesh sdmesh;
+
+               /* create subd vertices */
+               for(size_t i = 0; i < P.size(); i++)
+                       sdmesh.add_vert(P[i]);
+
+               /* create subd faces */
+               int index_offset = 0;
+
+               for(size_t i = 0; i < nverts.size(); i++) {
+                       if(nverts[i] == 4) {
+                               int v0 = verts[index_offset + 0];
+                               int v1 = verts[index_offset + 1];
+                               int v2 = verts[index_offset + 2];
+                               int v3 = verts[index_offset + 3];
+
+                               sdmesh.add_face(v0, v1, v2, v3);
+                       }
+                       else {
+                               for(int j = 0; j < nverts[i]-2; j++) {
+                                       int v0 = verts[index_offset];
+                                       int v1 = verts[index_offset + j + 1];
+                                       int v2 = verts[index_offset + j + 2];;
+
+                                       sdmesh.add_face(v0, v1, v2);
+                               }
+                       }
+
+                       index_offset += nverts[i];
+               }
+
+               /* finalize subd mesh */
+               sdmesh.link_boundary();
+
+               /* subdivide */
+               DiagSplit dsplit;
+               //dsplit.camera = state.scene->camera;
+               //dsplit.dicing_rate = 5.0f;
+               dsplit.dicing_rate = state.dicing_rate;
+               xml_read_float(&dsplit.dicing_rate, node, "dicing_rate");
+               sdmesh.tesselate(&dsplit, false, mesh, shader, smooth);
+       }
+       else {
+               /* create vertices */
+               mesh->verts = P;
+
+               /* create triangles */
+               int index_offset = 0;
+
+               for(size_t i = 0; i < nverts.size(); i++) {
+                       for(int j = 0; j < nverts[i]-2; j++) {
+                               int v0 = verts[index_offset];
+                               int v1 = verts[index_offset + j + 1];
+                               int v2 = verts[index_offset + j + 2];
+
+                               assert(v0 < (int)P.size());
+                               assert(v1 < (int)P.size());
+                               assert(v2 < (int)P.size());
+
+                               mesh->add_triangle(v0, v1, v2, shader, smooth);
+                       }
+
+                       index_offset += nverts[i];
+               }
+       }
+
+       /* temporary for test compatibility */
+       mesh->attributes.remove(Attribute::STD_VERTEX_NORMAL);
+}
+
+/* Patch */
+
+static void xml_read_patch(const XMLReadState& state, pugi::xml_node node)
+{
+       /* read patch */
+       Patch *patch = NULL;
+
+       vector<float3> P;
+       xml_read_float3_array(P, node, "P");
+
+       if(xml_equal_string(node, "type", "bilinear")) {
+               /* bilinear patch */
+               if(P.size() == 4) {
+                       LinearQuadPatch *bpatch = new LinearQuadPatch();
+
+                       for(int i = 0; i < 4; i++)
+                               P[i] = transform(&state.tfm, P[i]);
+                       memcpy(bpatch->hull, &P[0], sizeof(bpatch->hull));
+
+                       patch = bpatch;
+               }
+               else
+                       fprintf(stderr, "Invalid number of control points for bilinear patch.\n");
+       }
+       else if(xml_equal_string(node, "type", "bicubic")) {
+               /* bicubic patch */
+               if(P.size() == 16) {
+                       BicubicPatch *bpatch = new BicubicPatch();
+
+                       for(int i = 0; i < 16; i++)
+                               P[i] = transform(&state.tfm, P[i]);
+                       memcpy(bpatch->hull, &P[0], sizeof(bpatch->hull));
+
+                       patch = bpatch;
+               }
+               else
+                       fprintf(stderr, "Invalid number of control points for bicubic patch.\n");
+       }
+       else
+               fprintf(stderr, "Unknown patch type.\n");
+
+       if(patch) {
+               /* add mesh */
+               Mesh *mesh = xml_add_mesh(state.scene, transform_identity());
+
+               mesh->used_shaders.push_back(state.shader);
+
+               /* split */
+               DiagSplit dsplit;
+               //dsplit.camera = state.scene->camera;
+               //dsplit.dicing_rate = 5.0f;
+               dsplit.dicing_rate = state.dicing_rate;
+               xml_read_float(&dsplit.dicing_rate, node, "dicing_rate");
+               dsplit.split_quad(mesh, patch, state.shader, state.smooth);
+
+               delete patch;
+
+               /* temporary for test compatibility */
+               mesh->attributes.remove(Attribute::STD_VERTEX_NORMAL);
+       }
+}
+
+/* Light */
+
+static void xml_read_light(const XMLReadState& state, pugi::xml_node node)
+{
+       Light *light = new Light();
+       light->shader = state.shader;
+       xml_read_float3(&light->co, node, "P");
+       light->co = transform(&state.tfm, light->co);
+
+       state.scene->lights.push_back(light);
+}
+
+/* Transform */
+
+static void xml_read_transform(pugi::xml_node node, Transform& tfm)
+{
+       if(node.attribute("matrix")) {
+               vector<float> matrix;
+               if(xml_read_float_array(matrix, node, "matrix") && matrix.size() == 16)
+                       tfm = tfm * transform_transpose((*(Transform*)&matrix[0]));
+       }
+
+       if(node.attribute("translate")) {
+               float3 translate = make_float3(0.0f, 0.0f, 0.0f);
+               xml_read_float3(&translate, node, "translate");
+               tfm = tfm * transform_translate(translate);
+       }
+
+       if(node.attribute("rotate")) {
+               float4 rotate = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+               xml_read_float4(&rotate, node, "rotate");
+               tfm = tfm * transform_rotate(rotate.x*M_PI/180.0f, make_float3(rotate.y, rotate.z, rotate.w));
+       }
+
+       if(node.attribute("scale")) {
+               float3 scale = make_float3(0.0f, 0.0f, 0.0f);
+               xml_read_float3(&scale, node, "scale");
+               tfm = tfm * transform_scale(scale);
+       }
+}
+
+/* State */
+
+static void xml_read_state(XMLReadState& state, pugi::xml_node node)
+{
+       /* read shader */
+       string shadername;
+
+       if(xml_read_string(&shadername, node, "shader")) {
+               int i = 0;
+               bool found = false;
+
+               foreach(Shader *shader, state.scene->shaders) {
+                       if(shader->name == shadername) {
+                               state.shader = i;
+                               found = true;
+                               break;
+                       }
+
+                       i++;
+               }
+
+               if(!found)
+                       fprintf(stderr, "Unknown shader \"%s\".\n", shadername.c_str());
+       }
+
+       xml_read_float(&state.dicing_rate, node, "dicing_rate");
+
+       /* read smooth/flat */
+       if(xml_equal_string(node, "interpolation", "smooth"))
+               state.smooth = true;
+       else if(xml_equal_string(node, "interpolation", "flat"))
+               state.smooth = false;
+
+       /* read displacement method */
+       if(xml_equal_string(node, "displacement_method", "true"))
+               state.displacement_method = Mesh::DISPLACE_TRUE;
+       else if(xml_equal_string(node, "displacement_method", "bump"))
+               state.displacement_method = Mesh::DISPLACE_BUMP;
+       else if(xml_equal_string(node, "displacement_method", "both"))
+               state.displacement_method = Mesh::DISPLACE_BOTH;
+}
+
+/* Scene */
+
+static void xml_read_include(const XMLReadState& state, const string& src);
+
+static void xml_read_scene(const XMLReadState& state, pugi::xml_node scene_node)
+{
+       for(pugi::xml_node node = scene_node.first_child(); node; node = node.next_sibling()) {
+               if(string_iequals(node.name(), "film")) {
+                       xml_read_film(state, node);
+               }
+               else if(string_iequals(node.name(), "integrator")) {
+                       xml_read_integrator(state, node);
+               }
+               else if(string_iequals(node.name(), "camera")) {
+                       xml_read_camera(state, node);
+               }
+               else if(string_iequals(node.name(), "shader")) {
+                       xml_read_shader(state, node);
+               }
+               else if(string_iequals(node.name(), "background")) {
+                       xml_read_background(state, node);
+               }
+               else if(string_iequals(node.name(), "mesh")) {
+                       xml_read_mesh(state, node);
+               }
+               else if(string_iequals(node.name(), "patch")) {
+                       xml_read_patch(state, node);
+               }
+               else if(string_iequals(node.name(), "light")) {
+                       xml_read_light(state, node);
+               }
+               else if(string_iequals(node.name(), "transform")) {
+                       XMLReadState substate = state;
+
+                       xml_read_transform(node, substate.tfm);
+                       xml_read_scene(substate, node);
+               }
+               else if(string_iequals(node.name(), "state")) {
+                       XMLReadState substate = state;
+
+                       xml_read_state(substate, node);
+                       xml_read_scene(substate, node);
+               }
+               else if(string_iequals(node.name(), "include")) {
+                       string src;
+
+                       if(xml_read_string(&src, node, "src"))
+                               xml_read_include(state, src);
+               }
+               else
+                       fprintf(stderr, "Unknown node \"%s\".\n", node.name());
+       }
+}
+
+/* Include */
+
+static void xml_read_include(const XMLReadState& state, const string& src)
+{
+       /* open XML document */
+       pugi::xml_document doc;
+       pugi::xml_parse_result parse_result;
+
+       string path = path_join(state.base, src);
+       parse_result = doc.load_file(path.c_str());
+
+       if(parse_result) {
+               XMLReadState