Merging r42800 through r42895 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 27 Dec 2011 10:11:07 +0000 (10:11 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 27 Dec 2011 10:11:07 +0000 (10:11 +0000)
193 files changed:
CMakeLists.txt
SConstruct
build_files/scons/config/linuxcross-config.py
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/btools.py
doc/python_api/rst/change_log.rst
intern/audaspace/intern/AUD_SoftwareDevice.cpp
intern/cycles/app/cycles_test.cpp
intern/cycles/app/cycles_xml.cpp
intern/cycles/app/io_export_cycles_xml.py [new file with mode: 0644]
intern/cycles/blender/addon/engine.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_mesh.cpp
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_python.cpp
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_session.h
intern/cycles/blender/blender_sync.cpp
intern/cycles/blender/blender_sync.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_types.h
intern/cycles/render/integrator.cpp
intern/cycles/render/integrator.h
intern/ghost/GHOST_C-api.h
intern/ghost/GHOST_ISystem.h
intern/ghost/GHOST_IWindow.h
intern/ghost/intern/GHOST_C-api.cpp
intern/ghost/intern/GHOST_CallbackEventConsumer.cpp
intern/ghost/intern/GHOST_Debug.h
intern/ghost/intern/GHOST_DisplayManager.h
intern/ghost/intern/GHOST_EventDragnDrop.h
intern/ghost/intern/GHOST_EventKey.h
intern/ghost/intern/GHOST_EventNDOF.h
intern/ghost/intern/GHOST_EventTrackpad.h
intern/ghost/intern/GHOST_System.cpp
intern/ghost/intern/GHOST_System.h
intern/ghost/intern/GHOST_SystemCocoa.h
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_TimerTask.h
intern/ghost/intern/GHOST_Window.cpp
intern/ghost/intern/GHOST_Window.h
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.h
intern/ghost/intern/GHOST_WindowX11.cpp
intern/guardedalloc/MEM_sys_types.h
intern/iksolver/intern/IK_Solver.cpp
intern/mikktspace/mikktspace.c
intern/opennl/intern/opennl.c
intern/opennl/superlu/get_perm_c.c
intern/opennl/superlu/scolumn_bmod.c
intern/opennl/superlu/strsv.c
intern/opennl/superlu/sutil.c
intern/opennl/superlu/util.h
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/modules/bpy_extras/keyconfig_utils.py
release/scripts/modules/bpy_extras/view3d_utils.py
release/scripts/startup/bl_operators/clip.py
release/scripts/startup/bl_operators/sequencer.py
release/scripts/startup/bl_operators/uvcalc_smart_project.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/intern/blf_lang.c
source/blender/blenfont/intern/blf_translation.c
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/BKE_writeffmpeg.h
source/blender/blenkernel/depsgraph_private.h
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_validate.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/unit.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/BLO_sys_types.h
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/include/ED_view3d.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/view2d.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_codegen.h
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/makesdna/DNA_defs.h
source/blender/makesdna/DNA_genfile.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/intern/dna_genfile.c
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_define.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_multires.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/modifiers/intern/MOD_shrinkwrap.c
source/blender/modifiers/intern/MOD_smooth.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_weightvgproximity.c
source/blender/nodes/composite/nodes/node_composite_alphaOver.c
source/blender/python/generic/bgl.c
source/blender/python/generic/bpy_internal_import.c
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_app.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/intern/bpy_driver.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_interface_atexit.c
source/blender/python/intern/bpy_intern_string.c
source/blender/python/intern/bpy_library.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_props.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna_anim.c
source/blender/python/intern/bpy_rna_array.c
source/blender/python/intern/bpy_rna_callback.c
source/blender/python/intern/bpy_traceback.c
source/blender/python/intern/bpy_util.c
source/blender/python/intern/gpu.c
source/blender/python/mathutils/mathutils.c
source/blender/python/mathutils/mathutils.h
source/blender/python/mathutils/mathutils_Color.c
source/blender/python/mathutils/mathutils_Euler.c
source/blender/python/mathutils/mathutils_Euler.h
source/blender/python/mathutils/mathutils_Matrix.c
source/blender/python/mathutils/mathutils_Matrix.h
source/blender/python/mathutils/mathutils_Quaternion.c
source/blender/python/mathutils/mathutils_Vector.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/python/mathutils/mathutils_noise.c
source/blender/quicktime/apple/qtkit_export.m
source/blender/quicktime/apple/quicktime_export.c
source/blender/quicktime/quicktime_export.h
source/blender/render/intern/raytrace/rayobject_octree.cpp
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/volumetric.c
source/blender/windowmanager/intern/wm_event_system.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/Ketsji/KX_IPO_SGController.cpp
source/gameengine/Ketsji/KX_PyMath.h
source/tests/bl_pyapi_mathutils.py

index 371b7eb089680b3206754e9e2c8ef190c715a283..a7e9de026e48e7f25fcf203f771e2587c0b18832 100644 (file)
@@ -281,10 +281,12 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
        message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
 endif()
 
-if(WITH_CODEC_QUICKTIME AND MINGW)
-       message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
-                                               "because it is currently unsupported, remove this "
-                                               "line if youre a developer who wants to add support.")
+if(MINGW)
+       if(WITH_CODEC_QUICKTIME)
+               message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
+                                                       "because it is currently unsupported, remove this "
+                                                       "line if youre a developer who wants to add support.")
+       endif()
 endif()
 
 if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
@@ -658,7 +660,7 @@ elseif(WIN32)
        if(WITH_OPENAL)
                set(OPENAL ${LIBDIR}/openal)
                set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
-               set(OPENAL_LIBRARY wrap_oal)
+               set(OPENAL_LIBRARY OpenAL32)
                set(OPENAL_LIBPATH ${OPENAL}/lib)
        endif()
 
index 1a03827840461a2e5cdbc34d4807691a91245fea..88444c6131485020679b5db7182bc6e8ae7b6953 100644 (file)
@@ -756,7 +756,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
 
     if env['WITH_BF_OPENAL']:
         dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
-        dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
 
     if env['WITH_BF_SNDFILE']:
         dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
index 5e2c1d67d1ff777079764eb23d72c804690d281d..7ec27af9ea82a1fa099766853ce51d04262086b4 100644 (file)
@@ -13,7 +13,7 @@ WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = False
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'OpenAL32 wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 # Warning, this static lib configuration is untested! users of this OS please confirm.
 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
index 6e65e093a46630dc0d337c3224f8f99fa68279db..d9fafbda5b04d3e9cc0c9894683402a4a3392a80 100644 (file)
@@ -14,7 +14,7 @@ BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PY
 WITH_BF_OPENAL = True
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_FFMPEG = True
index 53ac9937885c5a66d913142a8bdc12c8f866a3d8..097740c4b858df7338f8b6a106d258cfadb5e78d 100644 (file)
@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 WITH_BF_OPENAL = True
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include '
-BF_OPENAL_LIB = 'wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_ICONV = True
index 74a526a59f71966c8314b1e073d76c8d8182af07..f502d3ac360a263e07c558c176f0bdfdf7c0027e 100644 (file)
@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 WITH_BF_OPENAL = True
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include '
-BF_OPENAL_LIB = 'wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_SNDFILE = True
index 05e28ab1813f281066908a5dc9710b955e423707..adeca5668eb68c047f4d3375ddc4c1816ccabbeb 100644 (file)
@@ -159,7 +159,8 @@ def validate_arguments(args, bc):
             'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
             'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES' 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE',
             'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
-            'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH'
+            'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
+            'WITH_BF_LIBMV'
             ]
     
     # Have options here that scons expects to be lists
index d332c4faff4ba09ef7bf1b0604eed2ad213d208a..5de7bb49e1cfc5fa4b017d08e0697dd6fe5b46dd 100644 (file)
@@ -1480,3 +1480,640 @@ Added
 * :class:`bpy.types.SceneGameData.restrict_animation_updates`
 * :class:`bpy.types.SceneGameData.show_obstacle_simulation`
 
+
+2.60 to 2.61
+============
+
+bpy.types.BlendDataGroups
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataGroups.is_updated`
+
+bpy.types.BlendDataBrushes
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataBrushes.is_updated`
+
+bpy.types.Theme
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Theme.clip_editor`
+
+bpy.types.BlendData
+-------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendData.movieclips`
+
+bpy.types.BlendDataGreasePencils
+--------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataGreasePencils.is_updated`
+
+bpy.types.BlendDataImages
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataImages.is_updated`
+
+bpy.types.CompositorNodes
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.CompositorNodes.clear`
+
+bpy.types.BlendDataScenes
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataScenes.is_updated`
+
+bpy.types.RenderEngine
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.RenderEngine.bl_use_shading_nodes`
+* :class:`bpy.types.RenderEngine.is_animation`
+* :class:`bpy.types.RenderEngine.is_preview`
+* :class:`bpy.types.RenderEngine.tag_redraw`
+* :class:`bpy.types.RenderEngine.tag_update`
+* :class:`bpy.types.RenderEngine.update`
+* :class:`bpy.types.RenderEngine.update_progress`
+* :class:`bpy.types.RenderEngine.view_draw`
+* :class:`bpy.types.RenderEngine.view_update`
+
+bpy.types.BackgroundImage
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BackgroundImage.clip`
+* :class:`bpy.types.BackgroundImage.clip_user`
+* :class:`bpy.types.BackgroundImage.show_background_image`
+* :class:`bpy.types.BackgroundImage.source`
+* :class:`bpy.types.BackgroundImage.use_camera_clip`
+
+bpy.types.BlendDataMetaBalls
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataMetaBalls.is_updated`
+
+bpy.types.SpaceTimeline
+-----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SpaceTimeline.cache_dynamicpaint`
+
+bpy.types.BlendDataMeshes
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataMeshes.is_updated`
+
+bpy.types.BlendDataNodeTrees
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataNodeTrees.is_updated`
+
+bpy.types.RenderSettings
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.RenderSettings.image_settings`
+* :class:`bpy.types.RenderSettings.use_shading_nodes`
+
+Removed
+^^^^^^^
+
+* **cineon_black**
+* **cineon_gamma**
+* **cineon_white**
+* **color_mode**
+* **exr_codec**
+* **exr_preview**
+* **exr_zbuf**
+* **file_format**
+* **file_quality**
+* **jpeg2k_depth**
+* **jpeg2k_preset**
+* **jpeg2k_ycc**
+* **use_cineon_log**
+* **use_exr_half**
+* **use_tiff_16bit**
+
+bpy.types.Curve
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Curve.cycles`
+
+bpy.types.RegionView3D
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.RegionView3D.view_camera_offset`
+* :class:`bpy.types.RegionView3D.view_camera_zoom`
+
+bpy.types.Scene
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Scene.active_clip`
+* :class:`bpy.types.Scene.cycles`
+
+bpy.types.NodeLinks
+-------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.NodeLinks.clear`
+
+bpy.types.BlendDataLattices
+---------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataLattices.is_updated`
+
+bpy.types.BlendDataParticles
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataParticles.is_updated`
+
+bpy.types.BlendDataWorlds
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataWorlds.is_updated`
+
+bpy.types.ObjectConstraints
+---------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ObjectConstraints.clear`
+
+bpy.types.RenderLayers
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.RenderLayers.new`
+* :class:`bpy.types.RenderLayers.remove`
+
+bpy.types.Menu
+--------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Menu.bl_description`
+
+bpy.types.Lamp
+--------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Lamp.cycles`
+* :class:`bpy.types.Lamp.node_tree`
+* :class:`bpy.types.Lamp.use_nodes`
+
+bpy.types.CurveSplines
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.CurveSplines.clear`
+
+bpy.types.Screen
+----------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Screen.use_play_clip_editors`
+
+bpy.types.BlendDataActions
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataActions.is_updated`
+
+bpy.types.BlendDataSounds
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataSounds.is_updated`
+
+bpy.types.Object
+----------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Object.cycles_visibility`
+* :class:`bpy.types.Object.slow_parent_offset`
+
+Removed
+^^^^^^^
+
+* **time_offset**
+* **use_time_offset_add_parent**
+* **use_time_offset_edit**
+* **use_time_offset_parent**
+* **use_time_offset_particle**
+
+bpy.types.ObjectModifiers
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ObjectModifiers.clear`
+
+bpy.types.BlendDataMaterials
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataMaterials.is_updated`
+
+bpy.types.MetaBallElements
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.MetaBallElements.clear`
+
+bpy.types.NodeSocket
+--------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.NodeSocket.group_socket`
+* :class:`bpy.types.NodeSocket.show_expanded`
+
+bpy.types.Node
+--------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Node.show_texture`
+
+bpy.types.CompositorNodeOutputFile
+----------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.CompositorNodeOutputFile.image_settings`
+
+Removed
+^^^^^^^
+
+* **exr_codec**
+* **image_type**
+* **quality**
+* **use_exr_half**
+
+bpy.types.BlendDataTexts
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataTexts.is_updated`
+
+bpy.types.ThemeView3D
+---------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ThemeView3D.bundle_solid`
+* :class:`bpy.types.ThemeView3D.camera_path`
+
+bpy.types.Event
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Event.unicode`
+
+bpy.types.VertexGroups
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.VertexGroups.clear`
+
+bpy.types.TexMapping
+--------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.TexMapping.mapping`
+* :class:`bpy.types.TexMapping.mapping_x`
+* :class:`bpy.types.TexMapping.mapping_y`
+* :class:`bpy.types.TexMapping.mapping_z`
+
+bpy.types.BlendDataObjects
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataObjects.is_updated`
+
+bpy.types.BlendDataCurves
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataCurves.is_updated`
+
+bpy.types.BlendDataLibraries
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataLibraries.is_updated`
+
+bpy.types.ThemeUserInterface
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ThemeUserInterface.icon_alpha`
+* :class:`bpy.types.ThemeUserInterface.panel`
+
+bpy.types.SpaceNodeEditor
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SpaceNodeEditor.shader_type`
+
+bpy.types.SpaceView3D
+---------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SpaceView3D.show_bundle_names`
+* :class:`bpy.types.SpaceView3D.show_camera_path`
+* :class:`bpy.types.SpaceView3D.show_reconstruction`
+* :class:`bpy.types.SpaceView3D.tracks_draw_size`
+* :class:`bpy.types.SpaceView3D.tracks_draw_type`
+
+bpy.types.BlendDataWindowManagers
+---------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataWindowManagers.is_updated`
+
+bpy.types.BlendDataScreens
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataScreens.is_updated`
+
+bpy.types.BlendDataArmatures
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataArmatures.is_updated`
+
+bpy.types.UserPreferencesInput
+------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.UserPreferencesInput.tweak_threshold`
+
+Removed
+^^^^^^^
+
+* **ndof_orbit_invert_axes**
+
+bpy.types.Mesh
+--------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Mesh.cycles`
+
+bpy.types.BlendDataCameras
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataCameras.is_updated`
+
+bpy.types.MetaBall
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.MetaBall.cycles`
+
+bpy.types.UILayout
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.UILayout.template_image_settings`
+* :class:`bpy.types.UILayout.template_marker`
+* :class:`bpy.types.UILayout.template_movieclip`
+* :class:`bpy.types.UILayout.template_node_link`
+* :class:`bpy.types.UILayout.template_node_view`
+* :class:`bpy.types.UILayout.template_texture_user`
+* :class:`bpy.types.UILayout.template_track`
+
+Function Arguments
+^^^^^^^^^^^^^^^^^^
+
+* :class:`bpy.types.UILayout.template_list` (data, property, active_data, active_property, prop_list, rows, maxrows, type), *was (data, property, active_data, active_property, rows, maxrows, type)*
+
+bpy.types.ID
+------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ID.is_updated`
+* :class:`bpy.types.ID.is_updated_data`
+
+bpy.types.World
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.World.cycles`
+* :class:`bpy.types.World.node_tree`
+* :class:`bpy.types.World.use_nodes`
+
+bpy.types.BlendDataTextures
+---------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataTextures.is_updated`
+
+bpy.types.ShaderNodes
+---------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ShaderNodes.clear`
+
+bpy.types.TimelineMarkers
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.TimelineMarkers.clear`
+
+bpy.types.SpaceFileBrowser
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SpaceFileBrowser.active_operator`
+
+bpy.types.Material
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Material.cycles`
+
+bpy.types.BlendDataSpeakers
+---------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataSpeakers.is_updated`
+
+bpy.types.Camera
+----------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Camera.angle_x`
+* :class:`bpy.types.Camera.angle_y`
+* :class:`bpy.types.Camera.cycles`
+* :class:`bpy.types.Camera.sensor_fit`
+* :class:`bpy.types.Camera.sensor_height`
+* :class:`bpy.types.Camera.sensor_width`
+* :class:`bpy.types.Camera.show_sensor`
+
+bpy.types.BlendDataLamps
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataLamps.is_updated`
+
+bpy.types.TextureNodes
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.TextureNodes.clear`
+
+bpy.types.BlendDataFonts
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendDataFonts.is_updated`
index b1e5d8ccd758f49ec9eb385f58e18d23714d7d6a..1d993abab73e9f1939d47d0b23760b046184ddda 100644 (file)
@@ -121,7 +121,9 @@ void AUD_SoftwareDevice::AUD_SoftwareHandle::update()
 
                if(flags & AUD_RENDER_DISTANCE)
                {
-                       if(m_device->m_distance_model == AUD_DISTANCE_MODEL_INVERSE_CLAMPED || m_device->m_distance_model == AUD_DISTANCE_MODEL_LINEAR_CLAMPED || m_device->m_distance_model == AUD_DISTANCE_MODEL_EXPONENT_CLAMPED)
+                       if(m_device->m_distance_model == AUD_DISTANCE_MODEL_INVERSE_CLAMPED ||
+                          m_device->m_distance_model == AUD_DISTANCE_MODEL_LINEAR_CLAMPED ||
+                          m_device->m_distance_model == AUD_DISTANCE_MODEL_EXPONENT_CLAMPED)
                        {
                                distance = AUD_MAX(AUD_MIN(m_distance_max, distance), m_distance_reference);
                        }
index 838167274048a0689678d74d26608274080a7018..d9386f7514190822966ddef49378fd16f44baac5 100644 (file)
@@ -82,9 +82,9 @@ static void session_print_status()
        session_print(status);
 }
 
-static BufferParams session_buffer_params()
+static BufferParams& session_buffer_params()
 {
-       BufferParams buffer_params;
+       static BufferParams buffer_params;
        buffer_params.width = options.width;
        buffer_params.height = options.height;
        buffer_params.full_width = options.width;
@@ -109,12 +109,15 @@ static void session_init()
        options.scene = NULL;
 }
 
-static void scene_init()
+static void scene_init(int width, int height)
 {
        options.scene = new Scene(options.scene_params);
        xml_read_file(options.scene, options.filepath.c_str());
-       options.width = options.scene->camera->width;
-       options.height = options.scene->camera->height;
+       
+       if (width == 0 || height == 0) {
+               options.width = options.scene->camera->width;
+               options.height = options.scene->camera->height;
+       }
 }
 
 static void session_exit()
@@ -194,8 +197,8 @@ static int files_parse(int argc, const char *argv[])
 
 static void options_parse(int argc, const char **argv)
 {
-       options.width= 1024;
-       options.height= 512;
+       options.width= 0;
+       options.height= 0;
        options.filepath = "";
        options.session = NULL;
        options.quiet = false;
@@ -234,6 +237,8 @@ static void options_parse(int argc, const char **argv)
                "--samples %d", &options.session_params.samples, "Number of samples to render",
                "--output %s", &options.session_params.output_path, "File path to write output image",
                "--threads %d", &options.session_params.threads, "CPU Rendering Threads",
+               "--width  %d", &options.width, "Window width in pixel",
+               "--height %d", &options.height, "Window height in pixel",
                "--help", &help, "Print help message",
                NULL);
        
@@ -287,7 +292,7 @@ static void options_parse(int argc, const char **argv)
        }
 
        /* load scene */
-       scene_init();
+       scene_init(options.width, options.height);
 }
 
 CCL_NAMESPACE_END
index f5cc01cd0626528419e8dfaf73263adc3d1091e4..e29a73ec9e865cce427dac8690b452eb943eb139 100644 (file)
@@ -257,8 +257,18 @@ static void xml_read_integrator(const XMLReadState& state, pugi::xml_node node)
 
        xml_read_int(&integrator->min_bounce, node, "min_bounce");
        xml_read_int(&integrator->max_bounce, node, "max_bounce");
+       
+       xml_read_int(&integrator->max_diffuse_bounce, node, "max_diffuse_bounce");
+       xml_read_int(&integrator->max_glossy_bounce, node, "max_glossy_bounce");
+       xml_read_int(&integrator->max_transmission_bounce, node, "max_transmission_bounce");
+       
+       xml_read_int(&integrator->transparent_min_bounce, node, "transparent_min_bounce");
+       xml_read_int(&integrator->transparent_max_bounce, node, "transparent_max_bounce");
+       
+       xml_read_bool(&integrator->transparent_shadows, node, "transparent_shadows");
        xml_read_bool(&integrator->no_caustics, node, "no_caustics");
-       xml_read_float(&integrator->blur_caustics, node, "blur_caustics");
+       
+       xml_read_int(&integrator->seed, node, "seed");
 }
 
 /* Camera */
diff --git a/intern/cycles/app/io_export_cycles_xml.py b/intern/cycles/app/io_export_cycles_xml.py
new file mode 100644 (file)
index 0000000..2314d93
--- /dev/null
@@ -0,0 +1,143 @@
+#
+# Copyright 2011, Blender Foundation.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+# XML exporter for generating test files, not intended for end users
+
+import os
+import xml.etree.ElementTree as etree
+import xml.dom.minidom as dom
+
+import bpy
+from bpy_extras.io_utils import ExportHelper
+from bpy.props import PointerProperty, StringProperty
+
+def strip(root):
+    root.text = None
+    root.tail = None
+
+    for elem in root:
+        strip(elem)
+
+def write(node, fname):
+    strip(node)
+
+    s = etree.tostring(node)
+    s = dom.parseString(s).toprettyxml()
+
+    f = open(fname, "w")
+    f.write(s)
+    
+class CyclesXMLSettings(bpy.types.PropertyGroup):
+    @classmethod
+    def register(cls):
+        bpy.types.Scene.cycles_xml = PointerProperty(
+                                        type=cls,
+                                        name="Cycles XML export Settings",
+                                        description="Cycles XML export settings")
+        cls.filepath = StringProperty(
+                        name='Filepath',
+                        description='Filepath for the .xml file',
+                        maxlen=256,
+                        default='',
+                        subtype='FILE_PATH')
+                        
+    @classmethod
+    def unregister(cls):
+        del bpy.types.Scene.cycles_xml
+        
+# User Interface Drawing Code
+class RenderButtonsPanel():
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "render"
+
+    @classmethod
+    def poll(self, context):
+        rd = context.scene.render
+        return rd.engine == 'CYCLES'
+
+
+class PHYSICS_PT_fluid_export(RenderButtonsPanel, bpy.types.Panel):
+    bl_label = "Cycles XML Exporter"
+
+    def draw(self, context):
+        layout = self.layout
+        
+        cycles = context.scene.cycles_xml
+        
+        #layout.prop(cycles, "filepath")
+        layout.operator("export_mesh.cycles_xml")
+
+        
+# Export Operator
+class ExportCyclesXML(bpy.types.Operator, ExportHelper):
+    bl_idname = "export_mesh.cycles_xml"
+    bl_label = "Export Cycles XML"
+
+    filename_ext = ".xml"
+
+    @classmethod
+    def poll(cls, context):
+        return context.active_object != None
+
+    def execute(self, context):
+        filepath = bpy.path.ensure_ext(self.filepath, ".xml")
+
+        # get mesh
+        scene = context.scene
+        object = context.active_object
+
+        if not object:
+            raise Exception("No active object")
+
+        mesh = object.to_mesh(scene, True, 'PREVIEW')
+
+        if not mesh:
+            raise Exception("No mesh data in active object")
+
+        # generate mesh node
+        nverts = ""
+        verts = ""
+        P = ""
+
+        for v in mesh.vertices:
+            P += "%f %f %f  " % (v.co[0], v.co[1], v.co[2])
+
+        for i, f in enumerate(mesh.faces):
+            nverts += str(len(f.vertices)) + " "
+
+            for v in f.vertices:
+                verts += str(v) + " "
+            verts += " "
+
+        node = etree.Element('mesh', attrib={'nverts': nverts, 'verts': verts, 'P': P})
+        
+        # write to file
+        write(node, filepath)
+
+        return {'FINISHED'}
+
+def register():
+    bpy.utils.register_module(__name__)
+
+def unregister():
+    bpy.utils.unregister_module(__name__)
+
+if __name__ == "__main__":
+    register()
+
index 60b77b23f25c89ee5921cc57773d8ad8220d68f2..3d71c25d7ade46c9fcad252a73e6aae1ec378195 100644 (file)
@@ -22,17 +22,17 @@ import bpy
 
 
 def init():
-    import bcycles
+    import _cycles
     import os.path
 
     path = os.path.dirname(__file__)
     user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', '')))
 
-    bcycles.init(path, user_path)
+    _cycles.init(path, user_path)
 
 
 def create(engine, data, scene, region=0, v3d=0, rv3d=0):
-    import bcycles
+    import _cycles
 
     data = data.as_pointer()
     scene = scene.as_pointer()
@@ -43,42 +43,42 @@ def create(engine, data, scene, region=0, v3d=0, rv3d=0):
     if rv3d:
         rv3d = rv3d.as_pointer()
 
-    engine.session = bcycles.create(engine.as_pointer(), data, scene, region, v3d, rv3d)
+    engine.session = _cycles.create(engine.as_pointer(), data, scene, region, v3d, rv3d)
 
 
 def free(engine):
     if hasattr(engine, "session"):
         if engine.session:
-            import bcycles
-            bcycles.free(engine.session)
+            import _cycles
+            _cycles.free(engine.session)
         del engine.session
 
 
 def render(engine):
-    import bcycles
+    import _cycles
     if hasattr(engine, "session"):
-        bcycles.render(engine.session)
+        _cycles.render(engine.session)
 
 
 def update(engine, data, scene):
-    import bcycles
-    bcycles.sync(engine.session)
+    import _cycles
+    _cycles.sync(engine.session)
 
 
 def draw(engine, region, v3d, rv3d):
-    import bcycles
+    import _cycles
     v3d = v3d.as_pointer()
     rv3d = rv3d.as_pointer()
 
     # draw render image
-    bcycles.draw(engine.session, v3d, rv3d)
+    _cycles.draw(engine.session, v3d, rv3d)
 
 
 def available_devices():
-    import bcycles
-    return bcycles.available_devices()
+    import _cycles
+    return _cycles.available_devices()
 
 
 def with_osl():
-    import bcycles
-    return bcycles.with_osl()
+    import _cycles
+    return _cycles.with_osl
index d631158f5eba29c1aa15f9b9615b4cf6ae6c4ecc..6e73795666e9952e4ac376b85e5f10bb4a8e639b 100644 (file)
@@ -160,18 +160,17 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
         scene = context.scene
         rd = scene.render
 
-        row = layout.row()
-        row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
+        row = layout.row()
+        row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
 
-        col = row.column(align=True)
-        col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
-        col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
+        col = row.column(align=True)
+        col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
+        col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
 
         row = layout.row()
-        # rl = rd.layers.active
-        rl = rd.layers[0]
+        rl = rd.layers.active
         row.prop(rl, "name")
-        #row.prop(rd, "use_single_layer", text="", icon_only=True)
+        row.prop(rd, "use_single_layer", text="", icon_only=True)
 
         split = layout.split()
 
@@ -183,6 +182,7 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
 
         layout.separator()
 
+        rl = rd.layers[0]
         layout.prop(rl, "material_override", text="Material")
 
 
@@ -745,6 +745,12 @@ def get_panels():
         bpy.types.RENDER_PT_encoding,
         bpy.types.RENDER_PT_dimensions,
         bpy.types.RENDER_PT_stamp,
+        bpy.types.SCENE_PT_scene,
+        bpy.types.SCENE_PT_audio,
+        bpy.types.SCENE_PT_unit,
+        bpy.types.SCENE_PT_keying_sets,
+        bpy.types.SCENE_PT_keying_set_paths,
+        bpy.types.SCENE_PT_physics,
         bpy.types.WORLD_PT_context_world,
         bpy.types.DATA_PT_context_mesh,
         bpy.types.DATA_PT_context_camera,
index 4b7651dba4c62690bc00768c98eeff4b50a1fade..72b8cfa23552ca6a208bb0128e2ab18e581d843a 100644 (file)
@@ -232,8 +232,10 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated)
 
        BL::Object::material_slots_iterator slot;
        for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot) {
-               if(render_layer.material_override)
-                       find_shader(render_layer.material_override, used_shaders, scene->default_surface);
+               BL::Material material_override = render_layers.front().material_override;
+
+               if(material_override)
+                       find_shader(material_override, used_shaders, scene->default_surface);
                else
                        find_shader(slot->material(), used_shaders, scene->default_surface);
        }
index ec22d3db6f71c197ef79495cd59ee19b2c39f63c..608c5fda5ac356cc15dfba80e053fda4f2e3f815 100644 (file)
@@ -154,7 +154,7 @@ void BlenderSync::sync_light(BL::Object b_parent, int b_index, BL::Object b_ob,
 
 /* Object */
 
-void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm, uint visibility)
+void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm, uint layer_flag)
 {
        /* light is handled separately */
        if(object_is_light(b_ob)) {
@@ -181,11 +181,19 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
        if(object_updated || (object->mesh && object->mesh->need_update)) {
                object->name = b_ob.name().c_str();
                object->tfm = tfm;
-               
-               object->visibility = object_ray_visibility(b_ob) & visibility;
+
+               /* visibility flags for both parent */
+               object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL;
                if(b_parent.ptr.data != b_ob.ptr.data)
                        object->visibility &= object_ray_visibility(b_parent);
 
+               /* camera flag is not actually used, instead is tested
+                  against render layer flags */
+               if(object->visibility & PATH_RAY_CAMERA) {
+                       object->visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
+                       object->visibility &= ~PATH_RAY_CAMERA;
+               }
+
                object->tag_update(scene);
        }
 }
@@ -195,8 +203,7 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
 void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
 {
        /* layer data */
-       uint scene_layer = render_layer.scene_layer;
-       uint layer = render_layer.layer;
+       uint scene_layer = render_layers.front().scene_layer;
        
        /* prepare for sync */
        light_map.pre_sync();
@@ -212,11 +219,6 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
                uint ob_layer = get_layer(b_ob->layers());
 
                if(!hide && (ob_layer & scene_layer)) {
-                       uint visibility = PATH_RAY_ALL;
-                       
-                       if(!(ob_layer & layer))
-                               visibility &= ~PATH_RAY_CAMERA;
-
                        if(b_ob->is_duplicator()) {
                                /* dupli objects */
                                object_create_duplilist(*b_ob, b_scene);
@@ -226,7 +228,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
 
                                for(b_ob->dupli_list.begin(b_dup); b_dup != b_ob->dupli_list.end(); ++b_dup) {
                                        Transform tfm = get_transform(b_dup->matrix());
-                                       sync_object(*b_ob, b_index, b_dup->object(), tfm, visibility);
+                                       sync_object(*b_ob, b_index, b_dup->object(), tfm, ob_layer);
                                        b_index++;
                                }
 
@@ -244,7 +246,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
                        if(!hide) {
                                /* object itself */
                                Transform tfm = get_transform(b_ob->matrix_world());
-                               sync_object(*b_ob, 0, *b_ob, tfm, visibility);
+                               sync_object(*b_ob, 0, *b_ob, tfm, ob_layer);
                        }
                }
        }
index 58049bb8cbe9809a5aa3b559b27464458b981353..90dab298dc303bc998ce78b348ae15ec691dab96 100644 (file)
@@ -35,8 +35,7 @@ static PyObject *init_func(PyObject *self, PyObject *args)
        
        path_init(path, user_path);
 
-       Py_INCREF(Py_None);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *create_func(PyObject *self, PyObject *args)
@@ -89,35 +88,23 @@ static PyObject *create_func(PyObject *self, PyObject *args)
        return PyLong_FromVoidPtr(session);
 }
 
-static PyObject *free_func(PyObject *self, PyObject *args)
+static PyObject *free_func(PyObject *self, PyObject *value)
 {
-       PyObject *pysession;
+       delete (BlenderSession*)PyLong_AsVoidPtr(value);
 
-       if(!PyArg_ParseTuple(args, "O", &pysession))
-               return NULL;
-
-       delete (BlenderSession*)PyLong_AsVoidPtr(pysession);
-
-       Py_INCREF(Py_None);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
-static PyObject *render_func(PyObject *self, PyObject *args)
+static PyObject *render_func(PyObject *self, PyObject *value)
 {
-       PyObject *pysession;
-
-       if(!PyArg_ParseTuple(args, "O", &pysession))
-               return NULL;
-       
        Py_BEGIN_ALLOW_THREADS
 
-       BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
+       BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(value);
        session->render();
 
        Py_END_ALLOW_THREADS
 
-       Py_INCREF(Py_None);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *draw_func(PyObject *self, PyObject *args)
@@ -137,22 +124,15 @@ static PyObject *draw_func(PyObject *self, PyObject *args)
                session->draw(viewport[2], viewport[3]);
        }
 
-       Py_INCREF(Py_None);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
-static PyObject *sync_func(PyObject *self, PyObject *args)
+static PyObject *sync_func(PyObject *self, PyObject *value)
 {
-       PyObject *pysession;
-
-       if(!PyArg_ParseTuple(args, "O", &pysession))
-               return NULL;
-
-       BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
+       BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(value);
        session->synchronize();
 
-       Py_INCREF(Py_None);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *available_devices_func(PyObject *self, PyObject *args)
@@ -163,38 +143,26 @@ static PyObject *available_devices_func(PyObject *self, PyObject *args)
 
        for(size_t i = 0; i < types.size(); i++) {
                string name = Device::string_from_type(types[i]);
-               PyTuple_SetItem(ret, i, PyUnicode_FromString(name.c_str()));
+               PyTuple_SET_ITEM(ret, i, PyUnicode_FromString(name.c_str()));
        }
 
        return ret;
 }
 
-static PyObject *with_osl_func(PyObject *self, PyObject *args)
-{
-#ifdef WITH_OSL
-       PyObject *ret = Py_True;
-#else
-       PyObject *ret = Py_False;
-#endif
-
-       return Py_INCREF(ret), ret;
-}
-
 static PyMethodDef methods[] = {
        {"init", init_func, METH_VARARGS, ""},
        {"create", create_func, METH_VARARGS, ""},
-       {"free", free_func, METH_VARARGS, ""},
-       {"render", render_func, METH_VARARGS, ""},
+       {"free", free_func, METH_O, ""},
+       {"render", render_func, METH_O, ""},
        {"draw", draw_func, METH_VARARGS, ""},
-       {"sync", sync_func, METH_VARARGS, ""},
+       {"sync", sync_func, METH_O, ""},
        {"available_devices", available_devices_func, METH_NOARGS, ""},
-       {"with_osl", with_osl_func, METH_NOARGS, ""},
        {NULL, NULL, 0, NULL},
 };
 
 static struct PyModuleDef module = {
        PyModuleDef_HEAD_INIT,
-       "bcycles",
+       "_cycles",
        "Blender cycles render integration",
        -1,
        methods,
@@ -207,6 +175,16 @@ extern "C" PyObject *CYCLES_initPython();
 
 PyObject *CYCLES_initPython()
 {
-       return PyModule_Create(&ccl::module);
+       PyObject *mod= PyModule_Create(&ccl::module);
+
+#ifdef WITH_OSL
+       PyModule_AddObject(mod, "with_osl", Py_True);
+       Py_INCREF(Py_True);
+#else
+       PyModule_AddObject(mod, "with_osl", Py_False);
+       Py_INCREF(Py_False);
+#endif
+
+       return mod;
 }
 
index 1803dd36beb43a650a548578be3c75137c19edb2..d8c65c7a607d0020e4e1ca5257de5b7e7c558c39 100644 (file)
@@ -40,7 +40,8 @@
 CCL_NAMESPACE_BEGIN
 
 BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_, BL::Scene b_scene_)
-: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL)
+: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL),
+  b_rr(PointerRNA_NULL), b_rlay(PointerRNA_NULL)
 {
        /* offline render */
        BL::RenderSettings r = b_scene.render();
@@ -55,7 +56,8 @@ BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_
 
 BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_, BL::Scene b_scene_,
        BL::SpaceView3D b_v3d_, BL::RegionView3D b_rv3d_, int width_, int height_)
-: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(b_v3d_), b_rv3d(b_rv3d_)
+: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(b_v3d_), b_rv3d(b_rv3d_),
+  b_rr(PointerRNA_NULL), b_rlay(PointerRNA_NULL)
 {
        /* 3d view render */
        width = width_;
@@ -64,6 +66,7 @@ BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_
        last_redraw_time = 0.0f;
 
        create_session();
+       session->start();
 }
 
 BlenderSession::~BlenderSession()
@@ -99,11 +102,9 @@ void BlenderSession::create_session()
        session->progress.set_cancel_callback(function_bind(&BlenderSession::test_cancel, this));
        session->set_pause(BlenderSync::get_session_pause(b_scene, background));
 
-       /* start rendering */
+       /* set buffer parameters */
        BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height);
-
        session->reset(buffer_params, session_params.samples);
-       session->start();
 }
 
 void BlenderSession::free_session()
@@ -114,42 +115,67 @@ void BlenderSession::free_session()
 
 void BlenderSession::render()
 {
-       session->wait();
+       /* get buffer parameters */
+       BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height);
+       int w = buffer_params.width, h = buffer_params.height;
 
-       if(session->progress.get_cancel())
-               return;
+       /* create render result */
+       RenderResult *rrp = RE_engine_begin_result((RenderEngine*)b_engine.ptr.data, 0, 0, w, h);
+       PointerRNA rrptr;
+       RNA_pointer_create(NULL, &RNA_RenderResult, rrp, &rrptr);
+       b_rr = BL::RenderResult(rrptr);
+
+       BL::RenderSettings r = b_scene.render();
+       BL::RenderResult::layers_iterator b_iter;
+       BL::RenderLayers b_rr_layers(r.ptr);
+       
+       int active = 0;
+
+       /* render each layer */
+       for(b_rr.layers.begin(b_iter); b_iter != b_rr.layers.end(); ++b_iter, ++active) {
+               /* single layer render */
+               if(r.use_single_layer())
+                       active = b_rr_layers.active_index();
+
+               /* set layer */
+               b_rlay = *b_iter;
 
-       /* write result */
-       write_render_result();
+               /* update scene */
+               sync->sync_data(b_v3d, active);
+
+               /* render */
+               session->start();
+               session->wait();
+
+               if(session->progress.get_cancel())
+                       break;
+
+               /* write result */
+               write_render_result();
+       }
+
+       /* delete render result */
+       RE_engine_end_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data);
 }
 
 void BlenderSession::write_render_result()
 {
-       /* get result */
+       /* get state */
        RenderBuffers *buffers = session->buffers;
        float exposure = scene->film->exposure;
        double total_time, sample_time;
        int sample;
        session->progress.get_sample(sample, total_time, sample_time);
 
+       /* get pixels */
        float4 *pixels = buffers->copy_from_device(exposure, sample);
 
        if(!pixels)
                return;
 
-       BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height);
-       int w = buffer_params.width, h = buffer_params.height;
-
-       struct RenderResult *rrp = RE_engine_begin_result((RenderEngine*)b_engine.ptr.data, 0, 0, w, h);
-       PointerRNA rrptr;
-       RNA_pointer_create(NULL, &RNA_RenderResult, rrp, &rrptr);
-       BL::RenderResult rr(rrptr);
-
-       BL::RenderResult::layers_iterator layer;
-       rr.layers.begin(layer);
-       rna_RenderLayer_rect_set(&layer->ptr, (float*)pixels);
-
-       RE_engine_end_result((RenderEngine*)b_engine.ptr.data, rrp);
+       /* write pixels */
+       rna_RenderLayer_rect_set(&b_rlay.ptr, (float*)pixels);
+       RE_engine_update_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data);
 
        delete [] pixels;
 }
@@ -164,6 +190,7 @@ void BlenderSession::synchronize()
           scene->params.modified(scene_params)) {
                free_session();
                create_session();
+               session->start();
                return;
        }
 
index e30b60c3d637bedf5d95dc39c90b7ad4343bfbb3..26fffcf3aff9a20603fdd3f8dffe2a212b8f43fb 100644 (file)
@@ -69,6 +69,8 @@ public:
        BL::Scene b_scene;
        BL::SpaceView3D b_v3d;
        BL::RegionView3D b_rv3d;
+       BL::RenderResult b_rr;
+       BL::RenderLayer b_rlay;
 
        string last_status;
        float last_progress;
index 4c8fe350b88209a3b0f771ca8f8a7cfc53c61205..3443f76b1ce58cd846de66093cb8382fa41135b0 100644 (file)
@@ -48,7 +48,8 @@ BlenderSync::BlenderSync(BL::BlendData b_data_, BL::Scene b_scene_, Scene *scene
   light_map(&scene_->lights),
   world_map(NULL),
   world_recalc(false),
-  experimental(false)
+  experimental(false),
+  active_layer(0)
 {
        scene = scene_;
        preview = preview_;
@@ -120,18 +121,18 @@ bool BlenderSync::sync_recalc()
        return recalc;
 }
 
-void BlenderSync::sync_data(BL::SpaceView3D b_v3d)
+void BlenderSync::sync_data(BL::SpaceView3D b_v3d, int layer)
 {
-       sync_integrator();
+       sync_render_layers(b_v3d);
+       sync_integrator(layer);
        sync_film();
-       sync_render_layer(b_v3d);
        sync_shaders();
        sync_objects(b_v3d);
 }
 
 /* Integrator */
 
-void BlenderSync::sync_integrator()
+void BlenderSync::sync_integrator(int layer)
 {
        PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
 
@@ -152,9 +153,8 @@ void BlenderSync::sync_integrator()
        integrator->transparent_shadows = get_boolean(cscene, "use_transparent_shadows");
 
        integrator->no_caustics = get_boolean(cscene, "no_caustics");
-       integrator->blur_caustics = get_float(cscene, "blur_caustics");
-
        integrator->seed = get_int(cscene, "seed");
+       integrator->layer_flag = render_layers[layer].layer;
 
        if(integrator->modified(previntegrator))
                integrator->tag_update(scene);
@@ -186,27 +186,32 @@ void BlenderSync::sync_film()
 
 /* Render Layer */
 
-void BlenderSync::sync_render_layer(BL::SpaceView3D b_v3d)
+void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d)
 {
+       render_layers.clear();
+
        if(b_v3d) {
-               render_layer.scene_layer = get_layer(b_v3d.layers());
-               render_layer.layer = render_layer.scene_layer;
-               render_layer.material_override = PointerRNA_NULL;
+               RenderLayerInfo rlay;
+
+               rlay.scene_layer = get_layer(b_v3d.layers());
+               rlay.layer = rlay.scene_layer;
+               rlay.material_override = PointerRNA_NULL;
+
+               render_layers.push_back(rlay);
        }
        else {
                BL::RenderSettings r = b_scene.render();
                BL::RenderSettings::layers_iterator b_rlay;
-               bool first = true;
 
                for(r.layers.begin(b_rlay); b_rlay != r.layers.end(); ++b_rlay) {
                        /* single layer for now */
-                       if(first) {
-                               render_layer.scene_layer = get_layer(b_scene.layers());
-                               render_layer.layer = get_layer(b_rlay->layers());
-                               render_layer.material_override = b_rlay->material_override();
+                       RenderLayerInfo rlay;
 
-                               first = false;
-                       }
+                       rlay.scene_layer = get_layer(b_scene.layers());
+                       rlay.layer = get_layer(b_rlay->layers());
+                       rlay.material_override = b_rlay->material_override();
+
+                       render_layers.push_back(rlay);
                }
        }
 }
index 824904cd81d2a64cbd2a87654a4a36ffc33a8c96..60fdd7c386b143c48afabc9e43fce40dd392c5d2 100644 (file)
@@ -54,7 +54,7 @@ public:
 
        /* sync */
        bool sync_recalc();
-       void sync_data(BL::SpaceView3D b_v3d);
+       void sync_data(BL::SpaceView3D b_v3d, int layer = 0);
        void sync_camera(int width, int height);
        void sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height);
 
@@ -70,15 +70,15 @@ private:
        void sync_materials();
        void sync_objects(BL::SpaceView3D b_v3d);
        void sync_film();
-       void sync_integrator();
+       void sync_integrator(int layer);
        void sync_view();
        void sync_world();
-       void sync_render_layer(BL::SpaceView3D b_v3d);
+       void sync_render_layers(BL::SpaceView3D b_v3d);
        void sync_shaders();
 
        void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
        Mesh *sync_mesh(BL::Object b_ob, bool object_updated);
-       void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint visibility);
+       void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint layer_flag);
        void sync_light(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm);
 
        /* util */
@@ -112,7 +112,10 @@ private:
                uint scene_layer;
                uint layer;
                BL::Material material_override;
-       } render_layer;
+       };
+
+       vector<RenderLayerInfo> render_layers;
+       int active_layer;
 };
 
 CCL_NAMESPACE_END
index 05707f31352e38fa778f53db6504dd522c4a1381..d27ad861c6add93c300574dfaeaa925eaddc6e2a 100644 (file)
@@ -130,13 +130,16 @@ __device_inline void path_state_next(KernelGlobals *kg, PathState *state, int la
        }
 }
 
-__device_inline uint path_state_ray_visibility(PathState *state)
+__device_inline uint path_state_ray_visibility(KernelGlobals *kg, PathState *state)
 {
        uint flag = state->flag;
 
        /* for visibility, diffuse/glossy are for reflection only */
        if(flag & PATH_RAY_TRANSMIT)
                flag &= ~(PATH_RAY_DIFFUSE|PATH_RAY_GLOSSY);
+       /* for camera visibility, use render layer flags */
+       if(flag & PATH_RAY_CAMERA)
+               flag |= kernel_data.integrator.layer_flag;
 
        return flag;
 }
@@ -249,7 +252,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
        for(;; rng_offset += PRNG_BOUNCE_NUM) {
                /* intersect scene */
                Intersection isect;
-               uint visibility = path_state_ray_visibility(&state);
+               uint visibility = path_state_ray_visibility(kg, &state);
 
                if(!scene_intersect(kg, &ray, visibility, &isect)) {
                        /* eval background shader if nothing hit */
index ea73f87a8a56385e09e891f4a81e900612346b79..56db4d2b78a46c5e5c7aded2472965a31b31291e 100644 (file)
@@ -100,7 +100,10 @@ enum PathTraceDimension {
 
 /* these flag values correspond exactly to OSL defaults, so be careful not to
  * change this, or if you do, set the "raytypes" shading system attribute with
- * your own new ray types and bitflag values */
+ * your own new ray types and bitflag values.
+ *
+ * for ray visibility tests in BVH traversal, the upper 20 bits are used for
+ * layer visibility tests. */
 
 enum PathRayFlag {
        PATH_RAY_CAMERA = 1,
@@ -117,7 +120,9 @@ enum PathRayFlag {
 
        PATH_RAY_MIS_SKIP = 512,
 
-       PATH_RAY_ALL = (1|2|4|8|16|32|64|128|256|512)
+       PATH_RAY_ALL = (1|2|4|8|16|32|64|128|256|512),
+
+       PATH_RAY_LAYER_SHIFT = (32-20)
 };
 
 /* Closure Label */
@@ -383,10 +388,12 @@ typedef struct KernelIntegrator {
 
        /* caustics */
        int no_caustics;
-       float blur_caustics;
 
        /* seed */
        int seed;
+
+       /* render layer */
+       int layer_flag;
 } KernelIntegrator;
 
 typedef struct KernelBVH {
index 9d129d8e8db07f1c48076845fbe7fa8f5b73e12e..47059a0a009207f8e326e3290ebc4b1492532956 100644 (file)
@@ -41,9 +41,8 @@ Integrator::Integrator()
        transparent_shadows = false;
 
        no_caustics = false;
-       blur_caustics = 0.0f;
-
        seed = 0;
+       layer_flag = ~0;
 
        need_update = true;
 }
@@ -81,9 +80,8 @@ void Integrator::device_update(Device *device, DeviceScene *dscene)
        kintegrator->transparent_shadows = transparent_shadows;
 
        kintegrator->no_caustics = no_caustics;
-       kintegrator->blur_caustics = blur_caustics;
-
        kintegrator->seed = hash_int(seed);
+       kintegrator->layer_flag = layer_flag << PATH_RAY_LAYER_SHIFT;
 
        /* sobol directions table */
        int dimensions = PRNG_BASE_NUM + (max_bounce + transparent_max_bounce + 2)*PRNG_BOUNCE_NUM;
@@ -115,7 +113,7 @@ bool Integrator::modified(const Integrator& integrator)
                transparent_probalistic == integrator.transparent_probalistic &&
                transparent_shadows == integrator.transparent_shadows &&
                no_caustics == integrator.no_caustics &&
-               blur_caustics == integrator.blur_caustics &&
+               layer_flag == integrator.layer_flag &&
                seed == integrator.seed);
 }
 
index 52032fa1a261714c582ca17ab796942ac10ea2ec..e610d670142fda087a154c2589226d13e602cd5e 100644 (file)
@@ -41,9 +41,9 @@ public:
        bool transparent_shadows;
 
        bool no_caustics;
-       float blur_caustics;
 
        int seed;
+       int layer_flag;
 
        bool need_update;
 
index 8d06bdbba65f4760ebbc1409f294624413cb7bf6..db66a68799e5c40c735a9ff999cada28c7d96aa9 100644 (file)
@@ -81,7 +81,8 @@ extern GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle);
  * @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);
+extern GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
+                                                           GHOST_TUserDataPtr userdata);
 
 /**
  * Disposes an event consumer object
index 04dc8717637babed4c60540bfe51ee6bac8e75a1..d451cb16df65d7dfed6dd57749c2f445511f2729 100644 (file)
@@ -181,7 +181,10 @@ public:
         * @param userData      Placeholder for user data.
         * @return A timer task (0 if timer task installation failed).
         */
-       virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData = 0) = 0;
+       virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay,
+                                              GHOST_TUns64 interval,
+                                              GHOST_TimerProcPtr timerProc,
+                                              GHOST_TUserDataPtr userData = 0) = 0;
 
        /**
         * Removes a timer.
index 12a11d838dc0d46c37c0f6af9bdaf7d89e21c5ad..6438059287dec94b2df89c8b34e6cfdf90bc9ac5 100644 (file)
@@ -303,7 +303,7 @@ public:
         * @param       grab The new grab state of the cursor.
         * @return      Indication of success.
         */
-       virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds) { return GHOST_kSuccess; };
+       virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds) { return GHOST_kSuccess; }
 
 #ifdef WITH_CXX_GUARDEDALLOC
 public:
index 35a97b6d41698ff7a91523917f0a4dcf01000c43..6edfc4287aebd7142073b01b03ba987966e9de2f 100644 (file)
@@ -65,7 +65,8 @@ GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
 }
 
 
-GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata)
+GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
+                                                    GHOST_TUserDataPtr userdata)
 {
        return (GHOST_EventConsumerHandle) new GHOST_CallbackEventConsumer (eventCallback, userdata);
 }
index 50000421bfdd7d55501d2c7f279fbab4c46dd8ca..49590c77eaa88a3123005637217924790b55f98c 100644 (file)
@@ -42,7 +42,7 @@
 #include "GHOST_CallbackEventConsumer.h"
 
 GHOST_CallbackEventConsumer::GHOST_CallbackEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
-                                                                                                               GHOST_TUserDataPtr userData)
+                                                         GHOST_TUserDataPtr userData)
 {
        m_eventCallback = eventCallback;
        m_userData = userData;
index f2e16259c57bbc8f2891bb63047ee1e36e6ebbd8..38512f6ce2b7ce63b7cd8273039cb4cacc366b7e 100644 (file)
 #define _GHOST_DEBUG_H_
 
 #if defined(WIN32) && !defined(FREE_WINDOWS)
-       #ifdef DEBUG
-               #pragma warning (disable:4786) // suppress stl-MSVC debug info warning
-               // #define GHOST_DEBUG
-       #endif // DEBUG
+#  ifdef DEBUG
+#    pragma warning (disable:4786) // suppress stl-MSVC debug info warning
+     // #define GHOST_DEBUG
+#  endif // DEBUG
 #endif // WIN32
 
 #ifdef WITH_GHOST_DEBUG 
-       #define GHOST_DEBUG // spit ghost events to stdout
+#  define GHOST_DEBUG // spit ghost events to stdout
 #endif // WITH_GHOST_DEBUG 
 
 #ifdef GHOST_DEBUG
-       #include <iostream>
-       #include <stdio.h> //for printf()
+#  include <iostream>
+#  include <stdio.h> //for printf()
 #endif // GHOST_DEBUG
 
 
 #ifdef GHOST_DEBUG
-       #define GHOST_PRINT(x) { std::cout << x; }
-       #define GHOST_PRINTF(x, ...) { printf(x, __VA_ARGS__); }
+#  define GHOST_PRINT(x) { std::cout << x; }
+#  define GHOST_PRINTF(x, ...) { printf(x, __VA_ARGS__); }
 #else  // GHOST_DEBUG
-       #define GHOST_PRINT(x)
-       #define GHOST_PRINTF(x, ...)
+#  define GHOST_PRINT(x)
+#  define GHOST_PRINTF(x, ...)
 #endif // GHOST_DEBUG
 
 
 #ifdef GHOST_DEBUG
-       #define GHOST_ASSERT(x, info) { if (!(x)) {GHOST_PRINT("assertion failed: "); GHOST_PRINT(info); GHOST_PRINT("\n"); } }
+#  define GHOST_ASSERT(x, info)                                               \
+       {                                                                         \
+           if (!(x)) {                                                           \
+               GHOST_PRINT("assertion failed: ");                                \
+               GHOST_PRINT(info);                                                \
+               GHOST_PRINT("\n");                                                \
+           }                                                                     \
+       }
 #else  // GHOST_DEBUG
-       #define GHOST_ASSERT(x, info)
+#  define GHOST_ASSERT(x, info)
 #endif // GHOST_DEBUG
 
 #endif // _GHOST_DEBUG_H_
index d7a9b151d14f455fc2ca1c35f4dffa81200a979b..b89f303c73487097fe706204d46cef2c8cd40099 100644 (file)
@@ -75,7 +75,8 @@ public:
         * @param numSettings The number of settings of the display device with this index.
         * @return Indication of success.
         */
-       virtual GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32& numSettings) const;
+       virtual GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display,
+                                                    GHOST_TInt32& numSettings) const;
 
        /**
         * Returns the current setting for this display device. 
@@ -84,7 +85,9 @@ public:
         * @param setting The setting of the display device with this index.
         * @return Indication of success.
         */
-       virtual GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting) const;
+       virtual GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display,
+                                                GHOST_TInt32 index,
+                                                GHOST_DisplaySetting& setting) const;
 
        /**
         * Returns the current setting for this display device. 
@@ -92,7 +95,8 @@ public:
         * @param setting The current setting of the display device with this index.
         * @return Indication of success.
         */
-       virtual GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_DisplaySetting& setting) const;
+       virtual GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display,
+                                                       GHOST_DisplaySetting& setting) const;
 
        /**
         * Changes the current setting for this display device.
@@ -102,7 +106,8 @@ public:
         * @param setting The setting of the display device to be matched and activated.
         * @return Indication of success.
         */
-       virtual GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, const GHOST_DisplaySetting& setting);
+       virtual GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display,
+                                                       const GHOST_DisplaySetting& setting);
 
 protected:
        typedef std::vector<GHOST_DisplaySetting> GHOST_DisplaySettings;
@@ -114,7 +119,9 @@ protected:
         * @param match         The optimal display setting.
         * @return Indication of success.
         */
-       GHOST_TSuccess findMatch(GHOST_TUns8 display, const GHOST_DisplaySetting& setting, GHOST_DisplaySetting& match) const;
+       GHOST_TSuccess findMatch(GHOST_TUns8 display,
+                                const GHOST_DisplaySetting& setting,
+                                GHOST_DisplaySetting& match) const;
 
        /**
         * Retrieves settings for each display device and stores them.
index 650a109a668a14495d48dc236bee6d160f4d5d04..330635de50afebac5fcf9aa377394133051ef7e2 100644 (file)
@@ -44,19 +44,21 @@ extern "C" {
  * 
  * The dragging sequence is performed in four phases:
  * 
- * <li> Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started. Already gives the object data type,
- * and the entering mouse location
+ * <li> Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started.
+ * Already gives the object data type, and the entering mouse location
  *
- * <li> Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation stops, to give the updated mouse position.
- * Useful to highlight a potential destination, and update the status (through GHOST_setAcceptDragOperation) telling if the object can be dropped at
+ * <li> Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation
+ * stops, to give the updated mouse position. Useful to highlight a potential destination, and update the status
+ * (through GHOST_setAcceptDragOperation) telling if the object can be dropped at
  * the current cursor position.
  *
  * <li> Abort drag'n'drop sequence (GHOST_kEventDraggingExited) sent when the user moved the mouse outside the window.
  *
  * <li> Send the dropped data (GHOST_kEventDraggingDropDone)
  *
- * <li> Outside of the normal sequence, dropped data can be sent (GHOST_kEventDraggingDropOnIcon). This can happen when the user drops an object
- * on the application icon. (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder)
+ * <li> Outside of the normal sequence, dropped data can be sent (GHOST_kEventDraggingDropOnIcon).
+ * This can happen when the user drops an object on the application icon.
+ * (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder)
  *
  * <br><br>Note that the mouse positions are given in Blender coordinates (y=0 at bottom)
  *
@@ -78,7 +80,10 @@ public:
         * @param y                     The y-coordinate of the location the cursor was at at the time of the event.
         * @param data          The "content" dropped in the window
         */
-       GHOST_EventDragnDrop(GHOST_TUns64 time, GHOST_TEventType type, GHOST_TDragnDropTypes dataType, GHOST_IWindow* window,
+       GHOST_EventDragnDrop(GHOST_TUns64 time,
+                            GHOST_TEventType type,
+                            GHOST_TDragnDropTypes dataType,
+                            GHOST_IWindow* window,
                                                 int x, int y, GHOST_TEventDataPtr data)
                : GHOST_Event(time, type, window)
        {
index 5410b1eda16675d95ebeb79c70f28f3c2f3235f5..a602bd65e5a0e31804ea6863f0cadbcd31f1f4c7 100644 (file)
@@ -49,7 +49,10 @@ public:
         * @param type  The type of key event.
         * @param key   The key code of the key.
         */
-       GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key)
+       GHOST_EventKey(GHOST_TUns64 msec,
+                      GHOST_TEventType type,
+                      GHOST_IWindow* window,
+                      GHOST_TKey key)
                : GHOST_Event(msec, type, window)
        {
                m_keyEventData.key = key;
@@ -65,7 +68,12 @@ public:
         * @param key   The key code of the key.
         * @param ascii The ascii code for the key event.
         */
-       GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii, const char utf8_buf[6])
+       GHOST_EventKey(GHOST_TUns64 msec,
+                      GHOST_TEventType type,
+                      GHOST_IWindow* window,
+                      GHOST_TKey key,
+                      char ascii,
+                      const char utf8_buf[6])
                : GHOST_Event(msec, type, window)
        {
                m_keyEventData.key = key;
index 394aff0493fc4edc17deeb5abc0d7ee7609df284..fceacce08058d25ba8bba73a291a9a5646fd9e2b 100644 (file)
  *
  * ***** END GPL LICENSE BLOCK *****
  */
+
+/** \file ghost/intern/GHOST_EventNDOF.h
+ *  \ingroup GHOST
+ * Declaration of GHOST_EventManager class.
+ */
 
 #ifndef _GHOST_EVENT_NDOF_H_
 #define _GHOST_EVENT_NDOF_H_
index 06706ea5ff3e611560167e3e02012ff4eaa480f8..55517f0a76c3cad79d42168a90ca5db509f8702d 100644 (file)
@@ -50,7 +50,11 @@ public:
         * @param x                     The x-delta of the pan event.
         * @param y                     The y-delta of the pan event.
         */
-       GHOST_EventTrackpad(GHOST_TUns64 msec, GHOST_IWindow* window, GHOST_TTrackpadEventSubTypes subtype, GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 deltaX, GHOST_TInt32 deltaY)
+       GHOST_EventTrackpad(GHOST_TUns64 msec,
+                           GHOST_IWindow* window,
+                           GHOST_TTrackpadEventSubTypes subtype,
+                           GHOST_TInt32 x, GHOST_TInt32 y,
+                           GHOST_TInt32 deltaX, GHOST_TInt32 deltaY)
                : GHOST_Event(msec, GHOST_kEventTrackpad, window)
        {
                m_trackpadEventData.subtype = subtype;
index afc54d3c6a025139d33653365a29cf116decf3be..b0b693e2f8f574301f38bb883b769e4c25ed934f 100644 (file)
@@ -73,7 +73,10 @@ GHOST_TUns64 GHOST_System::getMilliSeconds() const
 }
 
 
-GHOST_ITimerTask* GHOST_System::installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData)
+GHOST_ITimerTask* GHOST_System::installTimer(GHOST_TUns64 delay,
+                                             GHOST_TUns64 interval,
+                                             GHOST_TimerProcPtr timerProc,
+                                             GHOST_TUserDataPtr userData)
 {
        GHOST_TUns64 millis = getMilliSeconds();
        GHOST_TimerTask* timer = new GHOST_TimerTask(millis+delay, interval, timerProc, userData);
index afd2a8cbae30a11e52a9ec63a379a03312b7b62d..300826431184b0609ac5890d9972841cbf306b0a 100644 (file)
@@ -97,7 +97,10 @@ public:
         * @param userData      Placeholder for user data.
         * @return A timer task (0 if timer task installation failed).
         */
-       virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData = 0);
+       virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay,
+                                              GHOST_TUns64 interval,
+                                              GHOST_TimerProcPtr timerProc,
+                                              GHOST_TUserDataPtr userData = 0);
 
        /**
         * Removes a timer.
index 470fea7969caa3f704ce11738de8ae8d0a0ab4ea..581535e82b8f90ab1d4b199f0aa57624c296a617 100644 (file)
@@ -241,7 +241,9 @@ protected:
        /**
         * Handles a tablet event.
         * @param eventPtr      An NSEvent pointer (casted to void* to enable compilation in standard C++)
-        * @param eventType The type of the event. It needs to be passed separately as it can be either directly in the event type, or as a subtype if combined with a mouse button event
+        * @param eventType The type of the event.
+        * It needs to be passed separately as it can be either directly in the event type,
+        * or as a subtype if combined with a mouse button event.
         * @return Indication whether the event was handled.
         */
        GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType);
index 2547006ef287271aa1b68777904161338e779f2b..61c65384d2db6ddb5e78763281aedbcba8f82ae7 100644 (file)
@@ -790,9 +790,11 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        /*Check to see if the requestor is asking for String*/
                        if(xse->target == string || xse->target == compound_text || xse->target == c_string) {
                                if (xse->selection == XInternAtom(m_display, "PRIMARY", False)) {
-                                       XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace, (unsigned char*)txt_select_buffer, strlen(txt_select_buffer));
+                                       XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace,
+                                                       (unsigned char*)txt_select_buffer, strlen(txt_select_buffer));
                                } else if (xse->selection == XInternAtom(m_display, "CLIPBOARD", False)) {
-                                       XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace, (unsigned char*)txt_cut_buffer, strlen(txt_cut_buffer));
+                                       XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace,
+                                                       (unsigned char*)txt_cut_buffer, strlen(txt_cut_buffer));
                                }
                        } else if (xse->target == target) {
                                Atom alist[4];
@@ -800,7 +802,8 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                                alist[1] = string;
                                alist[2] = compound_text;
                                alist[3] = c_string;
-                               XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 32, PropModeReplace, (unsigned char*)alist, 4);
+                               XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 32, PropModeReplace,
+                                               (unsigned char*)alist, 4);
                                XFlush(m_display);
                        } else  {
                                //Change property to None because we do not support anything but STRING
index 01bf0053343c972314b9821808dec45b36b72f6e..ac86d6c1ce689624853a895036022d073f75270b 100644 (file)
@@ -51,8 +51,16 @@ public:
         * @param timerProc     The callbak invoked when the interval expires.
         * @param data          The timer user data.
         */
-       GHOST_TimerTask(GHOST_TUns64 start, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData = 0)
-               : m_start(start), m_interval(interval), m_next(start), m_timerProc(timerProc), m_userData(userData), m_auxData(0)
+       GHOST_TimerTask(GHOST_TUns64 start,
+                       GHOST_TUns64 interval,
+                       GHOST_TimerProcPtr timerProc,
+                       GHOST_TUserDataPtr userData = 0)
+               : m_start(start),
+             m_interval(interval),
+             m_next(start),
+             m_timerProc(timerProc),
+             m_userData(userData),
+             m_auxData(0)
        {
        }
 
index 0545b309f4bcb64b5abc663e86995acb8ad626b7..b560b04b5df39eee757279b455191896672170a4 100644 (file)
@@ -145,15 +145,15 @@ GHOST_TSuccess GHOST_Window::setCursorShape(GHOST_TStandardCursor cursorShape)
 }
 
 GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2],
-                                                                                                        int hotX, int hotY)
+                                                  int hotX, int hotY)
 {
-       return setCustomCursorShape( (GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask, 
-                                                                       16, 16, hotX, hotY, 0, 1 );
+       return setCustomCursorShape((GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask,
+                                   16, 16, hotX, hotY, 0, 1 );
 }
 
 GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, 
-                                                                                                       int sizex, int sizey, int hotX, int hotY,
-                                                                                                       int fg_color, int bg_color )
+                                                  int sizex, int sizey, int hotX, int hotY,
+                                                  int fg_color, int bg_color)
 {
        if (setWindowCustomCursorShape(bitmap, mask, sizex, sizey,hotX, hotY, fg_color, bg_color)) {
                m_cursorShape = GHOST_kStandardCursorCustom;
index a9f070b89514ca51a1b1741fdec245e856de8c25..646097d42c4f79763abb6a8ba33ec32ea06f1df0 100644 (file)
@@ -289,8 +289,9 @@ protected:
         * Sets the cursor shape on the window using
         * native window system calls.
         */
-       virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2],
-                                                        int hotX, int hotY) = 0;
+       virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
+                                                         GHOST_TUns8 mask[16][2],
+                                                         int hotX, int hotY) = 0;
        
        virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, 
                                                int szx, int szy, int hotX, int hotY, int fg, int bg) = 0;
index a363130c8976b1e8dbfa71d792751e480e224819..cb4d3f87e837b335c704717066545e7a6cfe43ce 100644 (file)
@@ -1196,10 +1196,11 @@ static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
        return shrt;
 }
 GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
-                                       GHOST_TUns8 mask[16][2], int hotX, int hotY)
+                                                             GHOST_TUns8 mask[16][2],
+                                                             int hotX, int hotY)
 {
        return setWindowCustomCursorShape((GHOST_TUns8*)bitmap, (GHOST_TUns8*)mask,
-                                                                       16, 16, hotX, hotY, 0, 1);
+                                         16, 16, hotX, hotY, 0, 1);
 }
 
 GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap,
index b24f37aa2648fd4f9e87d986b741c1bdf8855eb3..190966ee48587eb5da1e0ecdec8374d343d6cfb8 100644 (file)
@@ -309,7 +309,9 @@ protected:
         * Sets the cursor shape on the window using
         * native window system calls.
         */
-       virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
+       virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
+                                                         GHOST_TUns8 mask[16][2],
+                                                         int hotX, int hotY);
 
        virtual GHOST_TSuccess setWindowCustomCursorShape(
                GHOST_TUns8 *bitmap, 
index c379e4c7e485eb530397d3531fe87aa06fb582c4..5611644f8f2e8da193746fa3b73a3d911dcc4c06 100644 (file)
@@ -239,7 +239,8 @@ GHOST_WindowX11(
                        }
                } else {
                        if (m_numOfAASamples && (m_numOfAASamples > samples)) {
-                               printf("%s:%d: oversampling requested %i but using %i samples\n", __FILE__, __LINE__, m_numOfAASamples, samples);
+                               printf("%s:%d: oversampling requested %i but using %i samples\n",
+                                      __FILE__, __LINE__, m_numOfAASamples, samples);
                        }
                        break;
                }
@@ -1343,7 +1344,9 @@ installDrawingContext(
                        if (!s_firstContext) {
                                s_firstContext = m_context;
                        }
-                       glXMakeCurrent(m_display, m_window,m_context);                                          
+                       glXMakeCurrent(m_display, m_window,m_context);
+                       glClearColor(0.447, 0.447, 0.447, 0);
+                       glClear(GL_COLOR_BUFFER_BIT);
                        success = GHOST_kSuccess;
                } else {
                        success = GHOST_kFailure;
@@ -1491,7 +1494,8 @@ setWindowCursorGrab(
 
                }
 #ifdef GHOST_X11_GRAB
-               XGrabPointer(m_display, m_window, False, ButtonPressMask| ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
+               XGrabPointer(m_display, m_window, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+                            GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
 #endif
        }
        else {
index 345df5b16cfeb7164bf3aa11f405d41f5e5ba2c8..01ddddb73a04bed7168a7a249514a481c5ef334e 100644 (file)
@@ -93,6 +93,14 @@ typedef unsigned long uintptr_t;
        /* Linux-i386, Linux-Alpha, Linux-ppc */
 #include <stdint.h>
 
+/* XXX */
+#ifndef uint64_t
+typedef uint8_t   u_int8_t;
+typedef uint16_t  u_int16_t;
+typedef uint32_t  u_int32_t;
+typedef uint64_t  u_int64_t;
+#endif
+
 #elif defined (__APPLE__)
 
 #include <inttypes.h>
index af49b07d064032711c36b5b0f885aae3a0ba593f..3876f26362c7c98d7efa0a2b75aa92fb52449237 100644 (file)
@@ -225,11 +225,12 @@ void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness)
 void IK_GetBasisChange(IK_Segment *seg, float basis_change[][3])
 {
        IK_QSegment *qseg = (IK_QSegment*)seg;
-       const MT_Matrix3x3& change = qseg->BasisChange();
 
        if (qseg->Translational() && qseg->Composite())
                qseg = qseg->Composite();
 
+       const MT_Matrix3x3& change = qseg->BasisChange();
+
        // convert from moto row major to blender column major
        basis_change[0][0] = (float)change[0][0];
        basis_change[1][0] = (float)change[0][1];
index ff857e82d8f7d3f2099b34cc8c925499998d1c2c..2036e601bcbb9b8274ae7d28410243c6ed38a47d 100644 (file)
@@ -1350,7 +1350,6 @@ static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], con
                for(s=0; s<iUniqueSubGroups; s++)
                        free(pUniSubGroups[s].pTriMembers);
                iUniqueTspaces += iUniqueSubGroups;
-               iUniqueSubGroups = 0;
        }
 
        // clean up
index c3fb7135fcbf3159c0a39ac42eeaad1200a740c7..20b4c0a66811083cf3d316cfa3961ddcccd4e4d6 100644 (file)
@@ -1137,7 +1137,7 @@ static NLboolean __nlInvert_SUPERLU(__NLContext *context) {
 
        /* SuperLU variables */
        SuperMatrix B;
-       NLint info;
+       NLint info = 0;
 
        for(j=0; j<context->nb_rhs; j++, b+=n, x+=n) {
                /* Create superlu array for B */
index 2eb0aea678e91dfa2ca7087277cabb24512f257f..320fe3471f44e75a976940da35a122a245af8169 100644 (file)
@@ -368,7 +368,7 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
     int m, n, bnz, *b_colptr, i;
     int delta, maxint, nofsub, *invp;
     int *b_rowind, *dhead, *qsize, *llist, *marker;
-    double t, SuperLU_timer_();
+    /* double t, SuperLU_timer_(); */
     
     /* make gcc happy */
     b_rowind=NULL;
@@ -377,7 +377,7 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
     m = A->nrow;
     n = A->ncol;
 
-    t = SuperLU_timer_();
+    /* t = SuperLU_timer_(); */
     switch ( ispec ) {
         case 0: /* Natural ordering */
              for (i = 0; i < n; ++i) perm_c[i] = i;
@@ -391,8 +391,8 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
 #if ( PRNTlevel>=1 )
              printf("Use minimum degree ordering on A'*A.\n");
 #endif
-             t = SuperLU_timer_() - t;
-             /*printf("Form A'*A time = %8.3f\n", t);*/
+             /*t = SuperLU_timer_() - t;
+             printf("Form A'*A time = %8.3f\n", t);*/
              break;
         case 2: /* Minimum degree ordering on A'+A */
              if ( m != n ) ABORT("Matrix is not square");
@@ -401,8 +401,8 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
 #if ( PRNTlevel>=1 )
              printf("Use minimum degree ordering on A'+A.\n");
 #endif
-             t = SuperLU_timer_() - t;
-             /*printf("Form A'+A time = %8.3f\n", t);*/
+             /*t = SuperLU_timer_() - t;
+             printf("Form A'+A time = %8.3f\n", t);*/
              break;
         case 3: /* Approximate minimum degree column ordering. */
              get_colamd(m, n, Astore->nnz, Astore->colptr, Astore->rowind,
@@ -417,7 +417,7 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
     }
 
     if ( bnz != 0 ) {
-       t = SuperLU_timer_();
+       /* t = SuperLU_timer_(); */
 
        /* Initialize and allocate storage for GENMMD. */
        delta = 1; /* DELTA is a parameter to allow the choice of nodes
@@ -452,8 +452,8 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
        SUPERLU_FREE(llist);
        SUPERLU_FREE(marker);
 
-       t = SuperLU_timer_() - t;
-       /*  printf("call GENMMD time = %8.3f\n", t);*/
+       /* t = SuperLU_timer_() - t;
+       printf("call GENMMD time = %8.3f\n", t);*/
 
     } else { /* Empty adjacency structure */
        for (i = 0; i < n; ++i) perm_c[i] = i;
index cb8d83686becbd7eaede3b223eef61b957db7c01..3d4f5968778c905e7af34561c733aac49d47b1e0 100644 (file)
@@ -303,7 +303,6 @@ scolumn_bmod (
           d_fsupc=0 if fsupc >= fpanelc. */
        d_fsupc = fst_col - fsupc;
 
-       lptr = xlsub[fsupc] + d_fsupc;
        luptr = xlusup[fst_col] + d_fsupc;
        nsupr = xlsub[fsupc+1] - xlsub[fsupc];  /* Leading dimension */
        nsupc = jcol - fst_col; /* Excluding jcol */
index a1d66ed734195b1dccc5ca3b4cb083a1d01e213f..da904ba3e9d806306429ff9dfdf75e960b3e4083 100644 (file)
@@ -9,9 +9,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
 {
 
 
-    /* System generated locals */
-    int i__1, i__2;
-
     /* Local variables */
     static int info;
     static float temp;
@@ -213,14 +210,12 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
            }
        } else {
            if (*incx == 1) {
-               i__1 = *n;
                for (j = 1; j <= *n; ++j) {
                    if (X(j) != 0.f) {
                        if (nounit) {
                            X(j) /= A(j,j);
                        }
                        temp = X(j);
-                       i__2 = *n;
                        for (i = j + 1; i <= *n; ++i) {
                            X(i) -= temp * A(i,j);
 /* L50: */
@@ -230,7 +225,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
                }
            } else {
                jx = kx;
-               i__1 = *n;
                for (j = 1; j <= *n; ++j) {
                    if (X(jx) != 0.f) {
                        if (nounit) {
@@ -238,7 +232,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
                        }
                        temp = X(jx);
                        ix = jx;
-                       i__2 = *n;
                        for (i = j + 1; i <= *n; ++i) {
                            ix += *incx;
                            X(ix) -= temp * A(i,j);
@@ -256,10 +249,8 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
 
        if (lsame_(uplo, "U")) {
            if (*incx == 1) {
-               i__1 = *n;
                for (j = 1; j <= *n; ++j) {
                    temp = X(j);
-                   i__2 = j - 1;
                    for (i = 1; i <= j-1; ++i) {
                        temp -= A(i,j) * X(i);
 /* L90: */
@@ -272,11 +263,9 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
                }
            } else {
                jx = kx;
-               i__1 = *n;
                for (j = 1; j <= *n; ++j) {
                    temp = X(jx);
                    ix = kx;
-                   i__2 = j - 1;
                    for (i = 1; i <= j-1; ++i) {
                        temp -= A(i,j) * X(ix);
                        ix += *incx;
@@ -294,7 +283,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
            if (*incx == 1) {
                for (j = *n; j >= 1; --j) {
                    temp = X(j);
-                   i__1 = j + 1;
                    for (i = *n; i >= j+1; --i) {
                        temp -= A(i,j) * X(i);
 /* L130: */
@@ -311,7 +299,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
                for (j = *n; j >= 1; --j) {
                    temp = X(jx);
                    ix = kx;
-                   i__1 = j + 1;
                    for (i = *n; i >= j+1; --i) {
                        temp -= A(i,j) * X(ix);
                        ix -= *incx;
index 510ade8233cf02db3d12a5a4e31672d7b0815204..a77e87b9c65d5b8205ef72c5e7b92f447472d5dc 100644 (file)
@@ -370,8 +370,6 @@ void
 sFillRHS(trans_t trans, int nrhs, float *x, int ldx,
          SuperMatrix *A, SuperMatrix *B)
 {
-    NCformat *Astore;
-    float   *Aval;
     DNformat *Bstore;
     float   *rhs;
     float one = 1.0;
@@ -379,8 +377,6 @@ sFillRHS(trans_t trans, int nrhs, float *x, int ldx,
     int      ldc;
     char transc[1];
 
-    Astore = A->Store;
-    Aval   = (float *) Astore->nzval;
     Bstore = B->Store;
     rhs    = Bstore->nzval;
     ldc    = Bstore->lda;
index f13108b22563d3e141a7600d3eef16b9c681b927..c4c478cec2bc2e8dea195a026d36a87b8831eba4 100644 (file)
@@ -24,7 +24,8 @@
 #define NUM_TEMPV(m,w,t,b)  ( SUPERLU_MAX(m, (t + b)*w) )
 
 #ifndef USER_ABORT
-#define USER_ABORT(msg) superlu_abort_and_exit(msg)
+#define USER_ABORT(msg) \
+ {  fprintf(stderr, "%s", msg); exit (-1); }
 #endif
 
 #define ABORT(err_msg) \
index 90f0d3f1c1daa4540c349191d82f28dda5468a86..38fdb8f5fec9cc400a8b827b763139664f5bce25 100644 (file)
@@ -121,24 +121,24 @@ _axis_convert_matrix = (
     ((-1.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, 1.0, 0.0)),
     ((-1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, -1.0)),
     ((0.0, -1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, -1.0)),
-    ((0.0, -1.0, 0.0), (0.0, 0.0, -1.0), (1.0, 0.0, 0.0)),
-    ((0.0, -1.0, 0.0), (0.0, 0.0, 1.0), (-1.0, 0.0, 0.0)),
-    ((0.0, -1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
+    ((0.0, 0.0, 1.0), (-1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
     ((0.0, 0.0, -1.0), (-1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
+    ((0.0, 1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
+    ((0.0, -1.0, 0.0), (0.0, 0.0, 1.0), (-1.0, 0.0, 0.0)),
     ((0.0, 0.0, -1.0), (0.0, -1.0, 0.0), (-1.0, 0.0, 0.0)),
-    ((0.0, 0.0, -1.0), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0)),
-    ((0.0, 0.0, -1.0), (1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
-    ((0.0, 0.0, 1.0), (-1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
-    ((0.0, 0.0, 1.0), (0.0, -1.0, 0.0), (1.0, 0.0, 0.0)),
     ((0.0, 0.0, 1.0), (0.0, 1.0, 0.0), (-1.0, 0.0, 0.0)),
-    ((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
-    ((0.0, 1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
     ((0.0, 1.0, 0.0), (0.0, 0.0, -1.0), (-1.0, 0.0, 0.0)),
+    ((0.0, -1.0, 0.0), (0.0, 0.0, -1.0), (1.0, 0.0, 0.0)),
+    ((0.0, 0.0, 1.0), (0.0, -1.0, 0.0), (1.0, 0.0, 0.0)),
+    ((0.0, 0.0, -1.0), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0)),
     ((0.0, 1.0, 0.0), (0.0, 0.0, 1.0), (1.0, 0.0, 0.0)),
+    ((0.0, -1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
+    ((0.0, 0.0, -1.0), (1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
+    ((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
     ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, -1.0)),
     ((1.0, 0.0, 0.0), (0.0, -1.0, 0.0), (0.0, 0.0, -1.0)),
-    ((1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, 1.0, 0.0)),
     ((1.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, -1.0, 0.0)),
+    ((1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, 1.0, 0.0)),
     )
 
 # store args as a single int
index fab6886b3145420809c7563a0f5af49846d84e46..a9eb86aaf79a74eeeac5a7e5e6c09a7075378d17 100644 (file)
@@ -89,7 +89,6 @@ KM_HIERARCHY = [
 
     ('Property Editor', 'PROPERTIES', 'WINDOW', []),  # align context menu
 
-    ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []),
     ('Text', 'TEXT_EDITOR', 'WINDOW', []),
     ('Console', 'CONSOLE', 'WINDOW', []),
     ('Clip', 'CLIP_EDITOR', 'WINDOW', [
index 32f7b654690d0d68522c811192dc384962d67015..edc17c36c36af3416c24f492137611a643c629fc 100644 (file)
@@ -42,6 +42,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
     """
     from mathutils import Vector
 
+    viewinv = rv3d.view_matrix.inverted()
     if rv3d.is_perspective:
         persinv = rv3d.perspective_matrix.inverted()
 
@@ -50,13 +51,11 @@ def region_2d_to_vector_3d(region, rv3d, coord):
                       -0.5
                     ))
 
-        w = ((out[0] * persinv[0][3]) +
-             (out[1] * persinv[1][3]) +
-             (out[2] * persinv[2][3]) + persinv[3][3])
+        w = out.dot(persinv[3].xyz) + persinv[3][3]
 
-        return ((persinv * out) / w) - rv3d.view_matrix.inverted()[3].xyz
+        return ((persinv * out) / w) - viewinv.translation
     else:
-        return rv3d.view_matrix.inverted()[2].xyz.normalized()
+        return viewinv.col[2].xyz.normalized()
 
 
 def region_2d_to_location_3d(region, rv3d, coord, depth_location):
@@ -81,15 +80,16 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location):
     from mathutils.geometry import intersect_point_line
 
     persmat = rv3d.perspective_matrix.copy()
+    viewinv = rv3d.view_matrix.inverted()
     coord_vec = region_2d_to_vector_3d(region, rv3d, coord)
     depth_location = Vector(depth_location)
 
     if rv3d.is_perspective:
         from mathutils.geometry import intersect_line_plane
 
-        origin_start = rv3d.view_matrix.inverted()[3].to_3d()
+        origin_start = viewinv.translation.copy()
         origin_end = origin_start + coord_vec
-        view_vec = rv3d.view_matrix.inverted()[2]
+        view_vec = viewinv.col[2].copy()
         return intersect_line_plane(origin_start,
                                     origin_end,
                                     depth_location,
@@ -100,8 +100,9 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location):
         dy = (2.0 * coord[1] / region.height) - 1.0
         persinv = persmat.inverted()
         viewinv = rv3d.view_matrix.inverted()
-        origin_start = ((persinv[0].xyz * dx) +
-                        (persinv[1].xyz * dy) + viewinv[3].xyz)
+        origin_start = ((persinv.col[0].xyz * dx) +
+                        (persinv.col[1].xyz * dy) +
+                         viewinv.translation)
         origin_end = origin_start + coord_vec
         return intersect_point_line(depth_location,
                                     origin_start,
index 061c66dc1fa23ab0a738e2172ace70cb5f7fd492..cb21f17cff5cb677a9ff7fe80813619b54b16553 100644 (file)
@@ -188,7 +188,7 @@ class CLIP_OT_delete_proxy(Operator):
             proxydir = clip.proxy.directory
         else:
             clipdir = os.path.dirname(clip.filepath)
-            proxydir = os.path.join(clipdir, 'BL_proxy')
+            proxydir = os.path.join(clipdir, "BL_proxy")
 
         clipfile = os.path.basename(clip.filepath)
         proxy = os.path.join(proxydir, clipfile)
@@ -196,15 +196,15 @@ class CLIP_OT_delete_proxy(Operator):
 
         # proxy_<quality>[_undostorted]
         for x in (25, 50, 75, 100):
-            d = os.path.join(absproxy, 'proxy_' + str(x))
+            d = os.path.join(absproxy, "proxy_%d" % x)
 
             self._rmproxy(d)
-            self._rmproxy(d + '_undistorted')
-            self._rmproxy(os.path.join(absproxy, 'proxy_' + str(x) + '.avi'))
+            self._rmproxy(d + "_undistorted")
+            self._rmproxy(os.path.join(absproxy, "proxy_%d.avi" % x))
 
-        tc = ('free_run.blen_tc',
-              'interp_free_run.blen_tc',
-              'record_run.blen_tc')
+        tc = ("free_run.blen_tc",
+              "interp_free_run.blen_tc",
+              "record_run.blen_tc")
 
         for x in tc:
             self._rmproxy(os.path.join(absproxy, x))
@@ -269,7 +269,7 @@ object's movement caused by this constraint"""
         # TODO: several camera solvers and track followers would fail,
         #       but can't think about eal workflow where it'll be useful
         for x in ob.constraints:
-            if x.type in ('CAMERA_SOLVER', 'FOLLOW_TRACK'):
+            if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK'}:
                 con = x
 
         if not con:
@@ -340,7 +340,8 @@ object's movement caused by this constraint"""
 
     def execute(self, context):
         scene = context.scene
-
+        # XXX, should probably use context.selected_editable_objects
+        # since selected objects can be from a lib or in hidden layer!
         for ob in scene.objects:
             if ob.select:
                 self._bake_object(scene, ob)
index 67b9be59f2a0461eb3d86221573a75a538857dc3..39c73f206642d305188d59e7b06823cf8853b7d5 100644 (file)
@@ -60,14 +60,14 @@ class SequencerCrossfadeSounds(Operator):
         if seq1.frame_final_end > seq2.frame_final_start:
             tempcfra = context.scene.frame_current
             context.scene.frame_current = seq2.frame_final_start
-            seq1.keyframe_insert('volume')
+            seq1.keyframe_insert("volume")
             context.scene.frame_current = seq1.frame_final_end
             seq1.volume = 0
-            seq1.keyframe_insert('volume')
-            seq2.keyframe_insert('volume')
+            seq1.keyframe_insert("volume")
+            seq2.keyframe_insert("volume")
             context.scene.frame_current = seq2.frame_final_start
             seq2.volume = 0
-            seq2.keyframe_insert('volume')
+            seq2.keyframe_insert("volume")
             context.scene.frame_current = tempcfra
             return {'FINISHED'}
         else:
index 17e353ff238165a01c27890277001ad7613ae129..b79fc0c01b322722fdc3a31e5b97c483045bab54 100644 (file)
@@ -756,7 +756,7 @@ def VectoQuat(vec):
 
 
 class thickface(object):
-    __slost__= 'v', 'uv', 'no', 'area', 'edge_keys'
+    __slost__= "v", "uv", "no", "area", "edge_keys"
     def __init__(self, face, uvface, mesh_verts):
         self.v = [mesh_verts[i] for i in face.vertices]
         if len(self.v)==4:
index 58941e00914177fca85aa8b2cd7988e98191b594..4f498e72f4b4b40ce288d8799d7e1dc8ec017697 100644 (file)
@@ -766,12 +766,12 @@ class WM_OT_path_open(Operator):
             return {'CANCELLED'}
 
         if sys.platform[:3] == "win":
-            subprocess.Popen(['start', filepath], shell=True)
-        elif sys.platform == 'darwin':
-            subprocess.Popen(['open', filepath])
+            subprocess.Popen(["start", filepath], shell=True)
+        elif sys.platform == "darwin":
+            subprocess.Popen(["open", filepath])
         else:
             try:
-                subprocess.Popen(['xdg-open', filepath])
+                subprocess.Popen(["xdg-open", filepath])
             except OSError:
                 # xdg-open *should* be supported by recent Gnome, KDE, Xfce
                 pass
@@ -847,8 +847,8 @@ class WM_OT_doc_edit(Operator):
         print("sending data:", data_dict)
 
         import xmlrpc.client
-        user = 'blenderuser'
-        pwd = 'blender>user'
+        user = "blenderuser"
+        pwd = "blender>user"
 
         docblog = xmlrpc.client.ServerProxy(self._url)
         docblog.metaWeblog.newPost(1, user, pwd, data_dict, 1)
@@ -986,9 +986,8 @@ class WM_OT_properties_edit(Operator):
         prop_ui = rna_idprop_ui_prop_get(item, prop)
 
         if prop_type in {float, int}:
-
-            prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.min)
-            prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.max)
+            prop_ui["soft_min"] = prop_ui["min"] = prop_type(self.min)
+            prop_ui["soft_max"] = prop_ui["max"] = prop_type(self.max)
 
         prop_ui['description'] = self.description
 
@@ -1035,7 +1034,7 @@ class WM_OT_properties_add(Operator):
         item = eval("context.%s" % data_path)
 
         def unique_name(names):
-            prop = 'prop'
+            prop = "prop"
             prop_new = prop
             i = 1
             while prop_new in names:
@@ -1163,10 +1162,10 @@ class WM_OT_copy_prev_settings(Operator):
 
             # in 2.57 and earlier windows installers, system scripts were copied
             # into the configuration directory, don't want to copy those
-            system_script = os.path.join(path_dst, 'scripts/modules/bpy_types.py')
+            system_script = os.path.join(path_dst, "scripts/modules/bpy_types.py")
             if os.path.isfile(system_script):
-                shutil.rmtree(os.path.join(path_dst, 'scripts'))
-                shutil.rmtree(os.path.join(path_dst, 'plugins'))
+                shutil.rmtree(os.path.join(path_dst, "scripts"))
+                shutil.rmtree(os.path.join(path_dst, "plugins"))
 
             # don't loose users work if they open the splash later.
             if bpy.data.is_saved is bpy.data.is_dirty is False:
@@ -1178,20 +1177,20 @@ class WM_OT_copy_prev_settings(Operator):
         return {'CANCELLED'}
 
 class WM_OT_blenderplayer_start(bpy.types.Operator):
-    '''Launches the Blenderplayer with the current blendfile'''
+    '''Launch the Blenderplayer with the current blendfile'''
     bl_idname = "wm.blenderplayer_start"
     bl_label = "Start"
     
     blender_bin_path = bpy.app.binary_path
     blender_bin_dir = os.path.dirname(blender_bin_path)
     ext = os.path.splitext(blender_bin_path)[-1]
-    player_path = os.path.join(blender_bin_dir, 'blenderplayer' + ext)
+    player_path = os.path.join(blender_bin_dir, "blenderplayer" + ext)
     
     def execute(self, context):
         import sys
 
-        if sys.platform == 'darwin':
-            self.player_path = os.path.join(self.blender_bin_dir, '../../../blenderplayer.app/Contents/MacOS/blenderplayer')
+        if sys.platform == "darwin":
+            self.player_path = os.path.join(self.blender_bin_dir, "../../../blenderplayer.app/Contents/MacOS/blenderplayer")
        
         filepath = bpy.app.tempdir + "game.blend"
         bpy.ops.wm.save_as_mainfile(filepath=filepath, check_existing=False, copy=True)
@@ -1451,7 +1450,7 @@ class WM_OT_operator_cheat_sheet(Operator):
             for op_submodule_name in dir(op_module):
                 op = getattr(op_module, op_submodule_name)
                 text = repr(op)
-                if text.split("\n")[-1].startswith('bpy.ops.'):
+                if text.split("\n")[-1].startswith("bpy.ops."):
                     op_strings.append(text)
                     tot += 1
 
index 57bde4eb0ddc3011de7d37b648deb3b92eae71e5..46a569c71d40bef67d77c31181d20bd7e91f56a1 100644 (file)
@@ -2247,6 +2247,8 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
         col.prop(mesh, "show_extra_edge_length")
         col.prop(mesh, "show_extra_face_angle")
         col.prop(mesh, "show_extra_face_area")
+        if bpy.app.debug:
+          col.prop(mesh, "show_extra_indices")
 
 
 class VIEW3D_PT_view3d_curvedisplay(Panel):
index ddbc9a6a76064dd3372557e91a3cd0f67c4079af..ce53b76da01fcabf8ad56de47e41fb77227fd619 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef BLF_TRANSLATION_H
 #define BLF_TRANSLATION_H
 
+#define TEXT_DOMAIN_NAME "blender"
+
 /* blf_translation.c  */
 
 #ifdef WITH_INTERNATIONAL
@@ -40,7 +42,8 @@ unsigned char *BLF_get_unifont(int *unifont_size);
 void BLF_free_unifont(void);
 #endif
 
-const char* BLF_gettext(const char *msgid);
+const char *BLF_gettext(const char *msgid);
+const char *BLF_pgettext(const char *context, const char *message);
 
 /* blf_lang.c */
 
index 77f9542883c6fc0b5df636008c1102674d565122..6c27beb14a7149aa155b74aefce85562c8f6d1b8 100644 (file)
@@ -32,6 +32,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "BKE_global.h"
+
 #include "BLF_api.h"
 
 #include "BLF_translation.h" /* own include */
@@ -58,7 +60,6 @@
 #include "BLI_utildefines.h"
 #include "BLI_path_util.h"
 
-#define DOMAIN_NAME "blender"
 #define SYSTEM_ENCODING_DEFAULT "UTF-8"
 #define FONT_SIZE_DEFAULT 12
 
@@ -82,11 +83,16 @@ static const char *locales[] = {
        "catalan", "ca_AD",
        "czech", "cs_CZ",
        "ptb", "pt_BR",
+#if defined (_WIN32) && !defined(FREE_WINDOWS)
        "Chinese (Simplified)_China.1252", "zh_CN",
        "Chinese (Traditional)_China.1252", "zh_TW",
+#else
+       "chs", "zh_CN",
+       "cht", "zh_TW",
+#endif
        "russian", "ru_RU",
        "croatian", "hr_HR",
-       "serbian", "sr",
+       "serbian", "sr_RS",
        "ukrainian", "uk_UA",
        "polish", "pl_PL",
        "romanian", "ro_RO",
@@ -97,7 +103,7 @@ static const char *locales[] = {
        "nepali", "ne_NP",
        "persian", "fa_PE",
        "indonesian", "id_ID",
-       "serbian (latin)", "sr@latin",
+       "serbian (latin)", "sr_RS@latin",
 };
 
 void BLF_lang_init(void)
@@ -116,15 +122,50 @@ void BLF_lang_init(void)
        
 }
 
+/* get LANG/LANGUAGE environment variable */
+static void get_language_variable(const char *varname, char *var, int maxlen)
+{
+       char *env= getenv(varname);
+
+       if(env) {
+               char *s;
+
+               /* store defaul locale */
+               BLI_strncpy(var, env, maxlen);
+
+               /* use first language as default */
+               s= strchr(var, ':');
+               if(s)
+                       s[0]= 0;
+       }
+}
+
+/* get language to be used based on locale(which might be empty when using default language) and
+ * LANG environment variable
+ */
+static void get_language(const char *locale, const char *lang, char *language, int maxlen)
+{
+       if(locale[0]) {
+               BLI_strncpy(language, locale, maxlen);
+       }
+       else {
+               char *s;
+
+               BLI_strncpy(language, lang, maxlen);
+
+               s= strchr(language, '.');
+               if(s)
+                       s[0]= 0;
+       }
+}
+
 /* XXX WARNING!!! IN osx somehow the previous function call jumps in this one??? (ton, ppc) */
 void BLF_lang_set(const char *str)
 {
        char *locreturn;
        const char *short_locale;
        int ok= 1;
-#if defined (_WIN32) && !defined(FREE_WINDOWS)
-       const char *long_locale = locales[ 2 * U.language];
-#endif
+       const char *long_locale = locales[2 * U.language];
 
        if((U.transopts&USER_DOTRANSLATE)==0)
                return;
@@ -150,50 +191,72 @@ void BLF_lang_set(const char *str)
        locreturn= setlocale(LC_ALL, long_locale);
 
        if (locreturn == NULL) {
-               printf("Could not change locale to %s\n", long_locale);
+               if(G.f & G_DEBUG)
+                       printf("Could not change locale to %s\n", long_locale);
+
                ok= 0;
        }
 #else
        {
-               const char *locale;
-               static char default_locale[64]="\0";
+               static char default_lang[64]="\0";
+               static char default_language[64]="\0";
 
-               if(default_locale[0]==0) {
-                       char *env_language= getenv("LANGUAGE");
+               if(default_lang[0]==0)
+                       get_language_variable("LANG", default_lang, sizeof(default_lang));
 
-                       if(env_language) {
-                               char *s;
+               if(default_language[0]==0)
+                       get_language_variable("LANGUAGE", default_language, sizeof(default_language));
 
-                               /* store defaul locale */
-                               BLI_strncpy(default_locale, env_language, sizeof(default_locale));
+               if(short_locale[0]) {
+                       if(G.f & G_DEBUG)
+                               printf("Setting LANG= and LANGUAGE to %s\n", short_locale);
 
-                               /* use first language as default */
-                               s= strchr(default_locale, ':');
-                               if(s) s[0]= 0;
-                       }
+                       BLI_setenv("LANG", short_locale);
+                       BLI_setenv("LANGUAGE", short_locale);
                }
+               else {
+                       if(G.f & G_DEBUG)
+                               printf("Setting LANG=%s and LANGUAGE=%s\n", default_lang, default_language);
 
-               if(short_locale[0])
-                       locale= short_locale;
-               else
-                       locale= default_locale;
-
-               BLI_setenv("LANG", locale);
-               BLI_setenv("LANGUAGE", locale);
+                       BLI_setenv("LANG", default_lang);
+                       BLI_setenv("LANGUAGE", default_language);
+               }
 
-               locreturn= setlocale(LC_ALL, locale);
+               locreturn= setlocale(LC_ALL, short_locale);
 
-               if (locreturn == NULL) {
-                       char *short_locale_utf8= BLI_sprintfN("%s.UTF-8", short_locale);
+               if(locreturn == NULL) {
+                       char *short_locale_utf8= NULL;
 
-                       locreturn= setlocale(LC_ALL, short_locale_utf8);
+                       if(short_locale[0]) {
+                               short_locale_utf8= BLI_sprintfN("%s.UTF-8", short_locale);
+                               locreturn= setlocale(LC_ALL, short_locale_utf8);
+                       }
 
                        if (locreturn == NULL) {
-                               printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
+                               char language[65];
+
+                               get_language(long_locale, default_lang, language, sizeof(language));
+
+                               if(G.f & G_DEBUG) {
+                                       if(short_locale[0])
+                                               printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
+                                       else
+                                               printf("Could not reset locale\n");
+
+                                       printf("Fallback to LANG=%s and LANGUAGE=%s\n", default_lang, language);
+                               }
+
+                               /* fallback to default settings */
+                               BLI_setenv("LANG", default_lang);
+                               BLI_setenv("LANGUAGE", language);
+
+                               locreturn= setlocale(LC_ALL, "");
+
                                ok= 0;
                        }
 
-                       MEM_freeN(short_locale_utf8);
+                       if(short_locale_utf8)
+                               MEM_freeN(short_locale_utf8);
                }
        }
 #endif
@@ -205,15 +268,15 @@ void BLF_lang_set(const char *str)
 
        setlocale(LC_NUMERIC, "C");
 
-       textdomain(DOMAIN_NAME);
-       bindtextdomain(DOMAIN_NAME, global_messagepath);
-       bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name);
+       textdomain(TEXT_DOMAIN_NAME);
+       bindtextdomain(TEXT_DOMAIN_NAME, global_messagepath);
+       bind_textdomain_codeset(TEXT_DOMAIN_NAME, global_encoding_name);
 }
 
 void BLF_lang_encoding(const char *str)
 {
        BLI_strncpy(global_encoding_name, str, sizeof(global_encoding_name));
-       /* bind_textdomain_codeset(DOMAIN_NAME, encoding_name); */
+       /* bind_textdomain_codeset(TEXT_DOMAIN_NAME, encoding_name); */
 }
 
 #else /* ! WITH_INTERNATIONAL */
index fe14f5d4d1c6e1d66c56087571a21ec38bb9819a..0ddb654971754214e633e4473b459fb8bbf6a1ab 100644 (file)
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 #ifdef WITH_INTERNATIONAL
 #include <libintl.h>
+#include <locale.h>
+
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* needed for windows version of gettext */
+#ifndef LC_MESSAGES
+#      define LC_MESSAGES 1729
+#endif
+
 #endif
 
 #include "MEM_guardedalloc.h"
@@ -91,6 +101,41 @@ const char* BLF_gettext(const char *msgid)
 #endif
 }
 
+const char *BLF_pgettext(const char *context, const char *message)
+{
+#ifdef WITH_INTERNATIONAL
+       char static_msg_ctxt_id[1024];
+       char *dynamic_msg_ctxt_id = NULL;
+       char *msg_ctxt_id;
+       const char *translation;
+
+       size_t overall_length = strlen(context) + strlen(message) + sizeof(GETTEXT_CONTEXT_GLUE) + 1;
+
+       if (overall_length > sizeof(static_msg_ctxt_id)) {
+               dynamic_msg_ctxt_id = malloc(overall_length);
+               msg_ctxt_id = dynamic_msg_ctxt_id;
+       }
+       else {
+               msg_ctxt_id = static_msg_ctxt_id;
+       }
+
+       sprintf(msg_ctxt_id, "%s%s%s", context, GETTEXT_CONTEXT_GLUE, message);
+
+       translation = (char*)dcgettext(TEXT_DOMAIN_NAME, msg_ctxt_id, LC_MESSAGES);
+
+       if (dynamic_msg_ctxt_id)
+               free(dynamic_msg_ctxt_id);
+
+       if (translation == msg_ctxt_id)
+               translation = message;
+
+       return translation;
+#else
+       (void)context;
+       return message;
+#endif
+}
+
 int BLF_translate_iface(void)
 {
 #ifdef WITH_INTERNATIONAL
@@ -132,4 +177,3 @@ const char *BLF_translate_do_tooltip(const char *msgid)
        return msgid;
 #endif
 }
-
index 1d344c6e81091e7a2daa88d63c26ce7a2bcfd24d..a4cef2d68629a792079d0bc8f40c2e78c6ba0a2e 100644 (file)
 extern "C" {
 #endif
 
+#include "../blenloader/BLO_sys_types.h" /* XXX, should have a more generic include for this */
+
 struct ID;
 struct CustomData;
 struct CustomDataLayer;
-typedef unsigned int CustomDataMask;
+typedef uint64_t CustomDataMask;
 
 extern const CustomDataMask CD_MASK_BAREMESH;
 extern const CustomDataMask CD_MASK_MESH;
@@ -65,6 +67,8 @@ extern const CustomDataMask CD_MASK_FACECORNERS;
 #define CD_DUPLICATE 4  /* do a full copy of all layers, only allowed if source
                                                   has same number of elements */
 
+#define CD_TYPE_AS_MASK(_type) (CustomDataMask)(1 << (CustomDataMask)(_type))
+
 /* initialises a CustomData object with the same layer setup as source.
  * mask is a bitfield where (mask & (1 << (layer type))) indicates
  * if a layer should be copied or not. alloctype must be one of the above. */
index 3263a1659f3d6c12157426c773a7fbeba32370cb..257ed0ba15fa895100282c1ee35c6edd6784b238 100644 (file)
@@ -72,7 +72,7 @@ extern int append_ffmpeg(struct RenderData *rd, int frame, int *pixels, int rect
 void filepath_ffmpeg(char* string, struct RenderData* rd);
 
 extern void ffmpeg_set_preset(struct RenderData *rd, int preset);
-extern void ffmpeg_verify_image_type(struct RenderData *rd);
+extern void ffmpeg_verify_image_type(struct RenderData *rd, struct ImageFormatData *imf);
 
 extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index);
 extern int ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str);
index 2dd14281253df0d3a6e31f17b7f7eab79bc9747d..0338d10a66d5a347b8172ef4e3d4c1e5a2d79df2 100644 (file)
@@ -69,7 +69,7 @@ typedef struct DagNode
        int ancestor_count;
        unsigned int lay;                               // accumulated layers of its relations + itself
        unsigned int scelay;                    // layers due to being in scene
-       unsigned int customdata_mask;   // customdata mask
+       uint64_t customdata_mask;       // customdata mask
        int lasttime;           // if lasttime != DagForest->time, this node was not evaluated yet for flushing
        int BFS_dist;           // BFS distance
        int DFS_dist;           // DFS distance
index 5305372402b18b012b7a60f7ccd531ca1fb67b26..289faaa0095fc64503a4021da3ab2de4bdee1e17 100644 (file)
@@ -943,7 +943,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
                        number++;
 
                if(lastflag & CD_FLAG_NOCOPY) continue;
-               else if(!((int)mask & (int)(1 << (int)type))) continue;
+               else if(!(mask & CD_TYPE_AS_MASK(type))) continue;
                else if(number < CustomData_number_of_layers(dest, type)) continue;
 
                if((alloctype == CD_ASSIGN) && (lastflag & CD_FLAG_NOFREE))
@@ -1500,7 +1500,7 @@ void CustomData_set_only_copy(const struct CustomData *data,
        int i;
 
        for(i = 0; i < data->totlayer; ++i)
-               if(!((int)mask & (int)(1 << (int)data->layers[i].type)))
+               if(!(mask & CD_TYPE_AS_MASK(data->layers[i].type)))
                        data->layers[i].flag |= CD_FLAG_NOCOPY;
 }
 
@@ -2441,7 +2441,7 @@ void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask
                layer = &data->layers[i];
                typeInfo = layerType_getInfo(layer->type);
 
-               if(!(mask & (1<<layer->type)));
+               if(!(mask & CD_TYPE_AS_MASK(layer->type)));
                else if((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) {
                        if(typeInfo->free)
                                typeInfo->free(layer->data, totelem, typeInfo->size);
@@ -2467,7 +2467,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
                layer = &data->layers[i];
                typeInfo = layerType_getInfo(layer->type);
 
-               if(!(mask & (1<<layer->type)));
+               if(!(mask & CD_TYPE_AS_MASK(layer->type)));
                else if(layer->flag & CD_FLAG_IN_MEMORY);
                else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read)
                        update= 1;
@@ -2488,7 +2488,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
                layer = &data->layers[i];
                typeInfo = layerType_getInfo(layer->type);
 
-               if(!(mask & (1<<layer->type)));
+               if(!(mask & CD_TYPE_AS_MASK(layer->type)));
                else if(layer->flag & CD_FLAG_IN_MEMORY);
                else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) {
                        blay= cdf_layer_find(cdf, layer->type, layer->name);
@@ -2527,7 +2527,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
                layer = &data->layers[i];
                typeInfo = layerType_getInfo(layer->type);
 
-               if(!(mask & (1<<layer->type)));
+               if(!(mask & CD_TYPE_AS_MASK(layer->type)));
                else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write)
                        update= 1;
        }
@@ -2641,7 +2641,7 @@ void CustomData_external_remove(CustomData *data, ID *id, int type, int totelem)
 
        if(layer->flag & CD_FLAG_EXTERNAL) {
                if(!(layer->flag & CD_FLAG_IN_MEMORY))
-                       CustomData_external_read(data, id, (1<<layer->type), totelem);
+                       CustomData_external_read(data, id, CD_TYPE_AS_MASK(layer->type), totelem);
 
                layer->flag &= ~CD_FLAG_EXTERNAL;
 
index b0776a0b51ba2feb3f772dbe93e17f9daddb72aa..ebeb45e9cd5588e6c814988ac39031969ecd603c 100644 (file)
@@ -1709,7 +1709,7 @@ static void scene_sort_groups(Main *bmain, Scene *sce)
 /* sort the base list on dependency order */
 void DAG_scene_sort(Main *bmain, Scene *sce)
 {
-       DagNode *node;
+       DagNode *node, *rootnode;
        DagNodeQueue *nqueue;
        DagAdjList *itA;
        int time;
@@ -1731,11 +1731,10 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
        
        time = 1;
        
-       node = sce->theDag->DagNode.first;
-       
-       node->color = DAG_GRAY;
+       rootnode = sce->theDag->DagNode.first;
+       rootnode->color = DAG_GRAY;
        time++;
-       push_stack(nqueue,node);  
+       push_stack(nqueue,rootnode);  
        
        while(nqueue->count) {
                
@@ -2853,10 +2852,8 @@ void DAG_pose_sort(Object *ob)
        for(node = dag->DagNode.first; node; node= node->next) 
                node->color = DAG_WHITE;
        
-       node = dag->DagNode.first;
-       
-       node->color = DAG_GRAY;
-       push_stack(nqueue, node);  
+       rootnode->color = DAG_GRAY;
+       push_stack(nqueue, rootnode);  
        
        while(nqueue->count) {
                
index b9947c506d10fe98f01862ed4e3cb7c99a809988..318165af80402fc1156da246d7823cac41bb6a9d 100644 (file)
@@ -1414,10 +1414,7 @@ void driver_free_variable (ChannelDriver *driver, DriverVar *dvar)
        DRIVER_TARGETS_LOOPER_END
        
        /* remove the variable from the driver */
-       if (driver)
-               BLI_freelinkN(&driver->variables, dvar);
-       else
-               MEM_freeN(dvar);
+       BLI_freelinkN(&driver->variables, dvar);
 
 #ifdef WITH_PYTHON
        /* since driver variables are cached, the expression needs re-compiling too */
index a44957ddc01996c0f8f93b2c9b00d65e48779e08..d9fe0138784e334afef7de9cff3dfbcfcd158ddb 100644 (file)
@@ -692,7 +692,11 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
                case IDP_ARRAY:
                {
                        /*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 || val->array.type == IDP_GROUP) {
+                       if ( (val->array.type == IDP_FLOAT) ||
+                            (val->array.type == IDP_INT) ||
+                            (val->array.type == IDP_DOUBLE) ||
+                            (val->array.type == IDP_GROUP) )
+                       {
                                prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
                                prop->subtype = val->array.type;
                                if (val->array.len)
index 25ff7b5fa04d3d19f193314dadff84fd86602fea..354a5265f9091324aabe1cc2f3c30bc1e89b02c8 100644 (file)
@@ -1544,7 +1544,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
                ibuf->ftype= OPENEXR;
                if(imf->depth == R_IMF_CHAN_DEPTH_16)
                        ibuf->ftype |= OPENEXR_HALF;
-               ibuf->ftype |= (quality & OPENEXR_COMPRESS);
+               ibuf->ftype |= (imf->exr_codec & OPENEXR_COMPRESS);
                
                if(!(imf->flag & R_IMF_FLAG_ZBUF))
                        ibuf->zbuf_float = NULL;        /* signal for exr saving */
index 622ec093a3f46f8e201bfde34e42d6b82b49feec..9890a2629fc6d60fa1ad49470dc6b546bc1b2102 100644 (file)
@@ -909,8 +909,10 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
                if (array_index)
                        *array_index= dummy_index;
        }
-       
+
+       /* 'buf' _must_ be initialized in this block */
        /* append preceding bits to path */
+       /* note, strings are not escapted and they should be! */
        if ((actname && actname[0]) && (constname && constname[0])) {
                /* Constraint in Pose-Channel */
                sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
@@ -918,6 +920,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
        else if (actname && actname[0]) {
                if ((blocktype == ID_OB) && strcmp(actname, "Object")==0) {
                        /* Actionified "Object" IPO's... no extra path stuff needed */
+                       buf[0]= '\0'; /* empty string */
                }
                else if ((blocktype == ID_KE) && strcmp(actname, "Shape")==0) {
                        /* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */
@@ -936,8 +939,10 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
                /* Sequence names in Scene */
                sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2);
        }
-       else
+       else {
                buf[0]= '\0'; /* empty string */
+       }
+
        BLI_dynstr_append(path, buf);
        
        /* need to add dot before property if there was anything precceding this */
index 43958457edbd656a6650422ae07a7ef929c487f8..4b4875213b1e7be05c43cf1b606aa53cd80ee919 100644 (file)
@@ -466,8 +466,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
                if(mface->v3==0) {
                        static int corner_indices[4] = {1, 2, 0, 3};
 
-                       SWAP(int, mface->v1, mface->v2);
-                       SWAP(int, mface->v2, mface->v3);
+                       SWAP(unsigned int, mface->v1, mface->v2);
+                       SWAP(unsigned int, mface->v2, mface->v3);
 
                        if(fdata)
                                CustomData_swap(fdata, mfindex, corner_indices);
@@ -477,8 +477,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
                if(mface->v3==0 || mface->v4==0) {
                        static int corner_indices[4] = {2, 3, 0, 1};
 
-                       SWAP(int, mface->v1, mface->v3);
-                       SWAP(int, mface->v2, mface->v4);
+                       SWAP(unsigned int, mface->v1, mface->v3);
+                       SWAP(unsigned int, mface->v2, mface->v4);
 
                        if(fdata)
                                CustomData_swap(fdata, mfindex, corner_indices);
@@ -520,12 +520,14 @@ void set_mesh(Object *ob, Mesh *me)
 /* ************** make edges in a Mesh, for outside of editmode */
 
 struct edgesort {
-       int v1, v2;
+       unsigned int v1, v2;
        short is_loose, is_draw;
 };
 
 /* edges have to be added with lowest index first for sorting */
-static void to_edgesort(struct edgesort *ed, int v1, int v2, short is_loose, short is_draw)
+static void to_edgesort(struct edgesort *ed,
+                        unsigned int v1, unsigned int v2,
+                        short is_loose, short is_draw)
 {
        if(v1<v2) {
                ed->v1= v1; ed->v2= v2;
@@ -627,7 +629,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, int UNUSED(
                        /* order is swapped so extruding this edge as a surface wont flip face normals
                         * with cyclic curves */
                        if(ed->v1+1 != ed->v2) {
-                               SWAP(int, medge->v1, medge->v2);
+                               SWAP(unsigned int, medge->v1, medge->v2);
                        }
                        medge++;
                }
@@ -1029,17 +1031,17 @@ typedef struct EdgeLink {
 
 typedef struct VertLink {
        Link *next, *prev;
-       int index;
+       unsigned int index;
 } VertLink;
 
-static void prependPolyLineVert(ListBase *lb, int index)
+static void prependPolyLineVert(ListBase *lb, unsigned int index)
 {
        VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink");
        vl->index = index;
        BLI_addhead(lb, vl);
 }
 
-static void appendPolyLineVert(ListBase *lb, int index)
+static void appendPolyLineVert(ListBase *lb, unsigned int index)
 {
        VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink");
        vl->index = index;
@@ -1111,8 +1113,8 @@ void mesh_to_curve(Scene *scene, Object *ob)
                        int closed = FALSE;
                        int totpoly= 0;
                        MEdge *med_current= ((EdgeLink *)edges.last)->edge;
-                       int startVert= med_current->v1;
-                       int endVert= med_current->v2;
+                       unsigned int startVert= med_current->v1;
+                       unsigned int endVert= med_current->v2;
                        int ok= TRUE;
 
                        appendPolyLineVert(&polyline, startVert);       totpoly++;
index 5a53d953f1b0e2a81eed3e2e9f2b022fc833a516..a1bf9cb9481da46439f8eae8e476f3e9d96aef55 100644 (file)
@@ -395,7 +395,7 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
 
        while(i<data->totlayer) {
                CustomDataLayer *layer= &data->layers[i];
-               int mask= 1 << layer->type;
+               CustomDataMask mask= CD_TYPE_AS_MASK(layer->type);
                int ok= 1;
 
                if((mask&CD_MASK_MESH)==0) {
index 5c9c59e53920925093af40e8d477b33bd9b04bac..224ce003ea34c5828375511213c996e566eb3eca 100644 (file)
@@ -991,9 +991,9 @@ void unlink_movieclip(Main *bmain, MovieClip *clip)
        }
 
        for(ob= bmain->object.first; ob; ob= ob->id.next) {
-               bConstraint *con= ob->constraints.first;
+               bConstraint *con;
 
-               for (con= ob->constraints.first; con; con= con->next) {
+               for(con= ob->constraints.first; con; con= con->next) {
                        bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
 
                        if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {
index 28c1aacdec51ba8b923da0edb0ec9b48e6c6020f..8251c4796ea6df8aebeb39013ff757772a665d1e 100644 (file)
@@ -2563,7 +2563,7 @@ void object_handle_update(Scene *scene, Object *ob)
 
 #else                          /* ensure CD_MASK_BAREMESH for now */
                                        EditMesh *em = (ob == scene->obedit)? BKE_mesh_get_editmesh(ob->data): NULL;
-                                       unsigned int data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH;
+                                       uint64_t data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH;
                                        if(em) {
                                                makeDerivedMesh(scene, ob, em,  data_mask); /* was CD_MASK_BAREMESH */
                                                BKE_mesh_end_editmesh(ob->data, em);
index 374ef3512e81e8253222cb0d44bc1122943cd1fe..e773eb6dd35606fa6e5b16be65059bbd8fd009ba 100644 (file)
@@ -2292,6 +2292,9 @@ static int ccgdm_adjacent_grid(CCGSubSurf *ss, int *gridOffset, CCGFace *f, int
                                break;
                }
        }
+
+       if(numEdges == 0)
+               return -1;
        
        fIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, adjf));
 
index aa914998a72b1fec522b934cc95e85f72dd540eb..81c526e45a69a1909a73905c81548d89efd4f96f 100644 (file)
@@ -299,7 +299,8 @@ static bUnitDef *unit_best_fit(double value, bUnitCollection *usys, bUnitDef *un
                if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
                        continue;
 
-               if (value_abs >= unit->scalar*(1.0-EPS)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+               /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+               if (value_abs >= unit->scalar*(1.0-EPS))
                        return unit;
        }
 
@@ -481,11 +482,14 @@ static int ch_is_op(char op)
        }
 }
 
-static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str)
+static int unit_scale_str(char *str, int len_max, char *str_tmp,
+                          double scale_pref, bUnitDef *unit, const char *replace_str)
 {
        char *str_found;
 
-       if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly  */
+       if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) {
+               /* XXX - investigate, does not respect len_max properly  */
+
                int len, len_num, len_name, len_move, found_ofs;
 
                found_ofs = (int)(str_found-str);
index 8cd3091284055fa8aafe005165676a686864e951..da64c464dceb14d50e58ed51ebfbf0bc89a97d27 100644 (file)
@@ -159,9 +159,6 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL
        
        avi = MEM_mallocN (sizeof(AviMovie), "avimovie");
 
-       /* RPW 11-21-2002 
-       if (rd->imtype != AVI_FORMAT_MJPEG) format = AVI_FORMAT_AVI_RGB;
-       */
        if (rd->im_format.imtype != R_IMF_IMTYPE_AVIJPEG ) format = AVI_FORMAT_AVI_RGB;
        else format = AVI_FORMAT_MJPEG;
 
index aa7d71b1577089a010214cfa755ee92e16d58456..bf547584b9e9360c2cf4b71ff66ee30a967e8ed8 100644 (file)
@@ -1333,11 +1333,11 @@ void ffmpeg_set_preset(RenderData *rd, int preset)
        }
 }
 
-void ffmpeg_verify_image_type(RenderData *rd)
+void ffmpeg_verify_image_type(RenderData *rd, ImageFormatData *imf)
 {
        int audio= 0;
 
-       if(rd->imtype == R_IMF_IMTYPE_FFMPEG) {
+       if(imf->imtype == R_IMF_IMTYPE_FFMPEG) {
                if(rd->ffcodecdata.type <= 0 ||
                   rd->ffcodecdata.codec <= 0 ||
                   rd->ffcodecdata.audio_codec <= 0 ||
@@ -1353,19 +1353,19 @@ void ffmpeg_verify_image_type(RenderData *rd)
 
                audio= 1;
        }
-       else if(rd->imtype == R_IMF_IMTYPE_H264) {
+       else if(imf->imtype == R_IMF_IMTYPE_H264) {
                if(rd->ffcodecdata.codec != CODEC_ID_H264) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_H264);
                        audio= 1;
                }
        }
-       else if(rd->imtype == R_IMF_IMTYPE_XVID) {
+       else if(imf->imtype == R_IMF_IMTYPE_XVID) {
                if(rd->ffcodecdata.codec != CODEC_ID_MPEG4) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID);
                        audio= 1;
                }
        }
-       else if(rd->imtype == R_IMF_IMTYPE_THEORA) {
+       else if(imf->imtype == R_IMF_IMTYPE_THEORA) {
                if(rd->ffcodecdata.codec != CODEC_ID_THEORA) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_THEORA);
                        audio= 1;
index e79d850caa582ef0b119496c29c297f32d3d3750..9adb39f09efdd4a447b9b6d6a2565639d6914409 100644 (file)
@@ -317,7 +317,7 @@ void BLI_uniquename(ListBase *list, void *vlink, const char defname[], char deli
 
 void BLI_cleanup_path(const char *relabase, char *dir)
 {
-       short a;
+       ptrdiff_t a;
        char *start, *eind;
        if (relabase) {
                BLI_path_abs(dir, relabase);
@@ -1416,7 +1416,7 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
 {
        size_t path_len= strlen(path);
        size_t ext_len= strlen(ext);
-       size_t a;
+       ssize_t a;
 
        for(a= path_len - 1; a >= 0; a--) {
                if (ELEM3(path[a], '.', '/', '\\')) {
@@ -1424,7 +1424,7 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
                }
        }
 
-       if (path[a] != '.') {
+       if ((a < 0) || (path[a] != '.')) {
                a= path_len;
        }
 
@@ -1440,7 +1440,7 @@ int BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
 {
        size_t path_len= strlen(path);
        size_t ext_len= strlen(ext);
-       size_t a;
+       ssize_t a;
 
        /* first check the extension is alread there */
        if (    (ext_len <= path_len) &&
index 001b191155d571d016e4d43c9ad34cfc529adeff..c5b6f46b3bc4dddfeecc07f415aac755612bc274 100644 (file)
@@ -54,7 +54,7 @@
 #include <sys/mount.h>
 #endif
 
-#if defined(linux) || defined(__CYGWIN32__) || defined(__hpux)
+#if defined(linux) || defined(__CYGWIN32__) || defined(__hpux) || defined(__GNU__) || defined(__GLIBC__)
 #include <sys/vfs.h>
 #endif
 
@@ -180,7 +180,7 @@ double BLI_dir_free_space(const char *dir)
                if (slash) slash[1] = 0;
        } else strcpy(name,"/");
 
-#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) 
+#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
        if (statfs(name, &disk)) return(-1);
 #endif
 
index e7f7a7e23bc009fa16e68a7a967786a9f52dbb69..800ae834b59c120d0e2f82d6584c5c11b51d3120 100644 (file)
@@ -86,6 +86,14 @@ typedef unsigned long uintptr_t;
        /* Linux-i386, Linux-Alpha, Linux-ppc */
 #include <stdint.h>
 
+/* XXX */
+#ifndef uint64_t
+typedef uint8_t   u_int8_t;
+typedef uint16_t  u_int16_t;
+typedef uint32_t  u_int32_t;
+typedef uint64_t  u_int64_t;
+#endif
+
 #elif defined (__APPLE__)
 
 #include <inttypes.h>
index 0e4d365305f0d56335045a6bffd16e50d7911e6f..eb4b10361d80a34783f0150d53a17a48184729cc 100644 (file)
@@ -10712,8 +10712,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                void *olddata = ob->data;
                                ob->data = me;
 
-                               if(me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) /* XXX - library meshes crash on loading most yoFrankie levels, the multires pointer gets invalid -  Campbell */
+                               /* XXX - library meshes crash on loading most yoFrankie levels,
+                                * the multires pointer gets invalid -  Campbell */
+                               if(me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) {
                                        multires_load_old(ob, me);
+                               }
 
                                ob->data = olddata;
                        }
@@ -14327,7 +14330,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
 
                                        expand_main(fd, mainptr);
                                        
-                                       /* dang FileData... now new libraries need to be appended to original filedata, it is not a good replacement for the old global (ton) */
+                                       /* dang FileData... now new libraries need to be appended to original filedata,
+                                        * it is not a good replacement for the old global (ton) */
                                        while( fd->mainlist.first ) {
                                                Main *mp= fd->mainlist.first;
                                                BLI_remlink(&fd->mainlist, mp);
@@ -14349,8 +14353,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                ID *idn= id->next;
                                if(id->flag & LIB_READ) {
                                        BLI_remlink(lbarray[a], id);
-                                       BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
-                                       if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
+                                       BKE_reportf(basefd->reports, RPT_ERROR,
+                                                   "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n",
+                                                   BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
+                                       if (!G.background && basefd->reports) {
+                                               printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n",
+                                                      BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
+                                       }
                                        change_idid_adr(mainlist, basefd, id, NULL);
 
                                        MEM_freeN(id);
index 8c699c840dccfa92c932801755d94ed1b87e4b6d..a21c394a81eb8247c9581f4143b2931e8fb469b2 100644 (file)
@@ -496,7 +496,7 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
                                break;
                        
                        /* store this level as the 'old' level now */
-                       prevLevel= level; // XXX: prevLevel is unused
+                       // prevLevel= level; // XXX: prevLevel is unused
                }
        }
 }
index fe6aed77462d2d65606749de4b6959651a34f857..45b715c406a96596e92b87400f6e3799ce07a398 100644 (file)
@@ -2205,12 +2205,12 @@ size_t ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_m
        
        /* only filter data if there's somewhere to put it */
        if (data && anim_data) {
-               Object *obact= (ac) ? ac->obact : NULL;
                
                /* firstly filter the data */
                switch (datatype) {
                        case ANIMCONT_ACTION:   /* 'Action Editor' */
                        {
+                               Object *obact= ac->obact;
                                SpaceAction *saction = (SpaceAction *)ac->sl;
                                bDopeSheet *ads = (saction)? &saction->ads : NULL;
                                
index 476cf2ac1093557893b4c3de06d817f7b0dd2c1b..0562f4007000c198204434c30e1aba16d346f2b4 100644 (file)
@@ -201,7 +201,7 @@ void ED_view3d_depth_tag_update(struct RegionView3D *rv3d);
 /* Projection */
 #define IS_CLIPPED        12000
 
-void ED_view3d_calc_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect);
+void ED_view3d_calc_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, const struct rcti *rect);
 
 void project_short(struct ARegion *ar, const float vec[3], short adr[2]);
 void project_short_noclip(struct ARegion *ar, const float vec[3], short adr[2]);
@@ -215,7 +215,7 @@ void project_float_noclip(struct ARegion *ar, const float vec[3], float adr[2]);
 int ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend);
 int ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend);
 void ED_view3d_ob_project_mat_get(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
-void ED_view3d_project_float(struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
+void ED_view3d_project_float(const struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
 void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, struct rctf *viewborder_r, short no_shift);
 void ED_view3d_calc_camera_border_size(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, float size_r[2]);
 
@@ -257,7 +257,7 @@ void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
 void view3d_operator_needs_opengl(const struct bContext *C);
 void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar);
 int view3d_get_view_aligned_coordinate(struct ViewContext *vc, float fp[3], const int mval[2], const short do_fallback);
-void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
+void view3d_get_transformation(const struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
 
 /* XXX should move to BLI_math */
 int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2);
@@ -286,8 +286,8 @@ Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
 void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip);
 int ED_view3d_lock(struct RegionView3D *rv3d);
 
-unsigned int ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
-unsigned int ED_viewedit_datamask(struct bScreen *screen);
+uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
+uint64_t ED_viewedit_datamask(struct bScreen *screen);
 
 /* camera lock functions */
 int ED_view3d_camera_lock_check(struct View3D *v3d, struct RegionView3D *rv3d);
index 63e410824498fc3e8a1cd3e625503ef9536f2919..4948073f9c64c579edf356a33d8f3703d2adbbbd 100644 (file)
@@ -904,7 +904,9 @@ void uiEndBlock(const bContext *C, uiBlock *block)
        /* handle pending stuff */
        if(block->layouts.first) uiBlockLayoutResolve(block, NULL, NULL);
        ui_block_do_align(block);
-       if((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) ui_menu_block_set_keyaccels(block); /* could use a different flag to check */
+       if((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) {
+               ui_menu_block_set_keyaccels(block); /* could use a different flag to check */
+       }
        if(block->flag & UI_BLOCK_LOOP) ui_menu_block_set_keymaps(C, block);
        
        /* after keymaps! */
index 9853c9c049b4b2ee10a466ba60dd5304900c2324..fca1591c2ea868ed619cca5bfa0468fb384b5e89 100644 (file)
@@ -681,7 +681,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
 
 static int modifier_can_delete(ModifierData *md)
 {
-       // fluid particle modifier can't be deleted here
+       /* fluid particle modifier can't be deleted here */
        if(md->type == eModifierType_ParticleSystem)
                if(((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID)
                        return 0;
@@ -689,14 +689,16 @@ static int modifier_can_delete(ModifierData *md)
        return 1;
 }
 
-// Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab
+/* Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab */
 static int modifier_is_simulation(ModifierData *md)
 {
-       // Physic Tab
-       if(ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint)) {
+       /* Physic Tab */
+       if (ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke,
+                           eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint))
+       {
                return 1;
        }
-       // Particle Tab
+       /* Particle Tab */
        else if (md->type == eModifierType_ParticleSystem) {
                return 2;
        }
@@ -705,7 +707,8 @@ static int modifier_is_simulation(ModifierData *md)
        }
 }
 
-static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, ModifierData *md, int index, int cageIndex, int lastCageIndex)
+static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
+                               ModifierData *md, int index, int cageIndex, int lastCageIndex)
 {
        ModifierTypeInfo *mti = modifierType_getInfo(md->type);
        PointerRNA ptr;
index c2c482b0a2cc0fab07da0e6c4bd09d66bb3b90b4..57d46de9cb7fb23886fb8e22456c3599c6aad377 100644 (file)
@@ -177,7 +177,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
                
                /* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
                switch (type) {
-                       /* 'standard view' - optimum setup for 'standard' view behaviour, that should be used new views as basis for their
+                       /* 'standard view' - optimum setup for 'standard' view behaviour,
+                        *  that should be used new views as basis for their
                         *      own unique View2D settings, which should be used instead of this in most cases...
                         */
                        case V2D_COMMONVIEW_STANDARD:
index 1477469ca857118deee9982ab0106acc70a871ba..f617971967cf89e2c1aefe0434465be914eeafbd 100644 (file)
@@ -922,7 +922,10 @@ void make_editMesh(Scene *scene, Object *ob)
                
                for(a=0; a<me->totselect; a++, mselect++){
                        /*check if recorded selection is still valid, if so copy into editmesh*/
-                       if( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) || (mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) || (mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) ){
+                       if ( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) ||
+                            (mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) ||
+                            (mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) )
+                       {
                                ese = MEM_callocN(sizeof(EditSelection), "Edit Selection");
                                ese->type = mselect->type;      
                                if(ese->type == EDITVERT) ese->data = EM_get_vert_for_index(mselect->index); else
index f3722e812469ccbc3bb64d89d931b3ff7c7cd025..b94b60fc279938ea940bb14201cbbd734882cfa4 100644 (file)
@@ -1080,8 +1080,8 @@ int *mesh_get_x_mirror_faces(Object *ob, EditMesh *em)
 
                /* make sure v4 is not 0 if a quad */
                if(mf->v4 && mirrormf.v4==0) {
-                       SWAP(int, mirrormf.v1, mirrormf.v3);
-                       SWAP(int, mirrormf.v2, mirrormf.v4);
+                       SWAP(unsigned int, mirrormf.v1, mirrormf.v3);
+                       SWAP(unsigned int, mirrormf.v2, mirrormf.v4);
                }
 
                hashmf= BLI_ghash_lookup(fhash, &mirrormf);
index 1c34df5393ada1652a6e8d49760af3e7170ba379..ffdfea7fde5b0fd037235676ab803fac24e3bad8 100644 (file)
@@ -1666,6 +1666,47 @@ static int region_scale_invoke(bContext *C, wmOperator *op, wmEvent *event)
        return OPERATOR_FINISHED;
 }
 
+static int region_scale_get_maxsize(RegionMoveData *rmd)
+{
+       int maxsize= 0;
+
+       if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
+               return rmd->sa->winx - UI_UNIT_X;
+       }
+
+       if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
+               /* this calculation seems overly verbose
+                * can someone explain why this method is necessary? - campbell */
+               maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4);
+       }
+
+       return maxsize;
+}
+
+static void region_scale_validate_size(RegionMoveData *rmd)
+{
+       if((rmd->ar->flag & RGN_FLAG_HIDDEN)==0) {
+               short *size, maxsize= -1;
+
+
+               if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT)
+                       size= &rmd->ar->sizex;
+               else
+                       size= &rmd->ar->sizey;
+
+               maxsize= region_scale_get_maxsize(rmd);
+
+               if(*size > maxsize && maxsize > 0)
+                       *size= maxsize;
+       }
+}
+
+static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd)
+{
+       ED_region_toggle_hidden(C, rmd->ar);
+       region_scale_validate_size(rmd);
+}
+
 static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
 {
        RegionMoveData *rmd= op->customdata;
@@ -1685,35 +1726,31 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
                                if(rmd->ar->sizex < UI_UNIT_X) {
                                        rmd->ar->sizex= rmd->origval;
                                        if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
-                                               ED_region_toggle_hidden(C, rmd->ar);
+                                               region_scale_toggle_hidden(C, rmd);
                                }
                                else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
-                                       ED_region_toggle_hidden(C, rmd->ar);
+                                       region_scale_toggle_hidden(C, rmd);
                        }
                        else {
-                               int maxsize=0;
+                               int maxsize= region_scale_get_maxsize(rmd);
                                delta= event->y - rmd->origy;
                                if(rmd->edge==AE_BOTTOM_TO_TOPLEFT) delta= -delta;
                                
                                rmd->ar->sizey= rmd->origval + delta;
                                CLAMP(rmd->ar->sizey, 0, rmd->maxsize);
 
-                               if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
-                                       /* this calculation seems overly verbose
-                                        * can someone explain why this method is necessary? - campbell */
-                                       maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4);
-                               }
-
                                /* note, 'UI_UNIT_Y/4' means you need to drag the header almost
                                 * all the way down for it to become hidden, this is done
                                 * otherwise its too easy to do this by accident */
-                               if(rmd->ar->sizey < UI_UNIT_Y/4 || (maxsize > 0 && (rmd->ar->sizey > maxsize)) ) {
+                               if(rmd->ar->sizey < UI_UNIT_Y/4) {
                                        rmd->ar->sizey= rmd->origval;
                                        if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
-                                               ED_region_toggle_hidden(C, rmd->ar);
+                                               region_scale_toggle_hidden(C, rmd);
                                }
+                               else if(maxsize > 0 && (rmd->ar->sizey > maxsize)) 
+                                       rmd->ar->sizey= maxsize;
                                else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
-                                       ED_region_toggle_hidden(C, rmd->ar);
+                                       region_scale_toggle_hidden(C, rmd);
                        }
                        ED_area_tag_redraw(rmd->sa);
                        WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
@@ -1725,10 +1762,14 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
                                
                                if(ABS(event->x - rmd->origx) < 2 && ABS(event->y - rmd->origy) < 2) {
                                        if(rmd->ar->flag & RGN_FLAG_HIDDEN) {
-                                               ED_region_toggle_hidden(C, rmd->ar);
-                                               ED_area_tag_redraw(rmd->sa);
-                                               WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
+                                               region_scale_toggle_hidden(C, rmd);
+                                       }
+                                       else if(rmd->ar->flag & RGN_FLAG_TOO_SMALL) {
+                                               region_scale_validate_size(rmd);
                                        }
+
+                                       ED_area_tag_redraw(rmd->sa);
+                                       WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
                                }
                                MEM_freeN(op->customdata);
                                op->customdata = NULL;
index 3aefe5f9ea3c0f00c1ff6526c2ea461012f1c599..8a4cb8aa78b2d743adcf155b4cc30b02f21cda7e 100644 (file)
@@ -1816,7 +1816,9 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s
                return 1;
         */
        
-       if((bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) || (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) ) {
+       if ( (bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) ||
+            (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) )
+       {
                return 1;
        }
        
@@ -2816,7 +2818,11 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
        p4[0] = bucket_bounds.xmax;     p4[1] = bucket_bounds.ymin;
                
        if (mf->v4) {
-               if(     isect_point_quad_v2(p1, v1, v2, v3, v4) || isect_point_quad_v2(p2, v1, v2, v3, v4) || isect_point_quad_v2(p3, v1, v2, v3, v4) || isect_point_quad_v2(p4, v1, v2, v3, v4) ||
+               if ( isect_point_quad_v2(p1, v1, v2, v3, v4) ||
+                    isect_point_quad_v2(p2, v1, v2, v3, v4) ||
+                    isect_point_quad_v2(p3, v1, v2, v3, v4) ||
+                    isect_point_quad_v2(p4, v1, v2, v3, v4) ||
+
                        /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
                        (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3) || isect_line_line_v2(p1, p2, v3, v4)) ||
                        (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3) || isect_line_line_v2(p2, p3, v3, v4)) ||
@@ -2827,7 +2833,10 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
                }
        }
        else {
-               if(     isect_point_tri_v2(p1, v1, v2, v3) || isect_point_tri_v2(p2, v1, v2, v3) || isect_point_tri_v2(p3, v1, v2, v3) || isect_point_tri_v2(p4, v1, v2, v3) ||
+               if ( isect_point_tri_v2(p1, v1, v2, v3) ||
+                    isect_point_tri_v2(p2, v1, v2, v3) ||
+                    isect_point_tri_v2(p3, v1, v2, v3) ||
+                    isect_point_tri_v2(p4, v1, v2, v3) ||
                        /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
                        (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3)) ||
                        (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3)) ||
index 3b001a8fcdc8da5565b0a64941e92e1c6595157e..a5e68f9a244f24e91215d56d3499f240b0fe5ddf 100644 (file)
@@ -41,6 +41,7 @@ struct Mesh;
 struct Object;
 struct PaintStroke;
 struct PointerRNA;
+struct rcti;
 struct Scene;
 struct VPaint;
 struct ViewContext;
@@ -104,6 +105,26 @@ void PAINT_OT_image_from_view(struct wmOperatorType *ot);
 
 
 /* paint_utils.c */
+
+/* Convert the object-space axis-aligned bounding box (expressed as
+   its minimum and maximum corners) into a screen-space rectangle,
+   returns zero if the result is empty */
+int paint_convert_bb_to_rect(struct rcti *rect,
+                                                        const float bb_min[3],
+                                                        const float bb_max[3],
+                                                        const struct ARegion *ar,
+                                                        struct RegionView3D *rv3d,
+                                                        struct Object *ob);
+
+/* Get four planes in object-space that describe the projection of
+   screen_rect from screen into object-space (essentially converting a
+   2D screens-space bounding box into four 3D planes) */
+void paint_calc_redraw_planes(float planes[4][4],
+                                                         const struct ARegion *ar,
+                                                         struct RegionView3D *rv3d,
+                                                         struct Object *ob,
+                                                         const struct rcti *screen_rect);
+
 void projectf(struct bglMats *mats, const float v[3], float p[2]);
 float paint_calc_object_space_radius(struct ViewContext *vc, float center[3], float pixel_radius);
 float paint_get_tex_pixel(struct Brush* br, float u, float v);
index 0e65383861b02c92291709d170dade1e3908aa60..7cff37e8814791a1636e42b59f6e434defd75008 100644 (file)
@@ -123,19 +123,19 @@ static int same_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
 {
        MTex* mtex = &brush->mtex;
 
-       return 
-               (mtex->tex &&
-                   mtex->ofs[0] == snap->ofs[0] &&
-                   mtex->ofs[1] == snap->ofs[1] &&
-                   mtex->ofs[2] == snap->ofs[2] &&
-                   mtex->size[0] == snap->size[0] &&
-                   mtex->size[1] == snap->size[1] &&
-                   mtex->size[2] == snap->size[2] &&
-                   mtex->rot == snap->rot) &&
-               ((mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && brush_size(brush) <= snap->brush_size) || (brush_size(brush) == snap->brush_size)) && // make brush smaller shouldn't cause a resample
-               mtex->brush_map_mode == snap->brush_map_mode &&
-               vc->ar->winx == snap->winx &&
-               vc->ar->winy == snap->winy;
+       return  ( (mtex->tex) &&
+                 equals_v3v3(mtex->ofs, snap->ofs) &&
+                 equals_v3v3(mtex->size, snap->size) &&
+                 mtex->rot == snap->rot
+                 ) &&
+
+               /* make brush smaller shouldn't cause a resample */
+               ( (mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && (brush_size(brush) <= snap->brush_size)) ||
+                 (brush_size(brush) == snap->brush_size)) &&
+
+               (mtex->brush_map_mode == snap->brush_map_mode) &&
+               (vc->ar->winx == snap->winx) &&
+               (vc->ar->winy == snap->winy);
 }
 
 static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
@@ -869,7 +869,10 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
                MEM_freeN(stroke);
                return OPERATOR_FINISHED;
        }
-       else if(first || ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (event->type == TIMER && (event->customdata == stroke->timer))) {
+       else if( (first) ||
+                (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) ||
+                (event->type == TIMER && (event->customdata == stroke->timer)) )
+       {
                if(stroke->stroke_started) {
                        if(paint_smooth_stroke(stroke, mouse, event)) {
                                if(paint_space_stroke_enabled(stroke->brush)) {
@@ -887,7 +890,8 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
                }
        }
 
-       /* we want the stroke to have the first daub at the start location instead of waiting till we have moved the space distance */
+       /* we want the stroke to have the first daub at the start location
+        * instead of waiting till we have moved the space distance */
        if(first &&
           stroke->stroke_started &&
           paint_space_stroke_enabled(stroke->brush) &&
index ed2956ff054b5fe6ab935e5ac973ebf3f21246ba..fdacc2d15f51ac4b340ac24e0832a971bf1604e3 100644 (file)
 
 #include "paint_intern.h"
 
+/* Convert the object-space axis-aligned bounding box (expressed as
+   its minimum and maximum corners) into a screen-space rectangle,
+   returns zero if the result is empty */
+int paint_convert_bb_to_rect(rcti *rect,
+                                                        const float bb_min[3],
+                                                        const float bb_max[3],
+                                                        const ARegion *ar,
+                                                        RegionView3D *rv3d,
+                                                        Object *ob)
+{
+       float projection_mat[4][4];
+       int i, j, k;
+
+       rect->xmin = rect->ymin = INT_MAX;
+       rect->xmax = rect->ymax = INT_MIN;
+
+       /* return zero if the bounding box has non-positive volume */
+       if(bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2])
+               return 0;
+
+       ED_view3d_ob_project_mat_get(rv3d, ob, projection_mat);
+
+       for(i = 0; i < 2; ++i) {
+               for(j = 0; j < 2; ++j) {
+                       for(k = 0; k < 2; ++k) {
+                               float vec[3], proj[2];
+                               vec[0] = i ? bb_min[0] : bb_max[0];
+                               vec[1] = j ? bb_min[1] : bb_max[1];
+                               vec[2] = k ? bb_min[2] : bb_max[2];
+                               /* convert corner to screen space */
+                               ED_view3d_project_float(ar, vec, proj,
+                                                                               projection_mat);
+                               /* expand 2D rectangle */
+                               rect->xmin = MIN2(rect->xmin, proj[0]);
+                               rect->xmax = MAX2(rect->xmax, proj[0]);
+                               rect->ymin = MIN2(rect->ymin, proj[1]);
+                               rect->ymax = MAX2(rect->ymax, proj[1]);
+                       }
+               }
+       }
+
+       /* return false if the rectangle has non-positive area */
+       return rect->xmin < rect->xmax && rect->ymin < rect->ymax;
+}
+
+/* Get four planes in object-space that describe the projection of
+   screen_rect from screen into object-space (essentially converting a
+   2D screens-space bounding box into four 3D planes) */
+void paint_calc_redraw_planes(float planes[4][4],
+                                                         const ARegion *ar,
+                                                         RegionView3D *rv3d,
+                                                         Object *ob,
+                                                         const rcti *screen_rect)
+{
+       BoundBox bb;
+       bglMats mats;
+       rcti rect;
+
+       memset(&bb, 0, sizeof(BoundBox));
+       view3d_get_transformation(ar, rv3d, ob, &mats);
+
+       /* use some extra space just in case */
+       rect = *screen_rect;
+       rect.xmin -= 2;
+       rect.xmax += 2;
+       rect.ymin -= 2;
+       rect.ymax += 2;
+
+       ED_view3d_calc_clipping(&bb, planes, &mats, &rect);
+       mul_m4_fl(planes, -1.0f);
+}
+
 /* convert a point in model coordinates to 2D screen coordinates */
 /* TODO: can be deleted once all calls are replaced with
    view3d_project_float() */
index 272475194ee1eddaec9659f6d616ae4fdd3754cd..9fb992d969c862fa48ee131b7ea964b0d2ce818d 100644 (file)
@@ -248,90 +248,51 @@ typedef struct StrokeCache {
 
 /* Get a screen-space rectangle of the modified area */
 static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
-                               Object *ob, rcti *rect)
+                                                                 Object *ob, rcti *rect)
 {
+       SculptSession *ss;
        PBVH *pbvh= ob->sculpt->pbvh;
-       float bb_min[3], bb_max[3], pmat[4][4];
-       int i, j, k;
-
-       ED_view3d_ob_project_mat_get(rv3d, ob, pmat);
+       float bb_min[3], bb_max[3];
 
        if(!pbvh)
                return 0;
 
        BLI_pbvh_redraw_BB(pbvh, bb_min, bb_max);
 
-       rect->xmin = rect->ymin = INT_MAX;
-       rect->xmax = rect->ymax = INT_MIN;
-
-       if(bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2])
+       /* convert 3D bounding box to screen space */
+       if(!paint_convert_bb_to_rect(rect,
+                                                                bb_min,
+                                                                bb_max,
+                                                                ar,
+                                                                rv3d,
+                                                                ob)) {
                return 0;
-
-       for(i = 0; i < 2; ++i) {
-               for(j = 0; j < 2; ++j) {
-                       for(k = 0; k < 2; ++k) {
-                               float vec[3], proj[2];
-                               vec[0] = i ? bb_min[0] : bb_max[0];
-                               vec[1] = j ? bb_min[1] : bb_max[1];
-                               vec[2] = k ? bb_min[2] : bb_max[2];
-                               ED_view3d_project_float(ar, vec, proj, pmat);
-                               rect->xmin = MIN2(rect->xmin, proj[0]);
-                               rect->xmax = MAX2(rect->xmax, proj[0]);
-                               rect->ymin = MIN2(rect->ymin, proj[1]);
-                               rect->ymax = MAX2(rect->ymax, proj[1]);
-                       }
-               }
        }
-       
-       if (rect->xmin < rect->xmax && rect->ymin < rect->ymax) {
-               /* expand redraw rect with redraw rect from previous step to prevent
-                  partial-redraw issues caused by fast strokes. This is needed here (not in sculpt_flush_update)
-                  as it was before because redraw rectangle should be the same in both of
-                  optimized PBVH draw function and 3d view redraw (if not -- some mesh parts could
-                  disapper from screen (sergey) */
-               SculptSession *ss = ob->sculpt;
 
-               if (ss->cache) {
-                       if (!BLI_rcti_is_empty(&ss->cache->previous_r))
-                               BLI_union_rcti(rect, &ss->cache->previous_r);
-               }
-
-               return 1;
+       /* expand redraw rect with redraw rect from previous step to
+          prevent partial-redraw issues caused by fast strokes. This is
+          needed here (not in sculpt_flush_update) as it was before
+          because redraw rectangle should be the same in both of
+          optimized PBVH draw function and 3d view redraw (if not -- some
+          mesh parts could disapper from screen (sergey) */
+       ss = ob->sculpt;
+       if(ss->cache) {
+               if(!BLI_rcti_is_empty(&ss->cache->previous_r))
+                       BLI_union_rcti(rect, &ss->cache->previous_r);
        }
 
-       return 0;
+       return 1;
 }
 
 void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
                                  RegionView3D *rv3d, Object *ob)
 {
        PBVH *pbvh= ob->sculpt->pbvh;
-       BoundBox bb;
-       bglMats mats;
        rcti rect;
 
-       memset(&bb, 0, sizeof(BoundBox));
-
-       view3d_get_transformation(ar, rv3d, ob, &mats);
-       sculpt_get_redraw_rect(ar, rv3d,ob, &rect);
-
-#if 1
-       /* use some extra space just in case */
-       rect.xmin -= 2;
-       rect.xmax += 2;
-       rect.ymin -= 2;
-       rect.ymax += 2;
-#else
-       /* it was doing this before, allows to redraw a smaller
-          part of the screen but also gives artifaces .. */
-       rect.xmin += 2;
-       rect.xmax -= 2;
-       rect.ymin += 2;
-       rect.ymax -= 2;
-#endif
+       sculpt_get_redraw_rect(ar, rv3d, ob, &rect);
 
-       ED_view3d_calc_clipping(&bb, planes, &mats, &rect);
-       mul_m4_fl(planes, -1.0f);
+       paint_calc_redraw_planes(planes, ar, rv3d, ob, &rect);
 
        /* clear redraw flag from nodes */
        if(pbvh)
@@ -592,7 +553,12 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
        float pen_flip     = cache->pen_flip ? -1 : 1;
        float invert       = cache->invert ? -1 : 1;
        float accum        = integrate_overlap(brush);
-       float overlap      = (brush->flag & BRUSH_SPACE_ATTEN && brush->flag & BRUSH_SPACE && !(brush->flag & BRUSH_ANCHORED)) && (brush->spacing < 100) ? 1.0f/accum : 1; // spacing is integer percentage of radius, divide by 50 to get normalized diameter
+       /* spacing is integer percentage of radius, divide by 50 to get
+          normalized diameter */
+       float overlap      = (brush->flag & BRUSH_SPACE_ATTEN &&
+                                                 brush->flag & BRUSH_SPACE &&
+                                                 !(brush->flag & BRUSH_ANCHORED) &&
+                                                 (brush->spacing < 100)) ? 1.0f/accum : 1;
        float flip         = dir * invert * pen_flip;
 
        switch(brush->sculpt_tool){
@@ -1716,7 +1682,9 @@ static void calc_flatten_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
 
 /* this calculates flatten center and area normal together, 
 amortizing the memory bandwidth and loop overhead to calculate both at the same time */
-static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float an[3], float fc[3])
+static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob,
+                                                                                               PBVHNode **nodes, int totnode,
+                                                                                               float an[3], float fc[3])
 {
        SculptSession *ss = ob->sculpt;
        int n;
@@ -2588,7 +2556,9 @@ static void sculpt_flush_stroke_deform(Sculpt *sd, Object *ob)
 
 /* Flip all the editdata across the axis/axes specified by symm. Used to
    calculate multiple modifications to the mesh when symmetry is enabled. */
-static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm, const char axis, const float angle, const float UNUSED(feather))
+static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm,
+                                                               const char axis, const float angle,
+                                                               const float UNUSED(feather))
 {
        (void)sd; /* unused */
 
@@ -2620,7 +2590,9 @@ static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm,
        mul_m4_v3(cache->symm_rot_mat, cache->grab_delta_symmetry);
 }
 
-static void do_radial_symmetry(Sculpt *sd, Object *ob, Brush *brush, const char symm, const int axis, const float feather)
+static void do_radial_symmetry(Sculpt *sd, Object *ob, Brush *brush,
+                                                          const char symm, const int axis,
+                                                          const float feather)
 {
        SculptSession *ss = ob->sculpt;
        int i;
@@ -2954,7 +2926,10 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio
                cache->original = 1;
        }
 
-       if(ELEM8(brush->sculpt_tool, SCULPT_TOOL_DRAW,  SCULPT_TOOL_CREASE, SCULPT_TOOL_BLOB, SCULPT_TOOL_LAYER, SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_TUBES, SCULPT_TOOL_ROTATE))
+       if(ELEM8(brush->sculpt_tool,
+                        SCULPT_TOOL_DRAW, SCULPT_TOOL_CREASE, SCULPT_TOOL_BLOB,
+                        SCULPT_TOOL_LAYER, SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
+                        SCULPT_TOOL_CLAY_TUBES, SCULPT_TOOL_ROTATE))
                if(!(brush->flag & BRUSH_ACCUMULATE))
                        cache->original = 1;
 
@@ -3038,7 +3013,9 @@ static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush)
 }
 
 /* Initialize the stroke cache variants from operator properties */
-static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, struct PaintStroke *stroke, PointerRNA *ptr)
+static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
+                                                                                struct PaintStroke *stroke,
+                                                                                PointerRNA *ptr)
 {
        SculptSession *ss = ob->sculpt;
        StrokeCache *cache = ss->cache;
@@ -3095,7 +3072,9 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, st
 
        cache->radius_squared = cache->radius*cache->radius;
 
-       if(!(brush->flag & BRUSH_ANCHORED || ELEM4(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE))) {
+       if(!(brush->flag & BRUSH_ANCHORED ||
+                ELEM4(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK,
+                          SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE))) {
                copy_v2_v2(cache->tex_mouse, cache->mouse);
 
                if  ( (brush->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED) &&
@@ -3137,7 +3116,9 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, st
                if (!hit)
                        copy_v2_v2(sd->anchored_initial_mouse, cache->initial_mouse);
 
-               cache->radius= paint_calc_object_space_radius(paint_stroke_view_context(stroke), cache->true_location, cache->pixel_radius);
+               cache->radius= paint_calc_object_space_radius(paint_stroke_view_context(stroke),
+                                                                                                         cache->true_location,
+                                                                                                         cache->pixel_radius);
                cache->radius_squared = cache->radius*cache->radius;
 
                copy_v3_v3(sd->anchored_location, cache->true_location);
index 30a7abd3c0b6d4431a0f190ae81b6e2a02972775..9b1bd1d7b3181a3b40edaaa491e45ab403cfbd52 100644 (file)
@@ -221,12 +221,17 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot)
 static void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports)
 {
        /* can't rename rna datablocks entries */
-       if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))
-                       ;
-       else if(ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE, TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS)) 
+       if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
+                       /* do nothing */;
+       }
+       else if(ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE,
+                                    TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS))
+       {
                        BKE_report(reports, RPT_WARNING, "Cannot edit builtin name");
-       else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP))
+       }
+       else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
                BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
+       }
        else if(tselem->id->lib) {
                // XXX                                          error_libdata();
        } 
index e728267f45ff189aa49cd17ee4adad0a33f46164..bf570c929ccc1346c1851711625136effac471ac 100644 (file)
@@ -823,8 +823,12 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event)
 
        UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval+1);
 
-       if(!ELEM3(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF, SO_KEYMAP) && !(soops->flag & SO_HIDE_RESTRICTCOLS) && fmval[0] > ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX)
+       if ( !ELEM3(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF, SO_KEYMAP) &&
+            !(soops->flag & SO_HIDE_RESTRICTCOLS) &&
+            (fmval[0] > ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX))
+       {
                return OPERATOR_CANCELLED;
+       }
 
        for(te= soops->tree.first; te; te= te->next) {
                if(do_outliner_item_activate(C, scene, ar, soops, te, extend, fmval)) break;
index 7827569bd302fbfafd8219372d402c6e77ffc9f8..79c08c8dea9a1f8cee5932aef8f59ce13f3aa21c 100644 (file)
@@ -2656,8 +2656,7 @@ static void draw_em_fancy_edges(Scene *scene, View3D *v3d,
        }
 }      
 
-static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d,
-                                  Object *ob, EditMesh *em, UnitSettings *unit)
+static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSettings *unit)
 {
        Mesh *me= ob->data;
        EditEdge *eed;
@@ -2680,11 +2679,6 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d,
        else if (grid < 1.0f)   conv_float= "%.4g";
        else if (grid < 10.0f)  conv_float= "%.3g";
        else                                    conv_float= "%.2g";
-
-       if(v3d->zbuf && (v3d->flag & V3D_ZBUF_SELECT)==0)
-               glDisable(GL_DEPTH_TEST);
-
-       if(v3d->zbuf) bglPolygonOffset(rv3d->dist, 5.0f);
        
        if(me->drawflag & ME_DRAWEXTRA_EDGELEN) {
                UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
@@ -2803,23 +2797,43 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d,
                        }
                }
        }
+}
 
-       /* useful for debugging index vs shape key index */
-#if 0
-       {
-               EditVert *eve;
-               int j;
-               UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
-               for(eve= em->verts.first, j= 0; eve; eve= eve->next, j++) {
-                       sprintf(val, "%d:%d", j, eve->keyindex);
-                       view3d_cached_text_draw_add(eve->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
+static void draw_em_indices(EditMesh *em)
+{
+       EditEdge *e;
+       EditFace *f;
+       EditVert *v;
+       int i;
+       char val[32];
+       float pos[3];
+       unsigned char col[4];
+
+       /* For now, reuse appropriate theme colors from stats text colors */
+
+       UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
+       for (v = em->verts.first, i = 0; v; v = v->next, i++) {
+               if (v->f & SELECT) {
+                       sprintf(val, "%d", i);
+                       view3d_cached_text_draw_add(v->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
+               }
+       }
+
+       UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
+       for (e = em->edges.first, i = 0; e; e = e->next, i++) {
+               if (e->f & SELECT) {
+                       sprintf(val, "%d", i);
+                       mid_v3_v3v3(pos, e->v1->co, e->v2->co);
+                       view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
                }
        }
-#endif
 
-       if(v3d->zbuf) {
-               glEnable(GL_DEPTH_TEST);
-               bglPolygonOffset(rv3d->dist, 0.0f);
+       UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
+       for (f = em->faces.first, i = 0; f; f = f->next, i++) {
+               if (f->f & SELECT) {
+                       sprintf(val, "%d", i);
+                       view3d_cached_text_draw_add(f->cent, val, 0, V3D_CACHE_TEXT_ASCII, col);
+               }
        }
 }
 
@@ -2996,7 +3010,12 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                if ( (me->drawflag & (ME_DRAWEXTRA_EDGELEN|ME_DRAWEXTRA_FACEAREA|ME_DRAWEXTRA_FACEANG)) &&
                     !(v3d->flag2 & V3D_RENDER_OVERRIDE))
                {
-                       draw_em_measure_stats(v3d, rv3d, ob, em, &scene->unit);
+                       draw_em_measure_stats(v3d, ob, em, &scene->unit);
+               }
+
+               if ((G.f & G_DEBUG) && (me->drawflag & ME_DRAWEXTRA_INDICES) &&
+                   !(v3d->flag2 & V3D_RENDER_OVERRIDE)) {
+                       draw_em_indices(em);
                }
        }
 
index 0c9ea3c6a2a5e423f597337b040f18a30f7ae7c9..315da0423d1e219ac343830379d9ddb8e2591872 100644 (file)
@@ -276,7 +276,7 @@ static int modeselect_addmode(char *str, const char *title, int id, int icon)
 static char *view3d_modeselect_pup(Scene *scene)
 {
        Object *ob= OBACT;
-       static char string[256];
+       static char string[512];
        const char *title= IFACE_("Mode: %t");
        char *str = string;
 
@@ -316,7 +316,10 @@ static char *view3d_modeselect_pup(Scene *scene)
                str += modeselect_addmode(str, N_("Pose Mode"), OB_MODE_POSE, ICON_POSE_HLT);
        }
 
-       if (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)) {
+       if ( ob->particlesystem.first ||
+            modifiers_findByType(ob, eModifierType_Cloth) ||
+            modifiers_findByType(ob, eModifierType_Softbody))
+       {
                str += modeselect_addmode(str, N_("Particle Mode"), OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE);
        }
        (void)str;
index fb309f6de255c501a8b7ae4ed8f9447c64614afc..551eb3cd6b59fd82293c3e0ed12c89271192fd4a 100644 (file)
@@ -135,7 +135,7 @@ int view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const int m
 /*
  * ob == NULL if you want global matrices
  * */
-void view3d_get_transformation(ARegion *ar, RegionView3D *rv3d, Object *ob, bglMats *mats)
+void view3d_get_transformation(const ARegion *ar, RegionView3D *rv3d, Object *ob, bglMats *mats)
 {
        float cpy[4][4];
        int i, j;
index 4d98afc4c103a11adf0532e60c345c82bd9006d3..aa444125287104e87f11a246fb716da286e8955f 100644 (file)
@@ -512,7 +512,7 @@ void VIEW3D_OT_object_as_camera(wmOperatorType *ot)
 
 /* ********************************** */
 
-void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, rcti *rect)
+void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, const rcti *rect)
 {
        float modelview[4][4];
        double xs, ys, p[3];
@@ -760,7 +760,7 @@ void view3d_unproject(bglMats *mats, float out[3], const short x, const short y,
 #endif
 
 /* use view3d_get_object_project_mat to get projecting mat */
-void ED_view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
+void ED_view3d_project_float(const ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
 {
        float vec4[4];
        
@@ -1727,7 +1727,11 @@ static int game_engine_exec(bContext *C, wmOperator *op)
        
        game_set_commmandline_options(&startscene->gm);
 
-       if(rv3d->persp==RV3D_CAMOB && startscene->gm.framing.type == SCE_GAMEFRAMING_BARS && startscene->gm.stereoflag != STEREO_DOME) { /* Letterbox */
+       if((rv3d->persp == RV3D_CAMOB) &&
+          (startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) &&
+          (startscene->gm.stereoflag != STEREO_DOME))
+       {
+               /* Letterbox */
                rctf cam_framef;
                ED_view3d_calc_camera_border(startscene, ar, CTX_wm_view3d(C), rv3d, &cam_framef, FALSE);
                cam_frame.xmin = cam_framef.xmin + ar->winrct.xmin;
index 8e6e5d08266b7d02c54d96e30d569af6ea2efd0b..30337551fe56b742709cf4bbad327d5f9708d96b 100644 (file)
@@ -585,6 +585,9 @@ int transformEvent(TransInfo *t, wmEvent *event)
                }
 
                applyMouseInput(t, &t->mouse, t->mval, t->values);
+
+               // Snapping mouse move events
+               t->redraw |= handleSnapping(t, event);
        }
 
        /* handle modal keymap first */
@@ -1027,7 +1030,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                // Numerical input events
                t->redraw |= handleNumInput(&(t->num), event);
 
-               // Snapping events
+               // Snapping key events
                t->redraw |= handleSnapping(t, event);
 
        }
index fcc285d52f099de4df281f1e2c2eeac7697fc531..2233aeda92ee02aa424c887f7d851357436c9e0d 100644 (file)
@@ -65,15 +65,6 @@ struct wmTimer;
 struct ARegion;
 struct ReportList;
 
-/*
-       The ctrl value has different meaning:
-               0                       : No value has been typed
-
-               otherwise, |value| - 1 is where the cursor is located after the period
-               Positive        : number is positive
-               Negative        : number is negative
-*/
-
 typedef struct TransSnapPoint {
        struct TransSnapPoint *next,*prev;
        float co[3];
@@ -94,6 +85,7 @@ typedef struct TransSnap {
        float   snapNormal[3];
        float   snapTangent[3];
        ListBase points;
+       TransSnapPoint  *selectedPoint;
        float   dist; // Distance from snapPoint to snapTarget
        double  last;
        void  (*applySnap)(struct TransInfo *, float *);
@@ -618,6 +610,7 @@ int validSnappingNormal(TransInfo *t);
 
 void getSnapPoint(TransInfo *t, float vec[3]);
 void addSnapPoint(TransInfo *t);
+int updateSelectedSnapPoint(TransInfo *t);
 void removeSnapPoint(TransInfo *t);
 
 /********************** Mouse Input ******************************/
index 5ff7053da33f2054fb699084eadc6a1d02922d7b..bc7514b4c9a5d804c9017bd204ec7d5d736cfe75 100644 (file)
@@ -1548,8 +1548,10 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
 
                        /* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandles
                         * but for now just dont change handle types */
-                       if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT) == 0)
-                               testhandlesNurb(nu); /* sets the handles based on their selection, do this after the data is copied to the TransData */
+                       if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT) == 0) {
+                               /* sets the handles based on their selection, do this after the data is copied to the TransData */
+                               testhandlesNurb(nu);
+                       }
                }
                else {
                        TransData *head, *tail;
@@ -3448,7 +3450,10 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
                                 *        then check if we're using auto-handles.
                                 *      - If so, change them auto-handles to aligned handles so that handles get affected too
                                 */
-                               if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) && ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) {
+                               if ( ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) &&
+                                    ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) &&
+                                    ELEM(t->mode, TFM_ROTATION, TFM_RESIZE))
+                               {
                                        if (hdata && (sel1) && (sel3)) {
                                                bezt->h1= HD_ALIGN;
                                                bezt->h2= HD_ALIGN;
@@ -4144,7 +4149,10 @@ static void createTransSeqData(bContext *C, TransInfo *t)
                                int i;
                                for(i=0; i<3; i++) {
                                        seq_user= *((&seq->seq1) + i);
-                                       if (seq_user && (seq_user->flag & SELECT) && !(seq_user->flag & SEQ_LOCK) && !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL))) {
+                                       if ( seq_user && (seq_user->flag & SELECT) &&
+                                            !(seq_user->flag & SEQ_LOCK) &&
+                                            !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)))
+                                       {
                                                seq->flag |= SELECT;
                                        }
                                }
@@ -4444,7 +4452,8 @@ static int count_proportional_objects(TransInfo *t)
                /* mark all children */
                for (base= scene->base.first; base; base= base->next) {
                        /* all base not already selected or marked that is editable */
-                       if ((base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && BASE_EDITABLE_BGMODE(v3d, scene, base))
+                       if ( (base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+                            (BASE_EDITABLE_BGMODE(v3d, scene, base)))
                        {
                                mark_children(base->object);
                        }
@@ -4455,7 +4464,8 @@ static int count_proportional_objects(TransInfo *t)
                Object *ob= base->object;
 
                /* if base is not selected, not a parent of selection or not a child of selection and it is editable */
-               if ((ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && BASE_EDITABLE_BGMODE(v3d, scene, base))
+               if ( (ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+                    (BASE_EDITABLE_BGMODE(v3d, scene, base)))
                {
 
                        /* used for flush, depgraph will change recalcs if needed :) */
@@ -4531,7 +4541,9 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob,
                        if (adt && adt->action) {
                                for (fcu= adt->action->curves.first; fcu; fcu= fcu->next) {
                                        fcu->flag &= ~FCURVE_SELECTED;
-                                       insert_keyframe(reports, id, adt->action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
+                                       insert_keyframe(reports, id, adt->action,
+                                                       (fcu->grp ? fcu->grp->name : NULL),
+                                                       fcu->rna_path, fcu->array_index, cfra, flag);
                                }
                        }
                }
@@ -5049,8 +5061,12 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
                        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 
        }
-       else if(t->scene->basact && (ob = t->scene->basact->object) && (ob->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, ob)) {
-               ;
+       else if ( (t->scene->basact) &&
+                 (ob = t->scene->basact->object) &&
+                 (ob->mode & OB_MODE_PARTICLE_EDIT) &&
+                 PE_get_current(t->scene, ob))
+       {
+               /* do nothing */ ;
        }
        else { /* Objects */
                int i, recalcObPaths=0;
index 4635411dcdf70b81c21c3859930c352906aba5d9..ed3e949c8a02393bf65274251aca6b9850d8752a 100644 (file)
@@ -141,11 +141,16 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
        if (validSnap(t) && activeSnap(t))
                {
                
-               unsigned char col[4];
+               unsigned char col[4], selectedCol[4], activeCol[4];
                UI_GetThemeColor3ubv(TH_TRANSFORM, col);
                col[3]= 128;
-               glColor4ubv(col);
                
+               UI_GetThemeColor3ubv(TH_SELECT, selectedCol);
+               selectedCol[3]= 128;
+
+               UI_GetThemeColor3ubv(TH_ACTIVE, activeCol);
+               activeCol[3]= 192;
+
                if (t->spacetype == SPACE_VIEW3D) {
                        TransSnapPoint *p;
                        View3D *v3d = CTX_wm_view3d(C);
@@ -160,16 +165,26 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
                        invert_m4_m4(imat, rv3d->viewmat);
 
                        for (p = t->tsnap.points.first; p; p = p->next) {
-                               drawcircball(GL_LINE_LOOP, p->co, ED_view3d_pixel_size(rv3d, p->co) * size, imat);
+                               if (p == t->tsnap.selectedPoint) {
+                                       glColor4ubv(selectedCol);
+                               } else {
+                                       glColor4ubv(col);
+                               }
+
+                               drawcircball(GL_LINE_LOOP, p->co, ED_view3d_pixel_size(rv3d, p->co) * size * 0.75f, imat);
                        }
 
                        if (t->tsnap.status & POINT_INIT) {
+                               glColor4ubv(activeCol);
+
                                drawcircball(GL_LINE_LOOP, t->tsnap.snapPoint, ED_view3d_pixel_size(rv3d, t->tsnap.snapPoint) * size, imat);
                        }
                        
                        /* draw normal if needed */
                        if (usingSnappingNormal(t) && validSnappingNormal(t))
                        {
+                               glColor4ubv(activeCol);
+
                                glBegin(GL_LINES);
                                        glVertex3f(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], t->tsnap.snapPoint[2]);
                                        glVertex3f(     t->tsnap.snapPoint[0] + t->tsnap.snapNormal[0],
@@ -219,7 +234,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
        }
 }
 
-int  handleSnapping(TransInfo *UNUSED(t), wmEvent *UNUSED(event))
+int  handleSnapping(TransInfo *t, wmEvent *event)
 {
        int status = 0;
 
@@ -232,6 +247,10 @@ int  handleSnapping(TransInfo *UNUSED(t), wmEvent *UNUSED(event))
                status = 1;
        }
 #endif
+       if (event->type == MOUSEMOVE)
+       {
+               status |= updateSelectedSnapPoint(t);
+       }
        
        return status;
 }
@@ -541,6 +560,8 @@ void addSnapPoint(TransInfo *t)
        if (t->tsnap.status & POINT_INIT) {
                TransSnapPoint *p = MEM_callocN(sizeof(TransSnapPoint), "SnapPoint");
 
+               t->tsnap.selectedPoint = p;
+
                copy_v3_v3(p->co, t->tsnap.snapPoint);
 
                BLI_addtail(&t->tsnap.points, p);
@@ -549,13 +570,55 @@ void addSnapPoint(TransInfo *t)
        }
 }
 
+int updateSelectedSnapPoint(TransInfo *t)
+{
+       int status = 0;
+       if (t->tsnap.status & MULTI_POINTS) {
+               TransSnapPoint *p, *closest_p = NULL;
+               int closest_dist = 0;
+               int screen_loc[2];
+
+               for( p = t->tsnap.points.first; p; p = p->next ) {
+                       int dx, dy;
+                       int dist;
+
+                       project_int(t->ar, p->co, screen_loc);
+
+                       dx = t->mval[0] - screen_loc[0];
+                       dy = t->mval[1] - screen_loc[1];
+
+                       dist = dx * dx + dy * dy;
+
+                       if (dist < 100 && (closest_p == NULL || closest_dist > dist)) {
+                               closest_p = p;
+                               closest_dist = dist;
+                       }
+               }
+
+               if (closest_p) {
+                       status = t->tsnap.selectedPoint == closest_p ? 0 : 1;
+                       t->tsnap.selectedPoint = closest_p;
+               }
+       }
+
+       return status;
+}
+
 void removeSnapPoint(TransInfo *t)
 {
        if (t->tsnap.status & MULTI_POINTS) {
-               BLI_freelinkN(&t->tsnap.points, t->tsnap.points.last);
+               updateSelectedSnapPoint(t);
+
+               if (t->tsnap.selectedPoint) {
+                       BLI_freelinkN(&t->tsnap.points, t->tsnap.selectedPoint);
+
+                       if (t->tsnap.points.first == NULL) {
+                               t->tsnap.status &= ~MULTI_POINTS;
+                       }
+
+                       t->tsnap.selectedPoint = NULL;
+               }
 
-               if (t->tsnap.points.first == NULL)
-                       t->tsnap.status &= ~MULTI_POINTS;
        }
 }
 
@@ -680,7 +743,7 @@ static float RotationBetween(TransInfo *t, float p1[3], float p2[3])
 
 static float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
 {
-       float d1[3], d2[3], center[3];
+       float d1[3], d2[3], center[3], len_d1;
        
        copy_v3_v3(center, t->center);  
        if(t->flag & (T_EDIT|T_POSE)) {
@@ -696,7 +759,9 @@ static float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
                mul_m3_v3(t->con.pmtx, d2);
        }
        
-       return len_v3(d2) / len_v3(d1);
+       len_d1 = len_v3(d1);
+
+       return len_d1 != 0.0f ? len_v3(d2) / len_d1 : 1;
 }
 
 /********************** CALC **************************/
@@ -1622,7 +1687,12 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c
        }
 
        for ( base = FIRSTBASE; base != NULL; base = base->next ) {
-               if ( BASE_VISIBLE(v3d, base) && (base->flag & (BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA)) == 0 && ((mode == SNAP_NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) || (ELEM(mode, SNAP_ALL, SNAP_NOT_OBEDIT) && base != BASACT)) ) {
+               if ( (BASE_VISIBLE(v3d, base)) &&
+                    (base->flag & (BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA)) == 0 &&
+
+                    (  (mode == SNAP_NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) ||
+                       (ELEM(mode, SNAP_ALL, SNAP_NOT_OBEDIT) && base != BASACT))  )
+               {
                        Object *ob = base->object;
                        
                        if (ob->transflag & OB_DUPLI)
index 33796b7c215e10feaa26795a20c57c625f24a625..d623697921cb60e8b557d9b6e252eb08f4e70b50 100644 (file)
@@ -241,7 +241,12 @@ GPUFunction *GPU_lookup_function(const char *name)
        return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, (void *)name);
 }
 
-void GPU_extensions_exit(void)
+void GPU_codegen_init(void)
+{
+       GPU_code_generate_glsl_lib();
+}
+
+void GPU_codegen_exit(void)
 {
        extern Material defmaterial;    // render module abuse...
 
@@ -253,8 +258,11 @@ void GPU_extensions_exit(void)
                FUNCTION_HASH = NULL;
        }
 
-       if(glsl_material_library)
+       if(glsl_material_library) {
                MEM_freeN(glsl_material_library);
+               glsl_material_library = NULL;
+       }
+
        /*if(FUNCTION_PROTOTYPES) {
                MEM_freeN(FUNCTION_PROTOTYPES);
                FUNCTION_PROTOTYPES = NULL;
@@ -538,12 +546,8 @@ static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *final
                                        BLI_dynstr_appendf(ds, ", gl_TexCoord[%d].st", input->texid);
                        }
                        else if (input->source == GPU_SOURCE_TEX_PIXEL) {
-                               if (input->link && input->link->output)
-                                       codegen_convert_datatype(ds, input->link->output->type, input->type,
-                                               "tmp", input->link->output->id);
-                               else
-                                       codegen_convert_datatype(ds, input->link->output->type, input->type,
-                                               "tex", input->texid);
+                               codegen_convert_datatype(ds, input->link->output->type, input->type,
+                                       "tmp", input->link->output->id);
                        }
                        else if(input->source == GPU_SOURCE_BUILTIN)
                                BLI_dynstr_appendf(ds, "%s", GPU_builtin_name(input->builtin));
index f52b5bb627edb38ac435add7dd8c1edd3a242eb1..85bf65232c1656858cd3d3c50da5c9347eb20a56 100644 (file)
@@ -178,6 +178,9 @@ void GPU_pass_unbind(GPUPass *pass);
 
 void GPU_pass_free(GPUPass *pass);
 
+void GPU_codegen_init(void);
+void GPU_codegen_exit(void);
+
 /* Material calls */
 
 const char *GPU_builtin_name(GPUBuiltin builtin);
index 2dcce99606568c367475a72f791639ac4fac5a06..5d36ba169f346cb8fb5fd3f8da5c4b30268de054 100644 (file)
@@ -1069,7 +1069,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
 
                /* setting do_alpha_after = 1 indicates this object needs to be
                 * drawn in a second alpha pass for improved blending */
-               if(GMS.use_alpha_pass && !GMS.is_alpha_pass)
+               if(do_alpha_after && !GMS.is_alpha_pass)
                        if(ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT))
                                *do_alpha_after= 1;
 
index eaa661a9dcffb682c9c4d90267f145d9dccd7987..c4ed88635b798504feb14d63de497d7c8e4bc9e2 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
+#include "gpu_codegen.h"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -85,6 +86,8 @@ int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver)
 
 /* GPU Extensions */
 
+static int gpu_extensions_init = 0;
+
 void GPU_extensions_disable(void)
 {
        GG.extdisabled = 1;
@@ -96,11 +99,11 @@ void GPU_extensions_init(void)
        const char *vendor, *renderer;
 
        /* can't avoid calling this multiple times, see wm_window_add_ghostwindow */
-       static char init= 0;
-       if(init) return;
-       init= 1;
+       if(gpu_extensions_init) return;
+       gpu_extensions_init= 1;
 
        glewInit();
+       GPU_codegen_init();
 
        /* glewIsSupported("GL_VERSION_2_0") */
 
@@ -112,8 +115,6 @@ void GPU_extensions_init(void)
        if (!GLEW_ARB_vertex_shader) GG.glslsupport = 0;
        if (!GLEW_ARB_fragment_shader) GG.glslsupport = 0;
 
-       GPU_code_generate_glsl_lib();
-
        glGetIntegerv(GL_RED_BITS, &r);
        glGetIntegerv(GL_GREEN_BITS, &g);
        glGetIntegerv(GL_BLUE_BITS, &b);
@@ -188,6 +189,12 @@ void GPU_extensions_init(void)
 #endif
 }
 
+void GPU_extensions_exit(void)
+{
+       gpu_extensions_init = 0;
+       GPU_codegen_exit();
+}
+
 int GPU_glsl_support(void)
 {
        return !GG.extdisabled && GG.glslsupport;
index 250ea51f8c8c47fbfe2ba09bc10551cdb46ed8a6..fb1d10b549118824f85e2437ee768be1f0e9ec83 100644 (file)
@@ -972,7 +972,6 @@ static void do_material_tex(GPUShadeInput *shi)
                                GPU_link(mat, "mtex_mapping_ofs", texco, GPU_uniform(ofs), &texco);
 
                        talpha = 0;
-                       rgbnor = 0;
 
                        if(tex && tex->type == TEX_IMAGE && tex->ima) {
                                GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser), &tin, &trgb);
index 88401d3d2d4e290b5c8e3a41c91c857e2ae007cc..25d954196057ac839de957ff8972c2943c471013 100644 (file)
@@ -42,4 +42,7 @@
 #  endif
 #endif
 
+/* hrmf, we need a better include then this */
+#include "../blenloader/BLO_sys_types.h" /* needed for int64_t only! */
+
 #endif /* DNA_DEFS_H */
index 4f8b2343a9f0ad73e71deaf63dd5bc91716b8555..be13c8bba4f48021ead46315648903d046544028 100644 (file)
@@ -38,6 +38,24 @@ struct SDNA;
 extern unsigned char DNAstr[];  /* DNA.c */
 extern int DNAlen;
 
+typedef enum eSDNA_Type {
+       SDNA_TYPE_CHAR     = 0,
+       SDNA_TYPE_UCHAR    = 1,
+       SDNA_TYPE_SHORT    = 2,
+       SDNA_TYPE_USHORT   = 3,
+       SDNA_TYPE_INT      = 4,
+       SDNA_TYPE_LONG     = 5,
+       SDNA_TYPE_ULONG    = 6,
+       SDNA_TYPE_FLOAT    = 7,
+       SDNA_TYPE_DOUBLE   = 8,
+       SDNA_TYPE_INT64    = 9,
+       SDNA_TYPE_UINT64   = 10
+       /* ,SDNA_TYPE_VOID     = 11 */ /* nothing uses yet */
+} eSDNA_Type;
+
+/* define so switch statements don't complain */
+#define SDNA_TYPE_VOID 11
+
 struct SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap);
 void DNA_sdna_free(struct SDNA *sdna);
 
@@ -49,6 +67,7 @@ void *DNA_struct_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *c
 int DNA_elem_array_size(const char *astr, int len);
 int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name);
 
-#endif
 
+int DNA_elem_type_size(const eSDNA_Type elem_nr);
 
+#endif
index 7d57e2c295ce9571dcd2783a931cfb2603b8ec48..f8062aeccc7ffe8a8ab7e7e5a32dda703b584d11 100644 (file)
@@ -162,6 +162,9 @@ typedef struct TFace {
 #define ME_DRAWEXTRA_FACEAREA (1 << 11)
 #define ME_DRAWEXTRA_FACEANG  (1 << 12)
 
+/* debug only option */
+#define ME_DRAWEXTRA_INDICES (1 << 13)
+
 /* old global flags:
 #define G_DRAWEDGES            (1 << 18)
 #define G_DRAWFACES            (1 <<  7)
index 8707ae038c3567755a8d3804671090122107d4ac..46b971e8e0dcbb255ed1d0f1bdb2942ae8b8e34c 100644 (file)
@@ -250,8 +250,8 @@ typedef struct Object {
        struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store additional settings */
 
        struct DerivedMesh *derivedDeform, *derivedFinal;
-       unsigned int lastDataMask;   /* the custom data layer mask that was last used to calculate derivedDeform and derivedFinal */
-       unsigned int customdata_mask; /* (extra) custom data layer mask to use for creating derivedmesh, set by depsgraph */
+       uint64_t lastDataMask;   /* the custom data layer mask that was last used to calculate derivedDeform and derivedFinal */
+       uint64_t customdata_mask; /* (extra) custom data layer mask to use for creating derivedmesh, set by depsgraph */
        unsigned int state;                     /* bit masks of game controllers that are active */
        unsigned int init_state;        /* bit masks of initial state as recorded by the users */
 
index 345e78d70c9c531e7a5efef7e304a1b7372bc8c3..64b5bda3fc8be1ea5ec23a0255f1a6335a41169a 100644 (file)
@@ -915,8 +915,6 @@ typedef struct Scene {
        unsigned int lay;                       /* bitflags for layer visibility */
        int layact;             /* active layer */
        unsigned int lay_updated;       /* runtime flag, has layer ever been updated since load? */
-       unsigned int customdata_mask;   /* XXX. runtime flag for drawing, actually belongs in the window, only used by object_handle_update() */
-       unsigned int customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */
        
        short flag;                                                             /* various settings */
        
@@ -971,6 +969,9 @@ typedef struct Scene {
 
        /* Movie Tracking */
        struct MovieClip *clip;                 /* active movie clip */
+
+       uint64_t customdata_mask;       /* XXX. runtime flag for drawing, actually belongs in the window, only used by object_handle_update() */
+       uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */
 } Scene;
 
 
index 0dba78ff97ec156913ac92a71195d6c3496e1222..5b115a404ce4113ec6fd9f4dbc60a346bd4366c5 100644 (file)
@@ -491,7 +491,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
                        for(nr=0; nr<sdna->nr_structs; nr++) {
                                sp= sdna->structs[nr];
                                if(strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0)
-                                       sp[10]= 9;
+                                       sp[10]= SDNA_TYPE_VOID;
                        }
                }
 
@@ -655,92 +655,92 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
        return compflags;
 }
 
-static void cast_elem(char *ctype, char *otype, const char *name, char *curdata, char *olddata)
+static eSDNA_Type sdna_type_nr(const char *dna_type)
+{
+       if     ((strcmp(dna_type, "char")==0) || (strcmp(dna_type, "const char")==0))         return SDNA_TYPE_CHAR;
+       else if((strcmp(dna_type, "uchar")==0) || (strcmp(dna_type, "unsigned char")==0))     return SDNA_TYPE_UCHAR;
+       else if( strcmp(dna_type, "short")==0)                                                return SDNA_TYPE_SHORT;
+       else if((strcmp(dna_type, "ushort")==0)||(strcmp(dna_type, "unsigned short")==0))     return SDNA_TYPE_USHORT;
+       else if( strcmp(dna_type, "int")==0)                                                  return SDNA_TYPE_INT;
+       else if( strcmp(dna_type, "long")==0)                                                 return SDNA_TYPE_LONG;
+       else if((strcmp(dna_type, "ulong")==0)||(strcmp(dna_type, "unsigned long")==0))       return SDNA_TYPE_ULONG;
+       else if( strcmp(dna_type, "float")==0)                                                return SDNA_TYPE_FLOAT;
+       else if( strcmp(dna_type, "double")==0)                                               return SDNA_TYPE_DOUBLE;
+       else if( strcmp(dna_type, "int64_t")==0)                                              return SDNA_TYPE_INT64;
+       else if( strcmp(dna_type, "uint64_t")==0)                                             return SDNA_TYPE_UINT64;
+       else                                                                                  return -1; /* invalid! */
+}
+
+static void cast_elem(const char *ctype, const char *otype, const char *name, char *curdata, char *olddata)
 {
        double val = 0.0;
-       int arrlen, curlen=1, oldlen=1, ctypenr, otypenr;
-       
+       int arrlen, curlen=1, oldlen=1;
+
+       eSDNA_Type ctypenr, otypenr;
+
        arrlen= DNA_elem_array_size(name, strlen(name));
-       
-       /* define otypenr */
-       if(strcmp(otype, "char")==0 || (strcmp(otype, "const char")==0)) otypenr= 0; 
-       else if((strcmp(otype, "uchar")==0) || (strcmp(otype, "unsigned char")==0)) otypenr= 1;
-       else if(strcmp(otype, "short")==0) otypenr= 2; 
-       else if((strcmp(otype, "ushort")==0)||(strcmp(otype, "unsigned short")==0)) otypenr= 3;
-       else if(strcmp(otype, "int")==0) otypenr= 4;
-       else if(strcmp(otype, "long")==0) otypenr= 5;
-       else if((strcmp(otype, "ulong")==0)||(strcmp(otype, "unsigned long")==0)) otypenr= 6;
-       else if(strcmp(otype, "float")==0) otypenr= 7;
-       else if(strcmp(otype, "double")==0) otypenr= 8;
-       else return;
-       
-       /* define ctypenr */
-       if(strcmp(ctype, "char")==0) ctypenr= 0; 
-       else if(strcmp(ctype, "const char")==0) ctypenr= 0; 
-       else if((strcmp(ctype, "uchar")==0)||(strcmp(ctype, "unsigned char")==0)) ctypenr= 1;
-       else if(strcmp(ctype, "short")==0) ctypenr= 2; 
-       else if((strcmp(ctype, "ushort")==0)||(strcmp(ctype, "unsigned short")==0)) ctypenr= 3;
-       else if(strcmp(ctype, "int")==0) ctypenr= 4;
-       else if(strcmp(ctype, "long")==0) ctypenr= 5;
-       else if((strcmp(ctype, "ulong")==0)||(strcmp(ctype, "unsigned long")==0)) ctypenr= 6;
-       else if(strcmp(ctype, "float")==0) ctypenr= 7;
-       else if(strcmp(ctype, "double")==0) ctypenr= 8;
-       else return;
+
+       if ( (otypenr= sdna_type_nr(otype)) == -1 ||
+            (ctypenr= sdna_type_nr(ctype)) == -1 )
+       {
+               return;
+       }
 
        /* define lengths */
-       if(otypenr < 2) oldlen= 1;
-       else if(otypenr < 4) oldlen= 2;
-       else if(otypenr < 8) oldlen= 4;
-       else oldlen= 8;
-
-       if(ctypenr < 2) curlen= 1;
-       else if(ctypenr < 4) curlen= 2;
-       else if(ctypenr < 8) curlen= 4;
-       else curlen= 8;
-       
+       oldlen= DNA_elem_type_size(otypenr);
+       curlen= DNA_elem_type_size(ctypenr);
+
        while(arrlen>0) {
                switch(otypenr) {
-               case 0:
+               case SDNA_TYPE_CHAR:
                        val= *olddata; break;
-               case 1:
+               case SDNA_TYPE_UCHAR:
                        val= *( (unsigned char *)olddata); break;
-               case 2:
+               case SDNA_TYPE_SHORT:
                        val= *( (short *)olddata); break;
-               case 3:
+               case SDNA_TYPE_USHORT: