[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34908] branches/soc-2010-nicks/release: synched with trunk at revision 34793
Nick Samarin
nicks1987 at bigmir.net
Wed Feb 16 17:56:14 CET 2011
Revision: 34908
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34908
Author: nicks
Date: 2011-02-16 16:56:11 +0000 (Wed, 16 Feb 2011)
Log Message:
-----------
synched with trunk at revision 34793
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34793
Modified Paths:
--------------
branches/soc-2010-nicks/release/VERSION
branches/soc-2010-nicks/release/bin/blender-thumbnailer.py
branches/soc-2010-nicks/release/datafiles/blenderbuttons
branches/soc-2010-nicks/release/datafiles/datatoc.py
branches/soc-2010-nicks/release/datafiles/prvicons
branches/soc-2010-nicks/release/datafiles/splash.png
branches/soc-2010-nicks/release/freedesktop/icons/16x16/blender.png
branches/soc-2010-nicks/release/freedesktop/icons/22x22/blender.png
branches/soc-2010-nicks/release/freedesktop/icons/32x32/blender.png
branches/soc-2010-nicks/release/freedesktop/icons/32x32/blender.svg
branches/soc-2010-nicks/release/plugins/sequence/color-correction-hsv.c
branches/soc-2010-nicks/release/plugins/sequence/color-correction-yuv.c
branches/soc-2010-nicks/release/scripts/io/netrender/__init__.py
branches/soc-2010-nicks/release/scripts/io/netrender/balancing.py
branches/soc-2010-nicks/release/scripts/io/netrender/client.py
branches/soc-2010-nicks/release/scripts/io/netrender/master.py
branches/soc-2010-nicks/release/scripts/io/netrender/master_html.py
branches/soc-2010-nicks/release/scripts/io/netrender/model.py
branches/soc-2010-nicks/release/scripts/io/netrender/netrender.js
branches/soc-2010-nicks/release/scripts/io/netrender/operators.py
branches/soc-2010-nicks/release/scripts/io/netrender/slave.py
branches/soc-2010-nicks/release/scripts/io/netrender/ui.py
branches/soc-2010-nicks/release/scripts/io/netrender/utils.py
branches/soc-2010-nicks/release/scripts/keyingsets/keyingsets_builtins.py
branches/soc-2010-nicks/release/scripts/modules/add_object_utils.py
branches/soc-2010-nicks/release/scripts/modules/animsys_refactor.py
branches/soc-2010-nicks/release/scripts/modules/bpy/__init__.py
branches/soc-2010-nicks/release/scripts/modules/bpy/ops.py
branches/soc-2010-nicks/release/scripts/modules/bpy/path.py
branches/soc-2010-nicks/release/scripts/modules/bpy/utils.py
branches/soc-2010-nicks/release/scripts/modules/bpy_types.py
branches/soc-2010-nicks/release/scripts/modules/console/__init__.py
branches/soc-2010-nicks/release/scripts/modules/console/complete_calltip.py
branches/soc-2010-nicks/release/scripts/modules/console/complete_import.py
branches/soc-2010-nicks/release/scripts/modules/console/complete_namespace.py
branches/soc-2010-nicks/release/scripts/modules/console/intellisense.py
branches/soc-2010-nicks/release/scripts/modules/io_utils.py
branches/soc-2010-nicks/release/scripts/modules/rna_info.py
branches/soc-2010-nicks/release/scripts/modules/rna_prop_ui.py
branches/soc-2010-nicks/release/scripts/op/add_mesh_torus.py
branches/soc-2010-nicks/release/scripts/op/animsys_update.py
branches/soc-2010-nicks/release/scripts/op/console_python.py
branches/soc-2010-nicks/release/scripts/op/fcurve_euler_filter.py
branches/soc-2010-nicks/release/scripts/op/image.py
branches/soc-2010-nicks/release/scripts/op/mesh.py
branches/soc-2010-nicks/release/scripts/op/nla.py
branches/soc-2010-nicks/release/scripts/op/object.py
branches/soc-2010-nicks/release/scripts/op/object_align.py
branches/soc-2010-nicks/release/scripts/op/object_randomize_transform.py
branches/soc-2010-nicks/release/scripts/op/presets.py
branches/soc-2010-nicks/release/scripts/op/screen_play_rendered_anim.py
branches/soc-2010-nicks/release/scripts/op/sequencer.py
branches/soc-2010-nicks/release/scripts/op/uv.py
branches/soc-2010-nicks/release/scripts/op/uvcalc_follow_active.py
branches/soc-2010-nicks/release/scripts/op/uvcalc_smart_project.py
branches/soc-2010-nicks/release/scripts/op/vertexpaint_dirt.py
branches/soc-2010-nicks/release/scripts/op/wm.py
branches/soc-2010-nicks/release/scripts/presets/ffmpeg/DV.py
branches/soc-2010-nicks/release/scripts/presets/ffmpeg/DVD.py
branches/soc-2010-nicks/release/scripts/presets/ffmpeg/SVCD.py
branches/soc-2010-nicks/release/scripts/presets/ffmpeg/VCD.py
branches/soc-2010-nicks/release/scripts/presets/ffmpeg/h264.py
branches/soc-2010-nicks/release/scripts/presets/ffmpeg/theora.py
branches/soc-2010-nicks/release/scripts/presets/ffmpeg/xvid.py
branches/soc-2010-nicks/release/scripts/presets/render/HDV_1080p.py
branches/soc-2010-nicks/release/scripts/presets/sss/apple.py
branches/soc-2010-nicks/release/scripts/presets/sss/chicken.py
branches/soc-2010-nicks/release/scripts/presets/sss/cream.py
branches/soc-2010-nicks/release/scripts/presets/sss/ketchup.py
branches/soc-2010-nicks/release/scripts/presets/sss/marble.py
branches/soc-2010-nicks/release/scripts/presets/sss/potato.py
branches/soc-2010-nicks/release/scripts/presets/sss/skim_milk.py
branches/soc-2010-nicks/release/scripts/presets/sss/skin1.py
branches/soc-2010-nicks/release/scripts/presets/sss/skin2.py
branches/soc-2010-nicks/release/scripts/presets/sss/whole_milk.py
branches/soc-2010-nicks/release/scripts/templates/gamelogic.py
branches/soc-2010-nicks/release/scripts/templates/gamelogic_basic.py
branches/soc-2010-nicks/release/scripts/templates/gamelogic_module.py
branches/soc-2010-nicks/release/scripts/templates/operator_modal.py
branches/soc-2010-nicks/release/scripts/templates/operator_modal_draw.py
branches/soc-2010-nicks/release/scripts/templates/operator_modal_view3d.py
branches/soc-2010-nicks/release/scripts/templates/operator_simple.py
branches/soc-2010-nicks/release/scripts/templates/operator_uv.py
branches/soc-2010-nicks/release/scripts/templates/panel_simple.py
branches/soc-2010-nicks/release/scripts/ui/properties_animviz.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_armature.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_bone.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_camera.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_curve.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_empty.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_lamp.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_lattice.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_mesh.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_metaball.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_modifier.py
branches/soc-2010-nicks/release/scripts/ui/properties_game.py
branches/soc-2010-nicks/release/scripts/ui/properties_material.py
branches/soc-2010-nicks/release/scripts/ui/properties_object.py
branches/soc-2010-nicks/release/scripts/ui/properties_object_constraint.py
branches/soc-2010-nicks/release/scripts/ui/properties_particle.py
branches/soc-2010-nicks/release/scripts/ui/properties_physics_cloth.py
branches/soc-2010-nicks/release/scripts/ui/properties_physics_common.py
branches/soc-2010-nicks/release/scripts/ui/properties_physics_field.py
branches/soc-2010-nicks/release/scripts/ui/properties_physics_fluid.py
branches/soc-2010-nicks/release/scripts/ui/properties_physics_smoke.py
branches/soc-2010-nicks/release/scripts/ui/properties_physics_softbody.py
branches/soc-2010-nicks/release/scripts/ui/properties_render.py
branches/soc-2010-nicks/release/scripts/ui/properties_scene.py
branches/soc-2010-nicks/release/scripts/ui/properties_texture.py
branches/soc-2010-nicks/release/scripts/ui/properties_world.py
branches/soc-2010-nicks/release/scripts/ui/space_console.py
branches/soc-2010-nicks/release/scripts/ui/space_dopesheet.py
branches/soc-2010-nicks/release/scripts/ui/space_filebrowser.py
branches/soc-2010-nicks/release/scripts/ui/space_graph.py
branches/soc-2010-nicks/release/scripts/ui/space_image.py
branches/soc-2010-nicks/release/scripts/ui/space_info.py
branches/soc-2010-nicks/release/scripts/ui/space_logic.py
branches/soc-2010-nicks/release/scripts/ui/space_nla.py
branches/soc-2010-nicks/release/scripts/ui/space_node.py
branches/soc-2010-nicks/release/scripts/ui/space_outliner.py
branches/soc-2010-nicks/release/scripts/ui/space_sequencer.py
branches/soc-2010-nicks/release/scripts/ui/space_text.py
branches/soc-2010-nicks/release/scripts/ui/space_time.py
branches/soc-2010-nicks/release/scripts/ui/space_userpref.py
branches/soc-2010-nicks/release/scripts/ui/space_userpref_keymap.py
branches/soc-2010-nicks/release/scripts/ui/space_view3d.py
branches/soc-2010-nicks/release/scripts/ui/space_view3d_toolbar.py
branches/soc-2010-nicks/release/text/readme.html
branches/soc-2010-nicks/release/windows/installer/00.sconsblender.nsi
Added Paths:
-----------
branches/soc-2010-nicks/release/datafiles/ctodata.py
branches/soc-2010-nicks/release/freedesktop/icons/16x16/blender.svg
branches/soc-2010-nicks/release/freedesktop/icons/22x22/blender.svg
branches/soc-2010-nicks/release/scripts/io/netrender/thumbnail.py
branches/soc-2010-nicks/release/scripts/io/netrender/versioning.py
branches/soc-2010-nicks/release/scripts/modules/image_utils.py
branches/soc-2010-nicks/release/scripts/modules/keyingsets_utils.py
branches/soc-2010-nicks/release/scripts/modules/sys_info.py
branches/soc-2010-nicks/release/scripts/presets/keyconfig/maya.py
branches/soc-2010-nicks/release/scripts/presets/render/HDV_NTSC_1080p.py
branches/soc-2010-nicks/release/scripts/presets/render/HDV_PAL_1080p.py
branches/soc-2010-nicks/release/scripts/templates/addon_add_object.py
branches/soc-2010-nicks/release/scripts/templates/background_job.py
branches/soc-2010-nicks/release/scripts/templates/builtin_keyingset.py
branches/soc-2010-nicks/release/scripts/templates/operator_export.py
branches/soc-2010-nicks/release/scripts/templates/operator_mesh_add.py
Removed Paths:
-------------
branches/soc-2010-nicks/release/Makefile
branches/soc-2010-nicks/release/freedesktop/icons/16x16/blender.xcf.bz2
branches/soc-2010-nicks/release/freedesktop/icons/22x22/blender.xcf.bz2
branches/soc-2010-nicks/release/getversion.py
branches/soc-2010-nicks/release/scripts/keyingsets/keyingsets_utils.py
branches/soc-2010-nicks/release/scripts/modules/rigify/
branches/soc-2010-nicks/release/scripts/modules/rigify_utils.py
branches/soc-2010-nicks/release/scripts/op/add_armature_human.py
branches/soc-2010-nicks/release/scripts/op/io_anim_bvh/
branches/soc-2010-nicks/release/scripts/op/io_mesh_ply/
branches/soc-2010-nicks/release/scripts/op/io_scene_3ds/
branches/soc-2010-nicks/release/scripts/op/io_scene_fbx/
branches/soc-2010-nicks/release/scripts/op/io_scene_obj/
branches/soc-2010-nicks/release/scripts/op/io_scene_x3d/
branches/soc-2010-nicks/release/scripts/op/io_shape_mdd/
branches/soc-2010-nicks/release/scripts/presets/interaction/maya.py
branches/soc-2010-nicks/release/scripts/templates/operator.py
branches/soc-2010-nicks/release/scripts/ui/properties_data_armature_rigify.py
branches/soc-2010-nicks/release/test/
branches/soc-2010-nicks/release/windows/BlenderPlayer/
branches/soc-2010-nicks/release/windows/extra/
branches/soc-2010-nicks/release/windows/specific.sh
Deleted: branches/soc-2010-nicks/release/Makefile
===================================================================
--- branches/soc-2010-nicks/release/Makefile 2011-02-16 16:55:16 UTC (rev 34907)
+++ branches/soc-2010-nicks/release/Makefile 2011-02-16 16:56:11 UTC (rev 34908)
@@ -1,209 +0,0 @@
-# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
-# vim: tabstop=8
-# $Id$
-#
-# ***** 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.
-#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-include nan_definitions.mk
-
-export VERSION := $(shell ./getversion.py)
-
-BLENDNAME=blender-$(VERSION)-$(CONFIG_GUESS)-py$(NAN_PYTHON_VERSION)$(TYPE)
-export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
-export CONFDIR=$(DISTDIR)/.blender
-
-ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
- TAR="tar"
- TARFLAGS="cf"
- EXT0=""
- EXT1=".tar"
- COMPRESS="bzip2"
- COMPRESSFLAGS="-f"
- EXT2=".bz2"
- ifeq ($(OS), solaris)
- ifeq ($(CPU), i386)
- NOPLUGINS?=true
- endif
- endif
- # don"t build plugins on irix if using gcc
- ifeq ($(OS), irix)
- ifeq ($(IRIX_USE_GCC), true)
- NOPLUGINS?=true
- endif
- endif
-endif
-
-ifeq ($(OS),windows)
- TAR="zip"
- TARFLAGS="-r9"
- EXT0=".exe"
- EXT1=".zip"
- NOPLUGINS?=true
- NOSTRIP?=true
-endif
-
-ifeq ($(OS),darwin)
- TAR="tar"
- TARFLAGS="cf"
- EXT0=".app"
- EXT1=".tar"
- COMPRESS="bzip2"
- COMPRESSFLAGS="-f"
- EXT2=".bz2"
-endif
-
-release: all
-
-all:
- @$(MAKE) pkg TYPE=""
-ifeq ($(WITH_BF_STATICOPENGL), true)
- @$(MAKE) pkg TYPE="-static"
-endif
-
-# OS independent targets below:
-
-dist: all
-
-package: version makedirs
-
-install: package
- @#echo "****> Install text"
- @cp text/readme.html $(DISTDIR)
- @cp text/*.txt $(DISTDIR)
- ifeq ($(FREEDESKTOP), true)
- @#echo "****> Install freedesktop icons"
- @mkdir $(DISTDIR)/icons
- @mkdir $(DISTDIR)/icons/16x16
- @cp freedesktop/icons/16x16/blender.png $(DISTDIR)/icons/16x16
- @mkdir $(DISTDIR)/icons/22x22
- @cp freedesktop/icons/22x22/blender.png $(DISTDIR)/icons/22x22
- @mkdir $(DISTDIR)/icons/32x32
- @cp freedesktop/icons/32x32/blender.png $(DISTDIR)/icons/32x32
- @mkdir $(DISTDIR)/icons/scalable
- @cp freedesktop/icons/scalable/blender.svg $(DISTDIR)/icons/scalable
- endif
- @echo "----> Make Config dir .blender"
- @mkdir -p $(CONFDIR)
- @# possible overruling .txt text documents
- @[ ! -d $(CONFIG_GUESS)/text ] || \
- cp -f $(CONFIG_GUESS)/text/*.txt $(DISTDIR)
-#on OS X the contents of the .blender dir is already inside the bundle
- ifneq ($(OS), darwin)
- @[ ! -d $(OCGDIR)/bin/.blender ] || \
- cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
- @cp $(NANBLENDERHOME)/release/bin/.blender/.Blanguages $(CONFDIR)
- @cp $(NANBLENDERHOME)/release/bin/.blender/.bfont.ttf $(CONFDIR)
- endif
- @echo "----> Copy blender$(EXT0) executable"
- ifeq ($(TYPE),-static)
- @cp $(OCGDIR)/bin/blenderstatic$(EXT0) $(DISTDIR)/blender$(EXT0)
- else
- ifeq ($(OS),darwin)
- @cp -r $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/Blender$(EXT0)
- else
- @cp $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/blender$(EXT0)
- endif
- @if [ -f $(OCGDIR)/bin/blenderplayer$(EXTO) ]; then \
- cp $(OCGDIR)/bin/blenderplayer$(EXTO) \
- $(DISTDIR)/blenderplayer$(EXTO) ; \
- fi
- endif
-
-ifneq ($(NOPLUGINS),true)
- @echo "----> Copy and compile plugins"
- @cp -r plugins $(DISTDIR)/plugins
- @mkdir -p $(DISTDIR)/plugins/include
- @cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
- @chmod 755 $(DISTDIR)/plugins/bmake
- @$(MAKE) -C $(DISTDIR)/plugins all > /dev/null || exit 1;
- @rm -f $(DISTDIR)/plugins/*/*.o
-
-#on OS X the plugins move to the installation directory
- ifneq ($(OS),darwin)
- @mkdir -p $(CONFDIR)/plugins/sequence
- @mkdir -p $(CONFDIR)/plugins/texture
- @mv $(DISTDIR)/plugins/sequence/*.so $(CONFDIR)/plugins/sequence
- @mv $(DISTDIR)/plugins/texture/*.so $(CONFDIR)/plugins/texture
- endif
-endif
-
- @echo "----> Copy python infrastructure"
- @[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
-
- ifeq ($(OS),darwin)
- @echo "----> Copy python modules"
- @mkdir $(CONFDIR)/python/
- @unzip -q $(LCGDIR)/release/python.zip -d $(CONFDIR)/python/
- endif
-
- ifeq ($(OS),darwin)
- @echo "----> Move .blender to .app/Contents/MacOS/"
- @rm -fr $(DISTDIR)/blender$(EXT0)/Contents/MacOS/.blender
- @mv $(DISTDIR)/.blender $(DISTDIR)/blender$(EXT0)/Contents/MacOS/
- endif
-
- ifneq ($(NOSTRIP),true)
- @echo "----> Strip blender executable"
- ifeq ($(OS),darwin)
- @strip -x $(DISTDIR)/blender$(EXT0)/Contents/MacOS/blender
- else
- @strip -x $(DISTDIR)/blender$(EXT0)
- @if [ -f $(DISTDIR)/blenderplayer$(EXTO) ]; then \
- strip -x $(DISTDIR)/blenderplayer$(EXT0) ; \
- fi
- endif
- endif
- @[ ! -x $(CONFIG_GUESS)/specific.sh ] || (\
- echo "**--> Execute specific.sh in $(CONFIG_GUESS)/" && \
- cd $(CONFIG_GUESS) && ./specific.sh )
- @echo "----> Cleaning .svn metadata directories"
- @find $(DISTDIR) -type d -name ".svn" | xargs rm -fr
-
-pkg: install
- @echo "----> Create distribution file $(BLENDNAME)$(EXT1)"
- @#enable the next sleep if you get 'tar file changed while reading'
- @#sleep 10
- rm -f $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)*
- @cd $(NAN_OBJDIR) && $(TAR) $(TARFLAGS) $(VERSION)/$(BLENDNAME)$(EXT1) $(BLENDNAME)
- ifdef COMPRESS
- @echo "----> Compressing distribution to $(BLENDNAME)$(EXT1)$(EXT2)"
- @$(COMPRESS) $(COMPRESSFLAGS) $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)
- endif
- @#echo "****> Clean up temporary distribution directory"
- @#rm -fr $(DISTDIR)
- @echo "****> $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)$(EXT2) is ready"
-
-version: FORCE
- @echo "*---> Create $(BLENDNAME) package"
-
-makedirs: FORCE
- @echo "****> Create package directory $(VERSION) if necessary"
- @[ -d $(NAN_OBJDIR)/$(VERSION) ] || mkdir $(NAN_OBJDIR)/$(VERSION)
- @echo "****> Remove and recreate temporary distribution directory"
- @rm -fr $(DISTDIR)
- @mkdir $(DISTDIR)
-
-FORCE:
Modified: branches/soc-2010-nicks/release/VERSION
===================================================================
--- branches/soc-2010-nicks/release/VERSION 2011-02-16 16:55:16 UTC (rev 34907)
+++ branches/soc-2010-nicks/release/VERSION 2011-02-16 16:56:11 UTC (rev 34908)
@@ -1 +1 @@
-2.54-beta
+2.56a-beta
Modified: branches/soc-2010-nicks/release/bin/blender-thumbnailer.py
===================================================================
--- branches/soc-2010-nicks/release/bin/blender-thumbnailer.py 2011-02-16 16:55:16 UTC (rev 34907)
+++ branches/soc-2010-nicks/release/bin/blender-thumbnailer.py 2011-02-16 16:56:11 UTC (rev 34908)
@@ -18,40 +18,65 @@
#
# ##### END GPL LICENSE BLOCK #####
+# <pep8 compliant>
+
"""
Thumbnailer runs with python 2.6 and 3.x.
To run automatically with nautilus:
gconftool --type boolean --set /desktop/gnome/thumbnailers/application at x-blender/enable true
- gconftool --type string --set /desktop/gnome/thumbnailers/application at x-blender/command "blender-thumbnailer.py %i %o"
+ gconftool --type string --set /desktop/gnome/thumbnailers/application at x-blender/command "blender-thumbnailer.py %u %o"
"""
import struct
+
+def open_wrapper_get():
+ """ wrap OS spesific read functionality here, fallback to 'open()'
+ """
+
+ def open_gio(path, mode):
+ g_file = gio.File(path).read()
+ g_file.orig_seek = g_file.seek
+
+ def new_seek(offset, whence=0):
+ return g_file.orig_seek(offset, [1, 0, 2][whence])
+
+ g_file.seek = new_seek
+ return g_file
+
+ try:
+ import gio
+ return open_gio
+ except ImportError:
+ return open
+
+
def blend_extract_thumb(path):
import os
+ open_wrapper = open_wrapper_get()
# 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')
+ REND = 1145980242 # MAKE_ID(b'REND')
+ TEST = 1414743380 # MAKE_ID(b'TEST')
- blendfile = open(path, 'rb')
+ blendfile = open_wrapper(path, 'rb')
head = blendfile.read(12)
- if head[0:2] == b'\x1f\x8b': # gzip magic
+ if head[0:2] == b'\x1f\x8b': # gzip magic
import gzip
blendfile.close()
- blendfile = gzip.open(path, 'rb')
+ blendfile = gzip.GzipFile('', 'rb', 0, open_wrapper(path, 'rb'))
head = blendfile.read(12)
if not head.startswith(b'BLENDER'):
blendfile.close()
return None, 0, 0
- is_64_bit = (head[7] == b'-')
+ is_64_bit = (head[7] == b'-'[0])
# true for PPC, false for X86
- is_big_endian = (head[8] == b'V')
+ is_big_endian = (head[8] == b'V'[0])
# blender pre 2.5 had no thumbs
if head[9:11] <= b'24':
@@ -66,23 +91,22 @@
if len(bhead) < sizeof_bhead:
return None, 0, 0
- code, length = struct.unpack(int_endian_pair, bhead[0:8]) # 8 == sizeof(int) * 2
+ 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
+ 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
+ length -= 8 # sizeof(int) * 2
if length != x * y * 4:
return None, 0, 0
@@ -116,13 +140,13 @@
if __name__ == '__main__':
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list