Revision: 30512 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30512 Author: nicholasbishop Date: 2010-07-20 00:05:25 +0200 (Tue, 20 Jul 2010)
Log Message: ----------- svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r30325:30510 Modified Paths: -------------- branches/soc-2010-nicolasbishop/CMakeLists.txt branches/soc-2010-nicolasbishop/SConstruct branches/soc-2010-nicolasbishop/build_files/cmake/macros.cmake branches/soc-2010-nicolasbishop/build_files/scons/tools/Blender.py branches/soc-2010-nicolasbishop/doc/blender.1 branches/soc-2010-nicolasbishop/doc/blender.1.py branches/soc-2010-nicolasbishop/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp branches/soc-2010-nicolasbishop/intern/ghost/CMakeLists.txt branches/soc-2010-nicolasbishop/intern/ghost/intern/GHOST_SystemX11.cpp branches/soc-2010-nicolasbishop/projectfiles_vc9/blender/editors/ED_editors.vcproj branches/soc-2010-nicolasbishop/projectfiles_vc9/blender/gpu/BL_gpu.vcproj branches/soc-2010-nicolasbishop/release/freedesktop/blender.desktop branches/soc-2010-nicolasbishop/release/scripts/io/export_3ds.py branches/soc-2010-nicolasbishop/release/scripts/io/export_fbx.py branches/soc-2010-nicolasbishop/release/scripts/io/export_obj.py branches/soc-2010-nicolasbishop/release/scripts/io/import_anim_bvh.py branches/soc-2010-nicolasbishop/release/scripts/io/import_scene_3ds.py branches/soc-2010-nicolasbishop/release/scripts/io/import_scene_obj.py branches/soc-2010-nicolasbishop/release/scripts/io/netrender/master_html.py branches/soc-2010-nicolasbishop/release/scripts/io/netrender/repath.py branches/soc-2010-nicolasbishop/release/scripts/io/netrender/slave.py branches/soc-2010-nicolasbishop/release/scripts/io/netrender/utils.py branches/soc-2010-nicolasbishop/release/scripts/modules/add_object_utils.py branches/soc-2010-nicolasbishop/release/scripts/modules/bpy/utils.py branches/soc-2010-nicolasbishop/release/scripts/modules/bpy_types.py branches/soc-2010-nicolasbishop/release/scripts/modules/console/complete_calltip.py branches/soc-2010-nicolasbishop/release/scripts/modules/rigify/__init__.py branches/soc-2010-nicolasbishop/release/scripts/modules/rigify/arm_biped.py branches/soc-2010-nicolasbishop/release/scripts/modules/rna_info.py branches/soc-2010-nicolasbishop/release/scripts/op/console_python.py branches/soc-2010-nicolasbishop/release/scripts/op/fcurve_euler_filter.py branches/soc-2010-nicolasbishop/release/scripts/op/mesh.py branches/soc-2010-nicolasbishop/release/scripts/op/nla.py branches/soc-2010-nicolasbishop/release/scripts/op/object.py branches/soc-2010-nicolasbishop/release/scripts/op/sequencer.py branches/soc-2010-nicolasbishop/release/scripts/op/uv.py branches/soc-2010-nicolasbishop/release/scripts/op/uvcalc_follow_active.py branches/soc-2010-nicolasbishop/release/scripts/op/uvcalc_smart_project.py branches/soc-2010-nicolasbishop/release/scripts/op/vertexpaint_dirt.py branches/soc-2010-nicolasbishop/release/scripts/presets/interaction/maya.py branches/soc-2010-nicolasbishop/release/scripts/templates/operator_uv.py branches/soc-2010-nicolasbishop/release/scripts/ui/properties_data_bone.py branches/soc-2010-nicolasbishop/release/scripts/ui/properties_game.py branches/soc-2010-nicolasbishop/release/scripts/ui/properties_material.py branches/soc-2010-nicolasbishop/release/scripts/ui/properties_object_constraint.py branches/soc-2010-nicolasbishop/release/scripts/ui/properties_render.py branches/soc-2010-nicolasbishop/release/scripts/ui/properties_world.py branches/soc-2010-nicolasbishop/release/scripts/ui/space_info.py branches/soc-2010-nicolasbishop/release/scripts/ui/space_sequencer.py branches/soc-2010-nicolasbishop/release/scripts/ui/space_time.py branches/soc-2010-nicolasbishop/release/scripts/ui/space_userpref.py branches/soc-2010-nicolasbishop/release/scripts/ui/space_view3d.py branches/soc-2010-nicolasbishop/release/scripts/ui/space_view3d_toolbar.py branches/soc-2010-nicolasbishop/source/blender/blenkernel/BKE_blender.h branches/soc-2010-nicolasbishop/source/blender/blenkernel/BKE_library.h branches/soc-2010-nicolasbishop/source/blender/blenkernel/BKE_object.h branches/soc-2010-nicolasbishop/source/blender/blenkernel/BKE_particle.h branches/soc-2010-nicolasbishop/source/blender/blenkernel/BKE_sequencer.h branches/soc-2010-nicolasbishop/source/blender/blenkernel/BKE_sound.h branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/brush.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/curve.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/image.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/library.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/object.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/particle.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/particle_system.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/sca.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/sequencer.c branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/sound.c branches/soc-2010-nicolasbishop/source/blender/blenlib/BLI_path_util.h branches/soc-2010-nicolasbishop/source/blender/blenlib/BLI_winstuff.h branches/soc-2010-nicolasbishop/source/blender/blenlib/intern/fileops.c branches/soc-2010-nicolasbishop/source/blender/blenlib/intern/math_color.c branches/soc-2010-nicolasbishop/source/blender/blenlib/intern/path_util.c branches/soc-2010-nicolasbishop/source/blender/blenlib/intern/storage.c branches/soc-2010-nicolasbishop/source/blender/blenloader/intern/readfile.c branches/soc-2010-nicolasbishop/source/blender/blenloader/intern/writefile.c branches/soc-2010-nicolasbishop/source/blender/editors/animation/anim_channels_edit.c branches/soc-2010-nicolasbishop/source/blender/editors/animation/anim_markers.c branches/soc-2010-nicolasbishop/source/blender/editors/animation/fmodifier_ui.c branches/soc-2010-nicolasbishop/source/blender/editors/armature/armature_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/armature/poseobject.c branches/soc-2010-nicolasbishop/source/blender/editors/curve/curve_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/curve/editcurve.c branches/soc-2010-nicolasbishop/source/blender/editors/datafiles/startup.blend.c branches/soc-2010-nicolasbishop/source/blender/editors/gpencil/gpencil_buttons.c branches/soc-2010-nicolasbishop/source/blender/editors/interface/interface_regions.c branches/soc-2010-nicolasbishop/source/blender/editors/interface/interface_style.c branches/soc-2010-nicolasbishop/source/blender/editors/interface/interface_templates.c branches/soc-2010-nicolasbishop/source/blender/editors/interface/resources.c branches/soc-2010-nicolasbishop/source/blender/editors/mesh/editmesh_mods.c branches/soc-2010-nicolasbishop/source/blender/editors/mesh/mesh_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/metaball/mball_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/object/object_edit.c branches/soc-2010-nicolasbishop/source/blender/editors/object/object_intern.h branches/soc-2010-nicolasbishop/source/blender/editors/object/object_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/physics/physics_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/screen/screen_edit.c branches/soc-2010-nicolasbishop/source/blender/editors/screen/screen_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/paint_image.c branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/paint_stroke.c branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/paint_vertex.c branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/sculpt.c branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/sculpt_undo.c branches/soc-2010-nicolasbishop/source/blender/editors/space_action/action_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/space_file/file_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/space_file/fsmenu.c branches/soc-2010-nicolasbishop/source/blender/editors/space_file/space_file.c branches/soc-2010-nicolasbishop/source/blender/editors/space_graph/graph_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/space_logic/logic_window.c branches/soc-2010-nicolasbishop/source/blender/editors/space_nla/nla_buttons.c branches/soc-2010-nicolasbishop/source/blender/editors/space_nla/nla_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/space_node/node_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/space_outliner/outliner.c branches/soc-2010-nicolasbishop/source/blender/editors/space_sequencer/sequencer_draw.c branches/soc-2010-nicolasbishop/source/blender/editors/space_sequencer/sequencer_edit.c branches/soc-2010-nicolasbishop/source/blender/editors/space_sequencer/sequencer_ops.c branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/drawobject.c branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/view3d_draw.c branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/view3d_edit.c branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/view3d_view.c branches/soc-2010-nicolasbishop/source/blender/editors/transform/transform_conversions.c branches/soc-2010-nicolasbishop/source/blender/gpu/GPU_extensions.h branches/soc-2010-nicolasbishop/source/blender/gpu/intern/gpu_draw.c branches/soc-2010-nicolasbishop/source/blender/gpu/intern/gpu_extensions.c branches/soc-2010-nicolasbishop/source/blender/imbuf/intern/anim.c branches/soc-2010-nicolasbishop/source/blender/imbuf/intern/imageprocess.c branches/soc-2010-nicolasbishop/source/blender/imbuf/intern/openexr/openexr_api.cpp branches/soc-2010-nicolasbishop/source/blender/imbuf/intern/png.c branches/soc-2010-nicolasbishop/source/blender/imbuf/intern/thumbs_blend.c branches/soc-2010-nicolasbishop/source/blender/makesdna/DNA_object_types.h branches/soc-2010-nicolasbishop/source/blender/makesdna/intern/dna_genfile.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/makesrna.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_action.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_actuator.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_animviz.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_armature.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_color.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_constraint.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_controller.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_curve.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_fcurve.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_gpencil.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_mesh.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_nla.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_object.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_pose.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_scene.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_sequencer.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_timeline.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_userdef.c branches/soc-2010-nicolasbishop/source/blender/makesrna/intern/rna_world.c branches/soc-2010-nicolasbishop/source/blender/makesrna/rna_cleanup/rna_booleans.txt branches/soc-2010-nicolasbishop/source/blender/makesrna/rna_cleanup/rna_cleaner.py branches/soc-2010-nicolasbishop/source/blender/modifiers/intern/MOD_screw.c branches/soc-2010-nicolasbishop/source/blender/python/doc/examples/bpy.data.py branches/soc-2010-nicolasbishop/source/blender/python/doc/sphinx_doc_gen.py branches/soc-2010-nicolasbishop/source/blender/python/generic/bgl.c branches/soc-2010-nicolasbishop/source/blender/python/generic/bpy_internal_import.c branches/soc-2010-nicolasbishop/source/blender/python/generic/geometry.c branches/soc-2010-nicolasbishop/source/blender/python/generic/mathutils.c branches/soc-2010-nicolasbishop/source/blender/python/generic/mathutils_vector.c branches/soc-2010-nicolasbishop/source/blender/python/intern/bpy.c branches/soc-2010-nicolasbishop/source/blender/python/intern/bpy_app.c branches/soc-2010-nicolasbishop/source/blender/python/intern/bpy_rna.c branches/soc-2010-nicolasbishop/source/blender/render/intern/source/convertblender.c branches/soc-2010-nicolasbishop/source/blender/render/intern/source/pipeline.c branches/soc-2010-nicolasbishop/source/blender/windowmanager/CMakeLists.txt branches/soc-2010-nicolasbishop/source/blender/windowmanager/WM_api.h branches/soc-2010-nicolasbishop/source/blender/windowmanager/intern/wm_draw.c branches/soc-2010-nicolasbishop/source/blender/windowmanager/intern/wm_event_system.c branches/soc-2010-nicolasbishop/source/blender/windowmanager/intern/wm_files.c branches/soc-2010-nicolasbishop/source/blender/windowmanager/intern/wm_init_exit.c branches/soc-2010-nicolasbishop/source/blender/windowmanager/intern/wm_jobs.c branches/soc-2010-nicolasbishop/source/blender/windowmanager/intern/wm_operators.c branches/soc-2010-nicolasbishop/source/blender/windowmanager/intern/wm_window.c branches/soc-2010-nicolasbishop/source/creator/CMakeLists.txt branches/soc-2010-nicolasbishop/source/creator/creator.c branches/soc-2010-nicolasbishop/source/gameengine/Expressions/PyObjectPlus.cpp branches/soc-2010-nicolasbishop/source/gameengine/GameLogic/SCA_PythonController.cpp branches/soc-2010-nicolasbishop/source/gameengine/Ketsji/KX_Camera.cpp branches/soc-2010-nicolasbishop/source/gameengine/Ketsji/KX_Camera.h branches/soc-2010-nicolasbishop/source/gameengine/Ketsji/KX_PythonSeq.cpp branches/soc-2010-nicolasbishop/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp branches/soc-2010-nicolasbishop/source/gameengine/PyDoc/bge.logic.rst branches/soc-2010-nicolasbishop/source/gameengine/PyDoc/bge.render.rst branches/soc-2010-nicolasbishop/source/gameengine/PyDoc/bge.types.rst Added Paths: ----------- branches/soc-2010-nicolasbishop/bin/blender-thumbnailer.py branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/ branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/cmake_linux_install.sh branches/soc-2010-nicolasbishop/release/datafiles/brushicons/ branches/soc-2010-nicolasbishop/release/datafiles/brushicons/clay.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/crease.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/draw.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/fill.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/flatten.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/grab.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/inflate.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/layer.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/nudge.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/pinch.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/scrape.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/smooth.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/snake_hook.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/thumb.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/twist.png Removed Paths: ------------- branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/cmake_linux_install.sh branches/soc-2010-nicolasbishop/release/datafiles/brushicons/clay.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/crease.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/draw.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/fill.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/flatten.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/grab.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/inflate.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/layer.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/nudge.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/pinch.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/scrape.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/smooth.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/snake_hook.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/thumb.png branches/soc-2010-nicolasbishop/release/datafiles/brushicons/twist.png Property Changed: ---------------- branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/sculpt_undo.c Modified: branches/soc-2010-nicolasbishop/CMakeLists.txt =================================================================== --- branches/soc-2010-nicolasbishop/CMakeLists.txt 2010-07-19 20:52:33 UTC (rev 30511) +++ branches/soc-2010-nicolasbishop/CMakeLists.txt 2010-07-19 22:05:25 UTC (rev 30512) @@ -55,10 +55,6 @@ SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) -# Note! - Could create this from the blender version string -# ...but thats quite involved, make sure this matches the blender version. -SET(BLENDER_VERSION 2.5) - #----------------------------------------------------------------------------- # Load some macros. INCLUDE(build_files/cmake/macros.cmake) @@ -66,6 +62,8 @@ #----------------------------------------------------------------------------- # Set default config options +GET_BLENDER_VERSION() + # Blender internal features OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) OPTION(WITH_LCMS "Enable color correction with lcms" OFF) @@ -628,6 +626,12 @@ SET(WITH_JACK OFF) ENDIF(WITH_JACK) + IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD) + SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}") + ADD_DEFINITIONS(-D__SSE__) + ADD_DEFINITIONS(-D__MMX__) + ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD) + ENDIF(MSVC) ENDIF(WIN32) Modified: branches/soc-2010-nicolasbishop/SConstruct =================================================================== --- branches/soc-2010-nicolasbishop/SConstruct 2010-07-19 20:52:33 UTC (rev 30511) +++ branches/soc-2010-nicolasbishop/SConstruct 2010-07-19 22:05:25 UTC (rev 30512) @@ -46,20 +46,22 @@ import re from tempfile import mkdtemp +# store path to tools +toolpath=os.path.join(".", "build_files", "scons", "tools") + # needed for importing tools -sys.path.append(os.path.join(".", "build_files", "scons")) +sys.path.append(toolpath) -import tools.Blender -import tools.btools -import tools.bcolors +import Blender +import btools +import bcolors EnsureSConsVersion(1,0,0) -BlenderEnvironment = tools.Blender.BlenderEnvironment -btools = tools.btools -B = tools.Blender +BlenderEnvironment = Blender.BlenderEnvironment +B = Blender -VERSION = tools.btools.VERSION # This is used in creating the local config directories +VERSION = btools.VERSION # This is used in creating the local config directories ### globals ### platform = sys.platform @@ -122,7 +124,7 @@ print "Using " + toolset if toolset=='mstoolkit': env = BlenderEnvironment(ENV = os.environ) - env.Tool('mstoolkit', ['tools']) + env.Tool('mstoolkit', [toolpath]) else: env = BlenderEnvironment(tools=[toolset], ENV = os.environ) # xxx commented out, as was supressing warnings under mingw.. @@ -171,7 +173,7 @@ if crossbuild and env['PLATFORM'] != 'win32': print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC - env.Tool('crossmingw', ['tools']) + env.Tool('crossmingw', [toolpath]) # todo: determine proper libs/includes etc. # Needed for gui programs, console programs should do without it @@ -628,9 +630,6 @@ '${BF_FFMPEG_LIBPATH}/avdevice-52.dll', '${BF_FFMPEG_LIBPATH}/avutil-50.dll', '${BF_FFMPEG_LIBPATH}/swscale-0.dll'] - - if env['WITH_BF_JACK']: - dllsources += ['${LCGDIR}/jack/lib/libjack.dll'] windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources) allinstall += windlls Copied: branches/soc-2010-nicolasbishop/bin/blender-thumbnailer.py (from rev 30510, trunk/blender/bin/blender-thumbnailer.py) =================================================================== --- branches/soc-2010-nicolasbishop/bin/blender-thumbnailer.py (rev 0) +++ branches/soc-2010-nicolasbishop/bin/blender-thumbnailer.py 2010-07-19 22:05:25 UTC (rev 30512) @@ -0,0 +1,131 @@ +#!/usr/bin/python + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# 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. +# +# ##### END GPL LICENSE BLOCK ##### + +""" +Thumbnailer runs with python 2.6 and 3.x. +To run automatically with nautilus: + gconftool --type boolean --set /desktop/gnome/thumbnailers/applicat...@x-blender/enable true + gconftool --type string --set /desktop/gnome/thumbnailers/applicat...@x-blender/command "blender-thumbnailer.py %i %o" +""" + +import struct + +def blend_extract_thumb(path): + import os + + # def MAKE_ID(tag): ord(tag[0])<<24 | ord(tag[1])<<16 | ord(tag[2])<<8 | ord(tag[3]) + REND = 1145980242 # MAKE_ID(b'REND') + TEST = 1414743380 # MAKE_ID(b'TEST') + + blendfile = open(path, 'rb') + + head = blendfile.read(12) + + if head[0:2] == b'\x1f\x8b': # gzip magic + import gzip + blendfile.close() + blendfile = gzip.open(path, 'rb') + head = blendfile.read(12) + + if not head.startswith(b'BLENDER'): + blendfile.close() + return None, 0, 0 + + is_64_bit = (head[7] == b'-') + + # true for PPC, false for X86 + is_big_endian = (head[8] == b'V') + + # blender pre 2.5 had no thumbs + if head[9:11] <= b'24': + return None, 0, 0 + + sizeof_bhead = 24 if is_64_bit else 20 + int_endian_pair = '>ii' if is_big_endian else '<ii' + + while True: + bhead = blendfile.read(sizeof_bhead) + + if len(bhead) < sizeof_bhead: + return None, 0, 0 + + code, length = struct.unpack(int_endian_pair, bhead[0:8]) # 8 == sizeof(int) * 2 + + if code == REND: + blendfile.seek(length, os.SEEK_CUR) + else: + break + + + if code != TEST: + return None, 0, 0 + + try: + x, y = struct.unpack(int_endian_pair, blendfile.read(8)) # 8 == sizeof(int) * 2 + except struct.error: + return None, 0, 0 + + length -= 8 # sizeof(int) * 2 + + if length != x * y * 4: + return None, 0, 0 + + image_buffer = blendfile.read(length) + + if len(image_buffer) != length: + return None, 0, 0 + + return image_buffer, x, y + + +def write_png(buf, width, height): + import zlib + + # reverse the vertical line order and add null bytes at the start + width_byte_4 = width * 4 + raw_data = b"".join([b'\x00' + buf[span:span + width_byte_4] for span in range((height - 1) * width * 4, -1, - width_byte_4)]) + + def png_pack(png_tag, data): + chunk_head = png_tag + data + return struct.pack("!I", len(data)) + chunk_head + struct.pack("!I", 0xFFFFFFFF & zlib.crc32(chunk_head)) + + return b"".join([ + b'\x89PNG\r\n\x1a\n', + png_pack(b'IHDR', struct.pack("!2I5B", width, height, 8, 6, 0, 0, 0)), + png_pack(b'IDAT', zlib.compress(raw_data, 9)), + png_pack(b'IEND', b'')]) + + +if __name__ == '__main__': + import sys + + if len(sys.argv) < 2: + print("Expected 2 arguments <input.blend> <output.png>") + else: + file_in = sys.argv[-2] + + buf, width, height = blend_extract_thumb(file_in) + + if buf: + file_out = sys.argv[-1] + + f = open(file_out, "wb") + f.write(write_png(buf, width, height)) + f.close() Copied: branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts (from rev 30510, trunk/blender/build_files/cmake/example_scripts) Deleted: branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/cmake_linux_install.sh =================================================================== --- trunk/blender/build_files/cmake/example_scripts/cmake_linux_install.sh 2010-07-19 20:01:18 UTC (rev 30510) +++ branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/cmake_linux_install.sh 2010-07-19 22:05:25 UTC (rev 30512) @@ -1,37 +0,0 @@ -#!/bin/sh - -# This shell script checks out and compiles blender, tested on ubuntu 10.04 -# assumes you have dependancies installed alredy - -# See this page for more info: -# http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Linux/Generic_Distro/CMake - -# grab blender -mkdir ~/blender-svn -cd ~/blender-svn -svn co https://svn.blender.org/svnroot/bf-blender/trunk/blender - -# create cmake dir -mkdir ~/blender-svn/build-cmake -cd ~/blender-svn/build-cmake - -# cmake without copying files for fast rebuilds -# the files from svn will be used in place -cmake ../blender -DWITH_INSTALL:BOOL=FALSE - -# make blender, will take some time -make - -# link the binary to blenders source directory to run quickly -ln -s ~/blender-svn/build-cmake/bin/blender ~/blender-svn/blender/blender.bin - -# useful info -echo "" -echo "* Useful Commands *" -echo " Run Blender: ~/blender-svn/blender/blender.bin" -echo " Update Blender: svn up ~/blender-svn/blender" -echo " Reconfigure Blender: cd ~/blender-svn/build-cmake ; cmake ." -echo " Build Blender: cd ~/blender-svn/build-cmake ; make" -echo "" - - Copied: branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/cmake_linux_install.sh (from rev 30510, trunk/blender/build_files/cmake/example_scripts/cmake_linux_install.sh) =================================================================== --- branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/cmake_linux_install.sh (rev 0) +++ branches/soc-2010-nicolasbishop/build_files/cmake/example_scripts/cmake_linux_install.sh 2010-07-19 22:05:25 UTC (rev 30512) @@ -0,0 +1,37 @@ +#!/bin/sh + +# This shell script checks out and compiles blender, tested on ubuntu 10.04 +# assumes you have dependancies installed alredy + +# See this page for more info: +# http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Linux/Generic_Distro/CMake + +# grab blender +mkdir ~/blender-svn +cd ~/blender-svn +svn co https://svn.blender.org/svnroot/bf-blender/trunk/blender + +# create cmake dir +mkdir ~/blender-svn/build-cmake +cd ~/blender-svn/build-cmake + @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs