Merged changes in the trunk up to revision 49986.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 18 Aug 2012 15:20:35 +0000 (15:20 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 18 Aug 2012 15:20:35 +0000 (15:20 +0000)
346 files changed:
CMakeLists.txt
GNUmakefile
SConstruct
build_files/cmake/cmake_netbeans_project.py
build_files/cmake/config/blender_lite.cmake
build_files/cmake/data_to_c.cmake [deleted file]
build_files/cmake/macros.cmake
build_files/scons/config/linux-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
intern/CMakeLists.txt
intern/container/CTR_HashedPtr.h
intern/ghost/GHOST_C-api.h
intern/ghost/intern/GHOST_C-api.cpp
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/ghost/intern/GHOST_WindowWin32.h
intern/ghost/intern/GHOST_WindowX11.cpp
intern/guardedalloc/MEM_guardedalloc.h
intern/guardedalloc/intern/mallocn.c
intern/guardedalloc/test/simpletest/memtest.c
intern/iksolver/CMakeLists.txt
intern/iksolver/SConscript
intern/string/STR_String.h
release/datafiles/bfont.pfb [moved from release/datafiles/.Bfont with 85% similarity]
release/datafiles/preview.blend
release/datafiles/prvicons.png [moved from release/datafiles/prvicons with 100% similarity]
release/datafiles/startup.blend [new file with mode: 0644]
release/scripts/modules/bpy/path.py
release/scripts/startup/bl_operators/node.py
release/scripts/startup/bl_ui/properties_animviz.py
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_data_lamp.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_mask_common.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/CMakeLists.txt
source/blender/avi/intern/avi.c
source/blender/blenfont/BLF_api.h
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/BKE_fcurve.h
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/image_gen.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/mask.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/sca.c
source/blender/blenkernel/intern/seqcache.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenkernel/intern/unit.c
source/blender/blenlib/BLI_array.h
source/blender/blenlib/BLI_kdopbvh.h
source/blender/blenlib/BLI_rect.h
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/rct.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/string_utf8.c
source/blender/blenlib/intern/voronoi.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_core.c
source/blender/bmesh/intern/bmesh_error.h
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_mods.c
source/blender/bmesh/intern/bmesh_operator_api.h
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/intern/bmesh_queries.c
source/blender/bmesh/intern/bmesh_structure.c
source/blender/bmesh/operators/bmo_create.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/tools/BME_bevel.c
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/EffectExporter.cpp
source/blender/collada/GeometryExporter.cpp
source/blender/collada/ImageExporter.cpp
source/blender/collada/InstanceWriter.cpp
source/blender/collada/MaterialExporter.h
source/blender/collada/MeshImporter.cpp
source/blender/collada/MeshImporter.h
source/blender/collada/collada_utils.cpp
source/blender/collada/collada_utils.h
source/blender/compositor/CMakeLists.txt
source/blender/compositor/COM_compositor.h
source/blender/compositor/intern/COM_ChunkOrder.cpp
source/blender/compositor/intern/COM_ChunkOrder.h
source/blender/compositor/intern/COM_Converter.cpp
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/intern/COM_ExecutionSystem.h
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/compositor/intern/COM_MemoryBuffer.h
source/blender/compositor/intern/COM_SocketReader.h
source/blender/compositor/intern/COM_WorkScheduler.cpp
source/blender/compositor/intern/COM_compositor.cpp
source/blender/compositor/nodes/COM_BlurNode.cpp
source/blender/compositor/nodes/COM_BokehBlurNode.cpp
source/blender/compositor/nodes/COM_GroupNode.cpp
source/blender/compositor/operations/COM_AntiAliasOperation.cpp
source/blender/compositor/operations/COM_BlurBaseOperation.cpp
source/blender/compositor/operations/COM_BokehBlurOperation.cpp
source/blender/compositor/operations/COM_BokehImageOperation.h
source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/compositor/operations/COM_DisplaceOperation.cpp
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
source/blender/compositor/operations/COM_InpaintOperation.cpp
source/blender/compositor/operations/COM_MapUVOperation.cpp
source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
source/blender/compositor/operations/COM_MovieDistortionOperation.h
source/blender/compositor/operations/COM_OpenCLKernels.cl
source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
source/blender/compositor/operations/COM_ReadBufferOperation.cpp
source/blender/compositor/operations/COM_ReadBufferOperation.h
source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
source/blender/compositor/operations/COM_SetColorOperation.cpp
source/blender/compositor/operations/COM_SetColorOperation.h
source/blender/compositor/operations/COM_VectorBlurOperation.cpp
source/blender/datatoc/CMakeLists.txt [new file with mode: 0644]
source/blender/datatoc/datatoc.c [new file with mode: 0644]
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/armature/editarmature.c
source/blender/editors/datafiles/Bfont.c [deleted file]
source/blender/editors/datafiles/CMakeLists.txt
source/blender/editors/datafiles/SConscript
source/blender/editors/datafiles/add.png.c [deleted file]
source/blender/editors/datafiles/bfont.ttf.c [deleted file]
source/blender/editors/datafiles/blender_icons.png.c [deleted file]
source/blender/editors/datafiles/blob.png.c [deleted file]
source/blender/editors/datafiles/blur.png.c [deleted file]
source/blender/editors/datafiles/bmonofont.ttf.c [deleted file]
source/blender/editors/datafiles/clay.png.c [deleted file]
source/blender/editors/datafiles/claystrips.png.c [deleted file]
source/blender/editors/datafiles/clone.png.c [deleted file]
source/blender/editors/datafiles/crease.png.c [deleted file]
source/blender/editors/datafiles/darken.png.c [deleted file]
source/blender/editors/datafiles/draw.png.c [deleted file]
source/blender/editors/datafiles/fill.png.c [deleted file]
source/blender/editors/datafiles/flatten.png.c [deleted file]
source/blender/editors/datafiles/grab.png.c [deleted file]
source/blender/editors/datafiles/inflate.png.c [deleted file]
source/blender/editors/datafiles/layer.png.c [deleted file]
source/blender/editors/datafiles/lighten.png.c [deleted file]
source/blender/editors/datafiles/mask.png.c [deleted file]
source/blender/editors/datafiles/mix.png.c [deleted file]
source/blender/editors/datafiles/multiply.png.c [deleted file]
source/blender/editors/datafiles/nudge.png.c [deleted file]
source/blender/editors/datafiles/pinch.png.c [deleted file]
source/blender/editors/datafiles/preview.blend.c [deleted file]
source/blender/editors/datafiles/prvicons.c [deleted file]
source/blender/editors/datafiles/scrape.png.c [deleted file]
source/blender/editors/datafiles/smear.png.c [deleted file]
source/blender/editors/datafiles/smooth.png.c [deleted file]
source/blender/editors/datafiles/snake_hook.png.c [deleted file]
source/blender/editors/datafiles/soften.png.c [deleted file]
source/blender/editors/datafiles/splash.png.c [deleted file]
source/blender/editors/datafiles/startup.blend.c [deleted file]
source/blender/editors/datafiles/subtract.png.c [deleted file]
source/blender/editors/datafiles/texdraw.png.c [deleted file]
source/blender/editors/datafiles/thumb.png.c [deleted file]
source/blender/editors/datafiles/twist.png.c [deleted file]
source/blender/editors/datafiles/vertexdraw.png.c [deleted file]
source/blender/editors/include/ED_datafiles.h
source/blender/editors/include/ED_image.h
source/blender/editors/include/ED_node.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_rip.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/dynamicpaint_ops.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_preview.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_clip/clip_intern.h
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_clip/tracking_select.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_image/image_edit.c
source/blender/editors/space_image/image_ops.c
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_select.c
source/blender/editors/space_node/node_view.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/SConscript
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/shaders/gpu_shader_material.glsl.c [deleted file]
source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl
source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl.c [deleted file]
source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl.c [deleted file]
source/blender/gpu/shaders/gpu_shader_vertex.glsl.c [deleted file]
source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl.c [deleted file]
source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl.c [deleted file]
source/blender/ikplugin/CMakeLists.txt
source/blender/ikplugin/intern/ikplugin_api.c
source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/bmp.c
source/blender/imbuf/intern/divers.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/iris.c
source/blender/imbuf/intern/jp2.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/metadata.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/png.c
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/rotate.c
source/blender/imbuf/intern/scaling.c
source/blender/imbuf/intern/targa.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_view2d_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_space.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/nodes/composite/nodes/node_composite_trackpos.c
source/blender/python/bmesh/bmesh_py_ops.c
source/blender/render/intern/source/pixelblending.c
source/blender/render/intern/source/shadbuf.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/SConscript
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_apple.c
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_subwindow.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_event_types.h
source/blenderplayer/CMakeLists.txt
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/StringValue.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/BL_Texture.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h

index 77f934fcc15f42c4910fb11ef48adc57b87f800a..fd473889909e319a97d6e246addd2b2306b2c2f2 100644 (file)
@@ -126,6 +126,7 @@ option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid d
 option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
 option(WITH_BUILDINFO     "Include extra build details (only disable for development & faster builds)" ON)
 option(WITH_IK_ITASC      "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
+option(WITH_IK_SOLVER     "Enable Legacy IK solver (only disable for development)" ON)
 option(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
 option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
 option(WITH_GAMEENGINE    "Enable Game Engine" ON)
@@ -976,9 +977,10 @@ elseif(WIN32)
                        # normally cached but not since we include them with blender
                        set(PYTHON_VERSION 3.2) # CACHE STRING)
                        set_lib_path(PYTHON "python")
-                       set(PYTHON_INCLUDE_DIR ${PYTHON}/include/python${PYTHON_VERSION})
                        set(PYTHON_LIBRARY ${PYTHON}/lib/python32.lib) #CACHE FILEPATH
-                       
+                       #Shared includes for both vc2008 and vc2010
+                       set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/include/python${PYTHON_VERSION})
+
                        # uncached vars
                        set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
                        set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
@@ -988,7 +990,7 @@ elseif(WIN32)
                        set(BOOST ${LIBDIR}/boost)
                        set(BOOST_INCLUDE_DIR ${BOOST}/include)
                        if(MSVC10)
-                               set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
+                               set(BOOST_LIBPATH ${BOOST}/vc2010/lib)
                                set(BOOST_POSTFIX "vc100-mt-s-1_49.lib")
                                set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_49.lib")
                        else()
index 88ce32959afa5569ad0ef4c44d7fab1f67ffa603..f48ac5c2e413647b338e149630c92907d63b518f 100644 (file)
@@ -19,9 +19,9 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-# This Makefile does an out-of-source CMake build in ../build/`OS`_`CPU`
+# This Makefile does an out-of-source CMake build in ../build_`OS`_`CPU`
 # eg:
-#   ../build/Linux_i386
+#   ../build_linux_i386
 # This is for users who like to configure & build blender with a single command.
 
 
@@ -40,7 +40,7 @@ ifndef BUILD_CMAKE_ARGS
 endif
 
 ifndef BUILD_DIR
-       BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
+       BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build_$(OS_NCASE)
 endif
 
 
index 53e1911a3e7cf0419e04f4eebe422a075826ea62..7e6bcdf8747b33dfb730a38f594af17141f8b373 100644 (file)
@@ -450,9 +450,12 @@ if not os.path.isdir ( B.root_build_dir):
 ###################################
 if not os.path.isdir ( B.root_build_dir + 'data_headers'):
     os.makedirs ( B.root_build_dir + 'data_headers' )
+if not os.path.isdir ( B.root_build_dir + 'data_sources'):
+    os.makedirs ( B.root_build_dir + 'data_sources' )
 # use for includes
 env['DATA_HEADERS'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_headers")
-def ensure_data(FILE_FROM, FILE_TO, VAR_NAME):
+env['DATA_SOURCES'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_sources")
+def data_to_c(FILE_FROM, FILE_TO, VAR_NAME):
     if os.sep == "\\":
         FILE_FROM = FILE_FROM.replace("/", "\\")
         FILE_TO   = FILE_TO.replace("/", "\\")
@@ -483,9 +486,69 @@ def ensure_data(FILE_FROM, FILE_TO, VAR_NAME):
     fpin.close()
     fpout.close()
 
-ensure_data("source/blender/compositor/operations/COM_OpenCLKernels.cl",
-            B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
-            "clkernelstoh_COM_OpenCLKernels_cl")
+def data_to_c_simple(FILE_FROM):
+       filename_only = os.path.basename(FILE_FROM)
+       FILE_TO = os.path.join(env['DATA_SOURCES'], filename_only + ".c")
+       VAR_NAME = "datatoc_" + filename_only.replace(".", "_")
+       
+       data_to_c(FILE_FROM, FILE_TO, VAR_NAME)
+       
+
+data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
+          B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
+          "datatoc_COM_OpenCLKernels_cl")
+
+data_to_c_simple("release/datafiles/startup.blend")
+data_to_c_simple("release/datafiles/preview.blend")
+
+# --- glsl ---
+data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
+data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
+data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
+data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
+data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
+data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
+data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
+
+# --- blender ---
+data_to_c_simple("release/datafiles/bfont.pfb")
+data_to_c_simple("release/datafiles/bfont.ttf")
+data_to_c_simple("release/datafiles/bmonofont.ttf")
+
+data_to_c_simple("release/datafiles/splash.png")
+data_to_c_simple("release/datafiles/blender_icons.png")
+data_to_c_simple("release/datafiles/prvicons.png")
+
+data_to_c_simple("release/datafiles/brushicons/add.png")
+data_to_c_simple("release/datafiles/brushicons/blob.png")
+data_to_c_simple("release/datafiles/brushicons/blur.png")
+data_to_c_simple("release/datafiles/brushicons/clay.png")
+data_to_c_simple("release/datafiles/brushicons/claystrips.png")
+data_to_c_simple("release/datafiles/brushicons/clone.png")
+data_to_c_simple("release/datafiles/brushicons/crease.png")
+data_to_c_simple("release/datafiles/brushicons/darken.png")
+data_to_c_simple("release/datafiles/brushicons/draw.png")
+data_to_c_simple("release/datafiles/brushicons/fill.png")
+data_to_c_simple("release/datafiles/brushicons/flatten.png")
+data_to_c_simple("release/datafiles/brushicons/grab.png")
+data_to_c_simple("release/datafiles/brushicons/inflate.png")
+data_to_c_simple("release/datafiles/brushicons/layer.png")
+data_to_c_simple("release/datafiles/brushicons/lighten.png")
+data_to_c_simple("release/datafiles/brushicons/mask.png")
+data_to_c_simple("release/datafiles/brushicons/mix.png")
+data_to_c_simple("release/datafiles/brushicons/multiply.png")
+data_to_c_simple("release/datafiles/brushicons/nudge.png")
+data_to_c_simple("release/datafiles/brushicons/pinch.png")
+data_to_c_simple("release/datafiles/brushicons/scrape.png")
+data_to_c_simple("release/datafiles/brushicons/smear.png")
+data_to_c_simple("release/datafiles/brushicons/smooth.png")
+data_to_c_simple("release/datafiles/brushicons/snake_hook.png")
+data_to_c_simple("release/datafiles/brushicons/soften.png")
+data_to_c_simple("release/datafiles/brushicons/subtract.png")
+data_to_c_simple("release/datafiles/brushicons/texdraw.png")
+data_to_c_simple("release/datafiles/brushicons/thumb.png")
+data_to_c_simple("release/datafiles/brushicons/twist.png")
+data_to_c_simple("release/datafiles/brushicons/vertexdraw.png")
 
 ##### END DATAFILES ##########
 
index aa6124ac8fe109bd9ed9d9d20eb1d194f116f0a5..8f3835c3401d8d1a546bc2f961c5cf3539285fdb 100755 (executable)
@@ -24,7 +24,7 @@
 
 """
 Example linux usage
- python .~/blenderSVN/blender/build_files/cmake/cmake_netbeans_project.py ~/blenderSVN/cmake
+ python~/blenderSVN/blender/build_files/cmake/cmake_netbeans_project.py ~/blenderSVN/cmake
 
 Windows not supported so far
 """
index 06a822617958bf8a54488d4cd252c487329c7b71..b834cd37a8a27f67236cc4c3d87f5b63a5c62793 100644 (file)
@@ -18,6 +18,7 @@ set(WITH_LIBMV               OFF CACHE FORCE BOOL)
 set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
 set(WITH_COMPOSITOR          OFF CACHE FORCE BOOL)
 set(WITH_GHOST_XDND          OFF CACHE FORCE BOOL)
+set(WITH_IK_SOLVER           OFF CACHE FORCE BOOL)
 set(WITH_IK_ITASC            OFF CACHE FORCE BOOL)
 set(WITH_IMAGE_CINEON        OFF CACHE FORCE BOOL)
 set(WITH_IMAGE_DDS           OFF CACHE FORCE BOOL)
diff --git a/build_files/cmake/data_to_c.cmake b/build_files/cmake/data_to_c.cmake
deleted file mode 100644 (file)
index b8b1826..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# cmake script, to be called on its own with 3 defined args
-#
-# - FILE_FROM
-# - FILE_TO
-# - VAR_NAME
-
-# not highly optimal, may replace with generated C program like makesdna
-file(READ ${FILE_FROM} file_from_string HEX)
-string(LENGTH ${file_from_string} _max_index)
-math(EXPR size_on_disk ${_max_index}/2)
-
-file(REMOVE ${FILE_TO})
-
-file(APPEND ${FILE_TO} "int  ${VAR_NAME}_size = ${size_on_disk};\n")
-file(APPEND ${FILE_TO} "char ${VAR_NAME}[] = {")
-
-set(_index 0)
-
-while(NOT _index EQUAL _max_index)
-    string(SUBSTRING "${file_from_string}" ${_index} 2 _pair)
-    file(APPEND ${FILE_TO} "0x${_pair},")
-    math(EXPR _index ${_index}+2)
-endwhile()
-# null terminator not essential but good if we want plane strings encoded
-file(APPEND ${FILE_TO} "0x00};\n")
index 50bbab9eed9b61849d1d9f5ed6395a37595229d3..62e1e83326c7f4c069f880795f3892b4a8f9d1a3 100644 (file)
@@ -638,7 +638,7 @@ macro(blender_project_hack_post)
        # --------------
        # MINGW HACK END
        if (_reset_standard_libraries)
-               # Must come after project(...)
+               # Must come after projecINCt(...)
                #
                # MINGW workaround for -ladvapi32 being included which surprisingly causes
                # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
@@ -727,29 +727,43 @@ macro(set_lib_path
 endmacro()
 
 
-# not highly optimal, may replace with generated C program like makesdna
-function(data_to_c
-         file_from file_to var_name)
+macro(data_to_c
+      file_from file_to
+      list_to_add)
 
-       file(READ ${file_from} file_from_string HEX)
-       string(LENGTH ${file_from_string} _max_index)
-       math(EXPR size_on_disk ${_max_index}/2)
+       list(APPEND ${list_to_add} ${file_to})
 
-       file(REMOVE ${file_to})
+       get_filename_component(_file_to_path ${file_to} PATH)
 
-       file(APPEND ${file_to} "int  ${var_name}_size = ${size_on_disk};\n")
-       file(APPEND ${file_to} "char ${var_name}[] = {")
+       add_custom_command(
+               OUTPUT ${file_to}
+               COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
+               COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc ${file_from} ${file_to}
+               DEPENDS ${file_from} datatoc)
+       unset(_file_to_path)
+endmacro()
 
-       set(_index 0)
 
-       while(NOT _index EQUAL _max_index)
-               string(SUBSTRING "${file_from_string}" ${_index} 2 _pair)
-               file(APPEND ${file_to} "0x${_pair},")
-               math(EXPR _index ${_index}+2)
-       endwhile()
-       file(APPEND ${file_to} "};\n")
-endfunction()
+# same as above but generates the var name and output automatic.
+macro(data_to_c_simple
+      file_from
+      list_to_add)
+
+       # remove ../'s
+       get_filename_component(_file_from ${CMAKE_CURRENT_SOURCE_DIR}/${file_from}   REALPATH)
+       get_filename_component(_file_to   ${CMAKE_CURRENT_BINARY_DIR}/${file_from}.c REALPATH)
 
-# eg
-# data_to_c("/home/guest/test.txt" "/home/guest/test.txt.h" "this_is_data")
+       list(APPEND ${list_to_add} ${_file_to})
 
+       get_filename_component(_file_to_path ${_file_to} PATH)
+
+       add_custom_command(
+               OUTPUT  ${_file_to}
+               COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
+               COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc ${_file_from} ${_file_to}
+               DEPENDS ${_file_from} datatoc)
+
+       unset(_file_from)
+       unset(_file_to)
+       unset(_file_to_path)
+endmacro()
index cd97ffe8b56e100f67a1f9549a00c6a6fd98244d..e97c3b8b9d7825cb41221c80537161fa56b077b7 100644 (file)
@@ -105,6 +105,11 @@ BF_BULLET = '#extern/bullet2/src'
 BF_BULLET_INC = '${BF_BULLET}'
 BF_BULLET_LIB = 'extern_bullet'
 
+WITH_BF_ELTOPO = False
+BF_LAPACK = '/usr'
+BF_LAPACK_LIB = 'lapack3gf blas clapack'
+BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
+
 BF_FREETYPE = '/usr'
 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
 BF_FREETYPE_LIB = 'freetype'
index 609ee867eec6d981e189afc8b076f500280cfc2c..452bbaaf54f9613e49c603f9616c291256b65b83 100644 (file)
@@ -101,6 +101,11 @@ BF_BULLET = '#extern/bullet2/src'
 BF_BULLET_INC = '${BF_BULLET}'
 BF_BULLET_LIB = 'extern_bullet'
 
+WITH_BF_ELTOPO = False
+BF_LAPACK = LIBDIR + '/lapack'
+BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
+BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
+
 BF_WINTAB = LIBDIR + '/wintab'
 BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
 
index 681e058f5bec41bb6d371b03d18684d44ddad396..b6a3c108cdb86736c8db4bf13a407d1d53735d12 100644 (file)
@@ -97,6 +97,11 @@ BF_BULLET = '#extern/bullet2/src'
 BF_BULLET_INC = '${BF_BULLET}'
 BF_BULLET_LIB = 'extern_bullet'
 
+WITH_BF_ELTOPO = False
+BF_LAPACK = LIBDIR + '/lapack'
+BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
+BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
+
 BF_WINTAB = LIBDIR + '/wintab'
 BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
 
index 2a6e027a819bff59c8f8796e4567d630fa9f87ff..6054ddb9f55700ac38037b91143bbc3a28abfeb6 100644 (file)
@@ -159,6 +159,10 @@ def setup_staticlibs(lenv):
         libincs += Split(lenv['BF_FFTW3_LIBPATH'])
         if lenv['WITH_BF_STATICFFTW3']:
             statlibs += Split(lenv['BF_FFTW3_LIB_STATIC'])
+    if lenv['WITH_BF_ELTOPO']:
+        libincs += Split(lenv['BF_LAPACK_LIBPATH'])
+        if lenv['WITH_BF_STATICLAPACK']:
+                   statlibs += Split(lenv['BF_LAPACK_LIB_STATIC'])        
     if lenv['WITH_BF_FFMPEG'] and lenv['WITH_BF_STATICFFMPEG']:
         statlibs += Split(lenv['BF_FFMPEG_LIB_STATIC'])
     if lenv['WITH_BF_INTERNATIONAL']:
@@ -264,6 +268,8 @@ def setup_syslibs(lenv):
         syslibs += Split(lenv['BF_SNDFILE_LIB'])
     if lenv['WITH_BF_FFTW3'] and not lenv['WITH_BF_STATICFFTW3']:
         syslibs += Split(lenv['BF_FFTW3_LIB'])
+    if lenv['WITH_BF_ELTOPO']:
+        syslibs += Split(lenv['BF_LAPACK_LIB'])
     if lenv['WITH_BF_SDL']:
         syslibs += Split(lenv['BF_SDL_LIB'])
     if not lenv['WITH_BF_STATICOPENGL']:
index 034d261e7cdb7e52f64a2adb9b7fefef1e5f4270..8f5bb1ffc57f6556e99fc2119c0985e11e7e3c01 100644 (file)
@@ -120,7 +120,7 @@ def validate_arguments(args, bc):
             'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
             'WITH_BF_GAMEENGINE',
             'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
-            'WITH_BF_ELTOPO',
+            'WITH_BF_ELTOPO', 'BF_LAPACK', 'BF_LAPACK_LIB', 'BF_LAPACK_LIBPATH', 'BF_LAPACK_LIB_STATIC',
             'BF_WINTAB', 'BF_WINTAB_INC',
             'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
             'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
@@ -393,7 +393,13 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_GAMEENGINE', 'Build with gameengine' , False)),
 
         (BoolVariable('WITH_BF_BULLET', 'Use Bullet if true', True)),
+        
         (BoolVariable('WITH_BF_ELTOPO', 'Use Eltopo collision library if true', False)),
+        ('BF_LAPACK', 'LAPACK base path', ''),
+        ('BF_LAPACK_LIB', 'LAPACK library', ''),
+        ('BF_LAPACK_LIB_STATIC', 'LAPACK library', ''),
+        ('BF_LAPACK_LIBPATH', 'LAPACK library path', ''),
+        (BoolVariable('WITH_BF_STATICLAPACK', 'Staticly link to LAPACK', False)),
         
         ('BF_BULLET', 'Bullet base dir', ''),
         ('BF_BULLET_INC', 'Bullet include path', ''),
index 2b4a84d6b39682705a2de698df6e6aaa230830df..d520ffc87b4ec3fa9880232a22ca6b83f0717004 100644 (file)
@@ -28,7 +28,6 @@ add_subdirectory(ghost)
 add_subdirectory(guardedalloc)
 add_subdirectory(moto)
 add_subdirectory(memutil)
-add_subdirectory(iksolver)
 add_subdirectory(opennl)
 add_subdirectory(mikktspace)
 add_subdirectory(raskter)
@@ -58,6 +57,10 @@ if(WITH_MOD_BOOLEAN)
        add_subdirectory(bsp)
 endif()
 
+if(WITH_IK_SOLVER)
+       add_subdirectory(iksolver)
+endif()
+
 if(WITH_IK_ITASC)
        add_subdirectory(itasc)
 endif()
index caf63f756068ed5bba8eabbe13ed077e9e121ca8..11dc37b362559c81a0b364d933529c9f14eedd7e 100644 (file)
@@ -38,7 +38,7 @@
 inline unsigned int CTR_Hash(void *inDWord)
 {
        size_t key = (size_t)inDWord;
-       return (unsigned int)(key ^ (key>>4));
+       return (unsigned int)(key ^ (key >> 4));
 }
 
 class CTR_HashedPtr
index 4466d614ee9169a71d6d08800b4fc0e50577778f..ae30458a5e59a1625ec92552b5872b5283510148 100644 (file)
@@ -26,7 +26,7 @@
  */
 /** \ingroup GHOST
  *
- * \file       GHOST_C-api.h
+ * \file GHOST_C-api.h
  * \brief GHOST C-API function and type declarations.
  */
 
@@ -43,7 +43,7 @@ extern "C" {
  * Creates a &quot;handle&quot; for a C++ GHOST object.
  * A handle is just an opaque pointer to an empty struct.
  * In the API the pointer is casted to the actual C++ class.
- * \param      name    Name of the handle to create.
+ * \param name Name of the handle to create.
  */
 
 GHOST_DECLARE_HANDLE(GHOST_SystemHandle);
@@ -56,48 +56,47 @@ GHOST_DECLARE_HANDLE(GHOST_EventConsumerHandle);
 
 /**
  * Definition of a callback routine that receives events.
- * @param event The event received.
- * @param userdata The callback's user data, supplied to GHOST_CreateSystem.
+ * \param event The event received.
+ * \param userdata The callback's user data, supplied to GHOST_CreateSystem.
  */
 typedef int (*GHOST_EventCallbackProcPtr)(GHOST_EventHandle event, GHOST_TUserDataPtr userdata);
 
 
 /**
  * Creates the one and only system.
- * @return a handle to the system.
+ * \return a handle to the system.
  */
 extern GHOST_SystemHandle GHOST_CreateSystem(void);
 
 /**
  * Disposes the one and only system.
- * @param systemhandle The handle to the system
- * @return An indication of success.
+ * \param systemhandle The handle to the system
+ * \return An indication of success.
  */
 extern GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle);
 
 
 /**
  * Creates an event consumer object
- * @param eventCallback The event callback routine.
- * @param userdata             Pointer to user data returned to the callback routine.
+ * \param eventCallback The event callback routine.
+ * \param userdata Pointer to user data returned to the callback routine.
  */
 extern GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
                                                            GHOST_TUserDataPtr userdata);
 
 /**
  * Disposes an event consumer object
- * @param consumerhandle       Handle to the event consumer.
- * @return An indication of success.
+ * \param consumerhandle Handle to the event consumer.
+ * \return An indication of success.
  */
 extern GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhandle);
 
-
 /**
  * Returns the system time.
  * Returns the number of milliseconds since the start of the system process.
  * Based on ANSI clock() routine.
- * @param systemhandle The handle to the system
- * @return The number of milliseconds.
+ * \param systemhandle The handle to the system
+ * \return The number of milliseconds.
  */
 extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
 
@@ -105,12 +104,12 @@ extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
  * Installs a timer.
  * Note that, on most operating systems, messages need to be processed in order 
  * for the timer callbacks to be invoked.
- * @param systemhandle The handle to the system
- * @param delay                The time to wait for the first call to the timerProc (in milliseconds)
- * @param interval     The interval between calls to the timerProc (in milliseconds)
- * @param timerProc    The callback invoked when the interval expires,
- * @param userData     Placeholder for user data.
- * @return A timer task (0 if timer task installation failed).
+ * \param systemhandle The handle to the system
+ * \param delay The time to wait for the first call to the timerProc (in milliseconds)
+ * \param interval The interval between calls to the timerProc (in milliseconds)
+ * \param timerProc The callback invoked when the interval expires,
+ * \param userData Placeholder for user data.
+ * \return A timer task (0 if timer task installation failed).
  */
 extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
                                                 GHOST_TUns64 delay,
@@ -120,9 +119,9 @@ extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
 
 /**
  * Removes a timer.
- * @param systemhandle The handle to the system
- * @param timerTask Timer task to be removed.
- * @return Indication of success.
+ * \param systemhandle The handle to the system
+ * \param timerTask Timer task to be removed.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
                                         GHOST_TimerTaskHandle timertaskhandle);
@@ -133,17 +132,17 @@ extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
 
 /**
  * Returns the number of displays on this system.
- * @param systemhandle The handle to the system
- * @return The number of displays.
+ * \param systemhandle The handle to the system
+ * \return The number of displays.
  */
 extern GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle);
 
 /**
  * Returns the dimensions of the main display on this system.
- * @param systemhandle The handle to the system
- * @param width                A pointer the width gets put in
- * @param height       A pointer the height gets put in
- * @return void.
+ * \param systemhandle The handle to the system
+ * \param width A pointer the width gets put in
+ * \param height A pointer the height gets put in
+ * \return void.
  */
 extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
                                            GHOST_TUns32 *width,
@@ -153,17 +152,17 @@ extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
  * Create a new window.
  * The new window is added to the list of windows managed. 
  * Never explicitly delete the window, use disposeWindow() instead.
- * @param systemhandle The handle to the system
- * @param      title   The name of the window (displayed in the title bar of the window if the OS supports it).
- * @param      left    The coordinate of the left edge of the window.
- * @param      top             The coordinate of the top edge of the window.
- * @param      width   The width the window.
- * @param      height  The height the window.
- * @param      state   The state of the window when opened.
- * @param      type    The type of drawing context installed in this window.
- * @param stereoVisual         Stereo visual for quad buffered stereo.
- * @param numOfAASamples       Number of samples used for AA (zero if no AA)
- * @return     A handle to the new window ( == NULL if creation failed).
+ * \param systemhandle The handle to the system
+ * \param title The name of the window (displayed in the title bar of the window if the OS supports it).
+ * \param left The coordinate of the left edge of the window.
+ * \param top The coordinate of the top edge of the window.
+ * \param width The width the window.
+ * \param height The height the window.
+ * \param state The state of the window when opened.
+ * \param type The type of drawing context installed in this window.
+ * \param stereoVisual Stereo visual for quad buffered stereo.
+ * \param numOfAASamples Number of samples used for AA (zero if no AA)
+ * \return A handle to the new window ( == NULL if creation failed).
  */
 extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
                                              const char *title,
@@ -178,43 +177,43 @@ extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
 
 /**
  * Returns the window user data.
- * @param windowhandle The handle to the window
- * @return The window user data.
+ * \param windowhandle The handle to the window
+ * \return The window user data.
  */
 extern GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle);
-       
+
 /**
  * Changes the window user data.
- * @param windowhandle The handle to the window
- * @param data The window user data.
+ * \param windowhandle The handle to the window
+ * \param data The window user data.
  */
 extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, 
                                     GHOST_TUserDataPtr userdata);
 
 /**
  * Dispose a window.
- * @param systemhandle The handle to the system
- * @param      window Handle to the window to be disposed.
- * @return     Indication of success.
+ * \param systemhandle The handle to the system
+ * \param windowhandle Handle to the window to be disposed.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
                                           GHOST_WindowHandle windowhandle);
 
 /**
  * Returns whether a window is valid.
- * @param systemhandle The handle to the system
- * @param      window Handle to the window to be checked.
- * @return     Indication of validity.
+ * \param systemhandle The handle to the system
+ * \param windowhandle Handle to the window to be checked.
+ * \return Indication of validity.
  */
 extern int GHOST_ValidWindow(GHOST_SystemHandle systemhandle,
                              GHOST_WindowHandle windowhandle);
 
 /**
  * Begins full screen mode.
- * @param systemhandle The handle to the system
- * @param setting      The new setting of the display.
- * @return                     A handle to the window displayed in full screen.
- *                                     This window is invalid after full screen has been ended.
+ * \param systemhandle The handle to the system
+ * \param setting The new setting of the display.
+ * \return A handle to the window displayed in full screen.
+ *         This window is invalid after full screen has been ended.
  */
 extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
                                                 GHOST_DisplaySetting *setting,
@@ -222,15 +221,15 @@ extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
 
 /**
  * Ends full screen mode.
- * @param systemhandle The handle to the system
- * @return     Indication of success.
+ * \param systemhandle The handle to the system
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle);
 
 /**
  * Returns current full screen mode status.
- * @param systemhandle The handle to the system
- * @return The current status.
+ * \param systemhandle The handle to the system
+ * \return The current status.
  */
 extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle);
 
@@ -240,34 +239,34 @@ extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle);
 
 /**
  * Retrieves events from the system and stores them in the queue.
- * @param systemhandle The handle to the system
- * @param waitForEvent Boolean to indicate that ProcessEvents should
+ * \param systemhandle The handle to the system
+ * \param waitForEvent Boolean to indicate that ProcessEvents should
  * wait (block) until the next event before returning.
- * @return Indication of the presence of events.
+ * \return Indication of the presence of events.
  */
 extern int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent);
 
 /**
  * Retrieves events from the queue and send them to the event consumers.
- * @param systemhandle The handle to the system
- * @return Indication of the presence of events.
+ * \param systemhandle The handle to the system
+ * \return Indication of the presence of events.
  */
 extern int GHOST_DispatchEvents(GHOST_SystemHandle systemhandle);
 
 /**
  * Adds the given event consumer to our list.
- * @param systemhandle The handle to the system
- * @param consumerhandle The event consumer to add.
- * @return Indication of success.
+ * \param systemhandle The handle to the system
+ * \param consumerhandle The event consumer to add.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
                                              GHOST_EventConsumerHandle consumerhandle);
 
 /**
  * Remove the given event consumer to our list.
- * @param systemhandle The handle to the system
- * @param consumerhandle The event consumer to remove.
- * @return Indication of success.
+ * \param systemhandle The handle to the system
+ * \param consumerhandle The event consumer to remove.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle,
                                                 GHOST_EventConsumerHandle consumerhandle);
@@ -278,14 +277,14 @@ extern GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle,
 
 /**
  * Sets the progress bar value displayed in the window/application icon
- * @param windowhandle The handle to the window
- * @param progress The progress % (0.0 to 1.0)
+ * \param windowhandle The handle to the window
+ * \param progress The progress % (0.0 to 1.0)
  */
 extern GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress);
 
 /**
  * Hides the progress bar in the icon
- * @param windowhandle The handle to the window
+ * \param windowhandle The handle to the window
  */
 extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
 
@@ -295,28 +294,28 @@ extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
 
 /**
  * Returns the current cursor shape.
- * @param windowhandle The handle to the window
- * @return     The current cursor shape.
+ * \param windowhandle The handle to the window
+ * \return The current cursor shape.
  */
 extern GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle);
 
 /**
  * Set the shape of the cursor.
- * @param windowhandle The handle to the window
- * @param      cursor  The new cursor shape type id.
- * @return     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param cursor The new cursor shape type id.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
                                            GHOST_TStandardCursor cursorshape);
 
 /**
  * Set the shape of the cursor to a custom cursor.
- * @param windowhandle The handle to the window
- * @param      bitmap  The bitmap data for the cursor.
- * @param      mask    The mask data for the cursor.
- * @param      hotX    The X coordinate of the cursor hotspot.
- * @param      hotY    The Y coordinate of the cursor hotspot.
- * @return     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param bitmap The bitmap data for the cursor.
+ * \param  mask The mask data for the cursor.
+ * \param hotX The X coordinate of the cursor hotspot.
+ * \param hotY The Y coordinate of the cursor hotspot.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
                                                  GHOST_TUns8 bitmap[16][2],
@@ -325,15 +324,15 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle
                                                  int hotY);
 /**
  * Set the shape of the cursor to a custom cursor of specified size.
- * @param windowhandle The handle to the window
- * @param      bitmap  The bitmap data for the cursor.
- * @param      mask    The mask data for the cursor.
- * @param      sizex   The width of the cursor
- * @param      sizey   The height of the cursor
- * @param      hotX    The X coordinate of the cursor hotspot.
- * @param      hotY    The Y coordinate of the cursor hotspot.
- * @param   fg_color, bg_color  Colors of the cursor
- * @return     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param bitmap The bitmap data for the cursor.
+ * \param mask The mask data for the cursor.
+ * \param sizex The width of the cursor
+ * \param sizey The height of the cursor
+ * \param hotX The X coordinate of the cursor hotspot.
+ * \param hotY The Y coordinate of the cursor hotspot.
+ * \param   fg_color, bg_color  Colors of the cursor
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhandle,
                                                    GHOST_TUns8 *bitmap,
@@ -344,26 +343,26 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhand
 
 /**
  * Returns the visibility state of the cursor.
- * @param windowhandle The handle to the window
- * @return     The visibility state of the cursor.
+ * \param windowhandle The handle to the window
+ * \return The visibility state of the cursor.
  */
 extern int GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle);
 
 /**
  * Shows or hides the cursor.
- * @param windowhandle The handle to the window
- * @param      visible The new visibility state of the cursor.
- * @return     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param visible The new visibility state of the cursor.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle,
                                                 int visible);
 
 /**
  * Returns the current location of the cursor (location in screen coordinates)
- * @param systemhandle The handle to the system
- * @param x                    The x-coordinate of the cursor.
- * @param y                    The y-coordinate of the cursor.
- * @return                     Indication of success.
+ * \param systemhandle The handle to the system
+ * \param x The x-coordinate of the cursor.
+ * \param y The y-coordinate of the cursor.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
                                               GHOST_TInt32 *x,
@@ -372,10 +371,10 @@ extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
 /**
  * Updates the location of the cursor (location in screen coordinates).
  * Not all operating systems allow the cursor to be moved (without the input device being moved).
- * @param systemhandle The handle to the system
- * @param x                    The x-coordinate of the cursor.
- * @param y                    The y-coordinate of the cursor.
- * @return                     Indication of success.
+ * \param systemhandle The handle to the system
+ * \param x The x-coordinate of the cursor.
+ * \param y The y-coordinate of the cursor.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
                                               GHOST_TInt32 x,
@@ -385,10 +384,10 @@ extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
  * Grabs the cursor for a modal operation, to keep receiving
  * events when the mouse is outside the window. X11 only, others
  * do this automatically.
- * @param windowhandle The handle to the window
- * @param      mode The new grab state of the cursor.
- * @param      bounds The grab ragion (optional) - left,top,right,bottom
- * @return     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param mode The new grab state of the cursor.
+ * \param bounds The grab ragion (optional) - left,top,right,bottom
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
                                           GHOST_TGrabCursorMode mode,
@@ -400,10 +399,10 @@ extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
 
 /**
  * Returns the state of a modifier key (ouside the message queue).
- * @param systemhandle The handle to the system
- * @param mask         The modifier key state to retrieve.
- * @param isDown       Pointer to return modifier state in.
- * @return                     Indication of success.
+ * \param systemhandle The handle to the system
+ * \param mask The modifier key state to retrieve.
+ * \param isDown Pointer to return modifier state in.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
                                                 GHOST_TModifierKeyMask mask,
@@ -411,10 +410,10 @@ extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
 
 /**
  * Returns the state of a mouse button (ouside the message queue).
- * @param systemhandle The handle to the system
- * @param mask         The button state to retrieve.
- * @param isDown       Pointer to return button state in.
- * @return                     Indication of success.
+ * \param systemhandle The handle to the system
+ * \param mask The button state to retrieve.
+ * \param isDown Pointer to return button state in.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
                                            GHOST_TButtonMask mask,
@@ -429,94 +428,93 @@ extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
  * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
  */
 extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept);
-       
-       
+
 /**
  * Returns the event type.
- * @param eventhandle The handle to the event
- * @return The event type.
+ * \param eventhandle The handle to the event
+ * \return The event type.
  */
 extern GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle);
 
 /**
  * Returns the time this event was generated.
- * @param eventhandle The handle to the event
- * @return The event generation time.
+ * \param eventhandle The handle to the event
+ * \return The event generation time.
  */
 extern GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle);
 
 /**
  * Returns the window this event was generated on, 
  * or NULL if it is a 'system' event.
- * @param eventhandle The handle to the event
- * @return The generating window.
+ * \param eventhandle The handle to the event
+ * \return The generating window.
  */
 extern GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle);
 
 /**
  * Returns the event data.
- * @param eventhandle The handle to the event
- * @return The event data.
+ * \param eventhandle The handle to the event
+ * \return The event data.
  */
 extern GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle);
 
 /**
  * Returns the timer callback.
- * @param timertaskhandle      The handle to the timertask
- * @return The timer callback.
+ * \param timertaskhandle The handle to the timertask
+ * \return The timer callback.
  */
 extern GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle);
 
 /**
  * Changes the timer callback.
- * @param timertaskhandle The handle to the timertask
- * @param timerProc The timer callback.
+ * \param timertaskhandle The handle to the timertask
+ * \param timerProc The timer callback.
  */
 extern void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle,
                                GHOST_TimerProcPtr timerProc);
 
 /**
  * Returns the timer user data.
- * @param timertaskhandle      The handle to the timertask
- * @return The timer user data.
+ * \param timertaskhandle The handle to the timertask
+ * \return The timer user data.
  */
 extern GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle);
-       
+
 /**
  * Changes the time user data.
- * @param timertaskhandle      The handle to the timertask
- * @param data The timer user data.
+ * \param timertaskhandle The handle to the timertask
+ * \param data The timer user data.
  */
 extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
                                        GHOST_TUserDataPtr userData);
 
 /**
  * Returns indication as to whether the window is valid.
- * @param windowhandle The handle to the window
- * @return The validity of the window.
+ * \param windowhandle The handle to the window
+ * \return The validity of the window.
  */
 extern int GHOST_GetValid(GHOST_WindowHandle windowhandle);
 
 /**
  * Returns the type of drawing context used in this window.
- * @param windowhandle The handle to the window
- * @return The current type of drawing context.
+ * \param windowhandle The handle to the window
+ * \return The current type of drawing context.
  */
 extern GHOST_TDrawingContextType GHOST_GetDrawingContextType(GHOST_WindowHandle windowhandle);
 
 /**
  * Tries to install a rendering context in this window.
- * @param windowhandle The handle to the window
- * @param type The type of rendering context installed.
- * @return Indication as to whether installation has succeeded.
+ * \param windowhandle The handle to the window
+ * \param type The type of rendering context installed.
+ * \return Indication as to whether installation has succeeded.
  */
 extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle,
                                                   GHOST_TDrawingContextType type);
 
 /**
  * Sets the title displayed in the title bar.
- * @param windowhandle The handle to the window
- * @param title        The title to display in the title bar.
+ * \param windowhandle The handle to the window
+ * \param title The title to display in the title bar.
  */
 extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
                            const char *title);
@@ -525,57 +523,57 @@ extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
  * Returns the title displayed in the title bar. The title
  * should be free'd with free().
  * 
- * @param windowhandle The handle to the window
- * @return The title, free with free().
+ * \param windowhandle The handle to the window
+ * \return The title, free with free().
  */
 extern char *GHOST_GetTitle(GHOST_WindowHandle windowhandle);
 
 /**
  * Returns the window rectangle dimensions.
  * These are screen coordinates.
- * @param windowhandle The handle to the window
- * @return A handle to the bounding rectangle of the window.
+ * \param windowhandle The handle to the window
+ * \return A handle to the bounding rectangle of the window.
  */
 extern GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle);
 
 /**
  * Returns the client rectangle dimensions.
  * The left and top members of the rectangle are always zero.
- * @param windowhandle The handle to the window
- * @return A handle to the bounding rectangle of the window.
+ * \param windowhandle The handle to the window
+ * \return A handle to the bounding rectangle of the window.
  */
 extern GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle);
 
 /**
  * Disposes a rectangle object
- * @param rectanglehandle      Handle to the rectangle.
+ * \param rectanglehandle Handle to the rectangle.
  */
 void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle);
 
 /**
  * Resizes client rectangle width.
- * @param windowhandle The handle to the window
- * @param width The new width of the client area of the window.
- * @return     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param width The new width of the client area of the window.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle,
                                            GHOST_TUns32 width);
 
 /**
  * Resizes client rectangle height.
- * @param windowhandle The handle to the window
- * @param height The new height of the client area of the window.
- * @return     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param height The new height of the client area of the window.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle,
                                             GHOST_TUns32 height);
 
 /**
  * Resizes client rectangle.
- * @param windowhandle The handle to the window
- * @param width                The new width of the client area of the window.
- * @param height       The new height of the client area of the window.
- * @return                     Indication of success.
+ * \param windowhandle The handle to the window
+ * \param width The new width of the client area of the window.
+ * \param height The new height of the client area of the window.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
                                           GHOST_TUns32 width,
@@ -583,11 +581,11 @@ extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
 
 /**
  * Converts a point in screen coordinates to client rectangle coordinates
- * @param windowhandle The handle to the window
- * @param inX  The x-coordinate on the screen.
- * @param inY  The y-coordinate on the screen.
- * @param outX The x-coordinate in the client rectangle.
- * @param outY The y-coordinate in the client rectangle.
+ * \param windowhandle The handle to the window
+ * \param inX The x-coordinate on the screen.
+ * \param inY The y-coordinate on the screen.
+ * \param outX The x-coordinate in the client rectangle.
+ * \param outY The y-coordinate in the client rectangle.
  */
 extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
                                  GHOST_TInt32 inX,
@@ -597,11 +595,11 @@ extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
 
 /**
  * Converts a point in screen coordinates to client rectangle coordinates
- * @param windowhandle The handle to the window
- * @param inX  The x-coordinate in the client rectangle.
- * @param inY  The y-coordinate in the client rectangle.
- * @param outX The x-coordinate on the screen.
- * @param outY The y-coordinate on the screen.
+ * \param windowhandle The handle to the window
+ * \param inX The x-coordinate in the client rectangle.
+ * \param inY The y-coordinate in the client rectangle.
+ * \param outX The x-coordinate on the screen.
+ * \param outY The y-coordinate on the screen.
  */
 extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
                                  GHOST_TInt32 inX,
@@ -611,88 +609,88 @@ extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
 
 /**
  * Returns the state of the window (normal, minimized, maximized).
- * @param windowhandle The handle to the window
- * @return The state of the window.
+ * \param windowhandle The handle to the window
+ * \return The state of the window.
  */
 extern GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle);
 
 /**
  * Sets the state of the window (normal, minimized, maximized).
- * @param windowhandle The handle to the window
- * @param state The state of the window.
- * @return Indication of success.
+ * \param windowhandle The handle to the window
+ * \param state The state of the window.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
                                            GHOST_TWindowState state);
 
-       
+
 /**
  * Sets the window "modified" status, indicating unsaved changes
- * @param windowhandle The handle to the window
- * @param isUnsavedChanges Unsaved changes or not
- * @return Indication of success.
+ * \param windowhandle The handle to the window
+ * \param isUnsavedChanges Unsaved changes or not
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
                                                    GHOST_TUns8 isUnsavedChanges);
-       
+
 /**
  * Sets the order of the window (bottom, top).
- * @param windowhandle The handle to the window
- * @param order The order of the window.
- * @return Indication of success.
+ * \param windowhandle The handle to the window
+ * \param order The order of the window.
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle,
                                            GHOST_TWindowOrder order);
 
 /**
  * Swaps front and back buffers of a window.
- * @param windowhandle The handle to the window
- * @return     An intean success indicator.
+ * \param windowhandle The handle to the window
+ * \return An intean success indicator.
  */
 extern GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle);
 
 /**
  * Activates the drawing context of this window.
- * @param windowhandle The handle to the window
- * @return     An intean success indicator.
+ * \param windowhandle The handle to the window
+ * \return An intean success indicator.
  */
 extern GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle);
 
 /**
  * Invalidates the contents of this window.
- * @param windowhandle The handle to the window
- * @return Indication of success.
+ * \param windowhandle The handle to the window
+ * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle);
 
 /**
  * Returns the status of the tablet
- * @param windowhandle The handle to the window
- * @return Status of tablet
+ * \param windowhandle The handle to the window
+ * \return Status of tablet
  */
 extern const GHOST_TabletData *GHOST_GetTabletData(GHOST_WindowHandle windowhandle);
 
 /**
  * Access to rectangle width.
- * @param rectanglehandle The handle to the rectangle
- * @return     width of the rectangle
+ * \param rectanglehandle The handle to the rectangle
+ * \return width of the rectangle
  */
 extern GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle);
 
 /**
  * Access to rectangle height.
- * @param rectanglehandle The handle to the rectangle
- * @return     height of the rectangle
+ * \param rectanglehandle The handle to the rectangle
+ * \return height of the rectangle
  */
 extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle);
 
 /**
  * Gets all members of the rectangle.
- * @param rectanglehandle The handle to the rectangle
- * @param      l       Pointer to return left coordinate in.
- * @param      t       Pointer to return top coordinate in.
- * @param      r       Pointer to return right coordinate in.
- * @param      b       Pointer to return bottom coordinate in.
+ * \param rectanglehandle The handle to the rectangle
+ * \param l Pointer to return left coordinate in.
+ * \param t Pointer to return top coordinate in.
+ * \param r Pointer to return right coordinate in.
+ * \param b Pointer to return bottom coordinate in.
  */
 extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
                                GHOST_TInt32 *l,
@@ -702,11 +700,11 @@ extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
 
 /**
  * Sets all members of the rectangle.
- * @param rectanglehandle The handle to the rectangle
- * @param      l       requested left coordinate of the rectangle
- * @param      t       requested top coordinate of the rectangle
- * @param      r       requested right coordinate of the rectangle
- * @param      b       requested bottom coordinate of the rectangle
+ * \param rectanglehandle The handle to the rectangle
+ * \param l requested left coordinate of the rectangle
+ * \param t requested top coordinate of the rectangle
+ * \param r requested right coordinate of the rectangle
+ * \param b requested bottom coordinate of the rectangle
  */
 extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
                                GHOST_TInt32 l,
@@ -717,24 +715,24 @@ extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
 /**
  * Returns whether this rectangle is empty.
  * Empty rectangles are rectangles that have width==0 and/or height==0.
- * @param rectanglehandle The handle to the rectangle
- * @return     intean value (true == empty rectangle)
+ * \param rectanglehandle The handle to the rectangle
+ * \return intean value (true == empty rectangle)
  */
 extern GHOST_TSuccess GHOST_IsEmptyRectangle(GHOST_RectangleHandle rectanglehandle);
 
 /**
  * Returns whether this rectangle is valid.
  * Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, emapty rectangles are valid.
- * @param rectanglehandle The handle to the rectangle
- * @return     intean value (true==valid rectangle)
+ * \param rectanglehandle The handle to the rectangle
+ * \return intean value (true == valid rectangle)
  */
 extern GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle);
 
 /**
  * Grows (or shrinks the rectangle).
  * The method avoids negative insets making the rectangle invalid
- * @param rectanglehandle The handle to the rectangle
- * @param      i       The amount of offset given to each extreme (negative values shrink the rectangle).
+ * \param rectanglehandle The handle to the rectangle
+ * \param i The amount of offset given to each extreme (negative values shrink the rectangle).
  */
 extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
                                  GHOST_TInt32 i);
@@ -742,17 +740,17 @@ extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
 /**
  * Does a union of the rectangle given and this rectangle.
  * The result is stored in this rectangle.
- * @param rectanglehandle The handle to the rectangle
- * @param      r       The rectangle that is input for the union operation.
+ * \param rectanglehandle The handle to the rectangle
+ * \param anotherrectanglehandle The rectangle that is input for the union operation.
  */
 extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
                                  GHOST_RectangleHandle anotherrectanglehandle);
 
 /**
  * Grows the rectangle to included a point.
- * @param rectanglehandle The handle to the rectangle
- * @param      x       The x-coordinate of the point.
- * @param      y       The y-coordinate of the point.
+ * \param rectanglehandle The handle to the rectangle
+ * \param x The x-coordinate of the point.
+ * \param y The y-coordinate of the point.
  */
 extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
                                       GHOST_TInt32 x,
@@ -761,10 +759,10 @@ extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
 /**
  * Returns whether the point is inside this rectangle.
  * Point on the boundary is considered inside.
- * @param rectanglehandle The handle to the rectangle
- * @param x    x-coordinate of point to test.
- * @param y y-coordinate of point to test.
- * @return intean value (true if point is inside).
+ * \param rectanglehandle The handle to the rectangle
+ * \param x x-coordinate of point to test.
+ * \param y y-coordinate of point to test.
+ * \return intean value (true if point is inside).
  */
 extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle,
                                               GHOST_TInt32 x,
@@ -772,9 +770,9 @@ extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehan
 
 /**
  * Returns whether the rectangle is inside this rectangle.
- * @param rectanglehandle The handle to the rectangle
- * @param      r       rectangle to test.
- * @return     visibility (not, partially or fully visible).
+ * \param rectanglehandle The handle to the rectangle
+ * \param anotherrectanglehandle The rectangle to test.
+ * \return visibility (not, partially or fully visible).
  */
 extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle,
                                                       GHOST_RectangleHandle anotherrectanglehandle);
@@ -782,9 +780,9 @@ extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rect
 /**
  * Sets rectangle members.
  * Sets rectangle members such that it is centered at the given location.
- * @param rectanglehandle The handle to the rectangle
- * @param      cx      requested center x-coordinate of the rectangle
- * @param      cy      requested center y-coordinate of the rectangle
+ * \param rectanglehandle The handle to the rectangle
+ * \param cx Requested center x-coordinate of the rectangle
+ * \param cy Requested center y-coordinate of the rectangle
  */
 extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
                                      GHOST_TInt32 cx,
@@ -794,11 +792,11 @@ extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
  * Sets rectangle members.
  * Sets rectangle members such that it is centered at the given location,
  * with the width requested.
- * @param rectanglehandle The handle to the rectangle
- * @param      cx      requested center x-coordinate of the rectangle
- * @param      cy      requested center y-coordinate of the rectangle
- * @param      w       requested width of the rectangle
- * @param      h       requested height of the rectangle
+ * \param rectanglehandle The handle to the rectangle
+ * \param cx requested center x-coordinate of the rectangle
+ * \param cy requested center y-coordinate of the rectangle
+ * \param w requested width of the rectangle
+ * \param h requested height of the rectangle
  */
 extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
                                      GHOST_TInt32 cx,
@@ -810,23 +808,23 @@ extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
  * Clips a rectangle.
  * Updates the rectangle given such that it will fit within this one.
  * This can result in an empty rectangle.
- * @param rectanglehandle The handle to the rectangle
- * @param      r       the rectangle to clip
- * @return     whether clipping has occurred
+ * \param rectanglehandle The handle to the rectangle
+ * \param anotherrectanglehandle The rectangle to clip
+ * \return Whether clipping has occurred
  */
 extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
                                           GHOST_RectangleHandle anotherrectanglehandle);
 
 /**
  * Return the data from the clipboad
- * @param      return the selection instead, X11 only feature
- * @return     clipboard data
+ * \param selection Boolean to return the selection instead, X11 only feature.
+ * \return clipboard data
  */
 extern GHOST_TUns8 *GHOST_getClipboard(int selection);
 
 /**
  * Put data to the Clipboard
- * @param      set the selection instead, X11 only feature
+ * \param set the selection instead, X11 only feature
  */
 extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
 
@@ -834,12 +832,13 @@ extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
 
 /**
  * Toggles console
- * @action     0 - Hides
- *                     1 - Shows
- *                     2 - Toggles
- *                     3 - Hides if it runs not from  command line
- *                     * - Does nothing
- * @return current status (1 -visible, 0 - hidden)
+ * \param action
+ * - 0: Hides
+ * - 1: Shows
+ * - 2: Toggles
+ * - 3: Hides if it runs not from  command line
+ * - *: Does nothing
+ * \return current status (1 -visible, 0 - hidden)
  */
 extern int GHOST_toggleConsole(int action);
 
index 4cdd9384eeef73dea3de75ba75a1ada2c3851a10..bb6c90cd4314e96febbfa8726e864df0e6c0ab78 100644 (file)
@@ -860,7 +860,8 @@ int GHOST_toggleConsole(int action)
 }
 
 
-int GHOST_confirmQuit(GHOST_WindowHandle windowhandle){
+int GHOST_confirmQuit(GHOST_WindowHandle windowhandle)
+{
        GHOST_ISystem *system = GHOST_ISystem::getSystem();
        return system->confirmQuit((GHOST_IWindow *) windowhandle);
 }
index 9f08f4cff802bf29cf7a633b3874c08ade7b86de..1bffbc8eb85c6a4beb0a2793d4721cdef4f6787f 100644 (file)
@@ -1662,17 +1662,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
                case NSKeyDown:
                case NSKeyUp:
                        charsIgnoringModifiers = [event charactersIgnoringModifiers];
-                       if ([charsIgnoringModifiers length]>0)
+                       if ([charsIgnoringModifiers length] > 0) {
                                keyCode = convertKey([event keyCode],
                                                                         [charsIgnoringModifiers characterAtIndex:0],
                                                                         [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
-                       else
+                       }
+                       else {
                                keyCode = convertKey([event keyCode],0,
                                                                         [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
+                       }
 
                        /* handling both unicode or ascii */
                        characters = [event characters];
-                       if ([characters length]>0) {
+                       if ([characters length] > 0) {
                                convertedCharacters = [characters dataUsingEncoding:NSUTF8StringEncoding];
                                
                                for (int x = 0; x < [convertedCharacters length]; x++) {
index ac6cc548f329f1b67454d3776b40f6bf78585563..31f91802e381e57d1dd940cdb76d08fb26b5d2b2 100644 (file)
@@ -502,7 +502,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        
        if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
        
-       if (numOfAASamples>0) {
+       if (numOfAASamples > 0) {
                // Multisample anti-aliasing
                pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample;
                
@@ -550,7 +550,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
                
        }
        
-       if (numOfAASamples>0) { //Set m_numOfAASamples to the actual value
+       if (numOfAASamples > 0) { //Set m_numOfAASamples to the actual value
                GLint gli;
                [pixelFormat getValues:&gli forAttribute:NSOpenGLPFASamples forVirtualScreen:0];
                if (m_numOfAASamples != (GHOST_TUns16)gli) {
@@ -653,7 +653,7 @@ void GHOST_WindowCocoa::setTitle(const STR_String& title)
                fileStrRange.location = [windowTitle rangeOfString:@"["].location+1;
                len = [windowTitle rangeOfString:@"]"].location - fileStrRange.location;
        
-               if (len >0)
+               if (len > 0)
                {
                        fileStrRange.length = len;
                        associatedFileName = [windowTitle substringWithRange:fileStrRange];
@@ -1424,9 +1424,9 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor sha
 /** Reverse the bits in a GHOST_TUns8
 static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
 {
-       ch= ((ch>>1)&0x55) | ((ch<<1)&0xAA);
-       ch= ((ch>>2)&0x33) | ((ch<<2)&0xCC);
-       ch= ((ch>>4)&0x0F) | ((ch<<4)&0xF0);
+       ch= ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
+       ch= ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
+       ch= ((ch >> 4) & 0x0F) | ((ch << 4) & 0xF0);
        return ch;
 }
 */
@@ -1435,10 +1435,10 @@ static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
 /** Reverse the bits in a GHOST_TUns16 */
 static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
 {
-       shrt= ((shrt>>1)&0x5555) | ((shrt<<1)&0xAAAA);
-       shrt= ((shrt>>2)&0x3333) | ((shrt<<2)&0xCCCC);
-       shrt= ((shrt>>4)&0x0F0F) | ((shrt<<4)&0xF0F0);
-       shrt= ((shrt>>8)&0x00FF) | ((shrt<<8)&0xFF00);
+       shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
+       shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
+       shrt = ((shrt >> 4) & 0x0F0F) | ((shrt << 4) & 0xF0F0);
+       shrt = ((shrt >> 8) & 0x00FF) | ((shrt << 8) & 0xFF00);
        return shrt;
 }
 
index 28ba470f75a30f5f8c31812546e81f48b10634ae..cf5a7fe808d4742f87adbb52534cd00950d3acbd 100644 (file)
@@ -344,7 +344,7 @@ protected:
        static HDC s_firstHDC;
        /** Flag for if window has captured the mouse */
        bool m_hasMouseCaptured;
-       /** Flag if an operator grabs the mouse with WM_cursor_grab/ungrab() 
+       /** Flag if an operator grabs the mouse with WM_cursor_grab_enable/ungrab() 
         * Multiple grabs must be realesed with a single ungrab*/
        bool m_hasGrabMouse;
        /** Count of number of pressed buttons */
index 3dc10d1716991a551a2c562c799450bf88b48662..17efecb4a82c31c219ef819d80aaf7800a97c91f 100644 (file)
@@ -1314,8 +1314,8 @@ validate()
  */
 
 GHOST_WindowX11::
-~GHOST_WindowX11(
-    ){
+~GHOST_WindowX11()
+{
        static Atom Primary_atom, Clipboard_atom;
        Window p_owner, c_owner;
        /*Change the owner of the Atoms to None if we are the owner*/
index ae8115a337e1d07cdf8adb6b36f6840b5c61a6ae..149483e719f82e00aa2e34fefdee67d31f51c6ff 100644 (file)
@@ -110,6 +110,16 @@ extern "C" {
 #endif
        ;
 
+       /**
+        * A variant of realloc which zeros new bytes
+        */
+       void *MEM_recallocN(void *vmemh, size_t len)
+#if MEM_GNU_ATTRIBUTES
+       __attribute__((warn_unused_result))
+       __attribute__((alloc_size(2)))
+#endif
+       ;
+
        /**
         * Allocate a block of memory of size len, with tag name str. The
         * memory is cleared. The name must be static, because only a
index c4902e6aa5a6f8a6e197be9cc96d399eff0ea0e3..df6f4d59c7f5de08262cb261fb8601c23f848793 100644 (file)
@@ -302,10 +302,45 @@ void *MEM_reallocN(void *vmemh, size_t len)
 
                newp = MEM_mallocN(len, memh->name);
                if (newp) {
-                       if (len < memh->len)
+                       if (len < memh->len) {
+                               /* shrink */
                                memcpy(newp, vmemh, len);
-                       else
+                       }
+                       else {
+                               /* grow (or remain same size) */
+                               memcpy(newp, vmemh, memh->len);
+                       }
+               }
+
+               MEM_freeN(vmemh);
+       }
+
+       return newp;
+}
+
+void *MEM_recallocN(void *vmemh, size_t len)
+{
+       void *newp = NULL;
+
+       if (vmemh) {
+               MemHead *memh = vmemh;
+               memh--;
+
+               newp = MEM_mallocN(len, memh->name);
+               if (newp) {
+                       if (len < memh->len) {
+                               /* shrink */
+                               memcpy(newp, vmemh, len);
+                       }
+                       else {
                                memcpy(newp, vmemh, memh->len);
+
+                               if (len > memh->len) {
+                                       /* grow */
+                                       /* zero new bytes */
+                                       memset(((char *)newp) + memh->len, 0, len - memh->len);
+                               }
+                       }
                }
 
                MEM_freeN(vmemh);
index fdc91730d6f316c94c2afc0a3643ec98e4e1b865..7c6a0a2d54674c09759cb2e683fb49372519749f 100644 (file)
@@ -80,7 +80,7 @@ int main (int argc, char *argv[])
        for (i = 0; i < NUM_BLOCKS; i++) {
                int blocksize = 10000;
                char tagstring[1000];
-               if (verbose >1) printf("|--* Allocating block %d\n", i);
+               if (verbose > 1) printf("|--* Allocating block %d\n", i);
                sprintf(tagstring,"Memblock no. %d : ", i);
                p[i]= MEM_callocN(blocksize, strdup(tagstring));
        }
@@ -112,7 +112,7 @@ int main (int argc, char *argv[])
        for (i = 0; i < NUM_BLOCKS; i++) {
                int blocksize = 10000;
                char tagstring[1000];
-               if (verbose >1) printf("|--* Allocating block %d\n", i);
+               if (verbose > 1) printf("|--* Allocating block %d\n", i);
                sprintf(tagstring,"Memblock no. %d : ", i);
                p[i]= MEM_callocN(blocksize, strdup(tagstring));
        }
index 119cb6eaff007a5e19ce4a0e782f215f322dd883..711a70ff2600f09b8ca4d95687f35b6c14caf7e1 100644 (file)
@@ -73,4 +73,4 @@ set(SRC
        intern/TNT/version.h
 )
 
-blender_add_lib(bf_intern_ik "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(bf_intern_iksolver "${SRC}" "${INC}" "${INC_SYS}")
index bdf7cd350ffc513e4ee0b9586ec6a483990c9f71..b88d3b1b71378d6866bc85beacdbf20a1aa01a8e 100644 (file)
@@ -5,5 +5,5 @@ sources = env.Glob('intern/*.cpp')
 
 incs = 'intern ../moto/include ../memutil'
 
-env.BlenderLib ('bf_intern_ik', sources, Split(incs), [], libtype=['intern','player'], priority=[100,90] )
+env.BlenderLib ('bf_intern_iksolver', sources, Split(incs), [], libtype=['intern','player'], priority=[100,90] )
 
index 1705d7855e09d9108b660aeffcdc70d2ccad45bf..98de5be9647c7981aeefe543527bc3f0f6d46607 100644 (file)
@@ -102,7 +102,7 @@ public:
        // Properties
        bool                            IsUpper() const;
        bool                            IsLower() const;
-       inline bool                     IsEmpty() const                                                         { return Len==0; }
+       inline bool                     IsEmpty() const                                                         { return Len == 0; }
        inline int                      Length() const                                                          { return Len; }
 
        // Data access
@@ -122,8 +122,8 @@ public:
        // Comparison
        int                                     Compare(rcSTR_String rhs) const;
        int                                     CompareNoCase(rcSTR_String rhs) const;
-       inline bool                     IsEqual(rcSTR_String rhs) const                                 { return (Compare(rhs)==0); }
-       inline bool                     IsEqualNoCase(rcSTR_String rhs) const                   { return (CompareNoCase(rhs)==0); }
+       inline bool                     IsEqual(rcSTR_String rhs) const                                 { return (Compare(rhs) == 0); }
+       inline bool                     IsEqualNoCase(rcSTR_String rhs) const                   { return (CompareNoCase(rhs) == 0); }
 
        // Search/replace
        int                                     Find(char c, int pos = 0) const;
@@ -178,12 +178,12 @@ public:
        inline friend bool operator>=(rcSTR_String     lhs, rcSTR_String     rhs)       { return (strcmp(lhs, rhs)>=0); }
        inline friend bool operator>=(rcSTR_String     lhs, const char      *rhs)       { return (strcmp(lhs, rhs)>=0); }
        inline friend bool operator>=(const char      *lhs, rcSTR_String     rhs)       { return (strcmp(lhs, rhs)>=0); }
-       inline friend bool operator==(rcSTR_String     lhs, rcSTR_String     rhs)       { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length())==0)); }
-       inline friend bool operator==(rcSTR_String     lhs, const char      *rhs)       { return (memcmp(lhs, rhs, lhs.Length()+1)==0); }
-       inline friend bool operator==(const char      *lhs, rcSTR_String     rhs)       { return (memcmp(lhs, rhs, rhs.Length()+1)==0); }
+       inline friend bool operator==(rcSTR_String     lhs, rcSTR_String     rhs)       { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length()) == 0)); }
+       inline friend bool operator==(rcSTR_String     lhs, const char      *rhs)       { return (memcmp(lhs, rhs, lhs.Length() + 1) == 0); }
+       inline friend bool operator==(const char      *lhs, rcSTR_String     rhs)       { return (memcmp(lhs, rhs, rhs.Length() + 1) == 0); }
        inline friend bool operator!=(rcSTR_String     lhs, rcSTR_String     rhs)       { return ((lhs.Length() != rhs.Length()) || (memcmp(lhs, rhs, lhs.Length())!=0)); }
-       inline friend bool operator!=(rcSTR_String     lhs, const char      *rhs)       { return (memcmp(lhs, rhs, lhs.Length()+1)!=0); }
-       inline friend bool operator!=(const char       *lhs, rcSTR_String    rhs)       { return (memcmp(lhs, rhs, rhs.Length()+1)!=0); }
+       inline friend bool operator!=(rcSTR_String     lhs, const char      *rhs)       { return (memcmp(lhs, rhs, lhs.Length() + 1) != 0); }
+       inline friend bool operator!=(const char       *lhs, rcSTR_String    rhs)       { return (memcmp(lhs, rhs, rhs.Length() + 1) != 0); }
 
        // serializing
        //int                   Serialize(pCStream stream);
similarity index 85%
rename from release/datafiles/.Bfont
rename to release/datafiles/bfont.pfb
index 364194d9ff11683177366930e51cbad6b9914311..8faffc3902d7f7b0086367a53f3a64fb16853a20 100644 (file)
Binary files a/release/datafiles/.Bfont and b/release/datafiles/bfont.pfb differ
index 807d1b08c4d0c9aa4aaf89ba3de25c408b8c0a73..7eaa7a63eebde014dc045645b121a9568d0777e1 100644 (file)
Binary files a/release/datafiles/preview.blend and b/release/datafiles/preview.blend differ
diff --git a/release/datafiles/startup.blend b/release/datafiles/startup.blend
new file mode 100644 (file)
index 0000000..6f6c664
Binary files /dev/null and b/release/datafiles/startup.blend differ
index f1313b583f764720ba923c11bb04e74db279bb57..41fe052c434b36eabdc73d832b974521dcf72d65 100644 (file)
@@ -256,7 +256,7 @@ def module_names(path, recursive=False):
         elif filename.endswith(".py") and filename != "__init__.py":
             fullpath = join(path, filename)
             modules.append((filename[0:-3], fullpath))
-        elif ("." not in filename):
+        elif "." not in filename:
             directory = join(path, filename)
             fullpath = join(directory, "__init__.py")
             if isfile(fullpath):
index 2f7fc359864bc5b0c7aec7c482d83551a42522c1..ee005fcb8bb276a26a9773e3fb7a35c52f17aaad 100644 (file)
@@ -36,6 +36,7 @@ node_type_items_dict = {}
 node_type_prefix = 'NODE_'
 node_group_prefix = 'GROUP_'
 
+
 # Generate a list of enum items for a given node class
 # Copy existing type enum, adding a prefix to distinguish from node groups
 # Skip the base node group type, node groups will be added below for all existing group trees
@@ -43,23 +44,25 @@ def node_type_items(node_class):
     return [(node_type_prefix + item.identifier, item.name, item.description)
                     for item in node_class.bl_rna.properties['type'].enum_items if item.identifier != 'GROUP']
 
+
 # Generate items for node group types
-# Filter by the given tree_type 
+# Filter by the given tree_type
 # Node group trees don't have a description property yet (could add this as a custom property though)
 def node_group_items(tree_type):
     return [(node_group_prefix + group.name, group.name, '')
                     for group in bpy.data.node_groups if group.type == tree_type]
 
+
 # Returns the enum item list for the edited tree in the context
 def node_type_items_cb(self, context):
     snode = context.space_data
     if not snode:
-        return []
+        return ()
     tree = snode.edit_tree
     if not tree:
-        return []
+        return ()
 
-    # Lists of basic node types for each 
+    # Lists of basic node types for each
     if not node_type_items_dict:
         node_type_items_dict.update({
             'SHADER': node_type_items(bpy.types.ShaderNode),
@@ -73,7 +76,7 @@ def node_type_items_cb(self, context):
     if tree.type in node_type_items_dict:
         return node_type_items_dict[tree.type] + node_group_items(tree.type)
     else:
-        return []
+        return ()
 
 
 class NODE_OT_add_search(Operator):
@@ -97,10 +100,10 @@ class NODE_OT_add_search(Operator):
 
         # Enum item identifier has an additional prefix to distinguish base node types from node groups
         item = self.type
-        if (item.startswith(node_type_prefix)):
+        if item.startswith(node_type_prefix):
             # item means base node type
             node = tree.nodes.new(type=item[len(node_type_prefix):])
-        elif (item.startswith(node_group_prefix)):
+        elif item.startswith(node_group_prefix):
             # item means node group type
             node = tree.nodes.new(type='GROUP', group=bpy.data.node_groups[item[len(node_group_prefix):]])
         else:
@@ -119,7 +122,7 @@ class NODE_OT_add_search(Operator):
     def poll(cls, context):
         space = context.space_data
         # needs active node editor and a tree to add nodes to
-        return space.type == 'NODE_EDITOR' and space.edit_tree
+        return (space.type == 'NODE_EDITOR' and space.edit_tree)
 
     def execute(self, context):
         self.create_node(context)
@@ -134,3 +137,33 @@ class NODE_OT_add_search(Operator):
 
         context.window_manager.invoke_search_popup(self)
         return {'CANCELLED'}
+
+
+class NODE_OT_collapse_hide_unused_toggle(Operator):
+    '''Toggle collapsed nodes and hide unused sockets'''
+    bl_idname = "node.collapse_hide_unused_toggle"
+    bl_label = "Collapse and Hide Unused Sockets"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    @classmethod
+    def poll(cls, context):
+        space = context.space_data
+        # needs active node editor and a tree
+        return (space.type == 'NODE_EDITOR' and space.edit_tree)
+
+    def execute(self, context):
+        space = context.space_data
+        tree = space.edit_tree
+
+        for node in tree.nodes:
+            if node.select:
+                hide = (not node.hide)
+
+                node.hide = hide
+                # Note: connected sockets are ignored internally
+                for socket in node.inputs:
+                    socket.hide = hide
+                for socket in node.outputs:
+                    socket.hide = hide
+
+        return {'FINISHED'}
index 3011f55fcb32bcacd294e295d5f0e4a375df221e..2d15c534e9f2ad294ef4199ab83b4d6e0a2b2ccf 100644 (file)
@@ -44,10 +44,10 @@ class MotionPathButtonsPanel():
         col = split.column()
         col.label(text="Display Range:")
         sub = col.column(align=True)
-        if (mps.type == 'CURRENT_FRAME'):
+        if mps.type == 'CURRENT_FRAME':
             sub.prop(mps, "frame_before", text="Before")
             sub.prop(mps, "frame_after", text="After")
-        elif (mps.type == 'RANGE'):
+        elif mps.type == 'RANGE':
             sub.prop(mps, "frame_start", text="Start")
             sub.prop(mps, "frame_end", text="End")
 
index 1e9fd5dd8a9aefc0966a0f4ee37a1c4cfd8a71db..a8f4aa30e95efc30ab63068294aeb4636ed98218 100644 (file)
@@ -106,7 +106,7 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
             sub.prop(curve, "resolution_v", text="Preview V")
             sub.prop(curve, "render_resolution_v", text="Render V")
 
-        if (is_curve or is_text):
+        if is_curve or is_text:
             col.label(text="Fill:")
             sub = col.column()
             sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
index 25b855918733f9413b24de51620a91afe45fc2cb..769715ef1b9a77d67bfd877e185fc241c273d1e5 100644 (file)
@@ -322,9 +322,9 @@ class DATA_PT_area(DataButtonsPanel, Panel):
         col.row().prop(lamp, "shape", expand=True)
         sub = col.row(align=True)
 
-        if (lamp.shape == 'SQUARE'):
+        if lamp.shape == 'SQUARE':
             sub.prop(lamp, "size")
-        elif (lamp.shape == 'RECTANGLE'):
+        elif lamp.shape == 'RECTANGLE':
             sub.prop(lamp, "size", text="Size X")
             sub.prop(lamp, "size_y", text="Size Y")
 
index 7485e532bd48bc985978329c7f72cc89bf4a2a1c..ae0c4d4161cc55cf39ca8fa45f2d29e1414718e7 100644 (file)
@@ -215,6 +215,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         layout.label(text="Face Count" + ": %d" % md.face_count)
 
     def DISPLACE(self, layout, ob, md):
+        has_texture = (md.texture is not None)
+        
         split = layout.split()
 
         col = split.column()
@@ -226,12 +228,18 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         col = split.column()
         col.label(text="Direction:")
         col.prop(md, "direction", text="")
-        col.label(text="Texture Coordinates:")
-        col.prop(md, "texture_coords", text="")
+        colsub = col.column()
+        colsub.active = has_texture
+        colsub.label(text="Texture Coordinates:")
+        colsub.prop(md, "texture_coords", text="")
         if md.texture_coords == 'OBJECT':
-            layout.prop(md, "texture_coords_object", text="Object")
+            row = layout.row()
+            row.active = has_texture
+            row.prop(md, "texture_coords_object", text="Object")
         elif md.texture_coords == 'UV' and ob.type == 'MESH':
-            layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
+            row = layout.row()
+            row.active = has_texture
+            row.prop_search(md, "uv_layer", ob.data, "uv_textures")
 
         layout.separator()
 
index 7cd2ae0b5095ee6e8a1fb93bc64557402efefb85..67980c388b5d3a41a3d7cd7c143dd84f5ef71355 100644 (file)
@@ -223,7 +223,7 @@ class MASK_PT_tools():
         col.operator("transform.translate")
         col.operator("transform.rotate")
         col.operator("transform.resize", text="Scale")
-        props = col.operator("transform.transform", text="Shrink/Fatten")
+        props = col.operator("transform.transform", text="Scale Feather")
         props.mode = 'MASK_SHRINKFATTEN'
 
         col = layout.column(align=True)
@@ -237,6 +237,13 @@ class MASK_PT_tools():
         col.operator("mask.parent_set")
         col.operator("mask.parent_clear")
 
+        col = layout.column(align=True)
+        col.label(text="Animation:")
+        col.operator("mask.shape_key_clear")
+        col.operator("mask.shape_key_insert")
+        col.operator("mask.shape_key_feather_reset")
+        col.operator("mask.shape_key_rekey")
+
 
 class MASK_MT_mask(Menu):
     bl_label = "Mask"
@@ -284,7 +291,7 @@ class MASK_MT_transform(Menu):
         layout.operator("transform.translate")
         layout.operator("transform.rotate")
         layout.operator("transform.resize")
-        props = layout.operator("transform.transform", text="Shrink/Fatten")
+        props = layout.operator("transform.transform", text="Scale Feather")
         props.mode = 'MASK_SHRINKFATTEN'
 
 
index 8d220e5aae63386d269c8616981d2975257883f3..2c9bcefd2f831ce45a5479f407cc8e86069f4d21 100644 (file)
@@ -1008,7 +1008,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
         sub.active = (part.draw_color in {'VELOCITY', 'ACCELERATION'})
         sub.prop(part, "color_maximum", text="Max")
 
-        if (path):
+        if path:
             col.prop(part, "draw_step")
 
 
index 70499b18f41d20389e3dff47d4989c1c8d50d6c8..569037cb0da0233c64e07b204680502d8212c5a2 100644 (file)
@@ -92,7 +92,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
             layout.separator()
 
             layout.prop(field, "guide_kink_type")
-            if (field.guide_kink_type != 'NONE'):
+            if field.guide_kink_type != 'NONE':
                 layout.prop(field, "guide_kink_axis")
 
                 split = layout.split()
index 46baef9b043cec5e74821814d779c349643b6bf3..5b7ecbfb6180fc18c65fee568b9acbac81e3f5a1 100644 (file)
@@ -182,6 +182,7 @@ class NODE_MT_node(Menu):
         layout.operator("node.preview_toggle")
         layout.operator("node.hide_socket_toggle")
         layout.operator("node.options_toggle")
+        layout.operator("node.collapse_hide_unused_toggle")
 
         layout.separator()
 
index 77789496a15426ccc74749e7190ae64d2c4c5a63..50c8603a7c2bbd172961ca3714e3f9842b891082 100644 (file)
@@ -75,6 +75,9 @@ class SEQUENCER_HT_header(Header):
                     row.prop(ed, "overlay_frame", text="")
                     row.prop(ed, "overlay_lock", text="", icon='LOCKED')
 
+                    row = layout.row()
+                    row.prop(st, "overlay_type", text="")
+
                 row = layout.row(align=True)
                 props = row.operator("render.opengl", text="", icon='RENDER_STILL')
                 props.sequencer = True
@@ -423,18 +426,24 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
         return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
                               'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
                               'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
-                              'MULTICAM'}
+                              'MULTICAM', 'ADJUSTMENT'}
 
     def draw(self, context):
         layout = self.layout
 
+        sequencer = context.scene.sequence_editor
         strip = act_strip(context)
+
         if strip.input_count > 0:
             col = layout.column()
             col.prop(strip, "input_1")
             if strip.input_count > 1:
                 col.prop(strip, "input_2")
 
+        if strip.is_supports_mask:
+            col = layout.column()
+            col.prop_search(strip, "input_mask", sequencer, "sequences")
+
         if strip.type == 'COLOR':
             layout.prop(strip, "color")
 
@@ -488,7 +497,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
 
             col = layout.column(align=True)
             col.prop(strip, "use_uniform_scale")
-            if (strip.use_uniform_scale):
+            if strip.use_uniform_scale:
                 col = layout.column(align=True)
                 col.prop(strip, "scale_start_x", text="Scale")
             else:
@@ -765,21 +774,21 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
         if strip.use_color_balance and strip.color_balance:  # TODO - need to add this somehow
             col = layout.column()
             col.label(text="Lift:")
-            col.template_color_wheel(strip.color_balance, "lift", value_slider=False, cubic=True)
+            col.template_color_wheel(strip.color_balance, "lift", value_slider=True, cubic=True)
             row = col.row()
             row.prop(strip.color_balance, "lift", text="")
             row.prop(strip.color_balance, "invert_lift", text="Inverse")
 
             col = layout.column()
             col.label(text="Gamma:")
-            col.template_color_wheel(strip.color_balance, "gamma", value_slider=False, lock_luminosity=True, cubic=True)
+            col.template_color_wheel(strip.color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True)
             row = col.row()
             row.prop(strip.color_balance, "gamma", text="")
             row.prop(strip.color_balance, "invert_gamma", text="Inverse")
 
             col = layout.column()
             col.label(text="Gain:")
-            col.template_color_wheel(strip.color_balance, "gain", value_slider=False, lock_luminosity=True, cubic=True)
+            col.template_color_wheel(strip.color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True)
             row = col.row()
             row.prop(strip.color_balance, "gain", text="")
             row.prop(strip.color_balance, "invert_gain", text="Inverse")
index f3050fb8a9fd61fde90c16e3d1d7d5a5ada88fb0..26da8bc1d5c715b4a432dd32092f85405ca38de2 100644 (file)
@@ -1183,6 +1183,7 @@ class VIEW3D_MT_hook(Menu):
         layout.operator_context = 'EXEC_AREA'
         layout.operator("object.hook_add_newob")
         layout.operator("object.hook_add_selob")
+        layout.operator("object.hook_add_selob", text="Hook to Selected Object Bone").use_bone = True
 
         if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
             layout.separator()
@@ -2568,7 +2569,7 @@ class VIEW3D_PT_background_image(Panel):
                 if bg.source == 'IMAGE':
                     row = box.row()
                     row.template_ID(bg, "image", open="image.open")
-                    if (bg.image):
+                    if bg.image is not None:
                         box.template_image(bg, "image", bg.image_user, compact=True)
                         has_bg = True
 
index ac962ab509756c7120f35a1e7b6edd60d3b77f46..2c1e963dcfef8feb52dd312c39260a34897ab807 100644 (file)
@@ -228,7 +228,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
 
         col = layout.column(align=True)
         col.operator("transform.tilt", text="Tilt")
-        col.operator("transform.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
+        col.operator("transform.transform", text="Scale Feather").mode = 'CURVE_SHRINKFATTEN'
 
         col = layout.column(align=True)
         col.label(text="Curve:")
index 1b9533bbd8c0dbcf8cc0b56a2768cbcfd9a43f90..611a920b7f1032f1c60c09e084f0a8512bede6f4 100644 (file)
@@ -90,6 +90,7 @@ set(SRC_DNA_INC
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_mask_types.h
 )
 
+add_subdirectory(datatoc)
 add_subdirectory(editors)
 add_subdirectory(windowmanager)
 add_subdirectory(blenkernel)
index 9d4704cf0f263db776e5e6b173cef55291f92e25..39424057faf6920e8bf9eb36402a9596ce6db73b 100644 (file)
@@ -968,9 +968,7 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
                const size_t entry_size = (movie->header->Streams + 1) * sizeof(AviIndexEntry);
 
                if (movie->entries != NULL) {
-                       temp = (AviIndexEntry *)MEM_reallocN(movie->entries, (frame_num + 1) * entry_size);
-                       /* clear new bytes */
-                       memset(&temp[movie->index_entries + 1], 0, (frame_num - movie->index_entries) * entry_size);
+                       temp = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
                }
                else {
                        temp = (AviIndexEntry *) MEM_callocN((frame_num + 1) * entry_size, "newidxentry");
index 364d5f90af382a5794b855e307c1195ab1320bc2..0732e02b5fc9d8aaf3f88c952495c80f8763ee2c 100644 (file)
@@ -145,13 +145,13 @@ void BLF_shadow_offset(int fontid, int x, int y);
 /* Set the buffer, size and number of channels to draw, one thing to take care is call
  * this function with NULL pointer when we finish, for example:
  *
- *     BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
+ *     BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4, TRUE);
  *
  *     ... set color, position and draw ...
  *
- *     BLF_buffer(NULL, NULL, 0, 0, 0);
+ *     BLF_buffer(NULL, NULL, 0, 0, 0, FALSE);
  */
-void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch);
+void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int do_color_management);
 
 /* Set the color to be used for text. */
 void BLF_buffer_col(int fontid, float r, float g, float b, float a);
index 683ef3f821c0214fb8514fbeadd29233a7e9cfab..d4739b37f93dfb612d8aab9fd2778107b06b82d9 100644 (file)
@@ -746,16 +746,17 @@ void BLF_shadow_offset(int fontid, int x, int y)
        }
 }
 
-void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch)
+void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int do_color_management)
 {
        FontBLF *font = BLF_get(fontid);
 
        if (font) {
-               font->b_fbuf = fbuf;
-               font->b_cbuf = cbuf;
-               font->bw = w;
-               font->bh = h;
-               font->bch = nch;
+               font->buf_info.fbuf = fbuf;
+               font->buf_info.cbuf = cbuf;
+               font->buf_info.w = w;
+               font->buf_info.h = h;
+               font->buf_info.ch = nch;
+               font->buf_info.do_color_management = do_color_management;
        }
 }
 
@@ -764,10 +765,10 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a)
        FontBLF *font = BLF_get(fontid);
 
        if (font) {
-               font->b_col[0] = r;
-               font->b_col[1] = g;
-               font->b_col[2] = b;
-               font->b_col[3] = a;
+               font->buf_info.col[0] = r;
+               font->buf_info.col[1] = g;
+               font->buf_info.col[2] = b;
+               font->buf_info.col[3] = a;
        }
 }
 
@@ -775,7 +776,7 @@ void BLF_draw_buffer(int fontid, const char *str)
 {
        FontBLF *font = BLF_get(fontid);
 
-       if (font && font->glyph_cache && (font->b_fbuf || font->b_cbuf)) {
+       if (font && font->glyph_cache && (font->buf_info.fbuf || font->buf_info.cbuf)) {
                blf_font_buffer(font, str);
        }
 }
index 945565e22a9d7bfbb3c636119e8b64d1be7ab8bb..dcefcc68d23cf58a4bd8f6510052879edf972fff 100644 (file)
@@ -225,11 +225,14 @@ void blf_font_buffer(FontBLF *font, const char *str)
        size_t i = 0;
        GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
 
-       /* buffer specific vars*/
-       const unsigned char b_col_char[4] = {font->b_col[0] * 255,
-                                            font->b_col[1] * 255,
-                                            font->b_col[2] * 255,
-                                            font->b_col[3] * 255};
+       /* buffer specific vars */
+       FontBufInfoBLF *buf_info = &font->buf_info;
+       float b_col_float[4];
+       const unsigned char b_col_char[4] = {buf_info->col[0] * 255,
+                                                                                buf_info->col[1] * 255,
+                                                                                buf_info->col[2] * 255,
+                                                                                buf_info->col[3] * 255};
+
        unsigned char *cbuf;
        int chx, chy;
        int y, x;
@@ -239,6 +242,14 @@ void blf_font_buffer(FontBLF *font, const char *str)
 
        blf_font_ensure_ascii_table(font);
 
+       /* another buffer spesific call for color conversion */
+       if (buf_info->do_color_management) {
+               srgb_to_linearrgb_v4(b_col_float, buf_info->col);
+       }
+       else {
+               copy_v4_v4(b_col_float, buf_info->col);
+       }
+
        while (str[i]) {
                BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
 
@@ -259,16 +270,16 @@ void blf_font_buffer(FontBLF *font, const char *str)
                        pen_y = (int)font->pos[1] - (g->height - (int)g->pos_y);
                }
 
-               if ((chx + g->width) >= 0 && chx < font->bw && (pen_y + g->height) >= 0 && pen_y < font->bh) {
+               if ((chx + g->width) >= 0 && chx < buf_info->w && (pen_y + g->height) >= 0 && pen_y < buf_info->h) {
                        /* don't draw beyond the buffer bounds */
                        int width_clip = g->width;
                        int height_clip = g->height;
                        int yb_start = g->pitch < 0 ? 0 : g->height - 1;
 
-                       if (width_clip + chx > font->bw)
-                               width_clip -= chx + width_clip - font->bw;
-                       if (height_clip + pen_y > font->bh)
-                               height_clip -= pen_y + height_clip - font->bh;
+                       if (width_clip + chx > buf_info->w)
+                               width_clip -= chx + width_clip - buf_info->w;
+                       if (height_clip + pen_y > buf_info->h)
+                               height_clip -= pen_y + height_clip - buf_info->h;
                        
                        /* drawing below the image? */
                        if (pen_y < 0) {
@@ -277,7 +288,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
                                pen_y = 0;
                        }
 
-                       if (font->b_fbuf) {
+                       if (buf_info->fbuf) {
                                int yb = yb_start;
                                for (y = ((chy >= 0) ? 0 : -chy); y < height_clip; y++) {
                                        for (x = ((chx >= 0) ? 0 : -chx); x < width_clip; x++) {
@@ -285,18 +296,18 @@ void blf_font_buffer(FontBLF *font, const char *str)
 
                                                if (a > 0.0f) {
                                                        float alphatest;
-                                                       fbuf = font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y) * font->bw));
+                                                       fbuf = buf_info->fbuf + buf_info->ch * ((chx + x) + ((pen_y + y) * buf_info->w));
                                                        if (a >= 1.0f) {
-                                                               fbuf[0] = font->b_col[0];
-                                                               fbuf[1] = font->b_col[1];
-                                                               fbuf[2] = font->b_col[2];
-                                                               fbuf[3] = (alphatest = (fbuf[3] + (font->b_col[3]))) < 1.0f ? alphatest : 1.0f;
+                                                               fbuf[0] = b_col_float[0];
+                                                               fbuf[1] = b_col_float[1];
+                                                               fbuf[2] = b_col_float[2];
+                                                               fbuf[3] = (alphatest = (fbuf[3] + (b_col_float[3]))) < 1.0f ? alphatest : 1.0f;
                                                        }
                                                        else {
-                                                               fbuf[0] = (font->b_col[0] * a) + (fbuf[0] * (1 - a));
-                                                               fbuf[1] = (font->b_col[1] * a) + (fbuf[1] * (1 - a));
-                                                               fbuf[2] = (font->b_col[2] * a) + (fbuf[2] * (1 - a));
-                                                               fbuf[3] = (alphatest = (fbuf[3] + (font->b_col[3] * a))) < 1.0f ? alphatest : 1.0f;
+                                                               fbuf[0] = (b_col_float[0] * a) + (fbuf[0] * (1.0f - a));
+                                                               fbuf[1] = (b_col_float[1] * a) + (fbuf[1] * (1.0f - a));
+                                                               fbuf[2] = (b_col_float[2] * a) + (fbuf[2] * (1.0f - a));
+                                                               fbuf[3] = (alphatest = (fbuf[3] + (b_col_float[3] * a))) < 1.0f ? alphatest : 1.0f;
                                                        }
                                                }
                                        }
@@ -308,7 +319,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
                                }
                        }
 
-                       if (font->b_cbuf) {
+                       if (buf_info->cbuf) {
                                int yb = yb_start;
                                for (y = 0; y < height_clip; y++) {
                                        for (x = 0; x < width_clip; x++) {
@@ -316,7 +327,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
 
                                                if (a > 0.0f) {
                                                        int alphatest;
-                                                       cbuf = font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y) * font->bw));
+                                                       cbuf = buf_info->cbuf + buf_info->ch * ((chx + x) + ((pen_y + y) * buf_info->w));
                                                        if (a >= 1.0f) {
                                                                cbuf[0] = b_col_char[0];
                                                                cbuf[1] = b_col_char[1];
@@ -324,10 +335,10 @@ void blf_font_buffer(FontBLF *font, const char *str)
                                                                cbuf[3] = (alphatest = ((int)cbuf[3] + (int)b_col_char[3])) < 255 ? alphatest : 255;
                                                        }
                                                        else {
-                                                               cbuf[0] = (b_col_char[0] * a) + (cbuf[0] * (1 - a));
-                                                               cbuf[1] = (b_col_char[1] * a) + (cbuf[1] * (1 - a));
-                                                               cbuf[2] = (b_col_char[2] * a) + (cbuf[2] * (1 - a));
-                                                               cbuf[3] = (alphatest = ((int)cbuf[3] + (int)((font->b_col[3] * a) * 255.0f))) <
+                                                               cbuf[0] = (b_col_char[0] * a) + (cbuf[0] * (1.0f - a));
+                                                               cbuf[1] = (b_col_char[1] * a) + (cbuf[1] * (1.0f - a));
+                                                               cbuf[2] = (b_col_char[2] * a) + (cbuf[2] * (1.0f - a));
+                                                               cbuf[3] = (alphatest = ((int)cbuf[3] + (int)((b_col_float[3] * a) * 255.0f))) <
                                                                          255 ? alphatest : 255;
                                                        }
                                                }
@@ -507,15 +518,17 @@ static void blf_font_fill(FontBLF *font)
        font->glyph_cache = NULL;
        font->blur = 0;
        font->max_tex_size = -1;
-       font->b_fbuf = NULL;
-       font->b_cbuf = NULL;
-       font->bw = 0;
-       font->bh = 0;
-       font->bch = 0;
-       font->b_col[0] = 0;
-       font->b_col[1] = 0;
-       font->b_col[2] = 0;
-       font->b_col[3] = 0;
+
+       font->buf_info.fbuf = NULL;
+       font->buf_info.cbuf = NULL;
+       font->buf_info.w = 0;
+       font->buf_info.h = 0;
+       font->buf_info.ch = 0;
+       font->buf_info.col[0] = 0;
+       font->buf_info.col[1] = 0;
+       font->buf_info.col[2] = 0;
+       font->buf_info.col[3] = 0;
+
        font->ft_lib = ft_lib;
 }
 
index bf9b98583481e08f68cddcdcc268128e4d3c8661..4c617da75836db3ca1bf8e28d434d6a6f1f733a8 100644 (file)
@@ -131,6 +131,28 @@ typedef struct GlyphBLF {
        short build_tex;
 } GlyphBLF;
 
+typedef struct FontBufInfoBLF {
+       /* for draw to buffer, always set this to NULL after finish! */
+       float *fbuf;
+
+       /* the same but unsigned char */
+       unsigned char *cbuf;
+
+       /* buffer size, keep signed so comparisons with negative values work */
+       int w;
+       int h;
+
+       /* number of channels. */
+       int ch;
+
+       /* is the float buffer linear */
+       int do_color_management;
+
+       /* and the color, the alphas is get from the glyph!
+        * color is srgb space */
+       float col[4];
+} FontBufInfoBLF;
+
 typedef struct FontBLF {
        /* font name. */
        char *name;
@@ -198,21 +220,8 @@ typedef struct FontBLF {
        /* freetype2 face. */
        FT_Face face;
 
-       /* for draw to buffer, always set this to NULL after finish! */
-       float *b_fbuf;
-
-       /* the same but unsigned char */
-       unsigned char *b_cbuf;
-
-       /* buffer size, keep signed so comparisons with negative values work */
-       int bw;
-       int bh;
-
-       /* number of channels. */
-       int bch;
-
-       /* and the color, the alphas is get from the glyph! */
-       float b_col[4];
+       /* data for buffer usage (drawing into a texture buffer) */
+       FontBufInfoBLF buf_info;
 } FontBLF;
 
 typedef struct DirBLF {
index ad1a63fd1e6d229ccdda37d7b416526ffc08ab91..bf2f1262eee809e1a6fc284f180435628951e73b 100644 (file)
@@ -217,8 +217,8 @@ void calc_fcurve_range(struct FCurve *fcu, float *min, float *max,
                        const short do_sel_only, const short do_min_length);
 
 /* get the bounding-box extents for F-Curve */
-void calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
-                        const short do_sel_only, const short include_handles);
+short calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
+                         const short do_sel_only, const short include_handles);
 
 /* .............. */
 
index 2407330a237dc3fc7dfb2e870810092bee521108..030af85ba849ddd1e18fe9c3a5b3d5749713fb1b 100644 (file)
@@ -67,10 +67,16 @@ short *give_totcolp(struct Object *ob);
 struct Material ***give_matarar_id(struct ID *id); /* same but for ID's */
 short *give_totcolp_id(struct ID *id);
 
+enum {
+       BKE_MAT_ASSIGN_USERPREF,
+       BKE_MAT_ASSIGN_OBDATA,
+       BKE_MAT_ASSIGN_OBJECT
+};
+
 struct Material *give_current_material(struct Object *ob, short act);
 struct ID *material_from(struct Object *ob, short act);
 void assign_material_id(struct ID *id, struct Material *ma, short act);
-void assign_material(struct Object *ob, struct Material *ma, short act);
+void assign_material(struct Object *ob, struct Material *ma, short act, int assign_type);
 void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
 
 short find_material_index(struct Object *ob, struct Material *ma);
index 3aa7148d821d11795815234db83f83985e5c17b6..31642dad60dc9fb92ea14acd83b29e1784aef3b3 100644 (file)
@@ -109,8 +109,8 @@ struct BoundBox *BKE_object_boundbox_get(struct Object *ob);
 void BKE_object_dimensions_get(struct Object *ob, float vec[3]);
 void BKE_object_dimensions_set(struct Object *ob, const float *value);
 void BKE_object_boundbox_flag(struct Object *ob, int flag, int set);
-void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3]);
-int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3]);
+void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3], const short use_hidden);
+int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3], const short use_hidden);
 
 /* sometimes min-max isn't enough, we need to loop over each point */
 void BKE_object_foreach_display_point(struct Object *ob, float obmat[4][4],
index 78e65fe3ea65e43e76781b526593399be678a266..823b1dd14da96ca150d41651d173c7aab9b4cfcc 100644 (file)
@@ -110,7 +110,8 @@ enum {
 };
 
 struct SeqEffectHandle {
-       int multithreaded;
+       short multithreaded;
+       short supports_mask;
 
        /* constructors & destructor */
        /* init is _only_ called on first creation */
@@ -150,11 +151,12 @@ struct SeqEffectHandle {
        struct ImBuf * (*execute)(SeqRenderData context, struct Sequence *seq, float cfra, float facf0, float facf1,
                                  struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3);
 
-       struct ImBuf * (*init_execution)(SeqRenderData context, struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3);
+       struct ImBuf * (*init_execution)(SeqRenderData context, struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+                                        struct ImBuf *ibuf3);
 
        void (*execute_slice)(SeqRenderData context, struct Sequence *seq, float cfra, float facf0, float facf1,
                              struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3,
-                              int start_line, int total_lines, struct ImBuf *out);
+                             int start_line, int total_lines, struct ImBuf *out);
 };
 
 /* ********************* prototypes *************** */
@@ -253,6 +255,7 @@ void BKE_sequence_effect_speed_rebuild_map(struct Scene *scene, struct Sequence
 /* extern */
 struct SeqEffectHandle BKE_sequence_get_effect(struct Sequence *seq);
 int BKE_sequence_effect_get_num_inputs(int seq_type);
+int BKE_sequence_effect_get_supports_mask(int seq_type);
 
 /* **********************************************************************
  * Sequencer editing functions
@@ -284,6 +287,7 @@ void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, in
 struct Sequence *BKE_sequence_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence *seq, int dupe_flag);
 int BKE_sequence_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str);
 
+int BKE_sequence_check_depend(struct Sequence *seq, struct Sequence *cur);
 void BKE_sequence_invalidate_cache(struct Scene *scene, struct Sequence *seq);
 
 void BKE_sequencer_update_sound_bounds_all(struct Scene *scene);
@@ -293,10 +297,11 @@ void BKE_sequencer_update_sound(struct Scene *scene, struct bSound *sound);
 
 void BKE_seqence_base_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq);
 void BKE_sequence_base_dupli_recursive(struct Scene *scene, struct Scene *scene_to, ListBase *nseqbase, ListBase *seqbase, int dupe_flag);
+int  BKE_seqence_is_valid_check(struct Sequence *seq);
 
 void BKE_sequencer_clear_scene_in_allseqs(struct Main *bmain, struct Scene *sce);
 
-struct Sequence *BKE_sequwnce_get_by_name(struct ListBase *seqbase, const char *name, int recursive);
+struct Sequence *BKE_sequence_get_by_name(struct ListBase *seqbase, const char *name, int recursive);
 
 /* api for adding new sequence strips */
 typedef struct SeqLoadInfo {
index 1bafc023740fb749dbbda0e60306c8632d86f3c9..cb2f89bd2e3d8fbfbfa96c893f83e1241ea9992c 100644 (file)
@@ -257,6 +257,7 @@ endif()
 if(WITH_MOD_CLOTH_ELTOPO)
        list(APPEND INC
                ../../../extern/eltopo
+               ../../../extern/eltopo/eltopo3d
        )
        add_definitions(-DWITH_ELTOPO)
 endif()
index 1b150848b7ec63d3599de534dd545ff45abd0f49..58827e326a3843ac9663adf057df36828bdf3ef3 100644 (file)
@@ -37,7 +37,8 @@ if env['WITH_BF_PYTHON']:
         defs.append('DEBUG')
 
 if env['WITH_BF_ELTOPO']:
-    incs += ' ../../../extern/eltopo'
+    incs += ' #/extern/eltopo'
+    incs += ' #/extern/eltopo/eltopo3d'
     defs.append('WITH_ELTOPO')
         
 if env['WITH_BF_QUICKTIME']:
index 120a0b2ba2761813c9f550334fd46acfbbecae10..a8a3d0cdbcbbf3e801543c38de509459a8bc8eef 100644 (file)
@@ -498,7 +498,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
                        }
                }
                else {
-                       /*if no object, set to INT_MAX so we don't mess up any shapekey layers*/
+                       /* if no object, set to INT_MAX so we don't mess up any shapekey layers */
                        uid = INT_MAX;
                }
 
@@ -1188,7 +1188,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
                        wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, coba);
 
                /* Now copy colors in all face verts. */
-               /*first add colors to the tessellation faces*/
+               /* first add colors to the tessellation faces */
                /* XXX Why update that layer? We have to update WEIGHT_MLOOPCOL anyway, 
                 *     and tessellation recreates mface layers from mloop/mpoly ones, so no
                 *     need to fill WEIGHT_MCOL here. */
index c10b1e2d4f4cb17024c8a9061307e5f0bdcd8a24..79ee0e96450283f623b9b698ec62d563f5c2fbeb 100644 (file)
@@ -210,7 +210,7 @@ bArmature *BKE_armature_copy(bArmature *arm)
        newArm = BKE_libblock_copy(&arm->id);
        BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
 
-       /* Duplicate the childrens' lists*/
+       /* Duplicate the childrens' lists */
        newBone = newArm->bonebase.first;
        for (oldBone = arm->bonebase.first; oldBone; oldBone = oldBone->next) {
                newBone->parent = NULL;
index e6259cc9faf823652bf0f2444be3ab9cec7728af..79d5e092a1015ac771b82217735b888673883a63 100644 (file)
@@ -425,7 +425,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
        if (flbr->ob) {
                float vec2[3], t;
 
-               /* first check we're not blocking the leader*/
+               /* first check we're not blocking the leader */
                sub_v3_v3v3(vec, flbr->loc, flbr->oloc);
                mul_v3_fl(vec, 1.0f/bbd->timestep);
 
index 88748d5f0b875e4aff75c8d77e012a8b68583457..881caec8a58705f45c465d5b7481957f38e84d68 100644 (file)
@@ -1869,7 +1869,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
        
        dm->deformedOnly = 1;
        
-       /*don't add origindex layer if one already exists*/
+       /* don't add origindex layer if one already exists */
        add_orig = !CustomData_has_layer(&bm->pdata, CD_ORIGINDEX);
 
        mask = use_mdisps ? CD_MASK_DERIVEDMESH | CD_MASK_MDISPS : CD_MASK_DERIVEDMESH;
@@ -1886,7 +1886,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
        CustomData_merge(&bm->pdata, &dm->polyData, mask,
                         CD_CALLOC, dm->numPolyData);
        
-       /*add tessellation mface layers*/
+       /* add tessellation mface layers */
        if (use_tessface) {
                CustomData_from_bmeshpoly(&dm->faceData, &dm->polyData, &dm->loopData, em->tottri);
        }
@@ -2260,7 +2260,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
        newe = MEM_callocN(sizeof(int) * dm->numEdgeData, "newv etable CDDM_merge_verts");
        newl = MEM_callocN(sizeof(int) * totloop, "newv ltable CDDM_merge_verts");
        
-       /*fill newl with destination vertex indices*/
+       /* fill newl with destination vertex indices */
        mv = cddm->mvert;
        c = 0;
        for (i = 0; i < dm->numVertData; i++, mv++) {
@@ -2271,14 +2271,14 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
                }
        }
        
-       /*now link target vertices to destination indices*/
+       /* now link target vertices to destination indices */
        for (i = 0; i < dm->numVertData; i++) {
                if (vtargetmap[i] != -1) {
                        newv[i] = newv[vtargetmap[i]];
                }
        }
        
-       /*find-replace merged vertices with target vertices*/   
+       /* find-replace merged vertices with target vertices */
        ml = cddm->mloop;
        for (i = 0; i < totloop; i++, ml++) {
                if (vtargetmap[ml->v] != -1) {
@@ -2286,7 +2286,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
                }
        }
 
-       /*now go through and fix edges and faces*/
+       /* now go through and fix edges and faces */
        med = cddm->medge;
        c = 0;
        for (i = 0; i < dm->numEdgeData; i++, med++) {
index af7afe7bf30836c328a77520c520ed89d6af50b4..b0de7a5ea6c88be004c1214bb0f908f242129ac9 100644 (file)
@@ -400,18 +400,8 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
                copy_v3_v3(verts->txold, verts->x);
 
                /* Get the current position. */
-               if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && 
-                       ((!(cloth->verts[i].flags & CLOTH_VERT_FLAG_PINNED)) 
-                       && (cloth->verts[i].goal > ALMOST_ZERO)))
-               {
-                       copy_v3_v3(verts->xconst, mvert[i].co);
-                       mul_m4_v3(ob->obmat, verts->xconst);
-               }
-               else
-               {
-                       /* This fixed animated goals not to jump back to "first frame position" */
-                       copy_v3_v3(verts->xconst, verts->txold);
-               }
+               copy_v3_v3(verts->xconst, mvert[i].co);
+               mul_m4_v3(ob->obmat, verts->xconst);
        }
 
        effectors = pdInitEffectors(clmd->scene, ob, NULL, clmd->sim_parms->effector_weights);
index 16edbc3f0a98658d90b4d7bb3ccd91c963aa3a63..00130dd3583f07e4535dad6a8fa9f1c762d1a32f 100644 (file)
@@ -3114,7 +3114,8 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar
                copy_v3_v3(ownLoc, obmat[3]);
                
                INIT_MINMAX(curveMin, curveMax);
-               BKE_object_minmax(ct->tar, curveMin, curveMax);
+               /* XXX - don't think this is good calling this here - campbell */
+               BKE_object_minmax(ct->tar, curveMin, curveMax, TRUE);
                
                /* get targetmatrix */
                if (cu->path && cu->path->data) {
index d92c4ca863255eedbccc621e2f7b8e176b5ac7be..b04bd5bc47fcd4e9646de4e417d728ad305751c4 100644 (file)
@@ -1898,7 +1898,7 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
                 * (this should work because layers are ordered by type)
                 */
                while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
-                       ++dest_i;
+                       dest_i++;
                }
 
                /* if there are no more dest layers, we're done */
@@ -1936,7 +1936,7 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
                         * we don't want to copy all source layers to the same dest, so
                         * increment dest_i
                         */
-                       ++dest_i;
+                       dest_i++;
                }
        }
 }
@@ -1989,7 +1989,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
                 * (this should work because layers are ordered by type)
                 */
                while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
-                       ++dest_i;
+                       dest_i++;
                }
 
                /* if there are no more dest layers, we're done */
@@ -2011,7 +2011,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
                         * we don't want to copy all source layers to the same dest, so
                         * increment dest_i
                         */
-                       ++dest_i;
+                       dest_i++;
                }
        }
 
@@ -2139,8 +2139,8 @@ void CustomData_set(const CustomData *data, int index, int type, void *source)
                memcpy(dest, source, typeInfo->size);
 }
 
-/*Bmesh functions*/
-/*needed to convert to/from different face reps*/
+/* BMesh functions */
+/* needed to convert to/from different face reps */
 void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata,
                              int totloop, int totpoly)
 {
@@ -2401,7 +2401,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
                 * (this should work because layers are ordered by type)
                 */
                while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
-                       ++dest_i;
+                       dest_i++;
                }
 
                /* if there are no more dest layers, we're done */
@@ -2425,7 +2425,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
                         * we don't want to copy all source layers to the same dest, so
                         * increment dest_i
                         */
-                       ++dest_i;
+                       dest_i++;
                }
        }
 }
@@ -2637,7 +2637,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
                 * (this should work because layers are ordered by type)
                 */
                while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
-                       ++dest_i;
+                       dest_i++;
                }
 
                /* if there are no more dest layers, we're done */
@@ -2661,7 +2661,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
                         * we don't want to copy all source layers to the same dest, so
                         * increment dest_i
                         */
-                       ++dest_i;
+                       dest_i++;
                }
        }
 }
@@ -2680,7 +2680,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
                 * (this should work because layers are ordered by type)
                 */
                while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
-                       ++dest_i;
+                       dest_i++;
                }
 
                /* if there are no more dest layers, we're done */
@@ -2704,7 +2704,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
                         * we don't want to copy all source layers to the same dest, so
                         * increment dest_i
                         */
-                       ++dest_i;
+                       dest_i++;
                }
        }
 
index 87ebc597ecd6ff16d3b15e442c23bd3adc297d99..1b53f8980cb8eb60ec3c00eb1af7e7fd21e13b3a 100644 (file)
@@ -570,12 +570,14 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
 
        /* softbody collision  */
        if ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_LATTICE)) {
-               if (modifiers_isModifierEnabled(ob, eModifierType_Softbody) 
-                       || modifiers_isModifierEnabled(ob, eModifierType_Cloth)
-                       || modifiers_isModifierEnabled(ob, eModifierType_Smoke)
-                       || modifiers_isModifierEnabled(ob, eModifierType_DynamicPaint)
-                       || ob->particlesystem.first)
+               if (ob->particlesystem.first ||
+                       modifiers_isModifierEnabled(ob, eModifierType_Softbody) ||
+                       modifiers_isModifierEnabled(ob, eModifierType_Cloth) ||
+                       modifiers_isModifierEnabled(ob, eModifierType_Smoke) ||
+                       modifiers_isModifierEnabled(ob, eModifierType_DynamicPaint))
+               {
                        dag_add_collision_field_relation(dag, scene, ob, node);  /* TODO: use effectorweight->group */
+               }
        }
        
        /* object data drivers */
@@ -2596,7 +2598,8 @@ static void dag_id_flush_update(Scene *sce, ID *id)
        if (id) {
                idtype = GS(id->name);
 
-               if (ELEM8(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR, ID_SPK)) {
+
+               if (OB_DATA_SUPPORT_ID(idtype)) {
                        for (obt = bmain->object.first; obt; obt = obt->id.next) {
                                if (!(ob && obt == ob) && obt->data == id) {
                                        obt->recalc |= OB_RECALC_DATA;
index 8122f9bf617a7bfcd31795ff2b8bb8cdf5315b8f..8db93f8b44a2462ad652b2271e05ff365001c607 100644 (file)
@@ -1997,7 +1997,10 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
 
                /* Get closest edge to that subpixel on UV map  */
                {
-                       float pixel[2], dist, t_dist;
+                       float pixel[2];
+                       /* distances only used for comparison */
+                       float dist_squared, t_dist_squared;
+
                        int i, uindex[3], edge1_index, edge2_index,
                            e1_index, e2_index, target_face;
                        float closest_point[2], lambda, dir_vec[2];
@@ -2019,17 +2022,17 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
                        /*
                         *      Find closest edge to that pixel
                         */
-                       /* Dist to first edge   */
+                       /* Dist to first edge */
                        e1_index = cPoint->v1; e2_index = cPoint->v2; edge1_index = uindex[0]; edge2_index = uindex[1];
-                       dist = dist_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[edge1_index], tface[cPoint->face_index].uv[edge2_index]);
+                       dist_squared = dist_squared_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[edge1_index], tface[cPoint->face_index].uv[edge2_index]);
 
-                       /* Dist to second edge  */
-                       t_dist = dist_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[1]], tface[cPoint->face_index].uv[uindex[2]]);
-                       if (t_dist < dist) { e1_index = cPoint->v2; e2_index = cPoint->v3; edge1_index = uindex[1]; edge2_index = uindex[2]; dist = t_dist; }
+                       /* Dist to second edge */
+                       t_dist_squared = dist_squared_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[1]], tface[cPoint->face_index].uv[uindex[2]]);
+                       if (t_dist_squared < dist_squared) { e1_index = cPoint->v2; e2_index = cPoint->v3; edge1_index = uindex[1]; edge2_index = uindex[2]; dist_squared = t_dist_squared; }
 
-                       /* Dist to third edge   */
-                       t_dist = dist_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[2]], tface[cPoint->face_index].uv[uindex[0]]);
-                       if (t_dist < dist) { e1_index = cPoint->v3; e2_index = cPoint->v1;  edge1_index = uindex[2]; edge2_index = uindex[0]; dist = t_dist; }
+                       /* Dist to third edge */
+                       t_dist_squared = dist_squared_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[2]], tface[cPoint->face_index].uv[uindex[0]]);
+                       if (t_dist_squared < dist_squared) { e1_index = cPoint->v3; e2_index = cPoint->v1;  edge1_index = uindex[2]; edge2_index = uindex[0]; dist_squared = t_dist_squared; }
 
 
                        /*
@@ -4315,7 +4318,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
                                        dir_factor = dir_dot * MIN2(speed_scale, 1.0f) * w_factor;
                                        if (dir_factor > 0.5f) dir_factor = 0.5f;
 
-                                       /* mix new wetness*/
+                                       /* mix new wetness */
                                        ePoint->wetness += dir_factor;
                                        CLAMP(ePoint->wetness, 0.0f, MAX_WETNESS);
 
index 32c6caffff75d15e04526467fc0cd6dbb2172967..c6ba6a0d8411bf747d999d948f81b19f2b324614 100644 (file)
@@ -151,7 +151,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
 #endif
 
        BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
-               /*don't consider two-edged faces*/
+               /* don't consider two-edged faces */
                if (efa->len < 3) {
                        /* do nothing */
                }
@@ -198,7 +198,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
 
                        /* scanfill time */
                        BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, j) {
-                               /*mark order*/
+                               /*mark order */
                                BM_elem_index_set(l, j); /* set_loop */
 
                                sf_vert = BLI_scanfill_vert_add(&sf_ctx, l->v->co);
@@ -334,7 +334,7 @@ typedef struct EditDerivedBMesh {
        float (*polyNos)[3];
 
        /* private variables, for number of verts/edges/faces
-        * within the above hash/table members*/
+        * within the above hash/table members */
        int tv, te, tf;
 } EditDerivedBMesh;
 
index 97b245bd067637e1c712c7bad6e378c058f4e836..67e7743c8a4504270c173db5b736759830d465c7 100644 (file)
@@ -433,16 +433,18 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
 /* ...................................... */
 
 /* helper for calc_fcurve_* functions -> find first and last BezTriple to be used */
-static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last,
-                                     const short do_sel_only)
+static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last,
+                                      const short do_sel_only)
 {
+       short found = FALSE;
+       
        /* init outputs */
        *first = NULL;
        *last = NULL;
        
        /* sanity checks */
        if (fcu->bezt == NULL)
-               return;
+               return found;
        
        /* only include selected items? */
        if (do_sel_only) {
@@ -454,6 +456,7 @@ static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple *
                for (i = 0; i < fcu->totvert; bezt++, i++) {
                        if (BEZSELECTED(bezt)) {
                                *first = bezt;
+                               found = TRUE;
                                break;
                        }
                }
@@ -463,6 +466,7 @@ static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple *
                for (i = 0; i < fcu->totvert; bezt--, i++) {
                        if (BEZSELECTED(bezt)) {
                                *last = bezt;
+                               found = TRUE;
                                break;
                        }
                }
@@ -471,13 +475,16 @@ static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple *
                /* just full array */
                *first = fcu->bezt;
                *last = ARRAY_LAST_ITEM(fcu->bezt, BezTriple, sizeof(BezTriple), fcu->totvert);
+               found = TRUE;
        }
+       
+       return found;
 }
 
 
 /* Calculate the extents of F-Curve's data */
-void calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
-                        const short do_sel_only, const short include_handles)
+short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
+                         const short do_sel_only, const short include_handles)
 {
        float xminv = 999999999.0f, xmaxv = -999999999.0f;
        float yminv = 999999999.0f, ymaxv = -999999999.0f;
@@ -490,7 +497,7 @@ void calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, floa
                        
                        if (xmin || xmax) {
                                /* get endpoint keyframes */
-                               get_fcurve_end_keyframes(fcu, &bezt_first, &bezt_last, do_sel_only);
+                               foundvert = get_fcurve_end_keyframes(fcu, &bezt_first, &bezt_last, do_sel_only);
                                
                                if (bezt_first) {
                                        BLI_assert(bezt_last != NULL);
@@ -566,6 +573,8 @@ void calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, floa
                if (ymin) *ymin = 0.0f;
                if (ymax) *ymax = 1.0f;
        }
+       
+       return foundvert;
 }
 
 /* Calculate the extents of F-Curve's keyframes */
index 02e5dc02746b47d4a27253978ee2b72dab9a6924..49c3d77a527cdabe42863e0e7bf2ffe7eb0e5a44 100644 (file)
@@ -422,7 +422,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
        }
 #endif
 
-       /* make a copy at distance ofsx, ofsy with shear*/
+       /* make a copy at distance ofsx, ofsy with shear */
        fsize = cu->fsize;
        shear = cu->shear;
        si = sinf(rot);
index c317dc63ef7e167c3e14a2f13b594d77a6d822e7..2ec5801746c0aa78bf76f7c866d0d169062de276 100644 (file)
@@ -97,7 +97,7 @@ void free_gpencil_layers(ListBase *list)
        /* error checking */
        if (list == NULL) return;
        
-       /* delete layers*/
+       /* delete layers */
        for (gpl = list->first; gpl; gpl = gpln) {
                gpln = gpl->next;
                
index a65d03e64cf51dda60f450090dbe7d2cd427a34c..7456f9aab8be4fa57488925bfb65178b6306296a 100644 (file)
@@ -159,12 +159,12 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
 
        newarr = MEM_callocN(sizeof(IDProperty) * newsize, "idproperty array resized");
        if (newlen >= prop->len) {
-               /* newlen is bigger*/
+               /* newlen is bigger */
                memcpy(newarr, prop->data.pointer, prop->len * sizeof(IDProperty));
        }
        else {
                int i;
-               /* newlen is smaller*/
+               /* newlen is smaller */
                for (i = newlen; i < prop->len; i++) {
                        IDP_FreeProperty(GETPROP(prop, i));
                }
@@ -233,12 +233,12 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
 
        newarr = MEM_callocN(idp_size_table[(int)prop->subtype] * newsize, "idproperty array resized");
        if (newlen >= prop->len) {
-               /* newlen is bigger*/
+               /* newlen is bigger */
                memcpy(newarr, prop->data.pointer, prop->len * idp_size_table[(int)prop->subtype]);
                idp_resize_group_array(prop, newlen, newarr);
        }
        else {
-               /* newlen is smaller*/
+               /* newlen is smaller */
                idp_resize_group_array(prop, newlen, newarr);
                memcpy(newarr, prop->data.pointer, newlen * idp_size_table[(int)prop->subtype]);
        }
@@ -694,7 +694,7 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
                        break;          
                case IDP_ARRAY:
                {
-                       /*for now, we only support float and int and double arrays*/
+                       /* for now, we only support float and int and double arrays */
                        if ( (val->array.type == IDP_FLOAT) ||
                             (val->array.type == IDP_INT) ||
                             (val->array.type == IDP_DOUBLE) ||
index fbcd943e13f1ed139efb40c229cb5f32e808747c..d84c20f7a9454b5e4a64d60b2cfb0c19c7720d1b 100644 (file)
@@ -1212,43 +1212,46 @@ void BKE_imformat_defaults(ImageFormatData *im_format)
 
 void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *imbuf)
 {
+       int ftype        = imbuf->ftype & ~IB_CUSTOM_FLAGS_MASK;
+       int custom_flags = imbuf->ftype & IB_CUSTOM_FLAGS_MASK;
+
        BKE_imformat_defaults(im_format);
 
        /* file type */
 
-       if (imbuf->ftype == IMAGIC)
+       if (ftype == IMAGIC)
                im_format->imtype = R_IMF_IMTYPE_IRIS;
 
 #ifdef WITH_HDR
-       else if (imbuf->ftype == RADHDR)
+       else if (ftype == RADHDR)
                im_format->imtype = R_IMF_IMTYPE_RADHDR;
 #endif
 
-       else if (imbuf->ftype == PNG)
+       else if (ftype == PNG)
                im_format->imtype = R_IMF_IMTYPE_PNG;
 
 #ifdef WITH_DDS
-       else if (imbuf->ftype == DDS)
+       else if (ftype == DDS)
                im_format->imtype = R_IMF_IMTYPE_DDS;
 #endif
 
-       else if (imbuf->ftype == BMP)
+       else if (ftype == BMP)
                im_format->imtype = R_IMF_IMTYPE_BMP;
 
 #ifdef WITH_TIFF
-       else if (imbuf->ftype & TIF) {
+       else if (ftype == TIF) {
                im_format->imtype = R_IMF_IMTYPE_TIFF;
-               if (imbuf->ftype & TIF_16BIT)
+               if (custom_flags & TIF_16BIT)
                        im_format->depth = R_IMF_CHAN_DEPTH_16;
        }
 #endif
 
 #ifdef WITH_OPENEXR
-       else if (imbuf->ftype & OPENEXR) {
+       else if (ftype == OPENEXR) {
                im_format->imtype = R_IMF_IMTYPE_OPENEXR;
-               if (imbuf->ftype & OPENEXR_HALF)
+               if (custom_flags & OPENEXR_HALF)
                        im_format->depth = R_IMF_CHAN_DEPTH_16;
-               if (imbuf->ftype & OPENEXR_COMPRESS)
+               if (custom_flags & OPENEXR_COMPRESS)
                        im_format->exr_codec = R_IMF_EXR_CODEC_ZIP;  // Can't determine compression
                if (imbuf->zbuf_float)
                        im_format->flag |= R_IMF_FLAG_ZBUF;
@@ -1256,35 +1259,35 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i
 #endif
 
 #ifdef WITH_CINEON
-       else if (imbuf->ftype == CINEON)
+       else if (ftype == CINEON)
                im_format->imtype = R_IMF_IMTYPE_CINEON;
-       else if (imbuf->ftype == DPX)
+       else if (ftype == DPX)
                im_format->imtype = R_IMF_IMTYPE_DPX;
 #endif
 
-       else if (imbuf->ftype == TGA) {
+       else if (ftype == TGA) {
                im_format->imtype = R_IMF_IMTYPE_TARGA;
        }
-       else if (imbuf->ftype == RAWTGA) {
+       else if (ftype == RAWTGA) {
                im_format->imtype = R_IMF_IMTYPE_RAWTGA;
        }
 
 #ifdef WITH_OPENJPEG
-       else if (imbuf->ftype & JP2) {
+       else if (ftype & JP2) {
                im_format->imtype = R_IMF_IMTYPE_JP2;
-               im_format->quality = imbuf->ftype & ~JPG_MSK;
+               im_format->quality = custom_flags & ~JPG_MSK;
 
-               if (imbuf->ftype & JP2_16BIT)
+               if (ftype & JP2_16BIT)
                        im_format->depth = R_IMF_CHAN_DEPTH_16;
-               else if (imbuf->ftype & JP2_12BIT)
+               else if (ftype & JP2_12BIT)
                        im_format->depth = R_IMF_CHAN_DEPTH_12;
 
-               if (imbuf->ftype & JP2_YCC)
+               if (ftype & JP2_YCC)
                        im_format->jp2_flag |= R_IMF_JP2_FLAG_YCC;
 
-               if (imbuf->ftype & JP2_CINE) {
+               if (ftype & JP2_CINE) {
                        im_format->jp2_flag |= R_IMF_JP2_FLAG_CINE_PRESET;
-                       if (imbuf->ftype & JP2_CINE_48FPS)
+                       if (ftype & JP2_CINE_48FPS)
                                im_format->jp2_flag |= R_IMF_JP2_FLAG_CINE_48;
                }
        }
@@ -1292,7 +1295,7 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i
 
        else {
                im_format->imtype = R_IMF_IMTYPE_JPEG90;
-               im_format->quality = imbuf->ftype & ~JPG_MSK;
+               im_format->quality = custom_flags & ~JPG_MSK;
        }
 
        /* planes */
@@ -1476,6 +1479,10 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
        float h_fixed;
        const int mono = blf_mono_font_render; // XXX
 
+       /* this could be an argument if we want to operate on non linear float imbuf's
+        * for now though this is only used for renders which use scene settings */
+       const int do_color_management = (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) != 0;
+
 #define BUFF_MARGIN_X 2
 #define BUFF_MARGIN_Y 1
 
@@ -1491,7 +1498,7 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
        /* set before return */
        BLF_size(mono, scene->r.stamp_font_id, 72);
 
-       BLF_buffer(mono, rectf, rect, width, height, channels);
+       BLF_buffer(mono, rectf, rect, width, height, channels, do_color_management);
        BLF_buffer_col(mono, scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0);
        pad = BLF_width_max(mono);
 
@@ -1508,7 +1515,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                y -= h;
 
                /* also a little of space to the background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                /* and draw the text. */
                BLF_position(mono, x, y + y_ofs, 0.0);
@@ -1524,7 +1532,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                y -= h;
 
                /* and space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                BLF_position(mono, x, y + y_ofs, 0.0);
                BLF_draw_buffer(mono, stamp_data.note);
@@ -1539,7 +1548,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                y -= h;
 
                /* and space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                BLF_position(mono, x, y + y_ofs, 0.0);
                BLF_draw_buffer(mono, stamp_data.date);
@@ -1554,7 +1564,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                y -= h;
 
                /* and space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                BLF_position(mono, x, y + y_ofs, 0.0);
                BLF_draw_buffer(mono, stamp_data.rendertime);
@@ -1568,7 +1579,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                BLF_width_and_height(mono, stamp_data.marker, &w, &h); h = h_fixed;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp,  do_color_management,
+                                                 x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                /* and pad the text. */
                BLF_position(mono, x, y + y_ofs, 0.0);
@@ -1583,7 +1595,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                BLF_width_and_height(mono, stamp_data.time, &w, &h); h = h_fixed;
 
                /* extra space for background */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 x - BUFF_MARGIN_X, y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                /* and pad the text. */
                BLF_position(mono, x, y + y_ofs, 0.0);
@@ -1597,7 +1610,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                BLF_width_and_height(mono, stamp_data.frame, &w, &h); h = h_fixed;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                /* and pad the text. */
                BLF_position(mono, x, y + y_ofs, 0.0);
@@ -1611,7 +1625,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                BLF_width_and_height(mono, stamp_data.camera, &w, &h); h = h_fixed;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
                BLF_position(mono, x, y + y_ofs, 0.0);
                BLF_draw_buffer(mono, stamp_data.camera);
 
@@ -1623,7 +1638,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                BLF_width_and_height(mono, stamp_data.cameralens, &w, &h); h = h_fixed;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
                BLF_position(mono, x, y + y_ofs, 0.0);
                BLF_draw_buffer(mono, stamp_data.cameralens);
        }
@@ -1635,7 +1651,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                x = width - w - 2;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                /* and pad the text. */
                BLF_position(mono, x, y + y_ofs, 0.0);
@@ -1650,14 +1667,15 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
                y = height - h;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
+                                                 x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
 
                BLF_position(mono, x, y + y_ofs, 0.0);
                BLF_draw_buffer(mono, stamp_data.strip);
        }
 
        /* cleanup the buffer. */
-       BLF_buffer(mono, NULL, NULL, 0, 0, 0);
+       BLF_buffer(mono, NULL, NULL, 0, 0, 0, FALSE);
 
 #undef BUFF_MARGIN_X
 #undef BUFF_MARGIN_Y
index d460368784ac1b06ae9b8299c8a9d1fb85eca462..4d7013b9f73b17df856272c9fe73292eefa3ab7b 100644 (file)
@@ -289,7 +289,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width
 
        BLF_size(mono, 54, 72); /* hard coded size! */
 
-       BLF_buffer(mono, rect_float, rect, width, height, 4);
+       BLF_buffer(mono, rect_float, rect, width, height, 4, TRUE);
 
        for (y = 0; y < height; y += step) {
                text[1] = '1';
@@ -330,7 +330,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width
        }
 
        /* cleanup the buffer. */
-       BLF_buffer(mono, NULL, NULL, 0, 0, 0);
+       BLF_buffer(mono, NULL, NULL, 0, 0, 0, FALSE);
 }
 
 void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, int width, int height)
index 8de9640eb359646cd4f4c4bf983a7676637deed9..b2a9e229be9520e7e6babf9d48676b696bbee0f5 100644 (file)
@@ -1764,8 +1764,7 @@ void do_versions_ipos_to_animato(Main *main)
                                        for (act = ob->actuators.first; act; act = act->next) {
                                                /* Any actuators set to ACT_IPO at this point are actually Action Actuators that
                                                   need this converted IPO to finish converting the actuator. */
-                                               if (act->type == ACT_IPO)
-                                               {
+                                               if (act->type == ACT_IPO) {
                                                        aa = (bActionActuator*)act->data;
                                                        aa->act = ob->adt->action;
                                                        act->type = ACT_ACTION;
index bed70bbd7808595485263474b4aff0b8aa1b0be8..17a3c595ea72fbb7b10f59d6edf01d2aebbe7c35 100644 (file)
@@ -377,7 +377,7 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
        k1 = k[0] = k[1] = k[2] = k[3] = firstkey;
        t[0] = t[1] = t[2] = t[3] = k1->pos;
 
-       /* if (fac<0.0 || fac>1.0) return 1; */
+       /* if (fac < 0.0 || fac > 1.0) return 1; */
 
        if (k1->next == NULL) return 1;
 
@@ -1449,6 +1449,8 @@ KeyBlock *add_keyblock(Key *key, const char *name)
  * \note sorting is a problematic side effect in some cases,
  * better only do this explicitly by having its own function,
  *
+ * \param key The key datablock to add to.
+ * \param name Optional name for the new keyblock.
  * \param do_force always use ctime even for relative keys.
  */
 KeyBlock *add_keyblock_ctime(Key *key, const char *name, const short do_force)
index 4b4dcff229de16a39cc82675332ab95555328fd9..3c46e7bcd47537c31fd674085e81951c20dd0ab0 100644 (file)
 #include "BLI_math.h"
 
 #include "DNA_mask_types.h"
+#include "DNA_node_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_space_types.h"
 #include "DNA_movieclip_types.h"
 #include "DNA_tracking_types.h"
+#include "DNA_sequence_types.h"
 
 #include "BKE_curve.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_mask.h"
+#include "BKE_node.h"
+#include "BKE_sequencer.h"
 #include "BKE_tracking.h"
 #include "BKE_movieclip.h"
 #include "BKE_utildefines.h"
@@ -1561,26 +1565,83 @@ void BKE_mask_free(Mask *mask)
        BKE_mask_layer_free_list(&mask->masklayers);
 }
 
+
+static void ntree_unlink_mask_cb(void *calldata, struct ID *UNUSED(owner_id), struct bNodeTree *ntree)
+{
+       ID *id = (ID *)calldata;
+       bNode *node;
+
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->id == id) {
+                       node->id = NULL;
+               }
+       }
+}
+
 void BKE_mask_unlink(Main *bmain, Mask *mask)
 {
        bScreen *scr;
        ScrArea *area;
        SpaceLink *sl;
+       Scene *scene;
 
        for (scr = bmain->screen.first; scr; scr = scr->id.next) {
                for (area = scr->areabase.first; area; area = area->next) {
                        for (sl = area->spacedata.first; sl; sl = sl->next) {
-                               if (sl->spacetype == SPACE_CLIP) {
-                                       SpaceClip *sc = (SpaceClip *) sl;
+                               switch (sl->spacetype) {
+                                       case SPACE_CLIP:
+                                       {
+                                               SpaceClip *sc = (SpaceClip *)sl;
 
-                                       if (sc->mask_info.mask == mask)
-                                               sc->mask_info.mask = NULL;
+                                               if (sc->mask_info.mask == mask) {
+                                                       sc->mask_info.mask = NULL;
+                                               }
+                                               break;
+                                       }
+                                       case SPACE_IMAGE:
+                                       {
+                                               SpaceImage *sima = (SpaceImage *)sl;
+
+                                               if (sima->mask_info.mask == mask) {
+                                                       sima->mask_info.mask = NULL;
+                                               }
+                                               break;
+                                       }
                                }
                        }
                }
        }
 
-       mask->id.us = 0;
+       for (scene = bmain->scene.first; scene; scene = scene->id.next) {
+               if (scene->ed) {
+                       Sequence *seq;
+
+                       SEQ_BEGIN (scene->ed, seq)
+                       {
+                               if (seq->mask == mask) {
+                                       seq->mask = NULL;
+                               }
+                       }
+                       SEQ_END
+               }
+
+
+               if (scene->nodetree) {
+                       bNode *node;
+                       for (node = scene->nodetree->nodes.first; node; node = node->next) {
+                               if (node->id == &mask->id) {
+                                       node->id = NULL;
+                               }
+                       }
+               }
+       }
+
+       {
+               bNodeTreeType *treetype = ntreeGetType(NTREE_COMPOSIT);
+               treetype->foreach_nodetree(bmain, (void *)mask, &ntree_unlink_mask_cb);
+       }
+
+       BKE_libblock_free(&bmain->mask, mask);
 }
 
 void BKE_mask_coord_from_frame(float r_co[2], const float co[2], const float frame_size[2])
index ad9aa8c9cb1ca434d75a50eda2e2f5d3c47a2bdc..936aac9726d9d6e267eab822b10de2e7687f9150 100644 (file)
@@ -495,6 +495,9 @@ short *give_totcolp(Object *ob)
 /* same as above but for ID's */
 Material ***give_matarar_id(ID *id)
 {
+       /* ensure we don't try get materials from non-obdata */
+       BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
        switch (GS(id->name)) {
                case ID_ME:
                        return &(((Mesh *)id)->mat);
@@ -511,6 +514,9 @@ Material ***give_matarar_id(ID *id)
 
 short *give_totcolp_id(ID *id)
 {
+       /* ensure we don't try get materials from non-obdata */
+       BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
        switch (GS(id->name)) {
                case ID_ME:
                        return &(((Mesh *)id)->totcol);
@@ -527,6 +533,9 @@ short *give_totcolp_id(ID *id)
 
 static void data_delete_material_index_id(ID *id, short index)
 {
+       /* ensure we don't try get materials from non-obdata */
+       BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
        switch (GS(id->name)) {
                case ID_ME:
                        BKE_mesh_delete_material_index((Mesh *)id, index);
@@ -766,11 +775,12 @@ void assign_material_id(ID *id, Material *ma, short act)
        test_object_materials(id);
 }
 
-void assign_material(Object *ob, Material *ma, short act)
+void assign_material(Object *ob, Material *ma, short act, int assign_type)
 {
        Material *mao, **matar, ***matarar;
        char *matbits;
        short *totcolp;
+       char bit = 0;
 
        if (act > MAXMAT) return;
        if (act < 1) act = 1;
@@ -797,8 +807,29 @@ void assign_material(Object *ob, Material *ma, short act)
                *matarar = matar;
                *totcolp = act;
        }
-       
+
+       // Determine the object/mesh linking
+       if (assign_type == BKE_MAT_ASSIGN_USERPREF && ob->totcol && ob->actcol) {
+               /* copy from previous material */
+               bit = ob->matbits[ob->actcol - 1];
+       }
+       else {
+               switch (assign_type) {
+                       case BKE_MAT_ASSIGN_OBDATA:
+                               bit = 0;
+                               break;
+                       case BKE_MAT_ASSIGN_OBJECT:
+                               bit = 1;
+                               break;
+                       case BKE_MAT_ASSIGN_USERPREF:
+                       default:
+                               bit = (U.flag & USER_MAT_ON_OB) ? 1 : 0;
+                               break;
+               }
+       }
+
        if (act > ob->totcol) {
+               /* Need more space in the material arrays */
                matar = MEM_callocN(sizeof(void *) * act, "matarray2");
                matbits = MEM_callocN(sizeof(char) * act, "matbits1");
                if (ob->totcol) {
@@ -810,17 +841,12 @@ void assign_material(Object *ob, Material *ma, short act)
                ob->mat = matar;
                ob->matbits = matbits;
                ob->totcol = act;
-
-               /* copy object/mesh linking, or assign based on userpref */
-               if (ob->actcol)
-                       ob->matbits[act - 1] = ob->matbits[ob->actcol - 1];
-               else
-                       ob->matbits[act - 1] = (U.flag & USER_MAT_ON_OB) ? 1 : 0;
        }
        
        /* do it */
 
-       if (ob->matbits[act - 1]) {   /* in object */
+       ob->matbits[act - 1] = bit;
+       if (bit == 1) {   /* in object */
                mao = ob->mat[act - 1];
                if (mao) mao->id.us--;
                ob->mat[act - 1] = ma;
@@ -846,7 +872,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
 
        /* now we have the right number of slots */
        for (i = 0; i < totcol; i++)
-               assign_material(ob, (*matar)[i], i + 1);
+               assign_material(ob, (*matar)[i], i + 1, BKE_MAT_ASSIGN_USERPREF);
 
        if (actcol_orig > ob->totcol)
                actcol_orig = ob->totcol;
@@ -880,7 +906,7 @@ int object_add_material_slot(Object *ob)
        if (ob == NULL) return FALSE;
        if (ob->totcol >= MAXMAT) return FALSE;
        
-       assign_material(ob, NULL, ob->totcol + 1);
+       assign_material(ob, NULL, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF);
        ob->actcol = ob->totcol;
        return TRUE;
 }
index 77cd127e6ea6c77bff40969d9d3b6b2e78aaba8d..f5ae3c7da2b3613b54739b838ad2d12412a0a6d9 100644 (file)
@@ -167,7 +167,7 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
                        for (j = 0; j < vtot; j++, v1++, v2++) {
                                if (len_v3v3(v1->co, v2->co) > thresh)
                                        return MESHCMP_VERTCOMISMATCH;
-                               /*I don't care about normals, let's just do coodinates*/
+                               /* I don't care about normals, let's just do coodinates */
                        }
                }
                
@@ -990,7 +990,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
 
        MEM_freeN(edsort);
        
-       /*set edge members of mloops*/
+       /* set edge members of mloops */
        medge = *alledge;
        for (a = 0; a < *_totedge; a++, medge++) {
                BLI_edgehash_insert(hash, medge->v1, medge->v2, SET_INT_IN_POINTER(a));
@@ -1846,7 +1846,7 @@ void BKE_mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
                return;
        }
 
-       /* if we are not calculating verts and no verts were passes thene we have nothign to do */
+       /* if we are not calculating verts and no verts were passes then we have nothing to do */
        if ((only_face_normals == TRUE) && (polyNors_r == NULL) && (faceNors_r == NULL)) {
                printf("%s: called with nothing to do\n", __func__);
                return;
@@ -1910,7 +1910,7 @@ void BKE_mesh_calc_normals(MVert *mverts, int numVerts, MLoop *mloop, MPoly *mpo
 
        if (!pnors) pnors = MEM_callocN(sizeof(float) * 3 * numPolys, "poly_nors mesh.c");
 
-       /*first go through and calculate normals for all the polys*/
+       /* first go through and calculate normals for all the polys */
        tnorms = MEM_callocN(sizeof(float) * 3 * numVerts, "tnorms mesh.c");
 
        mp = mpolys;
@@ -2820,7 +2820,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
                        mf = &mface[k];
 
                        if (mf->edcode == 3) {
-                               /*sort loop indices to ensure winding is correct*/
+                               /* sort loop indices to ensure winding is correct */
                                /* NO SORT - looks like we can skip this */
 
                                lindex[0] = mf->v1;
@@ -2828,7 +2828,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
                                lindex[2] = mf->v3;
                                lindex[3] = 0; /* unused */
 
-                               /*transform loop indices to vert indices*/
+                               /* transform loop indices to vert indices */
                                mf->v1 = mloop[mf->v1].v;
                                mf->v2 = mloop[mf->v2].v;
                                mf->v3 = mloop[mf->v3].v;
@@ -2839,7 +2839,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
                                test_index_face(mf, fdata, k, 3);
                        }
                        else {
-                               /*sort loop indices to ensure winding is correct*/
+                               /* sort loop indices to ensure winding is correct */
                                /* NO SORT - looks like we can skip this */
 
                                lindex[0] = mf->v1;
@@ -2847,7 +2847,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
                                lindex[2] = mf->v3;
                                lindex[3] = mf->v4;
 
-                               /*transform loop indices to vert indices*/
+                               /* transform loop indices to vert indices */
                                mf->v1 = mloop[mf->v1].v;
                                mf->v2 = mloop[mf->v2].v;
                                mf->v3 = mloop[mf->v3].v;
index 409e1e3921ad7dbc8050cb48738b3dc06c7cb701..bc6cdc949eb55ba4df8c4beab99a8f7d61958416 100644 (file)
@@ -2244,7 +2244,7 @@ void BKE_object_dimensions_set(Object *ob, const float *value)
        }
 }
 
-void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
+void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const short use_hidden)
 {
        BoundBox bb;
        float vec[3];
@@ -2294,14 +2294,23 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
                break;
                case OB_ARMATURE:
                        if (ob->pose) {
+                               bArmature *arm = ob->data;
                                bPoseChannel *pchan;
+
                                for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
-                                       mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
-                                       minmax_v3v3_v3(min_r, max_r, vec);
-                                       mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
-                                       minmax_v3v3_v3(min_r, max_r, vec);
+
+                                       if ((use_hidden == FALSE) && (PBONE_VISIBLE(arm, pchan->bone) == FALSE)) {
+                                               /* pass */
+                                       }
+                                       else {
+                                               mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
+                                               minmax_v3v3_v3(min_r, max_r, vec);
+                                               mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
+                                               minmax_v3v3_v3(min_r, max_r, vec);
+
+                                               change = TRUE;
+                                       }
                                }
-                               change = TRUE;
                        }
                        break;
                case OB_MESH:
@@ -2341,9 +2350,9 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
        }
 }
 
-int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_max[3])
+int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_max[3], const short use_hidden)
 {
-       int ok = 0;
+       int ok = FALSE;
        if ((ob->transflag & OB_DUPLI) == 0) {
                return ok;
        }
@@ -2353,7 +2362,10 @@ int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_ma
                
                lb = object_duplilist(scene, ob);
                for (dob = lb->first; dob; dob = dob->next) {
-                       if (dob->no_draw == 0) {
+                       if ((use_hidden == FALSE) && (dob->no_draw != 0)) {
+                               /* pass */
+                       }
+                       else {
                                BoundBox *bb = BKE_object_boundbox_get(dob->ob);
 
                                if (bb) {
@@ -2364,7 +2376,7 @@ int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_ma
                                                minmax_v3v3_v3(r_min, r_max, vec);
                                        }
 
-                                       ok = 1;
+                                       ok = TRUE;
                                }
                        }
                }
index b5bb6b76c614fa03cc362021374a236de35be9cd..c440d21f56d364adfa3472927415055cb1be8e8d 100644 (file)
@@ -717,7 +717,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
        if (!sens) return;
 
        /* move up */
-       if ( val==1 && sens->prev) {
+       if (val == 1 && sens->prev) {
                for (tmp=sens->prev; tmp; tmp=tmp->prev) {
                        if (tmp->flag & SENS_VISIBLE)
                                break;
@@ -728,7 +728,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
                }
        }
        /* move down */
-       else if ( val==2 && sens->next) {
+       else if (val == 2 && sens->next) {
                for (tmp=sens->next; tmp; tmp=tmp->next) {
                        if (tmp->flag & SENS_VISIBLE)
                                break;
@@ -756,7 +756,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
        if (!cont) return;
 
        /* move up */
-       if ( val==1 && cont->prev) {
+       if (val == 1 && cont->prev) {
                /* locate the controller that has the same state mask but is earlier in the list */
                tmp = cont->prev;
                while (tmp) {
@@ -771,7 +771,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
        }
 
        /* move down */
-       else if ( val==2 && cont->next) {
+       else if (val == 2 && cont->next) {
                tmp = cont->next;
                while (tmp) {
                        if (tmp->state_mask & cont->state_mask) 
@@ -799,7 +799,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
        if (!act) return;
 
        /* move up */
-       if ( val==1 && act->prev) {
+       if (val == 1 && act->prev) {
                /* locate the first visible actuators before this one */
                for (tmp = act->prev; tmp; tmp=tmp->prev) {
                        if (tmp->flag & ACT_VISIBLE)
@@ -811,7 +811,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
                }
        }
        /* move down */
-       else if ( val==2 && act->next) {
+       else if (val == 2 && act->next) {
                /* locate the first visible actuators after this one */
                for (tmp=act->next; tmp; tmp=tmp->next) {
                        if (tmp->flag & ACT_VISIBLE)
index a4ea5d1fb2634548e723a904d51d10f78ce9b1f0..387ec67eb1cccd50465a945e7b9e37360c15867f 100644 (file)
@@ -180,7 +180,8 @@ static int seqcache_key_check_seq(void *userkey, void *userdata)
 
 void BKE_sequencer_cache_cleanup_sequence(Sequence *seq)
 {
-       IMB_moviecache_cleanup(moviecache, seqcache_key_check_seq, seq);
+       if (moviecache)
+               IMB_moviecache_cleanup(moviecache, seqcache_key_check_seq, seq);
 }
 
 struct ImBuf *BKE_sequencer_cache_get(SeqRenderData context, Sequence *seq, float cfra, seq_stripelem_ibuf_t type)
index 911b6b00b98f928c9f9a61d11af6d0361db0c096..87906337ca21863483757f406fc777a2090aea47 100644 (file)
@@ -284,14 +284,14 @@ static void do_alphaover_effect(SeqRenderData context, Sequence *UNUSED(seq), fl
                                 int start_line, int total_lines, ImBuf *out)
 {
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_alphaover_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -446,14 +446,14 @@ static void do_alphaunder_effect(SeqRenderData context, Sequence *UNUSED(seq), f
                                  int start_line, int total_lines, ImBuf *out)
 {
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_alphaunder_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -556,14 +556,14 @@ static void do_cross_effect(SeqRenderData context, Sequence *UNUSED(seq), float
                             int start_line, int total_lines, ImBuf *out)
 {
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_cross_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -805,14 +805,14 @@ static void do_gammacross_effect(SeqRenderData context, Sequence *UNUSED(seq), f
                                  int start_line, int total_lines, ImBuf *out)
 {
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_gammacross_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -911,14 +911,14 @@ static void do_add_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
                           ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *UNUSED(ibuf3), int start_line, int total_lines, ImBuf *out)
 {
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_add_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -1015,14 +1015,14 @@ static void do_sub_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
                           ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *UNUSED(ibuf3), int start_line, int total_lines, ImBuf *out)
 {
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_sub_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -1212,14 +1212,14 @@ static void do_mul_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
                           ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *UNUSED(ibuf3), int start_line, int total_lines, ImBuf *out)
 {
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_mul_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -2746,7 +2746,7 @@ static void do_overdrop_effect(SeqRenderData context, Sequence *UNUSED(seq), flo
        int y = total_lines;
 
        if (out->rect_float) {
-               float *rect1, *rect2, *rect_out;
+               float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -2754,7 +2754,7 @@ static void do_overdrop_effect(SeqRenderData context, Sequence *UNUSED(seq), flo
                do_alphaover_effect_float(facf0, facf1, x, y, rect1, rect2, rect_out);
        }
        else {
-               unsigned char *rect1, *rect2, *rect_out;
+               unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
                slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
@@ -2840,6 +2840,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
        int sequence_type = seq_type;
 
        rval.multithreaded = FALSE;
+       rval.supports_mask = FALSE;
        rval.init = init_noop;
        rval.num_inputs = num_inputs_default;
        rval.load = load_noop;
@@ -2945,6 +2946,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
                        rval.execute = do_multicam;
                        break;
                case SEQ_TYPE_ADJUSTMENT:
+                       rval.supports_mask = TRUE;
                        rval.num_inputs = num_inputs_adjustment;
                        rval.early_out = early_out_adjustment;
                        rval.execute = do_adjustment;
@@ -2956,7 +2958,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
 
 struct SeqEffectHandle BKE_sequence_get_effect(Sequence *seq)
 {
-       struct SeqEffectHandle rval = {FALSE, NULL};
+       struct SeqEffectHandle rval = {FALSE, FALSE, NULL};
 
        if (seq->type & SEQ_TYPE_EFFECT) {
                rval = get_sequence_effect_impl(seq->type);
@@ -2971,7 +2973,7 @@ struct SeqEffectHandle BKE_sequence_get_effect(Sequence *seq)
 
 struct SeqEffectHandle BKE_sequence_get_blend(Sequence *seq)
 {
-       struct SeqEffectHandle rval = {FALSE, NULL};
+       struct SeqEffectHandle rval = {FALSE, FALSE, NULL};
 
        if (seq->blend_mode != 0) {
                rval = get_sequence_effect_impl(seq->blend_mode);
@@ -2994,3 +2996,10 @@ int BKE_sequence_effect_get_num_inputs(int seq_type)
        }
        return 0;
 }
+
+int BKE_sequence_effect_get_supports_mask(int seq_type)
+{
+       struct SeqEffectHandle rval = get_sequence_effect_impl(seq_type);
+
+       return rval.supports_mask;
+}
index 4f1b324bc28bfba852b8799665686f3f5de42ad4..9625fad69a6951dd5330472017b17a78d5c7fe96 100644 (file)
@@ -203,6 +203,8 @@ void BKE_sequence_free(Scene *scene, Sequence *seq)
                seq_free_animdata(scene, seq);
        }
 
+       BKE_sequencer_cache_cleanup_sequence(seq);
+
        MEM_freeN(seq);
 }
 
@@ -592,6 +594,9 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range)
                        }
                        break;
                case SEQ_TYPE_MOVIECLIP:
+                       if (seq->clip == NULL)
+                               return;
+
                        seq->len = BKE_movieclip_get_duration(seq->clip);
 
                        seq->len -= seq->anim_startofs;
@@ -601,8 +606,9 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range)
                        }
                        break;
                case SEQ_TYPE_MASK:
+                       if (seq->mask == NULL)
+                               return;
                        seq->len = BKE_mask_get_duration(seq->mask);
-
                        seq->len -= seq->anim_startofs;
                        seq->len -= seq->anim_endofs;
                        if (seq->len < 0) {
@@ -1426,12 +1432,13 @@ static void make_cb_table_float(float lift, float gain, float gamma,
        }
 }
 
-static void color_balance_byte_byte(Sequence *seq, unsigned char *rect, int width, int height, float mul)
+static void color_balance_byte_byte(Sequence *seq, unsigned char *rect, unsigned char *mask_rect, int width, int height, float mul)
 {
        unsigned char cb_tab[3][256];
        int c;
        unsigned char *p = rect;
        unsigned char *e = p + width * 4 * height;
+       unsigned char *m = mask_rect;
 
        StripColorBalance cb = calc_cb(seq->strip->color_balance);
 
@@ -1440,20 +1447,32 @@ static void color_balance_byte_byte(Sequence *seq, unsigned char *rect, int widt
        }
 
        while (p < e) {
-               p[0] = cb_tab[0][p[0]];
-               p[1] = cb_tab[1][p[1]];
-               p[2] = cb_tab[2][p[2]];
+               if (m) {
+                       float t[3] = {m[0] / 255.0f, m[1] / 255.0f, m[2] / 255.0f};
+
+                       p[0] = p[0] * (1.0f - t[0]) + t[0] * cb_tab[0][p[0]];
+                       p[1] = p[1] * (1.0f - t[1]) + t[1] * cb_tab[1][p[1]];
+                       p[2] = p[2] * (1.0f - t[2]) + t[2] * cb_tab[2][p[2]];
+
+                       m += 4;
+               }
+               else {
+                       p[0] = cb_tab[0][p[0]];
+                       p[1] = cb_tab[1][p[1]];
+                       p[2] = cb_tab[2][p[2]];
+               }
                
                p += 4;
        }
 }
 
-static void color_balance_byte_float(Sequence *seq, unsigned char *rect, float *rect_float, int width, int height, float mul)
+static void color_balance_byte_float(Sequence *seq, unsigned char *rect, float *rect_float, unsigned char *mask_rect, int width, int height, float mul)
 {
        float cb_tab[4][256];
        int c, i;
        unsigned char *p = rect;
        unsigned char *e = p + width * 4 * height;
+       unsigned char *m = mask_rect;
        float *o;
        StripColorBalance cb;
 
@@ -1470,27 +1489,48 @@ static void color_balance_byte_float(Sequence *seq, unsigned char *rect, float *
        }
 
        while (p < e) {
-               o[0] = cb_tab[0][p[0]];
-               o[1] = cb_tab[1][p[1]];
-               o[2] = cb_tab[2][p[2]];
+               if (m) {
+                       float t[3] = {m[0] / 255.0f, m[1] / 255.0f, m[2] / 255.0f};
+
+                       p[0] = p[0] * (1.0f - t[0]) + t[0] * cb_tab[0][p[0]];
+                       p[1] = p[1] * (1.0f - t[1]) + t[1] * cb_tab[1][p[1]];
+                       p[2] = p[2] * (1.0f - t[2]) + t[2] * cb_tab[2][p[2]];
+
+                       m += 4;
+               }
+               else {
+                       o[0] = cb_tab[0][p[0]];
+                       o[1] = cb_tab[1][p[1]];
+                       o[2] = cb_tab[2][p[2]];
+               }
+
                o[3] = cb_tab[3][p[3]];
 
                p += 4; o += 4;
        }
 }
 
-static void color_balance_float_float(Sequence *seq, float *rect_float, int width, int height, float mul)
+static void color_balance_float_float(Sequence *seq, float *rect_float, float *mask_rect_float, int width, int height, float mul)
 {
        float *p = rect_float;
        float *e = rect_float + width * 4 * height;
+       float *m = mask_rect_float;
        StripColorBalance cb = calc_cb(seq->strip->color_balance);
 
        while (p < e) {
                int c;
                for (c = 0; c < 3; c++) {
-                       p[c] = color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul);
+                       float t = color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul);
+
+                       if (m)
+                               p[c] = p[c] * (1.0f - m[c]) + t * m[c];
+                       else
+                               p[c] = t;
                }
+
                p += 4;
+               if (m)
+                       m += 4;
        }
 }
 
@@ -1498,6 +1538,7 @@ typedef struct ColorBalanceInitData {
        Sequence *seq;
        ImBuf *ibuf;
        float mul;
+       ImBuf *mask;
 } ColorBalanceInitData;
 
 typedef struct ColorBalanceThread {
@@ -1506,8 +1547,8 @@ typedef struct ColorBalanceThread {
 
        int width, height;
 
-       unsigned char *rect;
-       float *rect_float;
+       unsigned char *rect, *mask_rect;
+       float *rect_float, *mask_rect_float;
 } ColorBalanceThread;
 
 static void color_balance_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
@@ -1515,6 +1556,7 @@ static void color_balance_init_handle(void *handle_v, int start_line, int tot_li
        ColorBalanceThread *handle = (ColorBalanceThread *) handle_v;
        ColorBalanceInitData *init_data = (ColorBalanceInitData *) init_data_v;
        ImBuf *ibuf = init_data->ibuf;
+       ImBuf *mask = init_data->mask;
 
        int offset = 4 * start_line * ibuf->x;
 
@@ -1530,6 +1572,18 @@ static void color_balance_init_handle(void *handle_v, int start_line, int tot_li
 
        if (ibuf->rect_float)
                handle->rect_float = ibuf->rect_float + offset;
+
+       if (mask) {
+               if (mask->rect)
+                       handle->mask_rect = (unsigned char *) mask->rect + offset;
+
+               if (mask->rect_float)
+                       handle->mask_rect_float = mask->rect_float + offset;
+       }
+       else {
+               handle->mask_rect = NULL;
+               handle->mask_rect_float = NULL;
+       }
 }
 
 static void *color_balance_do_thread(void *thread_data_v)
@@ -1538,53 +1592,67 @@ static void *color_balance_do_thread(void *thread_data_v)
        Sequence *seq = thread_data->seq;
        int width = thread_data->width, height = thread_data->height;
        unsigned char *rect = thread_data->rect;
+       unsigned char *mask_rect = thread_data->mask_rect;
        float *rect_float = thread_data->rect_float;
+       float *mask_rect_float = thread_data->mask_rect_float;
        float mul = thread_data->mul;
 
        if (rect_float) {
-               color_balance_float_float(seq, rect_float, width, height, mul);
+               color_balance_float_float(seq, rect_float, mask_rect_float, width, height, mul);
        }
        else if (seq->flag & SEQ_MAKE_FLOAT) {
-               color_balance_byte_float(seq, rect, rect_float, width, height, mul);
+               color_balance_byte_float(seq, rect, rect_float, mask_rect, width, height, mul);
        }
        else {
-               color_balance_byte_byte(seq, rect, width, height, mul);
+               color_balance_byte_byte(seq, rect, mask_rect, width, height, mul);
        }
 
        return NULL;
 }