svn merge -r 31314:31370 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorJoerg Mueller <nexyon@gmail.com>
Mon, 16 Aug 2010 09:37:08 +0000 (09:37 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Mon, 16 Aug 2010 09:37:08 +0000 (09:37 +0000)
229 files changed:
build_files/scons/config/freebsd7-config.py [new file with mode: 0644]
build_files/scons/config/freebsd8-config.py [new file with mode: 0644]
build_files/scons/config/freebsd9-config.py [new file with mode: 0644]
intern/ghost/SConscript
projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
projectfiles_vc9/blender/editors/ED_editors.vcproj
projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
release/scripts/io/export_obj.py
release/scripts/io/import_scene_obj.py
release/scripts/io/netrender/client.py
release/scripts/io/netrender/master.py
release/scripts/io/netrender/operators.py
release/scripts/io/netrender/slave.py
release/scripts/io/netrender/utils.py
release/scripts/ui/properties_world.py
release/scripts/ui/space_image.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_userpref_keymap.py
source/blender/avi/intern/avi.c
source/blender/avi/intern/avi_intern.h
source/blender/blenfont/intern/blf_lang.c
source/blender/blenkernel/BKE_pointcache.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/BME_Customdata.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/booleanops_mesh.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fluidsim.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/sketch.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/world.c
source/blender/blenkernel/intern/writeframeserver.c
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/math_vector.c
source/blender/blenlib/intern/pbvh.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_generate.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/armature/poseUtils.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/editaction_gpencil.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_transform.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_preview.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_api/space.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/writeimage.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_graph/graph_utils.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_header.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_logic/logic_buttons.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_nla/nla_ops.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_buttons.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/script_edit.c
source/blender/editors/space_script/script_header.c
source/blender/editors/space_script/script_ops.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_header.c
source/blender/editors/space_time/time_ops.c
source/blender/editors/space_userpref/space_userpref.c
source/blender/editors/space_view3d/drawanimviz.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/ikplugin/intern/ikplugin_api.c
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/anim.c
source/blender/imbuf/intern/cache.c
source/blender/imbuf/intern/filter.c
source/blender/imbuf/intern/imbuf.h
source/blender/imbuf/intern/iris.c
source/blender/imbuf/intern/jp2.c
source/blender/imbuf/intern/png.c
source/blender/imbuf/intern/rotate.c
source/blender/imbuf/intern/scaling.c
source/blender/imbuf/intern/targa.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_material_api.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_vfont.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/rna_cleanup/rna_cleaner.py
source/blender/makesrna/rna_cleanup/rna_properties.txt
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_particleinstance.c
source/blender/modifiers/intern/MOD_shrinkwrap.c
source/blender/modifiers/intern/MOD_util.c
source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c
source/blender/python/generic/bgl.c
source/blender/python/generic/blf_api.c
source/blender/python/generic/bpy_internal_import.c
source/blender/python/generic/geometry.c
source/blender/python/generic/mathutils.c
source/blender/python/generic/noise.c
source/blender/python/intern/bpy.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_util.c
source/blender/python/intern/bpy_util.h
source/blender/render/intern/raytrace/bvh.h
source/blender/render/intern/raytrace/rayobject_qbvh.cpp
source/blender/render/intern/raytrace/rayobject_svbvh.cpp
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_dragdrop.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c
source/gameengine/Converter/BL_ArmatureObject.cpp

diff --git a/build_files/scons/config/freebsd7-config.py b/build_files/scons/config/freebsd7-config.py
new file mode 100644 (file)
index 0000000..7d66a69
--- /dev/null
@@ -0,0 +1,213 @@
+CC = 'gcc44'
+CXX = 'g++44'
+
+LCGDIR = '../lib/freebsd7'
+LIBDIR = "${LCGDIR}"
+
+BF_PYTHON = '/usr/local'
+BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
+BF_PYTHON_VERSION = '3.1'
+WITH_BF_STATICPYTHON = False
+BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
+BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION}.a'
+
+WITH_BF_OPENAL = True
+WITH_BF_STATICOPENAL = False
+BF_OPENAL = '/usr/local'
+BF_OPENAL_INC = '${BF_OPENAL}/include'
+BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
+BF_CXX = '/usr/local'
+WITH_BF_STATICCXX = False
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
+BF_LIBSAMPLERATE = '/usr/local'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
+WITH_BF_JACK = True
+BF_JACK = '/usr/local'
+BF_JACK_INC = '${BF_JACK}/include/jack'
+BF_JACK_LIB = 'jack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = True
+BF_SNDFILE = '/usr/local'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
+BF_SNDFILE_LIB = 'sndfile'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
+
+WITH_BF_SDL = True
+BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
+BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+
+WITH_BF_OPENEXR = True
+WITH_BF_STATICOPENEXR = False
+BF_OPENEXR = '/usr/local'
+# when compiling with your own openexr lib you might need to set...
+# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
+
+BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
+BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
+# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+
+
+WITH_BF_DDS = True
+
+WITH_BF_JPEG = True
+BF_JPEG = '/usr/local'
+BF_JPEG_INC = '${BF_JPEG}/include'
+BF_JPEG_LIB = 'jpeg'
+
+WITH_BF_PNG = True
+BF_PNG = '/usr/local'
+BF_PNG_INC = '${BF_PNG}/include'
+BF_PNG_LIB = 'png'
+
+WITH_BF_TIFF = True
+BF_TIFF = '/usr/local'
+BF_TIFF_INC = '${BF_TIFF}/include'
+BF_TIFF_LIB = 'tiff'
+
+WITH_BF_ZLIB = True
+BF_ZLIB = '/usr'
+BF_ZLIB_INC = '${BF_ZLIB}/include'
+BF_ZLIB_LIB = 'z'
+
+WITH_BF_INTERNATIONAL = True
+
+BF_GETTEXT = '/usr/local'
+BF_GETTEXT_INC = '${BF_GETTEXT}/include'
+BF_GETTEXT_LIB = 'gettextlib'
+BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
+
+WITH_BF_GAMEENGINE = True
+WITH_BF_PLAYER = True
+
+WITH_BF_BULLET = True
+BF_BULLET = '#extern/bullet2/src'
+BF_BULLET_INC = '${BF_BULLET}'
+BF_BULLET_LIB = 'extern_bullet'
+
+# enable freetype2 support for text objects
+BF_FREETYPE = '/usr/local'
+BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
+BF_FREETYPE_LIB = 'freetype'
+
+WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
+BF_QUICKTIME = '/usr/local'
+BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
+
+WITH_BF_ICONV = True
+BF_ICONV = LIBDIR + "/iconv"
+BF_ICONV_INC = '${BF_ICONV}/include'
+BF_ICONV_LIB = 'iconv'
+BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
+
+WITH_BF_BINRELOC = True
+
+# enable ffmpeg  support
+WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
+BF_FFMPEG = '/usr/local'
+BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
+BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
+
+# enable ogg, vorbis and theora in ffmpeg
+WITH_BF_OGG = True  # -DWITH_OGG 
+BF_OGG = '/usr/local'
+BF_OGG_INC = '${BF_OGG}/include'
+BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
+
+WITH_BF_OPENJPEG = True
+BF_OPENJPEG = '#extern/libopenjpeg'
+BF_OPENJPEG_LIB = ''
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
+BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+
+WITH_BF_FFTW3 = True
+BF_FFTW3 = LIBDIR + '/usr/local'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'fftw3'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
+WITH_BF_REDCODE = True  
+BF_REDCODE = '#extern/libredcode'
+BF_REDCODE_LIB = ''
+# BF_REDCODE_INC = '${BF_REDCODE}/include'
+BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
+BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_STATICOPENGL = False
+BF_OPENGL = '/usr/local'
+BF_OPENGL_INC = '${BF_OPENGL}/include'
+BF_OPENGL_LIB = 'GL GLU X11 Xi'
+BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
+BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
+
+WITH_BF_COLLADA = False
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+BF_OPENCOLLADA = '/usr'
+BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
+BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
+BF_PCRE = '/usr/local'
+BF_PCRE_LIB = 'pcre'
+BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
+BF_EXPAT = '/usr/local'
+BF_EXPAT_LIB = 'expat'
+BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
+
+WITH_BF_OPENMP = True
+
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = True
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
+
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+
+CPPFLAGS = []
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+if WITH_BF_FFMPEG:
+  # libavutil needs UINT64_C()
+  CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
+REL_CFLAGS = ['-O2']
+REL_CCFLAGS = ['-O2']
+##BF_DEPEND = True
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
+CC_WARN = ['-Wall']
+CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
+
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_PROFILE = False
+BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_LINKFLAGS = ['-pg']
+
+BF_DEBUG = False
+BF_DEBUG_CCFLAGS = ['-g']
+
+BF_BUILDDIR = '../build/freebsd7'
+BF_INSTALLDIR='../install/freebsd7'
+
+#Link against pthread
+PLATFORM_LINKFLAGS = ['-pthread']
diff --git a/build_files/scons/config/freebsd8-config.py b/build_files/scons/config/freebsd8-config.py
new file mode 100644 (file)
index 0000000..c0df29d
--- /dev/null
@@ -0,0 +1,213 @@
+CC = 'gcc44'
+CXX = 'g++44'
+
+LCGDIR = '../lib/freebsd8'
+LIBDIR = "${LCGDIR}"
+
+BF_PYTHON = '/usr/local'
+BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
+BF_PYTHON_VERSION = '3.1'
+WITH_BF_STATICPYTHON = False
+BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
+BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION}.a'
+
+WITH_BF_OPENAL = True
+WITH_BF_STATICOPENAL = False
+BF_OPENAL = '/usr/local'
+BF_OPENAL_INC = '${BF_OPENAL}/include'
+BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
+BF_CXX = '/usr/local'
+WITH_BF_STATICCXX = False
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
+BF_LIBSAMPLERATE = '/usr/local'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
+WITH_BF_JACK = True
+BF_JACK = '/usr/local'
+BF_JACK_INC = '${BF_JACK}/include/jack'
+BF_JACK_LIB = 'jack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = True
+BF_SNDFILE = '/usr/local'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
+BF_SNDFILE_LIB = 'sndfile'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
+
+WITH_BF_SDL = True
+BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
+BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+
+WITH_BF_OPENEXR = True
+WITH_BF_STATICOPENEXR = False
+BF_OPENEXR = '/usr/local'
+# when compiling with your own openexr lib you might need to set...
+# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
+
+BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
+BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
+# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+
+
+WITH_BF_DDS = True
+
+WITH_BF_JPEG = True
+BF_JPEG = '/usr/local'
+BF_JPEG_INC = '${BF_JPEG}/include'
+BF_JPEG_LIB = 'jpeg'
+
+WITH_BF_PNG = True
+BF_PNG = '/usr/local'
+BF_PNG_INC = '${BF_PNG}/include'
+BF_PNG_LIB = 'png'
+
+WITH_BF_TIFF = True
+BF_TIFF = '/usr/local'
+BF_TIFF_INC = '${BF_TIFF}/include'
+BF_TIFF_LIB = 'tiff'
+
+WITH_BF_ZLIB = True
+BF_ZLIB = '/usr'
+BF_ZLIB_INC = '${BF_ZLIB}/include'
+BF_ZLIB_LIB = 'z'
+
+WITH_BF_INTERNATIONAL = True
+
+BF_GETTEXT = '/usr/local'
+BF_GETTEXT_INC = '${BF_GETTEXT}/include'
+BF_GETTEXT_LIB = 'gettextlib'
+BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
+
+WITH_BF_GAMEENGINE = True
+WITH_BF_PLAYER = True
+
+WITH_BF_BULLET = True
+BF_BULLET = '#extern/bullet2/src'
+BF_BULLET_INC = '${BF_BULLET}'
+BF_BULLET_LIB = 'extern_bullet'
+
+# enable freetype2 support for text objects
+BF_FREETYPE = '/usr/local'
+BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
+BF_FREETYPE_LIB = 'freetype'
+
+WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
+BF_QUICKTIME = '/usr/local'
+BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
+
+WITH_BF_ICONV = True
+BF_ICONV = LIBDIR + "/iconv"
+BF_ICONV_INC = '${BF_ICONV}/include'
+BF_ICONV_LIB = 'iconv'
+BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
+
+WITH_BF_BINRELOC = True
+
+# enable ffmpeg  support
+WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
+BF_FFMPEG = '/usr/local'
+BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
+BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
+
+# enable ogg, vorbis and theora in ffmpeg
+WITH_BF_OGG = True  # -DWITH_OGG 
+BF_OGG = '/usr/local'
+BF_OGG_INC = '${BF_OGG}/include'
+BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
+
+WITH_BF_OPENJPEG = True
+BF_OPENJPEG = '#extern/libopenjpeg'
+BF_OPENJPEG_LIB = ''
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
+BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+
+WITH_BF_FFTW3 = True
+BF_FFTW3 = LIBDIR + '/usr/local'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'fftw3'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
+WITH_BF_REDCODE = True  
+BF_REDCODE = '#extern/libredcode'
+BF_REDCODE_LIB = ''
+# BF_REDCODE_INC = '${BF_REDCODE}/include'
+BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
+BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_STATICOPENGL = False
+BF_OPENGL = '/usr/local'
+BF_OPENGL_INC = '${BF_OPENGL}/include'
+BF_OPENGL_LIB = 'GL GLU X11 Xi'
+BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
+BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
+
+WITH_BF_COLLADA = False
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+BF_OPENCOLLADA = '/usr'
+BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
+BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
+BF_PCRE = '/usr/local'
+BF_PCRE_LIB = 'pcre'
+BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
+BF_EXPAT = '/usr/local'
+BF_EXPAT_LIB = 'expat'
+BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
+
+WITH_BF_OPENMP = True
+
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = True
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
+
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+
+CPPFLAGS = []
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+if WITH_BF_FFMPEG:
+  # libavutil needs UINT64_C()
+  CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
+REL_CFLAGS = ['-O2']
+REL_CCFLAGS = ['-O2']
+##BF_DEPEND = True
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
+CC_WARN = ['-Wall']
+CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
+
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_PROFILE = False
+BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_LINKFLAGS = ['-pg']
+
+BF_DEBUG = False
+BF_DEBUG_CCFLAGS = ['-g']
+
+BF_BUILDDIR = '../build/freebsd8'
+BF_INSTALLDIR='../install/freebsd8'
+
+#Link against pthread
+PLATFORM_LINKFLAGS = ['-pthread']
diff --git a/build_files/scons/config/freebsd9-config.py b/build_files/scons/config/freebsd9-config.py
new file mode 100644 (file)
index 0000000..c344046
--- /dev/null
@@ -0,0 +1,213 @@
+CC = 'gcc44'
+CXX = 'g++44'
+
+LCGDIR = '../lib/freebsd9'
+LIBDIR = "${LCGDIR}"
+
+BF_PYTHON = '/usr/local'
+BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
+BF_PYTHON_VERSION = '3.1'
+WITH_BF_STATICPYTHON = False
+BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
+BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION}.a'
+
+WITH_BF_OPENAL = True
+WITH_BF_STATICOPENAL = False
+BF_OPENAL = '/usr/local'
+BF_OPENAL_INC = '${BF_OPENAL}/include'
+BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
+BF_CXX = '/usr/local'
+WITH_BF_STATICCXX = False
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
+BF_LIBSAMPLERATE = '/usr/local'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
+WITH_BF_JACK = True
+BF_JACK = '/usr/local'
+BF_JACK_INC = '${BF_JACK}/include/jack'
+BF_JACK_LIB = 'jack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = True
+BF_SNDFILE = '/usr/local'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
+BF_SNDFILE_LIB = 'sndfile'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
+
+WITH_BF_SDL = True
+BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
+BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+
+WITH_BF_OPENEXR = True
+WITH_BF_STATICOPENEXR = False
+BF_OPENEXR = '/usr/local'
+# when compiling with your own openexr lib you might need to set...
+# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
+
+BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
+BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
+# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+
+
+WITH_BF_DDS = True
+
+WITH_BF_JPEG = True
+BF_JPEG = '/usr/local'
+BF_JPEG_INC = '${BF_JPEG}/include'
+BF_JPEG_LIB = 'jpeg'
+
+WITH_BF_PNG = True
+BF_PNG = '/usr/local'
+BF_PNG_INC = '${BF_PNG}/include'
+BF_PNG_LIB = 'png'
+
+WITH_BF_TIFF = True
+BF_TIFF = '/usr/local'
+BF_TIFF_INC = '${BF_TIFF}/include'
+BF_TIFF_LIB = 'tiff'
+
+WITH_BF_ZLIB = True
+BF_ZLIB = '/usr'
+BF_ZLIB_INC = '${BF_ZLIB}/include'
+BF_ZLIB_LIB = 'z'
+
+WITH_BF_INTERNATIONAL = True
+
+BF_GETTEXT = '/usr/local'
+BF_GETTEXT_INC = '${BF_GETTEXT}/include'
+BF_GETTEXT_LIB = 'gettextlib'
+BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
+
+WITH_BF_GAMEENGINE = True
+WITH_BF_PLAYER = True
+
+WITH_BF_BULLET = True
+BF_BULLET = '#extern/bullet2/src'
+BF_BULLET_INC = '${BF_BULLET}'
+BF_BULLET_LIB = 'extern_bullet'
+
+# enable freetype2 support for text objects
+BF_FREETYPE = '/usr/local'
+BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
+BF_FREETYPE_LIB = 'freetype'
+
+WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
+BF_QUICKTIME = '/usr/local'
+BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
+
+WITH_BF_ICONV = True
+BF_ICONV = LIBDIR + "/iconv"
+BF_ICONV_INC = '${BF_ICONV}/include'
+BF_ICONV_LIB = 'iconv'
+BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
+
+WITH_BF_BINRELOC = True
+
+# enable ffmpeg  support
+WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
+BF_FFMPEG = '/usr/local'
+BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
+BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
+
+# enable ogg, vorbis and theora in ffmpeg
+WITH_BF_OGG = True  # -DWITH_OGG 
+BF_OGG = '/usr/local'
+BF_OGG_INC = '${BF_OGG}/include'
+BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
+
+WITH_BF_OPENJPEG = True
+BF_OPENJPEG = '#extern/libopenjpeg'
+BF_OPENJPEG_LIB = ''
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
+BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+
+WITH_BF_FFTW3 = True
+BF_FFTW3 = LIBDIR + '/usr/local'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'fftw3'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
+WITH_BF_REDCODE = True  
+BF_REDCODE = '#extern/libredcode'
+BF_REDCODE_LIB = ''
+# BF_REDCODE_INC = '${BF_REDCODE}/include'
+BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
+BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_STATICOPENGL = False
+BF_OPENGL = '/usr/local'
+BF_OPENGL_INC = '${BF_OPENGL}/include'
+BF_OPENGL_LIB = 'GL GLU X11 Xi'
+BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
+BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
+
+WITH_BF_COLLADA = False
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+BF_OPENCOLLADA = '/usr'
+BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
+BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
+BF_PCRE = '/usr/local'
+BF_PCRE_LIB = 'pcre'
+BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
+BF_EXPAT = '/usr/local'
+BF_EXPAT_LIB = 'expat'
+BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
+
+WITH_BF_OPENMP = True
+
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = True
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
+
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+
+CPPFLAGS = []
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+if WITH_BF_FFMPEG:
+  # libavutil needs UINT64_C()
+  CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
+REL_CFLAGS = ['-O2']
+REL_CCFLAGS = ['-O2']
+##BF_DEPEND = True
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
+CC_WARN = ['-Wall']
+CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
+
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_PROFILE = False
+BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_LINKFLAGS = ['-pg']
+
+BF_DEBUG = False
+BF_DEBUG_CCFLAGS = ['-g']
+
+BF_BUILDDIR = '../build/freebsd9'
+BF_INSTALLDIR='../install/freebsd9'
+
+#Link against pthread
+PLATFORM_LINKFLAGS = ['-pthread']
index 65c00b163731d9dcc3cc5f145569e30673775eb6..9ecd61857cef66e7a0ede99b0307ec9f9d85c2f4 100644 (file)
@@ -14,7 +14,7 @@ if window_system == 'darwin':
 pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_Window', 'GHOST_DropTarget']
 defs=['_USE_MATH_DEFINES']
 
-if window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd6', 'irix6', 'aix4', 'aix5'):
+if window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'irix6', 'aix4', 'aix5'):
        for f in pf:
                try:
                        sources.remove('intern' + os.sep + f + 'Win32.cpp')
@@ -60,4 +60,4 @@ if env['BF_GHOST_DEBUG']:
 incs = '. ../string #extern/glew/include #source/blender/imbuf #source/blender/makesdna ' + env['BF_OPENGL_INC']
 if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
        incs = env['BF_WINTAB_INC'] + ' ' + incs
-env.BlenderLib ('bf_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] ) 
+env.BlenderLib ('bf_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] ) 
\ No newline at end of file
index 5271b7ffe3544d1d8566a930eb81689d3774fc40..7b7daa7022d6b6ea879e9f8d117d650989b682f3 100644 (file)
                                        RelativePath="..\..\..\source\blender\python\generic\mathutils_vector.c"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\..\..\source\blender\python\generic\noise.c"\r
+                                       >\r
+                               </File>\r
                        </Filter>\r
                </Filter>\r
                <Filter\r
                                        RelativePath="..\..\..\source\blender\python\intern\bpy_rna.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\..\..\source\blender\python\intern\bpy_rna_callback.h"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\..\..\source\blender\python\intern\bpy_util.h"\r
                                        >\r
index f1b92cde83709b9b5fc55e56ce246b7b7976165f..ba24f2185ab00f5500cd8849d9d4ebad45be291d 100644 (file)
                                RelativePath="..\..\..\source\blender\blenkernel\intern\icons.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\blenkernel\intern\idcode.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\blenkernel\intern\idprop.c"\r
                                >\r
                                RelativePath="..\..\..\source\blender\blenkernel\intern\script.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\blenkernel\intern\seqcache.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\blenkernel\intern\seqeffects.c"\r
                                >\r
                                RelativePath="..\..\..\source\blender\blenkernel\BKE_global.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\blenkernel\BKE_gpencil.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\blenkernel\BKE_group.h"\r
                                >\r
                                RelativePath="..\..\..\source\blender\blenkernel\BKE_icons.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\blenkernel\BKE_idcode.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\blenkernel\BKE_idprop.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\blenkernel\BKE_image.h"\r
                                >\r
                                RelativePath="..\..\..\source\blender\blenkernel\depsgraph_private.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\source\blender\blenkernel\Makefile"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\blenkernel\nla_private.h"\r
                                >\r
index cda69b46f5edd4b870ca5cad353caaab5254a659..12cb98c0a2ad1094e6503b1288d1ddb69f21c265 100644 (file)
                        Name="datafiles"\r
                        Filter="c"\r
                        >\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\add.png.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\Bfont.c"\r
                                >\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\blenderbuttons.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\blob.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\blur.png.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\bmonofont.ttf.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\clay.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\clone.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\crease.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\darken.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\draw.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\fill.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\flatten.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\grab.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\inflate.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\layer.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\lighten.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\mix.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\multiply.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\nudge.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\pinch.png.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\preview.blend.c"\r
                                >\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\prvicons.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\scrape.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\smear.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\smooth.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\snake_hook.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\soften.png.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\splash.png.c"\r
                                >\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\startup.blend.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\subtract.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\texdraw.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\thumb.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\twist.png.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\vertexdraw.png.c"\r
+                               >\r
+                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="interface"\r
                                RelativePath="..\..\..\source\blender\editors\space_logic\logic_buttons.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\source\blender\editors\space_logic\logic_header.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\space_logic\logic_intern.h"\r
                                >\r
index 185410f16c9d9752708d2b92a7966a1cd63dcf52..74f798973d472ebbdbb9b9e47c7c26da165764b6 100644 (file)
@@ -45,7 +45,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
                                PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                InlineFunctionExpansion="1"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
                                PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE;GAMEBLENDER=1;WITH_SDL;WITH_OPENAL;WITH_JACK"\r
                                StringPooling="true"\r
                                RuntimeLibrary="0"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                InlineFunctionExpansion="1"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
                                PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"\r
                                StringPooling="true"\r
                                RuntimeLibrary="2"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
                                PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;GAMEBLENDER=1;WITH_SDL;WITH_OPENAL;WITH_JACK"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
                                PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE;GAMEBLENDER=1;WITH_SDL;WITH_OPENAL;WITH_JACK"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                InlineFunctionExpansion="1"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesrna\internal"\r
                                PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE;GAMEBLENDER=1;WITH_SDL;WITH_OPENAL;WITH_JACK"\r
                                StringPooling="true"\r
                                RuntimeLibrary="0"\r
index 4fb2e780853f3a0e5067d378c45c9075babfc797..1fe05a11aec48c0eae449d7c71cc6f5a19e6ebed 100644 (file)
@@ -43,7 +43,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;GAMEBLENDER=1"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
+                               AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;GAMEBLENDER=1"\r
                                MinimalRebuild="true"\r
                                RuntimeLibrary="0"\r
index a25daedf1bb28b04974f08f52d76e2d136e6971e..3a551c9aa7eea6558bdd8cca50a412c989d5e242 100644 (file)
@@ -42,16 +42,6 @@ import shutil
 import bpy
 import mathutils
 
-
-# Returns a tuple - path,extension.
-# 'hello.obj' >  ('hello', '.obj')
-def splitExt(path):
-    dotidx = path.rfind('.')
-    if dotidx == -1:
-        return path, ''
-    else:
-        return path[:dotidx], path[dotidx:]
-
 def fixName(name):
     if name == None:
         return 'None'
@@ -428,9 +418,12 @@ def write_file(filepath, objects, scene,
 
             if EXPORT_UV:
                 faceuv = len(me.uv_textures) > 0
+                uv_layer = me.active_uv_texture.data[:]
             else:
                 faceuv = False
 
+            me_verts = me.verts[:]
+
             # XXX - todo, find a better way to do triangulation
             # ...removed convert_to_triface because it relies on editmesh
             '''
@@ -503,10 +496,7 @@ def write_file(filepath, objects, scene,
             if EXPORT_KEEP_VERT_ORDER:
                 pass
             elif faceuv:
-                # XXX update
-                tface = me.active_uv_texture.data
-
-                face_index_pairs.sort(key=lambda a: (a[0].material_index, hash(tface[a[1]].image), a[0].smooth))
+                face_index_pairs.sort(key=lambda a: (a[0].material_index, hash(uv_layer[a[1]].image), a[0].smooth))
             elif len(materials) > 1:
                 face_index_pairs.sort(key = lambda a: (a[0].material_index, a[0].smooth))
             else:
@@ -525,8 +515,6 @@ def write_file(filepath, objects, scene,
 #               try:    faces.sort(key = lambda a: a.smooth)
 #               except: faces.sort(lambda a,b: cmp(a.smooth, b.smooth))
 
-            faces = [pair[0] for pair in face_index_pairs]
-
             # Set the default mat to no material and no image.
             contextMat = (0, 0) # Can never be this, so we will label a new material teh first chance we get.
             contextSmooth = None # Will either be true or false,  set bad to force initialization switch.
@@ -546,28 +534,17 @@ def write_file(filepath, objects, scene,
 
 
             # Vert
-            for v in me.verts:
+            for v in me_verts:
                 file.write('v %.6f %.6f %.6f\n' % tuple(v.co))
 
             # UV
             if faceuv:
-                uv_face_mapping = [[0,0,0,0] for f in faces] # a bit of a waste for tri's :/
+                uv_face_mapping = [[0,0,0,0] for i in range(len(face_index_pairs))] # a bit of a waste for tri's :/
 
                 uv_dict = {} # could use a set() here
-                uv_layer = me.active_uv_texture
+                uv_layer = me.active_uv_texture.data
                 for f, f_index in face_index_pairs:
-
-                    tface = uv_layer.data[f_index]
-
-                    # workaround, since tface.uv iteration is wrong atm
-                    uvs = tface.uv
-                    # uvs = [tface.uv1, tface.uv2, tface.uv3]
-
-                    # # add another UV if it's a quad
-                    # if len(f.verts) == 4:
-                    #   uvs.append(tface.uv4)
-
-                    for uv_index, uv in enumerate(uvs):
+                    for uv_index, uv in enumerate(uv_layer[f_index].uv):
                         uvkey = veckey2d(uv)
                         try:
                             uv_face_mapping[f_index][uv_index] = uv_dict[uvkey]
@@ -575,27 +552,16 @@ def write_file(filepath, objects, scene,
                             uv_face_mapping[f_index][uv_index] = uv_dict[uvkey] = len(uv_dict)
                             file.write('vt %.6f %.6f\n' % tuple(uv))
 
-#               uv_dict = {} # could use a set() here
-#               for f_index, f in enumerate(faces):
-
-#                   for uv_index, uv in enumerate(f.uv):
-#                       uvkey = veckey2d(uv)
-#                       try:
-#                           uv_face_mapping[f_index][uv_index] = uv_dict[uvkey]
-#                       except:
-#                           uv_face_mapping[f_index][uv_index] = uv_dict[uvkey] = len(uv_dict)
-#                           file.write('vt %.6f %.6f\n' % tuple(uv))
-
                 uv_unique_count = len(uv_dict)
 #               del uv, uvkey, uv_dict, f_index, uv_index
                 # Only need uv_unique_count and uv_face_mapping
 
             # NORMAL, Smooth/Non smoothed.
             if EXPORT_NORMALS:
-                for f in faces:
+                for f, f_index in face_index_pairs:
                     if f.smooth:
-                        for vIdx in f.verts:
-                            v = me.verts[vIdx]
+                        for v_idx in f.verts:
+                            v = me_verts[v_idx]
                             noKey = veckey3d(v.normal)
                             if noKey not in globalNormals:
                                 globalNormals[noKey] = totno
@@ -619,16 +585,16 @@ def write_file(filepath, objects, scene,
 
                 currentVGroup = ''
                 # Create a dictionary keyed by face id and listing, for each vertex, the vertex groups it belongs to
-                vgroupsMap = [[] for _i in range(len(me.verts))]
-#               vgroupsMap = [[] for _i in xrange(len(me.verts))]
+                vgroupsMap = [[] for _i in range(len(me_verts))]
+#               vgroupsMap = [[] for _i in xrange(len(me_verts))]
                 for g in ob.vertex_groups:
 #               for vertexGroupName in vertGroupNames:
-                    for vIdx, vWeight in getVertsFromGroup(me, g.index):
-#                   for vIdx, vWeight in me.getVertsFromGroup(vertexGroupName, 1):
-                        vgroupsMap[vIdx].append((g.name, vWeight))
+                    for v_idx, vWeight in getVertsFromGroup(me, g.index):
+#                   for v_idx, vWeight in me.getVertsFromGroup(vertexGroupName, 1):
+                        vgroupsMap[v_idx].append((g.name, vWeight))
 
             for f, f_index in face_index_pairs:
-                f_v = [{"index": index, "vertex": me.verts[index]} for index in f.verts]
+                f_v = [me_verts[v_idx] for v_idx in f.verts]
 
                 # if f.verts[3] == 0:
                 #   f_v.pop()
@@ -639,7 +605,7 @@ def write_file(filepath, objects, scene,
 #               f_mat = min(f.mat, len(materialNames)-1)
                 if faceuv:
 
-                    tface = me.active_uv_texture.data[f_index]
+                    tface = uv_layer[f_index]
 
                     f_image = tface.image
                     f_uv = tface.uv
@@ -718,21 +684,21 @@ def write_file(filepath, objects, scene,
                         if f_smooth: # Smoothed, use vertex normals
                             for vi, v in enumerate(f_v):
                                 file.write( ' %d/%d/%d' % \
-                                                (v["index"] + totverts,
+                                                (v.index + totverts,
                                                  totuvco + uv_face_mapping[f_index][vi],
-                                                 globalNormals[ veckey3d(v["vertex"].normal) ]) ) # vert, uv, normal
+                                                 globalNormals[ veckey3d(v.normal) ]) ) # vert, uv, normal
 
                         else: # No smoothing, face normals
                             no = globalNormals[ veckey3d(f.normal) ]
                             for vi, v in enumerate(f_v):
                                 file.write( ' %d/%d/%d' % \
-                                                (v["index"] + totverts,
+                                                (v.index + totverts,
                                                  totuvco + uv_face_mapping[f_index][vi],
                                                  no) ) # vert, uv, normal
                     else: # No Normals
                         for vi, v in enumerate(f_v):
                             file.write( ' %d/%d' % (\
-                              v["index"] + totverts,\
+                              v.index + totverts,\
                               totuvco + uv_face_mapping[f_index][vi])) # vert, uv
 
                     face_vert_index += len(f_v)
@@ -742,14 +708,14 @@ def write_file(filepath, objects, scene,
                         if f_smooth: # Smoothed, use vertex normals
                             for v in f_v:
                                 file.write( ' %d//%d' %
-                                            (v["index"] + totverts, globalNormals[ veckey3d(v["vertex"].normal) ]) )
+                                            (v.index + totverts, globalNormals[ veckey3d(v.normal) ]) )
                         else: # No smoothing, face normals
                             no = globalNormals[ veckey3d(f.normal) ]
                             for v in f_v:
-                                file.write( ' %d//%d' % (v["index"] + totverts, no) )
+                                file.write( ' %d//%d' % (v.index + totverts, no) )
                     else: # No Normals
                         for v in f_v:
-                            file.write( ' %d' % (v["index"] + totverts) )
+                            file.write( ' %d' % (v.index + totverts) )
 
                 file.write('\n')
 
@@ -760,7 +726,7 @@ def write_file(filepath, objects, scene,
                         file.write('f %d %d\n' % (ed.verts[0] + totverts, ed.verts[1] + totverts))
 
             # Make the indicies global rather then per mesh
-            totverts += len(me.verts)
+            totverts += len(me_verts)
             if faceuv:
                 totuvco += uv_unique_count
 
@@ -809,7 +775,7 @@ def write(filepath, context,
               EXPORT_ALL_SCENES, # XXX not working atm
               EXPORT_ANIMATION): # Not used
     
-    base_name, ext = splitExt(filepath)
+    base_name, ext = os.path.splitext(filepath)
     context_name = [base_name, '', '', ext] # Base name, scene name, frame number, extension
 
     orig_scene = context.scene
index 3c976c4cf92185f8561f8a5b06d0f9ac6b4a01fe..3827b3225b6d9a52e11e687ef848d70c299856ab 100644 (file)
@@ -375,38 +375,32 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
                 # Image has alpha
 
                 # XXX bitmask won't work?
-                blender_material.add_texture(texture, "UV", ("COLOR", "ALPHA"))
+                blender_material.add_texture(texture, 'UV', {'COLOR', 'ALPHA'})
                 texture.mipmap = True
                 texture.interpolation = True
                 texture.use_alpha = True
-                blender_material.z_transparency = True
+                blender_material.transparency = True
                 blender_material.alpha = 0.0
-
-#                              blender_material.setTexture(0, texture, Texture.TexCo.UV, Texture.MapTo.COL | Texture.MapTo.ALPHA)
-#                              texture.setImageFlags('MipMap', 'InterPol', 'UseAlpha')
-#                              blender_material.mode |= Material.Modes.ZTRANSP
-#                              blender_material.alpha = 0.0
             else:
-                blender_material.add_texture(texture, "UV", "COLOR")
-#                              blender_material.setTexture(0, texture, Texture.TexCo.UV, Texture.MapTo.COL)
+                blender_material.add_texture(texture, 'UV', 'COLOR')
 
             # adds textures to faces (Textured/Alt-Z mode)
             # Only apply the diffuse texture to the face if the image has not been set with the inline usemat func.
             unique_material_images[context_material_name]= image, has_data # set the texface image
 
         elif type == 'Ka':
-            blender_material.add_texture(texture, "UV", "AMBIENT")
+            blender_material.add_texture(texture, 'UV', 'AMBIENT')
 #                      blender_material.setTexture(1, texture, Texture.TexCo.UV, Texture.MapTo.CMIR) # TODO- Add AMB to BPY API
 
         elif type == 'Ks':
-            blender_material.add_texture(texture, "UV", "SPECULARITY")
+            blender_material.add_texture(texture, 'UV', 'SPECULARITY')
 #                      blender_material.setTexture(2, texture, Texture.TexCo.UV, Texture.MapTo.SPEC)
 
         elif type == 'Bump':
-            blender_material.add_texture(texture, "UV", "NORMAL")
+            blender_material.add_texture(texture, 'UV', 'NORMAL')
 #                      blender_material.setTexture(3, texture, Texture.TexCo.UV, Texture.MapTo.NOR)
         elif type == 'D':
-            blender_material.add_texture(texture, "UV", "ALPHA")
+            blender_material.add_texture(texture, 'UV', 'ALPHA')
             blender_material.z_transparency = True
             blender_material.alpha = 0.0
 #                      blender_material.setTexture(4, texture, Texture.TexCo.UV, Texture.MapTo.ALPHA)
@@ -415,7 +409,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
             # Todo, unset deffuse material alpha if it has an alpha channel
 
         elif type == 'refl':
-            blender_material.add_texture(texture, "UV", "REFLECTION")
+            blender_material.add_texture(texture, 'UV', 'REFLECTION')
 #                      blender_material.setTexture(5, texture, Texture.TexCo.UV, Texture.MapTo.REF)
 
 
@@ -503,7 +497,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
 
 
 
-def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP, SPLIT_MATERIALS):
+def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP):
     '''
     Takes vert_loc and faces, and separates into multiple sets of
     (verts_loc, faces, unique_materials, dataname)
@@ -511,41 +505,24 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP,
 
     filename = os.path.splitext((os.path.basename(filepath)))[0]
 
-    if not SPLIT_OB_OR_GROUP and not SPLIT_MATERIALS:
+    if not SPLIT_OB_OR_GROUP:
         # use the filename for the object name since we arnt chopping up the mesh.
         return [(verts_loc, faces, unique_materials, filename)]
 
-
     def key_to_name(key):
         # if the key is a tuple, join it to make a string
-        if type(key) == tuple:
-            return '%s_%s' % key
-        elif not key:
+        if not key:
             return filename # assume its a string. make sure this is true if the splitting code is changed
         else:
             return key
 
     # Return a key that makes the faces unique.
-    if SPLIT_OB_OR_GROUP and not SPLIT_MATERIALS:
-        def face_key(face):
-            return face[4] # object
-
-    elif not SPLIT_OB_OR_GROUP and SPLIT_MATERIALS:
-        def face_key(face):
-            return face[2] # material
-
-    else: # Both
-        def face_key(face):
-            return face[4], face[2] # object,material
-
-
     face_split_dict= {}
 
     oldkey= -1 # initialize to a value that will never match the key
 
     for face in faces:
-
-        key= face_key(face)
+        key= face[4]
 
         if oldkey != key:
             # Check the key has changed.
@@ -570,7 +547,6 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP,
                 vert_remap[i]= new_index # set the new remapped index so we only add once and can reference next time.
                 face_vert_loc_indicies[enum] = new_index # remap to the local index
                 verts_split.append( verts_loc[i] ) # add the vert to the local verts
-
             else:
                 face_vert_loc_indicies[enum] = vert_remap[i] # remap to the local index
 
@@ -580,12 +556,11 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP,
 
         faces_split.append(face)
 
-
     # remove one of the itemas and reorder
     return [(value[0], value[1], value[2], key_to_name(key)) for key, value in list(face_split_dict.items())]
 
 
-def create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, verts_tex, faces, unique_materials, unique_material_images, unique_smooth_groups, vertex_groups, dataname):
+def create_mesh(new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, verts_tex, faces, unique_materials, unique_material_images, unique_smooth_groups, vertex_groups, dataname):
     '''
     Takes all the data gathered and generates a mesh, adding the new object to new_objects
     deals with fgons, sharp edges and assigning materials
@@ -844,7 +819,6 @@ def create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_l
 #      me.calcNormals()
 
     ob= bpy.data.objects.new("Mesh", me)
-    scn.objects.link(ob)
     new_objects.append(ob)
 
     # Create the vertex groups. No need to have the flag passed here since we test for the
@@ -858,7 +832,7 @@ def create_mesh(scn, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_l
 #              me.assignVertsToGroup(group_name, group_indicies, 1.00, Mesh.AssignModes.REPLACE)
 
 
-def create_nurbs(scn, context_nurbs, vert_loc, new_objects):
+def create_nurbs(context_nurbs, vert_loc, new_objects):
     '''
     Add nurbs object to blender, only support one type at the moment
     '''
@@ -933,8 +907,9 @@ def create_nurbs(scn, context_nurbs, vert_loc, new_objects):
     if do_closed:
         nu.flagU |= 1
     '''
+    
+    ob= bpy.data.objects.new("Mesh", me)
 
-    ob = scn.objects.new(cu)
     new_objects.append(ob)
 
 
@@ -1259,7 +1234,6 @@ def load_obj(filepath,
 #              bpy.ops.OBJECT_OT_select_all()
 
     scene = context.scene
-#      scn = bpy.data.scenes.active
 #      scn.objects.selected = []
     new_objects= [] # put new objects here
 
@@ -1268,14 +1242,20 @@ def load_obj(filepath,
     if SPLIT_OBJECTS or SPLIT_GROUPS:  SPLIT_OB_OR_GROUP = True
     else:                                                              SPLIT_OB_OR_GROUP = False
 
-    for verts_loc_split, faces_split, unique_materials_split, dataname in split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP, SPLIT_MATERIALS):
+    for verts_loc_split, faces_split, unique_materials_split, dataname in split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP):
         # Create meshes from the data, warning 'vertex_groups' wont support splitting
-        create_mesh(scene, new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc_split, verts_tex, faces_split, unique_materials_split, unique_material_images, unique_smooth_groups, vertex_groups, dataname)
+        create_mesh(new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc_split, verts_tex, faces_split, unique_materials_split, unique_material_images, unique_smooth_groups, vertex_groups, dataname)
 
     # nurbs support
 #      for context_nurbs in nurbs:
 #              create_nurbs(scn, context_nurbs, verts_loc, new_objects)
 
+    # Create new obj
+    for obj in new_objects:
+        scene.objects.link(obj)
+
+    scene.update()
+
 
     axis_min= [ 1000000000]*3
     axis_max= [-1000000000]*3
@@ -1317,14 +1297,13 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
     if BPyMessages.Error_NoFile(filepath):
         return
 
-    global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, CLAMP_SIZE, IMAGE_SEARCH, POLYGROUPS, KEEP_VERT_ORDER, ROTATE_X90
+    global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, CLAMP_SIZE, IMAGE_SEARCH, POLYGROUPS, KEEP_VERT_ORDER, ROTATE_X90
 
     CREATE_SMOOTH_GROUPS= Draw.Create(0)
     CREATE_FGONS= Draw.Create(1)
     CREATE_EDGES= Draw.Create(1)
     SPLIT_OBJECTS= Draw.Create(0)
     SPLIT_GROUPS= Draw.Create(0)
-    SPLIT_MATERIALS= Draw.Create(0)
     CLAMP_SIZE= Draw.Create(10.0)
     IMAGE_SEARCH= Draw.Create(1)
     POLYGROUPS= Draw.Create(0)
@@ -1343,7 +1322,6 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
     'Separate objects from obj...',\
     ('Object', SPLIT_OBJECTS, 'Import OBJ Objects into Blender Objects'),\
     ('Group', SPLIT_GROUPS, 'Import OBJ Groups into Blender Objects'),\
-    ('Split Materials', SPLIT_MATERIALS, 'Import each material into a separate mesh'),\
     'Options...',\
     ('Keep Vert Order', KEEP_VERT_ORDER, 'Keep vert and face order, disables some other options.'),\
     ('Clamp Scale:', CLAMP_SIZE, 0.0, 1000.0, 'Clamp the size to this maximum (Zero to Disable)'),\
@@ -1356,7 +1334,6 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
     if KEEP_VERT_ORDER.val:
         SPLIT_OBJECTS.val = False
         SPLIT_GROUPS.val = False
-        SPLIT_MATERIALS.val = False
     '''
 
 
@@ -1378,25 +1355,25 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
             GLOBALS['EVENT'] = e
 
         def do_split(e,v):
-            global SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, KEEP_VERT_ORDER, POLYGROUPS
-            if SPLIT_OBJECTS.val or SPLIT_GROUPS.val or SPLIT_MATERIALS.val:
+            global SPLIT_OBJECTS, SPLIT_GROUPS, KEEP_VERT_ORDER, POLYGROUPS
+            if SPLIT_OBJECTS.val or SPLIT_GROUPS.val:
                 KEEP_VERT_ORDER.val = 0
                 POLYGROUPS.val = 0
             else:
                 KEEP_VERT_ORDER.val = 1
 
         def do_vertorder(e,v):
-            global SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, KEEP_VERT_ORDER
+            global SPLIT_OBJECTS, SPLIT_GROUPS, KEEP_VERT_ORDER
             if KEEP_VERT_ORDER.val:
-                SPLIT_OBJECTS.val = SPLIT_GROUPS.val = SPLIT_MATERIALS.val = 0
+                SPLIT_OBJECTS.val = SPLIT_GROUPS.val = 0
             else:
-                if not (SPLIT_OBJECTS.val or SPLIT_GROUPS.val or SPLIT_MATERIALS.val):
+                if not (SPLIT_OBJECTS.val or SPLIT_GROUPS.val):
                     KEEP_VERT_ORDER.val = 1
 
         def do_polygroups(e,v):
-            global SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, KEEP_VERT_ORDER, POLYGROUPS
+            global SPLIT_OBJECTS, SPLIT_GROUPS, KEEP_VERT_ORDER, POLYGROUPS
             if POLYGROUPS.val:
-                SPLIT_OBJECTS.val = SPLIT_GROUPS.val = SPLIT_MATERIALS.val = 0
+                SPLIT_OBJECTS.val = SPLIT_GROUPS.val = 0
 
         def do_help(e,v):
             url = __url__[0]
@@ -1416,7 +1393,7 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
             ui_x -= 165
             ui_y -= 90
 
-            global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, SPLIT_MATERIALS, CLAMP_SIZE, IMAGE_SEARCH, POLYGROUPS, KEEP_VERT_ORDER, ROTATE_X90
+            global CREATE_SMOOTH_GROUPS, CREATE_FGONS, CREATE_EDGES, SPLIT_OBJECTS, SPLIT_GROUPS, CLAMP_SIZE, IMAGE_SEARCH, POLYGROUPS, KEEP_VERT_ORDER, ROTATE_X90
 
             Draw.Label('Import...', ui_x+9, ui_y+159, 220, 21)
             Draw.BeginAlign()
@@ -1429,7 +1406,6 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
             Draw.BeginAlign()
             SPLIT_OBJECTS = Draw.Toggle('Object', EVENT_REDRAW, ui_x+9, ui_y+89, 55, 21, SPLIT_OBJECTS.val, 'Import OBJ Objects into Blender Objects', do_split)
             SPLIT_GROUPS = Draw.Toggle('Group', EVENT_REDRAW, ui_x+64, ui_y+89, 55, 21, SPLIT_GROUPS.val, 'Import OBJ Groups into Blender Objects', do_split)
-            SPLIT_MATERIALS = Draw.Toggle('Split Materials', EVENT_REDRAW, ui_x+119, ui_y+89, 60, 21, SPLIT_MATERIALS.val, 'Import each material into a separate mesh', do_split)
             Draw.EndAlign()
 
             # Only used for user feedback
@@ -1489,7 +1465,6 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
               CREATE_EDGES.val,\
               SPLIT_OBJECTS.val,\
               SPLIT_GROUPS.val,\
-              SPLIT_MATERIALS.val,\
               ROTATE_X90.val,\
               IMAGE_SEARCH.val,\
               POLYGROUPS.val
@@ -1503,7 +1478,6 @@ def load_obj_ui(filepath, BATCH_LOAD= False):
           CREATE_EDGES.val,\
           SPLIT_OBJECTS.val,\
           SPLIT_GROUPS.val,\
-          SPLIT_MATERIALS.val,\
           ROTATE_X90.val,\
           IMAGE_SEARCH.val,\
           POLYGROUPS.val
@@ -1567,7 +1541,6 @@ class IMPORT_OT_obj(bpy.types.Operator):
     CREATE_EDGES = BoolProperty(name="Lines as Edges", description="Import lines and faces with 2 verts as edge", default= True)
     SPLIT_OBJECTS = BoolProperty(name="Object", description="Import OBJ Objects into Blender Objects", default= True)
     SPLIT_GROUPS = BoolProperty(name="Group", description="Import OBJ Groups into Blender Objects", default= True)
-    SPLIT_MATERIALS = BoolProperty(name="Split Materials", description="Import each material into a separate mesh", default= False)
     # old comment: only used for user feedback
     # disabled this option because in old code a handler for it disabled SPLIT* params, it's not passed to load_obj
     # KEEP_VERT_ORDER = BoolProperty(name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True)
@@ -1588,7 +1561,6 @@ class IMPORT_OT_obj(bpy.types.Operator):
                  self.properties.CREATE_EDGES,
                  self.properties.SPLIT_OBJECTS,
                  self.properties.SPLIT_GROUPS,
-                 self.properties.SPLIT_MATERIALS,
                  self.properties.ROTATE_X90,
                  self.properties.IMAGE_SEARCH,
                  self.properties.POLYGROUPS)
index 4a116bb982a478a658deed5f1f36075d1c8effe7..a1ad4d3e91cb9b3bf25cdf8f83d3f18f6557e1e1 100644 (file)
@@ -171,6 +171,7 @@ def clientSendJob(conn, scene, anim = False):
     # try to send path first
     conn.request("POST", "/job", repr(job.serialize()))
     response = conn.getresponse()
+    response.read()
 
     job_id = response.getheader("job-id")
 
@@ -181,6 +182,7 @@ def clientSendJob(conn, scene, anim = False):
             conn.request("PUT", fileURL(job_id, rfile.index), f)
             f.close()
             response = conn.getresponse()
+            response.read()
 
     # server will reply with ACCEPTED until all files are found
 
@@ -236,6 +238,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
 
             requestResult(conn, job_id, scene.frame_current)
             response = conn.getresponse()
+            response.read()
 
             if response.status == http.client.NO_CONTENT:
                 new_job = True
@@ -244,16 +247,19 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
 
                 requestResult(conn, job_id, scene.frame_current)
                 response = conn.getresponse()
+                response.read()
 
             while response.status == http.client.ACCEPTED and not self.test_break():
                 time.sleep(1)
                 requestResult(conn, job_id, scene.frame_current)
                 response = conn.getresponse()
+                response.read()
 
             # cancel new jobs (animate on network) on break
             if self.test_break() and new_job:
                 conn.request("POST", cancelURL(job_id))
                 response = conn.getresponse()
+                response.read()
                 print( response.status, response.reason )
                 netsettings.job_id = 0
 
@@ -265,7 +271,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
             x= int(r.resolution_x*r.resolution_percentage*0.01)
             y= int(r.resolution_y*r.resolution_percentage*0.01)
 
-            f = open(netsettings.path + "output.exr", "wb")
+            f = open(os.path.join(netsettings.path, "output.exr"), "wb")
             buf = response.read(1024)
 
             while buf:
@@ -275,7 +281,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
             f.close()
 
             result = self.begin_result(0, 0, x, y)
-            result.load_from_file(netsettings.path + "output.exr")
+            result.load_from_file(os.path.join(netsettings.path, "output.exr"))
             self.end_result(result)
 
             conn.close()
index f227f61a5363e5559b2b9cb64da0af7cca6bfa6c..6deb925420b712b73b748d1301ad8ab160a33da6 100644 (file)
@@ -89,7 +89,7 @@ class MRenderJob(netrender.model.RenderJob):
 
     def save(self):
         if self.save_path:
-            f = open(self.save_path + "job.txt", "w")
+            f = open(os.path.join(self.save_path, "job.txt"), "w")
             f.write(repr(self.serialize()))
             f.close()
 
@@ -134,8 +134,8 @@ class MRenderJob(netrender.model.RenderJob):
         self.status = JOB_QUEUED
 
     def addLog(self, frames):
-        log_name = "_".join(("%04d" % f for f in frames)) + ".log"
-        log_path = self.save_path + log_name
+        log_name = "_".join(("%06d" % f for f in frames)) + ".log"
+        log_path = os.path.join(self.save_path, log_name)
 
         for number in frames:
             frame = self[number]
@@ -260,7 +260,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
                         elif frame.status == DONE:
                             self.server.stats("", "Sending result to client")
 
-                            filename = job.save_path + "%04d" % frame_number + ".exr"
+                            filename = os.path.join(job.save_path, "%06d.exr" % frame_number)
 
                             f = open(filename, 'rb')
                             self.send_head(content = "image/x-exr")
@@ -294,7 +294,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
                         if frame.status in (QUEUED, DISPATCHED):
                             self.send_head(http.client.ACCEPTED)
                         elif frame.status == DONE:
-                            filename = job.save_path + "%04d" % frame_number + ".exr"
+                            filename = os.path.join(job.save_path, "%06d.exr" % frame_number)
 
                             thumbname = thumbnail(filename)
 
@@ -716,7 +716,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
                         if file_index > 0:
                             file_path = prefixPath(job.save_path, render_file.filepath, main_path)
                         else:
-                            file_path = job.save_path + main_name
+                            file_path = os.path.join(job.save_path, main_name)
 
                         buf = self.rfile.read(length)
 
@@ -772,7 +772,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
                             if job_result == DONE:
                                 length = int(self.headers['content-length'])
                                 buf = self.rfile.read(length)
-                                f = open(job.save_path + "%04d" % job_frame + ".exr", 'wb')
+                                f = open(os.path.join(job.save_path, "%06d.exr" % job_frame), 'wb')
                                 f.write(buf)
                                 f.close()
 
@@ -822,13 +822,12 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
                         if job.type == netrender.model.JOB_BLENDER:
                             length = int(self.headers['content-length'])
                             buf = self.rfile.read(length)
-                            f = open(job.save_path + "%04d" % job_frame + ".jpg", 'wb')
+                            f = open(os.path.join(job.save_path, "%06d.jpg" % job_frame), 'wb')
                             f.write(buf)
                             f.close()
 
                             del buf
 
-                        self.send_head()
                     else: # frame not found
                         self.send_head(http.client.NO_CONTENT)
                 else: # job not found
@@ -880,7 +879,7 @@ class RenderMasterServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
         self.job_id = 0
 
         if subdir:
-            self.path = path + "master_" + str(os.getpid()) + os.sep
+            self.path = os.path.join(path, "master_" + str(os.getpid()))
         else:
             self.path = path
 
@@ -1007,7 +1006,7 @@ class RenderMasterServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
         self.jobs_map[job.id] = job
 
         # create job directory
-        job.save_path = self.path + "job_" + job.id + os.sep
+        job.save_path = os.path.join(self.path, "job_" + job.id)
         if not os.path.exists(job.save_path):
             os.mkdir(job.save_path)
 
index 55c2d11e28e4c4adbd0bcfda4f71ef315012dfb2..c9645d0d1eef35307d6319c9ca3cfded726f8e41 100644 (file)
@@ -205,6 +205,7 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
             conn.request("GET", "/status")
 
             response = conn.getresponse()
+            response.read()
             print( response.status, response.reason )
 
             jobs = (netrender.model.RenderJob.materialize(j) for j in eval(str(response.read(), encoding='utf8')))
@@ -306,6 +307,7 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
             conn.request("GET", "/slaves")
 
             response = conn.getresponse()
+            response.read()
             print( response.status, response.reason )
 
             slaves = (netrender.model.RenderSlave.materialize(s) for s in eval(str(response.read(), encoding='utf8')))
@@ -354,6 +356,7 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
             conn.request("POST", cancelURL(job.id))
 
             response = conn.getresponse()
+            response.read()
             print( response.status, response.reason )
 
             netsettings.jobs.remove(netsettings.active_job_index)
@@ -380,6 +383,7 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
             conn.request("POST", "/clear")
 
             response = conn.getresponse()
+            response.read()
             print( response.status, response.reason )
 
             while(len(netsettings.jobs) > 0):
@@ -412,6 +416,7 @@ class netclientdownload(bpy.types.Operator):
             for frame in job.frames:
                 client.requestResult(conn, job.id, frame.number)
                 response = conn.getresponse()
+                response.read()
 
                 if response.status != http.client.OK:
                     print("missing", frame.number)
@@ -419,7 +424,7 @@ class netclientdownload(bpy.types.Operator):
 
                 print("got back", frame.number)
 
-                f = open(netsettings.path + "%06d" % frame.number + ".exr", "wb")
+                f = open(os.path.join(netsettings.path, "%06d.exr" % frame.number), "wb")
                 buf = response.read(1024)
 
                 while buf:
index fbaf22545043d756063e98923bc62554cf18e9a8..7528ea1053a4c6d9364a90b76511019667d2f19a 100644 (file)
@@ -59,8 +59,8 @@ def slave_Info():
 def testCancel(conn, job_id, frame_number):
         conn.request("HEAD", "/status", headers={"job-id":job_id, "job-frame": str(frame_number)})
 
-        # cancelled if job isn't found anymore
-        if conn.getresponse().status == http.client.NO_CONTENT:
+        # canceled if job isn't found anymore
+        if responseStatus(conn) == http.client.NO_CONTENT:
             return True
         else:
             return False
@@ -81,7 +81,7 @@ def testFile(conn, job_id, slave_id, rfile, JOB_PREFIX, main_path = None):
     if not found:
         # Force prefix path if not found
         job_full_path = prefixPath(JOB_PREFIX, rfile.filepath, main_path, force = True)
-        temp_path = JOB_PREFIX + "slave.temp"
+        temp_path = os.path.join(JOB_PREFIX, "slave.temp")
         conn.request("GET", fileURL(job_id, rfile.index), headers={"slave-id":slave_id})
         response = conn.getresponse()
 
@@ -113,10 +113,11 @@ def render_slave(engine, netsettings, threads):
     if conn:
         conn.request("POST", "/slave", repr(slave_Info().serialize()))
         response = conn.getresponse()
+        response.read()
 
         slave_id = response.getheader("slave-id")
 
-        NODE_PREFIX = netsettings.path + "slave_" + slave_id + os.sep
+        NODE_PREFIX = os.path.join(netsettings.path, "slave_" + slave_id)
         if not os.path.exists(NODE_PREFIX):
             os.mkdir(NODE_PREFIX)
 
@@ -132,7 +133,7 @@ def render_slave(engine, netsettings, threads):
                 job = netrender.model.RenderJob.materialize(eval(str(response.read(), encoding='utf8')))
                 engine.update_stats("", "Network render processing job from master")
 
-                JOB_PREFIX = NODE_PREFIX + "job_" + job.id + os.sep
+                JOB_PREFIX = os.path.join(NODE_PREFIX, "job_" + job.id)
                 if not os.path.exists(JOB_PREFIX):
                     os.mkdir(JOB_PREFIX)
 
@@ -157,6 +158,7 @@ def render_slave(engine, netsettings, threads):
                 logfile = netrender.model.LogFile(job.id, slave_id, [frame.number for frame in job.frames])
                 conn.request("POST", "/log", bytes(repr(logfile.serialize()), encoding='utf8'))
                 response = conn.getresponse()
+                response.read()
 
 
                 first_frame = job.frames[0].number
@@ -172,7 +174,7 @@ def render_slave(engine, netsettings, threads):
                         frame_args += ["-f", str(frame.number)]
 
                     val = SetErrorMode()
-                    process = subprocess.Popen([BLENDER_PATH, "-b", "-noaudio", job_full_path, "-t", str(threads), "-o", JOB_PREFIX + "######", "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+                    process = subprocess.Popen([BLENDER_PATH, "-b", "-noaudio", job_full_path, "-t", str(threads), "-o", os.path.join(JOB_PREFIX, "######"), "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
                     RestoreErrorMode(val)
                 elif job.type == netrender.model.JOB_PROCESS:
                     command = job.frames[0].command
@@ -196,9 +198,10 @@ def render_slave(engine, netsettings, threads):
                             # (only need to update on one frame, they are linked
                             conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
                             response = conn.getresponse()
+                            response.read()
                             
                             # Also output on console
-                            if netsettings.slave_thumb:
+                            if netsettings.slave_outputlog:
                                 print(str(stdout, encoding='utf8'), end="")
 
                             stdout = bytes()
@@ -227,7 +230,7 @@ def render_slave(engine, netsettings, threads):
                     
                     # (only need to update on one frame, they are linked
                     conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
-                    if conn.getresponse().status == http.client.NO_CONTENT:
+                    if responseStatus(conn) == http.client.NO_CONTENT:
                         continue
 
                 total_t = time.time() - start_t
@@ -248,7 +251,7 @@ def render_slave(engine, netsettings, threads):
                         if job.type == netrender.model.JOB_BLENDER:
                             # send image back to server
 
-                            filename = JOB_PREFIX + "%06d" % frame.number + ".exr"
+                            filename = os.path.join(JOB_PREFIX, "%06d.exr" % frame.number)
 
                             # thumbnail first
                             if netsettings.slave_thumb:
@@ -257,17 +260,18 @@ def render_slave(engine, netsettings, threads):
                                 f = open(thumbname, 'rb')
                                 conn.request("PUT", "/thumb", f, headers=headers)
                                 f.close()
-                                conn.getresponse()
+                                responseStatus(conn)
+                                
 
                             f = open(filename, 'rb')
                             conn.request("PUT", "/render", f, headers=headers)
                             f.close()
-                            if conn.getresponse().status == http.client.NO_CONTENT:
+                            if responseStatus(conn) == http.client.NO_CONTENT:
                                 continue
 
                         elif job.type == netrender.model.JOB_PROCESS:
                             conn.request("PUT", "/render", headers=headers)
-                            if conn.getresponse().status == http.client.NO_CONTENT:
+                            if responseStatus(conn) == http.client.NO_CONTENT:
                                 continue
                 else:
                     headers["job-result"] = str(ERROR)
@@ -275,7 +279,7 @@ def render_slave(engine, netsettings, threads):
                         headers["job-frame"] = str(frame.number)
                         # send error result back to server
                         conn.request("PUT", "/render", headers=headers)
-                        if conn.getresponse().status == http.client.NO_CONTENT:
+                        if responseStatus(conn) == http.client.NO_CONTENT:
                             continue
 
                 engine.update_stats("", "Network render connected to master, waiting for jobs")
index 31123ce26da5abedcebb141f33ec562984c66541..81617ac0d3020e3acf3b3ea515ebcc4ae9ad9af5 100644 (file)
@@ -57,6 +57,11 @@ FRAME_STATUS_TEXT = {
         ERROR: "Error"
         }
 
+def responseStatus(conn):
+    response = conn.getresponse()
+    response.read()
+    return response.status
+
 def reporting(report, message, errorType = None):
     if errorType:
         t = 'ERROR'
@@ -171,16 +176,16 @@ def prefixPath(prefix_directory, file_path, prefix_path, force = False):
 
             if prefix_path and p.startswith(prefix_path):
                 if len(prefix_path) < len(p):
-                    directory = prefix_directory + p[len(prefix_path)+1:] + os.sep # +1 to remove separator
+                    directory = os.path.join(prefix_directory, p[len(prefix_path)+1:]) # +1 to remove separator
                     if not os.path.exists(directory):
                         os.mkdir(directory)
                 else:
                     directory = prefix_directory
-                full_path = directory + n
+                full_path = os.path.join(directory, n)
             else:
-                full_path = prefix_directory + n
+                full_path = os.path.join(prefix_directory, n)
     else:
-        full_path = prefix_directory + file_path
+        full_path = (prefix_directory, file_path)
 
     return full_path
 
index 1fa0d15a90b86a782b4e20d62ccc8dad02d8f711..bb5758ff902967cff16f5d6c86532b6399f38d5d 100644 (file)
@@ -29,8 +29,7 @@ class WorldButtonsPanel():
 
     @classmethod
     def poll(cls, context):
-        rd = context.scene.render
-        return (rd.engine in cls.COMPAT_ENGINES)
+        return (context.world and context.scene.render.engine in cls.COMPAT_ENGINES)
 
 
 class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel):
@@ -70,12 +69,6 @@ class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel):
         self.layout.template_preview(context.world)
 
 
-
-
-
-
-
-
 class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "World"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -141,8 +134,8 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, bpy.types.Panel):
 
     @classmethod
     def poll(cls, context):
-        light = context.world.lighting
-        return light.gather_method == 'APPROXIMATE'
+        light = getattr(context.world, "lighting", None)
+        return light and light.gather_method == 'APPROXIMATE'
 
     def draw_header(self, context):
         light = context.world.lighting
index 99d41244431b167c0aa2b65972446997b2926e30..b3598b4d04c818035efb8217ebd3e3f9b5698823 100644 (file)
@@ -575,7 +575,7 @@ class IMAGE_PT_paint(bpy.types.Panel):
 
         col = layout.split().column()
         row = col.row()
-        col.template_ID_preview(toolsettings, "brush", new="brush.add", filter="is_imapaint_brush", rows=3, cols=8)
+        col.template_ID_preview(toolsettings, "brush", new="brush.add", rows=3, cols=8)
 
         if brush:
             col = layout.column()
index 049d22a44edc5a3b9f0ddc59afebc9fe54bce999..5f9514c5885cf168277afcf4d6b0c439cd18c817 100644 (file)
@@ -91,15 +91,12 @@ class USERPREF_HT_header(bpy.types.Header):
         layout.operator_context = 'INVOKE_DEFAULT'
 
         if userpref.active_section == 'INPUT':
-            op = layout.operator("wm.keyconfig_export")
-            op.filepath = "keymap.py"
-            op = layout.operator("wm.keyconfig_import")
-            op.filepath = "keymap.py"
+            layout.operator("wm.keyconfig_export")
+            layout.operator("wm.keyconfig_import")
         elif userpref.active_section == 'ADDONS':
-            op = layout.operator("wm.addon_install")
-            op.filepath = "*.py"
+            layout.operator("wm.addon_install")
         elif userpref.active_section == 'THEMES':
-            op = layout.operator("ui.reset_default_theme")
+            layout.operator("ui.reset_default_theme")
 
 
 class USERPREF_PT_tabs(bpy.types.Panel):
index 9a482b896527d53353fc6980592924a0c02ce274..24d77dbed3252ce041fdee5f6f05e600b7d9faea 100644 (file)
@@ -19,8 +19,8 @@
 # <pep8 compliant>
 import bpy
 import os
-import re
-import shutil
+
+KM_MOD_PREFIX = "keyconfig_"
 
 KM_HIERARCHY = [
     ('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit
@@ -384,6 +384,22 @@ class InputKeyMapPanel(bpy.types.Panel):
 from bpy.props import *
 
 
+def export_properties(prefix, properties, lines=None):
+    if lines is None:
+        lines = []
+
+    for pname in properties.keys():
+        if not properties.is_property_hidden(pname):
+            value = getattr(properties, pname)
+            if isinstance(value, bpy.types.OperatorProperties):
+                export_properties(prefix + "." + pname, value, lines)
+            elif properties.is_property_set(pname):
+                value = _string_value(value)
+                if value != "":
+                    lines.append("%s.%s = %s\n" % (prefix, pname, value))
+    return lines
+
+
 class WM_OT_keyconfig_test(bpy.types.Operator):
     "Test keyconfig for conflicts"
     bl_idname = "wm.keyconfig_test"
@@ -414,21 +430,10 @@ class WM_OT_keyconfig_test(bpy.types.Operator):
 
             s.append(")\n")
 
-            def export_properties(prefix, properties):
-                for pname in dir(properties):
-                    if not properties.is_property_hidden(pname):
-                        value = eval("properties.%s" % pname)
-                        if isinstance(value, bpy.types.OperatorProperties):
-                            export_properties(prefix + "." + pname, value)
-                        elif properties.is_property_set(pname):
-                            value = _string_value(value)
-                            if value != "":
-                                s.append(prefix + ".%s = %s\n" % (pname, value))
-
             props = kmi.properties
 
             if props is not None:
-                export_properties("kmi.properties", props)
+                export_properties("kmi.properties", props, s)
 
             return "".join(s).strip()
 
@@ -508,7 +513,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
     bl_idname = "wm.keyconfig_import"
     bl_label = "Import Key Configuration..."
 
-    filepath = StringProperty(name="File Path", description="Filepath to write file to")
+    filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
     filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
     filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
     filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
@@ -516,25 +521,26 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
     keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True)
 
     def execute(self, context):
-        if not self.properties.filepath:
+        import shutil
+        if not self.properties.is_property_set("filepath"):
             raise Exception("Filepath not set")
 
         f = open(self.properties.filepath, "r")
         if not f:
             raise Exception("Could not open file")
 
-        name_pattern = re.compile("^kc = wm.add_keyconfig\('(.*)'\)$")
+        config_name = None
+        for line in f:
+            if line.startswith("kc = wm.add_keyconfig("):
+                config_name = line[23:-3]
+                break
 
-        for line in f.readlines():
-            match = name_pattern.match(line)
+        if config_name is None:
+            raise Exception("config name not found")
 
-            if match:
-                config_name = match.groups()[0]
-
-        f.close()
-
-        path = os.path.split(os.path.split(__file__)[0])[0] # remove ui/space_userpref.py
-        path = os.path.join(path, "cfg")
+        path = os.path.join(__file__, "..", "..", "cfg") # remove ui/space_userpref.py
+        path = os.path.normpath(path)
+        print(path)
 
         # create config folder if needed
         if not os.path.exists(path):
@@ -547,7 +553,16 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
         else:
             shutil.move(self.properties.filepath, path)
 
-        exec("import " + config_name)
+        # sneaky way to check we're actually running the code.
+        wm = context.manager
+        while config_name in wm.keyconfigs:
+            wm.remove_keyconfig(wm.keyconfigs[config_name])
+
+        wm = context.manager
+        totmap = len(wm.keyconfigs)
+        mod = __import__(config_name)
+        if totmap == len(wm.keyconfigs):
+            reload(mod)
 
         wm = bpy.context.manager
         wm.active_keyconfig = wm.keyconfigs[config_name]
@@ -567,14 +582,14 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
     bl_idname = "wm.keyconfig_export"
     bl_label = "Export Key Configuration..."
 
-    filepath = StringProperty(name="File Path", description="Filepath to write file to")
+    filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
     filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
     filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
     filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
     kc_name = StringProperty(name="KeyConfig Name", description="Name to save the key config as")
 
     def execute(self, context):
-        if not self.properties.filepath:
+        if not self.properties.is_property_set("filepath"):
             raise Exception("Filepath not set")
 
         f = open(self.properties.filepath, "w")
@@ -642,21 +657,10 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
                     f.write(", key_modifier='%s'" % kmi.key_modifier)
                 f.write(")\n")
 
-                def export_properties(prefix, properties):
-                    for pname in dir(properties):
-                        if not properties.is_property_hidden(pname):
-                            value = eval("properties.%s" % pname)
-                            if isinstance(value, bpy.types.OperatorProperties):
-                                export_properties(prefix + "." + pname, value)
-                            elif properties.is_property_set(pname):
-                                value = _string_value(value)
-                                if value != "":
-                                    f.write(prefix + ".%s = %s\n" % (pname, value))
-
                 props = kmi.properties
 
                 if props is not None:
-                    export_properties("kmi.properties", props)
+                    f.write("".join(export_properties("kmi.properties", props)))
 
             f.write("\n")
 
@@ -769,18 +773,22 @@ class WM_OT_keyconfig_remove(bpy.types.Operator):
         return wm.active_keyconfig.user_defined
 
     def execute(self, context):
+        import sys
         wm = context.manager
 
         keyconfig = wm.active_keyconfig
 
-        module = __import__(keyconfig.name)
+        module = sys.modules.get(keyconfig.name)
 
-        os.remove(module.__file__)
+        if module:
+            path = module.__file__
+            if os.path.exists(path):
+                os.remove(path)
 
-        compiled_path = module.__file__ + "c" # for .pyc
+            path = module.__file__ + "c" # for .pyc
 
-        if os.path.exists(compiled_path):
-            os.remove(compiled_path)
+            if os.path.exists(path):
+                os.remove(path)
 
         wm.remove_keyconfig(keyconfig)
         return {'FINISHED'}
index a73dec57a559eb5d98078e6b79410d299b901d09..5f0d36e17e20ac7119d0238b51da039209975ba7 100644 (file)
@@ -38,6 +38,8 @@
 #include <stdio.h>
 #include <ctype.h>
 
+#include "MEM_guardedalloc.h"
+
 #include "AVI_avi.h"
 #include "avi_intern.h"
 
index 1ea304213caabf6d24256e92174c934570003121..20de67530fd2eee2565168056b2f366957a019ca 100644 (file)
@@ -31,8 +31,6 @@
 
 #include <stdio.h> /* for FILE */
 
-#include "MEM_guardedalloc.h"
-
 unsigned int GET_FCC (FILE *fp);
 unsigned int GET_TCC (FILE *fp);
 
index 1baf2c82ef79e6ed4b70ab312ec6a2a4d5e21100..7054d955faf2b62f030d0d6d9fa21b1f152b8e5b 100644 (file)
@@ -34,7 +34,6 @@
 #include <locale.h>
 #include "libintl.h"
 
-#include "MEM_guardedalloc.h"
 
 #include "DNA_listBase.h"
 #include "DNA_vec_types.h"
index 63f36a5f1036329940156bc28725b975989b50f2..52536e10e565b7d1bf965f54200561601ccf9f62 100644 (file)
@@ -33,8 +33,6 @@
 #include "DNA_object_force.h"
 #include "DNA_boid_types.h"
 
-#include "MEM_guardedalloc.h"
-
 /* Point cache clearing option, for BKE_ptcache_id_clear, before
  * and after are non inclusive (they wont remove the cfra) */
 #define PTCACHE_CLEAR_ALL              0
@@ -275,7 +273,7 @@ int         BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec);
 int            BKE_ptcache_write_cache(PTCacheID *pid, int cfra);
 
 /****************** Continue physics ***************/
-void BKE_ptcache_set_continue_physics(struct Scene *scene, int enable);
+void BKE_ptcache_set_continue_physics(struct Main *bmain, struct Scene *scene, int enable);
 int BKE_ptcache_get_continue_physics(void);
 
 /******************* Allocate & free ***************/
index b544b3461cdfaad2db7906056013bac8b2b38610..a9fb45c6e14e8e5cbad683cf934697dc3cf77eae 100644 (file)
 #ifndef BKE_SEQUENCER_H
 #define BKE_SEQUENCER_H
 
+struct bContext;
 struct Editing;
+struct ImBuf;
+struct Main;
+struct Scene;
 struct Sequence;
 struct Strip;
 struct StripElem;
-struct ImBuf;
-struct Scene;
-struct bContext;
 
 #define MAXSEQ          32
 
@@ -123,6 +124,7 @@ struct SeqEffectHandle {
            (mixed cases are handled one layer up...) */
        
        struct ImBuf* (*execute)(
+               struct Main *bmain,
                struct Scene *scene, struct Sequence *seq, float cfra,
                float facf0, float facf1,
                int x, int y, int preview_render_size,
@@ -146,15 +148,15 @@ void seq_free_editing(struct Scene *scene);
 void seq_free_clipboard(void);
 struct Editing *seq_give_editing(struct Scene *scene, int alloc);
 char *give_seqname(struct Sequence *seq);
-struct ImBuf *give_ibuf_seq(struct Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size);
-struct ImBuf *give_ibuf_seq_threaded(struct Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size);
-struct ImBuf *give_ibuf_seq_direct(struct Scene *scene, int rectx, int recty, int cfra, int render_size, struct Sequence *seq);
-struct ImBuf *give_ibuf_seqbase(struct Scene *scene, int rectx, int recty, int cfra, int chan_shown, int render_size, struct ListBase *seqbasep);
+struct ImBuf *give_ibuf_seq(struct Main *bmain, struct Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size);
+struct ImBuf *give_ibuf_seq_threaded(struct Main *bmain, struct Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size);
+struct ImBuf *give_ibuf_seq_direct(struct Main *bmain, struct Scene *scene, int rectx, int recty, int cfra, int render_size, struct Sequence *seq);
+struct ImBuf *give_ibuf_seqbase(struct Main *bmain, struct Scene *scene, int rectx, int recty, int cfra, int chan_shown, int render_size, struct ListBase *seqbasep);
 void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown, int render_size);
 void calc_sequence(struct Scene *scene, struct Sequence *seq);
 void calc_sequence_disp(struct Scene *scene, struct Sequence *seq);
 void new_tstripdata(struct Sequence *seq);
-void reload_sequence_new_file(struct Scene *scene, struct Sequence * seq, int lock_range);
+void reload_sequence_new_file(struct Main *bmain, struct Scene *scene, struct Sequence * seq, int lock_range);
 void sort_seq(struct Scene *scene);
 void build_seqar_cb(struct ListBase *seqbase, struct Sequence  ***seqar, int *totseq,
                                        int (*test_func)(struct Sequence * seq));
@@ -227,7 +229,7 @@ void seqbase_sound_reload(struct Scene *scene, ListBase *seqbase);
 void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq);
 void seqbase_dupli_recursive(struct Scene *scene, ListBase *nseqbase, ListBase *seqbase, int dupe_flag);
 
-void clear_scene_in_allseqs(struct Scene *sce);
+void clear_scene_in_allseqs(struct Main *bmain, struct Scene *sce);
 
 struct Sequence *get_seq_by_name(struct ListBase *seqbase, const char *name, int recursive);
 
index d8a6b66d5bb97f4c41f262ff29f50e7e6f43fb41..1087b3a873c762fd9fdb97ce1a4338e42b06dd2e 100644 (file)
@@ -36,9 +36,9 @@
 
 #include <string.h>
 
+#include "MEM_guardedalloc.h"
 #include "BKE_bmeshCustomData.h"
 #include "bmesh_private.h"
-#include "MEM_guardedalloc.h"
 
 /********************* Layer type information **********************/
 typedef struct BME_LayerTypeInfo {
index 663fbb89b4ed7c895557ea9e4303bedd82f99d38..de7b962e38a59105a0ad449d9944720d9ede0509 100644 (file)
@@ -1407,8 +1407,7 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
                        /* following Mesh convention; we use vertex coordinate itself
                         * for normal in this case */
                        if (normalize_v3(no)==0.0) {
-                               VECCOPY(no, vertexCos[i]);
-                               normalize_v3(no);
+                               normalize_v3_v3(no, vertexCos[i]);
                        }
                }
        }
@@ -2590,9 +2589,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
                
                for(j=0; j<len; j++) {
                        vtang= find_vertex_tangent(vtangents[mf_vi[j]], mtface ? tf->uv[j] : uv[j]);
-
-                       VECCOPY(tangent[j], vtang);
-                       normalize_v3(tangent[j]);
+                       normalize_v3_v3(tangent[j], vtang);
                }
        }
        
index 89c637d81922dbc2940383ac11e67cfdaed3d2a7..e27e3b2cd3f8c731caf8256e4ed988c5686be61f 100644 (file)
@@ -40,7 +40,6 @@
 #include "BLI_math.h"
 #include "BLI_rand.h"
 
-
 #include "DNA_anim_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_group_types.h"
@@ -49,7 +48,6 @@
 #include "DNA_scene_types.h"
 #include "DNA_vfont_types.h"
 
-//(INCLUDE_LINT)#include "BKE_anim.h"
 #include "BKE_curve.h"
 #include "BKE_DerivedMesh.h"
 #include "BKE_depsgraph.h"
@@ -66,7 +64,6 @@
 #include "BKE_utildefines.h"
 #include "BKE_depsgraph.h"
 
-#include "ED_curve.h" /* for ED_curve_nurbs */
 
 // XXX bad level call...
 
index b86be371d666924b4ae76f2b82699f1e559236df..41821f34ba89329209b35b8eb9fe9ee4d5ae120d 100644 (file)
@@ -1283,9 +1283,8 @@ void vec_roll_to_mat3(float *vec, float roll, float mat[][3])
        float   nor[3], axis[3], target[3]={0,1,0};
        float   theta;
        float   rMatrix[3][3], bMatrix[3][3];
-       
-       VECCOPY (nor, vec);
-       normalize_v3(nor);
+
+       normalize_v3_v3(nor, vec);
        
        /*      Find Axis & Amount for bone matrix*/
        cross_v3_v3v3(axis,target,nor);
index 82602a6951d8e7b9a041e86accc68d02704207b2..7ae65d0113a6154811f8a8d1dcd0843f91bf228f 100644 (file)
@@ -659,9 +659,9 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
                /* attack if in range */
                if(closest_dist <= bbd->part->boids->range + pa->size + enemy_pa->size) {
                        float damage = BLI_frand();
-                       float enemy_dir[3] = {bbd->wanted_co[0],bbd->wanted_co[1],bbd->wanted_co[2]};
+                       float enemy_dir[3];
 
-                       normalize_v3(enemy_dir);
+                       normalize_v3_v3(enemy_dir, bbd->wanted_co);
 
                        /* fight mode */
                        bbd->wanted_speed = 0.0f;
@@ -786,8 +786,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro
                if(hit.index>=0) {
                        t = hit.dist/col.ray_len;
                        interp_v3_v3v3(ground_co, col.co1, col.co2, t);
-                       VECCOPY(ground_nor, col.nor);
-                       normalize_v3(ground_nor);
+                       normalize_v3_v3(ground_nor, col.nor);
                        return col.hit_ob;
                }
                else {
@@ -1115,8 +1114,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                }
 
                VECCOPY(old_dir, pa->prev_state.ave);
-               VECCOPY(wanted_dir, bbd->wanted_co);
-               new_speed = normalize_v3(wanted_dir);
+               new_speed = normalize_v3_v3(wanted_dir, bbd->wanted_co);
 
                /* first check if we have valid direction we want to go towards */
                if(new_speed == 0.0f) {
@@ -1356,8 +1354,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
        /* save direction to state.ave unless the boid is falling */
        /* (boids can't effect their direction when falling) */
        if(bpa->data.mode!=eBoidMode_Falling && len_v3(pa->state.vel) > 0.1*pa->size) {
-               VECCOPY(pa->state.ave, pa->state.vel);
-               normalize_v3(pa->state.ave);
+               normalize_v3_v3(pa->state.ave, pa->state.vel);
        }
 
        /* apply damping */
index 431e51cf1497bbf9d9bef5ca2176d7cc5f70d9c2..dd595fc98b6f25aaf0ee5684a23eece8ac5ea5e5 100644 (file)
@@ -30,7 +30,6 @@
  */
 #include "CSG_BooleanOps.h"
 
-#include "MEM_guardedalloc.h"
 
 
 
index 905515914b437452b935166b6a009a61eea27499..71a43994363d96c35c94bff0301d0293ce5449e0 100644 (file)
@@ -39,7 +39,6 @@
 #include "DNA_windowmanager_types.h"
 
 #include "WM_types.h"
-#include "WM_api.h"
 
 #include "RNA_access.h"
 
index fb1e8c009915371c87e8631e0e93f13c32288578..ca81e216006b72316e6e2f9e9e33f54cac4c0859 100644 (file)
@@ -1777,14 +1777,10 @@ void CDDM_calc_normals(DerivedMesh *dm)
        for(i = 0; i < numVerts; i++, mv++) {
                float *no = temp_nors[i];
                
-               if (normalize_v3(no) == 0.0) {
-                       VECCOPY(no, mv->co);
-                       normalize_v3(no);
-               }
+               if (normalize_v3(no) == 0.0)
+                       normalize_v3_v3(no, mv->co);
 
-               mv->no[0] = (short)(no[0] * 32767.0);
-               mv->no[1] = (short)(no[1] * 32767.0);
-               mv->no[2] = (short)(no[2] * 32767.0);
+               normal_float_to_short_v3(mv->no, no);
        }
        
        MEM_freeN(temp_nors);
index 3a9c15f654c41596c7600b3fe9c25c7b1a6ebd84..af12d23b2c21be64ebe81e3bd9c8ee6dfb48b4e6 100644 (file)
@@ -691,8 +691,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
 
                if ( distance <= ( epsilon1 + epsilon2 + ALMOST_ZERO ) )
                {
-                       VECCOPY ( collpair->normal, collpair->vector );
-                       normalize_v3( collpair->normal );
+                       normalize_v3_v3( collpair->normal, collpair->vector );
 
                        collpair->distance = distance;
                        collpair->flag = 0;
index aae70c055d097d5266c9deaf1280a35480d046a0..b415484c1c1d5d0ffb38c23be28259fc88e63652 100644 (file)
@@ -256,7 +256,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
                                                                
                                                        /* construct offs_bone the same way it is done in armature.c */
                                                        copy_m4_m3(offs_bone, pchan->bone->bone_mat);
-                                                       VECCOPY(offs_bone[3], pchan->bone->head);
+                                                       copy_v3_v3(offs_bone[3], pchan->bone->head);
                                                        offs_bone[3][1]+= pchan->bone->parent->length;
                                                        
                                                        if (pchan->bone->flag & BONE_HINGE) {
@@ -267,7 +267,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
                                                                copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
                                                                
                                                                /* the location of actual parent transform */
-                                                               VECCOPY(tmat[3], offs_bone[3]);
+                                                               copy_v3_v3(tmat[3], offs_bone[3]);
                                                                offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
                                                                mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
                                                                
@@ -309,7 +309,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
                                                
                                                /* construct offs_bone the same way it is done in armature.c */
                                                copy_m4_m3(offs_bone, pchan->bone->bone_mat);
-                                               VECCOPY(offs_bone[3], pchan->bone->head);
+                                               copy_v3_v3(offs_bone[3], pchan->bone->head);
                                                offs_bone[3][1]+= pchan->bone->parent->length;
                                                
                                                if (pchan->bone->flag & BONE_HINGE) {
@@ -320,8 +320,8 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
                                                        copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
                                                        
                                                        /* the location of actual parent transform */
-                                                       VECCOPY(tmat[3], offs_bone[3]);
-                                                       offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
+                                                       copy_v3_v3(tmat[3], offs_bone[3]);
+                                                       zero_v3(offs_bone[3]);
                                                        mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
                                                        
                                                        mul_m4_m4m4(diff_mat, offs_bone, tmat);
@@ -400,7 +400,7 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
        DerivedMesh *dm = NULL;
        Mesh *me= ob->data;
        EditMesh *em = BKE_mesh_get_editmesh(me);
-       float vec[3] = {0.0f, 0.0f, 0.0f}, tvec[3];
+       float vec[3] = {0.0f, 0.0f, 0.0f};
        float normal[3] = {0.0f, 0.0f, 0.0f}, plane[3];
        float imat[3][3], tmat[3][3];
        int dgroup;
@@ -477,9 +477,9 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
                        mul_m3_v3(tmat, normal);
                        
                        normalize_v3(normal);
-                       VECCOPY(plane, tmat[1]);
+                       copy_v3_v3(plane, tmat[1]);
                        
-                       VECCOPY(tmat[2], normal);
+                       copy_v3_v3(tmat[2], normal);
                        cross_v3_v3v3(tmat[0], normal, plane);
                        cross_v3_v3v3(tmat[1], tmat[2], tmat[0]);
                        
@@ -488,8 +488,7 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
                        
                        
                        /* apply the average coordinate as the new location */
-                       mul_v3_m4v3(tvec, ob->obmat, vec);
-                       VECCOPY(mat[3], tvec);
+                       mul_v3_m4v3(mat[3], ob->obmat, vec);
                }
        }
        
@@ -554,7 +553,7 @@ static void contarget_get_lattice_mat (Object *ob, char *substring, float mat[][
        mul_v3_m4v3(tvec, ob->obmat, vec);
        
        /* copy new location to matrix */
-       VECCOPY(mat[3], tvec);
+       copy_v3_v3(mat[3], tvec);
 }
 
 /* generic function to get the appropriate matrix for most target cases */
@@ -819,11 +818,11 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                copy_m4_m4(invmat, data->invmat);
                
                /* extract components of both matrices */
-               VECCOPY(loc, ct->matrix[3]);
+               copy_v3_v3(loc, ct->matrix[3]);
                mat4_to_eulO(eul, ct->rotOrder, ct->matrix);
                mat4_to_size(size, ct->matrix);
                
-               VECCOPY(loco, invmat[3]);
+               copy_v3_v3(loco, invmat[3]);
                mat4_to_eulO(eulo, cob->rotOrder, invmat);
                mat4_to_size(sizo, invmat);
                
@@ -940,9 +939,8 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
        float right[3];
        float neg = -1;
        int right_index;
-       
-       copy_v3_v3(n, vec);
-       if (normalize_v3(n) == 0.0) { 
+
+       if (normalize_v3_v3(n, vec) == 0.0) { 
                n[0] = 0.0;
                n[1] = 0.0;
                n[2] = 1.0;
@@ -953,9 +951,7 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
        /* n specifies the transformation of the track axis */
        if (flags & TARGET_Z_UP) { 
                /* target Z axis is the global up axis */
-               u[0] = target_up[0];
-               u[1] = target_up[1];
-               u[2] = target_up[2];
+               copy_v3_v3(u, target_up);
        }
        else { 
                /* world Z axis is the global up axis */
@@ -988,20 +984,13 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
                m[right_index][1] = neg * right[1];
                m[right_index][2] = neg * right[2];
                
-               m[upflag][0] = proj[0];
-               m[upflag][1] = proj[1];
-               m[upflag][2] = proj[2];
+               copy_v3_v3(m[upflag], proj);
                
-               m[axis][0] = n[0];
-               m[axis][1] = n[1];
-               m[axis][2] = n[2];
+               copy_v3_v3(m[axis], n);
        }
        /* identity matrix - don't do anything if the two axes are the same */
        else {
-               m[0][0]= m[1][1]= m[2][2]= 1.0;
-               m[0][1]= m[0][2]= 0.0;
-               m[1][0]= m[1][2]= 0.0;
-               m[2][0]= m[2][1]= 0.0;
+               unit_m3(m);
        }
 }
 
@@ -1264,7 +1253,7 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                                        copy_m4_m4(totmat, rmat);
                                }
                                
-                               VECCOPY(totmat[3], vec);
+                               copy_v3_v3(totmat[3], vec);
                                
                                mul_serie_m4(ct->matrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
                        }
@@ -1383,7 +1372,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
        float eul[3];
        float size[3];
        
-       VECCOPY(loc, cob->matrix[3]);
+       copy_v3_v3(loc, cob->matrix[3]);
        mat4_to_size(size, cob->matrix);
        
        mat4_to_eulO(eul, cob->rotOrder, cob->matrix);
@@ -1544,7 +1533,7 @@ static void loclike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                float offset[3] = {0.0f, 0.0f, 0.0f};
                
                if (data->flag & LOCLIKE_OFFSET)
-                       VECCOPY(offset, cob->matrix[3]);
+                       copy_v3_v3(offset, cob->matrix[3]);
                        
                if (data->flag & LOCLIKE_X) {
                        cob->matrix[3][0] = ct->matrix[3][0];
@@ -1636,7 +1625,7 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                float   eul[3], obeul[3];
                float   size[3];
                
-               VECCOPY(loc, cob->matrix[3]);
+               copy_v3_v3(loc, cob->matrix[3]);
                mat4_to_size(size, cob->matrix);
                
                /* to allow compatible rotations, must get both rotations in the order of the owner... */
@@ -2138,7 +2127,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
                }
                else {
                        /* extract location */
-                       VECCOPY(vec, tempmat[3]);
+                       copy_v3_v3(vec, tempmat[3]);
                        axis= data->type - 20;
                }
                
@@ -2294,10 +2283,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        normalize_v3(totmat[1]);
                                        
                                        /* the x axis is fixed */
-                                       totmat[0][0] = cob->matrix[0][0];
-                                       totmat[0][1] = cob->matrix[0][1];
-                                       totmat[0][2] = cob->matrix[0][2];
-                                       normalize_v3(totmat[0]);
+                                       normalize_v3_v3(totmat[0], cob->matrix[0]);
                                        
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
@@ -2311,10 +2297,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        normalize_v3(totmat[2]);
                                        
                                        /* the x axis is fixed */
-                                       totmat[0][0] = cob->matrix[0][0];
-                                       totmat[0][1] = cob->matrix[0][1];
-                                       totmat[0][2] = cob->matrix[0][2];
-                                       normalize_v3(totmat[0]);
+                                       normalize_v3_v3(totmat[0], cob->matrix[0]);
                                        
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2329,10 +2312,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        negate_v3(totmat[1]);
                                        
                                        /* the x axis is fixed */
-                                       totmat[0][0] = cob->matrix[0][0];
-                                       totmat[0][1] = cob->matrix[0][1];
-                                       totmat[0][2] = cob->matrix[0][2];
-                                       normalize_v3(totmat[0]);
+                                       normalize_v3_v3(totmat[0], cob->matrix[0]);
                                        
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
@@ -2347,10 +2327,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        negate_v3(totmat[2]);
                                                
                                        /* the x axis is fixed */
-                                       totmat[0][0] = cob->matrix[0][0];
-                                       totmat[0][1] = cob->matrix[0][1];
-                                       totmat[0][2] = cob->matrix[0][2];
-                                       normalize_v3(totmat[0]);
+                                       normalize_v3_v3(totmat[0], cob->matrix[0]);
                                                
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2358,9 +2335,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        break;
                                default:
                                {
-                                       totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
-                                       totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
-                                       totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+                                       unit_m3(totmat);
                                }
                                        break;
                        }
@@ -2377,11 +2352,8 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        normalize_v3(totmat[0]);
                                        
                                        /* the y axis is fixed */
-                                       totmat[1][0] = cob->matrix[1][0];
-                                       totmat[1][1] = cob->matrix[1][1];
-                                       totmat[1][2] = cob->matrix[1][2];
-                                       normalize_v3(totmat[1]);
-                                       
+                                       normalize_v3_v3(totmat[1], cob->matrix[1]);
+
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
                                }
@@ -2394,10 +2366,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        normalize_v3(totmat[2]);
                                        
                                        /* the y axis is fixed */
-                                       totmat[1][0] = cob->matrix[1][0];
-                                       totmat[1][1] = cob->matrix[1][1];
-                                       totmat[1][2] = cob->matrix[1][2];
-                                       normalize_v3(totmat[1]);
+                                       normalize_v3_v3(totmat[1], cob->matrix[1]);
                                        
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2412,10 +2381,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        negate_v3(totmat[0]);
                                        
                                        /* the y axis is fixed */
-                                       totmat[1][0] = cob->matrix[1][0];
-                                       totmat[1][1] = cob->matrix[1][1];
-                                       totmat[1][2] = cob->matrix[1][2];
-                                       normalize_v3(totmat[1]);
+                                       normalize_v3_v3(totmat[1], cob->matrix[1]);
                                        
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
@@ -2430,10 +2396,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        negate_v3(totmat[2]);
                                        
                                        /* the y axis is fixed */
-                                       totmat[1][0] = cob->matrix[1][0];
-                                       totmat[1][1] = cob->matrix[1][1];
-                                       totmat[1][2] = cob->matrix[1][2];
-                                       normalize_v3(totmat[1]);
+                                       normalize_v3_v3(totmat[1], cob->matrix[1]);
                                        
                                        /* the z axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2441,9 +2404,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        break;
                                default:
                                {
-                                       totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
-                                       totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
-                                       totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+                                       unit_m3(totmat);
                                }
                                        break;
                        }
@@ -2460,10 +2421,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        normalize_v3(totmat[0]);
                                        
                                        /* the z axis is fixed */
-                                       totmat[2][0] = cob->matrix[2][0];
-                                       totmat[2][1] = cob->matrix[2][1];
-                                       totmat[2][2] = cob->matrix[2][2];
-                                       normalize_v3(totmat[2]);
+                                       normalize_v3_v3(totmat[2], cob->matrix[2]);
                                        
                                        /* the x axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2477,10 +2435,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        normalize_v3(totmat[1]);
                                        
                                        /* the z axis is fixed */
-                                       totmat[2][0] = cob->matrix[2][0];
-                                       totmat[2][1] = cob->matrix[2][1];
-                                       totmat[2][2] = cob->matrix[2][2];
-                                       normalize_v3(totmat[2]);
+                                       normalize_v3_v3(totmat[2], cob->matrix[2]);
                                                
                                        /* the x axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2495,10 +2450,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        negate_v3(totmat[0]);
                                        
                                        /* the z axis is fixed */
-                                       totmat[2][0] = cob->matrix[2][0];
-                                       totmat[2][1] = cob->matrix[2][1];
-                                       totmat[2][2] = cob->matrix[2][2];
-                                       normalize_v3(totmat[2]);
+                                       normalize_v3_v3(totmat[2], cob->matrix[2]);
                                        
                                        /* the x axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
@@ -2513,10 +2465,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        negate_v3(totmat[1]);
                                        
                                        /* the z axis is fixed */
-                                       totmat[2][0] = cob->matrix[2][0];
-                                       totmat[2][1] = cob->matrix[2][1];
-                                       totmat[2][2] = cob->matrix[2][2];
-                                       normalize_v3(totmat[2]);
+                                       normalize_v3_v3(totmat[2], cob->matrix[2]);
                                                
                                        /* the x axis gets mapped onto a third orthogonal vector */
                                        cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
@@ -2524,9 +2473,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        break;
                                default:
                                {
-                                       totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
-                                       totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
-                                       totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+                                       unit_m3(totmat);
                                }
                                        break;
                        }
@@ -2534,19 +2481,13 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                        break;
                default:
                {
-                       totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
-                       totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
-                       totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+                       unit_m3(totmat);
                }
                        break;
                }
                /* Block to keep matrix heading */
-               tmpmat[0][0] = cob->matrix[0][0];tmpmat[0][1] = cob->matrix[0][1];tmpmat[0][2] = cob->matrix[0][2];
-               tmpmat[1][0] = cob->matrix[1][0];tmpmat[1][1] = cob->matrix[1][1];tmpmat[1][2] = cob->matrix[1][2];
-               tmpmat[2][0] = cob->matrix[2][0];tmpmat[2][1] = cob->matrix[2][1];tmpmat[2][2] = cob->matrix[2][2];
-               normalize_v3(tmpmat[0]);
-               normalize_v3(tmpmat[1]);
-               normalize_v3(tmpmat[2]);
+               copy_m3_m4(tmpmat, cob->matrix);
+               normalize_m3(tmpmat);
                invert_m3_m3(invmat, tmpmat);
                mul_m3_m3m3(tmpmat, totmat, invmat);
                totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2];
@@ -2559,9 +2500,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                                totmat[1][0],totmat[1][1],totmat[1][2],
                                                totmat[2][0],totmat[2][1],totmat[2][2]);
                if (mdet==0) {
-                       totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
-                       totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
-                       totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
+                       unit_m3(totmat);
                }
                
                /* apply out transformaton to the object */
@@ -2689,7 +2628,7 @@ static void distlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                        interp_v3_v3v3(dvec, ct->matrix[3], cob->matrix[3], sfac);
                        
                        /* copy new vector onto owner */
-                       VECCOPY(cob->matrix[3], dvec);
+                       copy_v3_v3(cob->matrix[3], dvec);
                }
        }
 }
@@ -2772,16 +2711,10 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                mat4_to_size(size, cob->matrix);
                
                /* store X orientation before destroying obmat */
-               xx[0] = cob->matrix[0][0];
-               xx[1] = cob->matrix[0][1];
-               xx[2] = cob->matrix[0][2];
-               normalize_v3(xx);
+               normalize_v3_v3(xx, cob->matrix[0]);
                
                /* store Z orientation before destroying obmat */
-               zz[0] = cob->matrix[2][0];
-               zz[1] = cob->matrix[2][1];
-               zz[2] = cob->matrix[2][2];
-               normalize_v3(zz);
+               normalize_v3_v3(zz, cob->matrix[2]);
                
                sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
                vec[0] /= size[0];
@@ -2836,9 +2769,7 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                normalize_v3(vec);
                
                /* new Y aligns  object target connection*/
-               totmat[1][0] = -vec[0];
-               totmat[1][1] = -vec[1];
-               totmat[1][2] = -vec[2];
+               negate_v3_v3(totmat[1], vec);
                switch (data->plane) {
                case PLANE_X:
                        /* build new Z vector */
@@ -2847,16 +2778,11 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                        normalize_v3(orth);
                        
                        /* new Z*/
-                       totmat[2][0] = orth[0];
-                       totmat[2][1] = orth[1];
-                       totmat[2][2] = orth[2];
+                       copy_v3_v3(totmat[2], orth);
                        
                        /* we decided to keep X plane*/
                        cross_v3_v3v3(xx, orth, vec);
-                       normalize_v3(xx);
-                       totmat[0][0] = xx[0];
-                       totmat[0][1] = xx[1];
-                       totmat[0][2] = xx[2];
+                       normalize_v3_v3(totmat[0], xx);
                        break;
                case PLANE_Z:
                        /* build new X vector */
@@ -2865,16 +2791,11 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                        normalize_v3(orth);
                        
                        /* new X */
-                       totmat[0][0] = -orth[0];
-                       totmat[0][1] = -orth[1];
-                       totmat[0][2] = -orth[2];
+                       negate_v3_v3(totmat[0], orth);
                        
                        /* we decided to keep Z */
                        cross_v3_v3v3(zz, orth, vec);
-                       normalize_v3(zz);
-                       totmat[2][0] = zz[0];
-                       totmat[2][1] = zz[1];
-                       totmat[2][2] = zz[2];
+                       normalize_v3_v3(totmat[2], zz);
                        break;
                } /* switch (data->plane) */
                
@@ -3006,10 +2927,10 @@ static void minmax_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *tar
                        obmat[3][index] = tarmat[3][index] + data->offset;
                        if (data->flag & MINMAX_STICKY) {
                                if (data->flag & MINMAX_STUCK) {
-                                       VECCOPY(obmat[3], data->cache);
+                                       copy_v3_v3(obmat[3], data->cache);
                                } 
                                else {
-                                       VECCOPY(data->cache, obmat[3]);
+                                       copy_v3_v3(data->cache, obmat[3]);
                                        data->flag |= MINMAX_STUCK;
                                }
                        }
@@ -3019,7 +2940,7 @@ static void minmax_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *tar
                                copy_m4_m4(cob->matrix, tmat);
                        } 
                        else {                  
-                               VECCOPY(cob->matrix[3], obmat[3]);
+                               copy_v3_v3(cob->matrix[3], obmat[3]);
                        }
                } 
                else {
@@ -3174,7 +3095,7 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                
                copy_m4_m4(obmat, cob->matrix);
                unit_m4(targetMatrix);
-               VECCOPY(ownLoc, obmat[3]);
+               copy_v3_v3(ownLoc, obmat[3]);
                
                INIT_MINMAX(curveMin, curveMax)
                minmax_object(ct->tar, curveMin, curveMax);
@@ -3263,14 +3184,14 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                        /* 3. position on curve */
                        if (where_on_path(ct->tar, curvetime, vec, dir, NULL, NULL, NULL) ) {
                                unit_m4(totmat);
-                               VECCOPY(totmat[3], vec);
+                               copy_v3_v3(totmat[3], vec);
                                
                                mul_serie_m4(targetMatrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
                        }
                }
                
                /* obtain final object position */
-               VECCOPY(cob->matrix[3], targetMatrix[3]);
+               copy_v3_v3(cob->matrix[3], targetMatrix[3]);
        }
 }
 
@@ -3362,7 +3283,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                }
                
                /* extract components of owner's matrix */
-               VECCOPY(loc, cob->matrix[3]);
+               copy_v3_v3(loc, cob->matrix[3]);
                mat4_to_eulO(eul, cob->rotOrder, cob->matrix);
                mat4_to_size(size, cob->matrix);        
                
@@ -3556,7 +3477,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                                                fail = TRUE;
                                                break;
                                        }
-                                       VECCOPY(co, hit.co);
+                                       copy_v3_v3(co, hit.co);
                                break;
                        }
                        
@@ -3572,7 +3493,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                        
                        /* co is in local object coordinates, change it to global and update target position */
                        mul_m4_v3(cob->matrix, co);
-                       VECCOPY(ct->matrix[3], co);
+                       copy_v3_v3(ct->matrix[3], co);
                }
        }
 }
@@ -3584,7 +3505,7 @@ static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
        /* only evaluate if there is a target */
        if (VALID_CONS_TARGET(ct))
        {
-               VECCOPY(cob->matrix[3], ct->matrix[3]);
+               copy_v3_v3(cob->matrix[3], ct->matrix[3]);
        }
 }
 
@@ -3668,23 +3589,23 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                 *      - the normalisation step at the end should take care of any unwanted scaling
                 *        left over in the 3x3 matrix we used
                 */
-               VECCOPY(obvec, track_dir_vecs[data->trackflag]);
+               copy_v3_v3(obvec, track_dir_vecs[data->trackflag]);
                mul_mat3_m4_v3(cob->matrix, obvec);
                
                if (normalize_v3(obvec) == 0.0f) {
                        /* exceptional case - just use the track vector as appropriate */
-                       VECCOPY(obvec, track_dir_vecs[data->trackflag]);
+                       copy_v3_v3(obvec, track_dir_vecs[data->trackflag]);
                }
                
                /* find the (unit) direction vector going from the owner to the target */
-               VECCOPY(obloc, cob->matrix[3]);
+               copy_v3_v3(obloc, cob->matrix[3]);
                sub_v3_v3v3(tarvec, ct->matrix[3], obloc);
                
                if (normalize_v3(tarvec) == 0.0f) {
                        /* the target is sitting on the owner, so just make them use the same direction vectors */
                        // FIXME: or would it be better to use the pure direction vector?
-                       VECCOPY(tarvec, obvec);
-                       //VECCOPY(tarvec, track_dir_vecs[data->trackflag]);
+                       copy_v3_v3(tarvec, obvec);
+                       //copy_v3_v3(tarvec, track_dir_vecs[data->trackflag]);
                }
                
                /* determine the axis-angle rotation, which represents the smallest possible rotation
@@ -3712,7 +3633,7 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                mul_m4_m3m4(tmat, rmat, cob->matrix); // m1, m3, m2
                
                copy_m4_m4(cob->matrix, tmat);
-               VECCOPY(cob->matrix[3], obloc);
+               copy_v3_v3(cob->matrix[3], obloc);
        }
 }
 
@@ -3907,7 +3828,7 @@ static void pivotcon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
                }
                else {
                        /* directly use the 'offset' specified as an absolute position instead */
-                       VECCOPY(pivot, data->offset);
+                       copy_v3_v3(pivot, data->offset);
                }
        }
        
index 1f8360324d51433c465efbbf1a563e91bae163b8..382c0690ae33cb2f40da928c8a57ba2fbfe4d4f9 100644 (file)
@@ -41,6 +41,8 @@
 #include "DNA_screen_types.h"
 #include "DNA_windowmanager_types.h"
 
+#include "MEM_guardedalloc.h"
+
 #include "BLI_ghash.h"
 
 #include "BKE_animsys.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
 
-#include "MEM_guardedalloc.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
- #include "depsgraph_private.h"
+#include "depsgraph_private.h"
  
 /* Queue and stack operations for dag traversal 
  *
@@ -2180,7 +2176,7 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay)
                dag_object_time_update_flags(scene->camera);
        
        /* and store the info in groupobject */
-       for(group= G.main->group.first; group; group= group->id.next) {
+       for(group= bmain->group.first; group; group= group->id.next) {
                if(group->id.flag & LIB_DOIT) {
                        for(go= group->gobject.first; go; go= go->next) {
                                go->recalc= go->ob->recalc;
index 5f55814341ba092be7a60ffe87c941310a667140..6f6d405dd90bf51558ea53accae5e1bbc00d29f8 100644 (file)
@@ -662,8 +662,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
                where_is_object_time(eff->scene, ob, cfra);
 
                /* use z-axis as normal*/
-               VECCOPY(efd->nor, ob->obmat[2]);
-               normalize_v3(efd->nor);
+               normalize_v3_v3(efd->nor, ob->obmat[2]);
 
                /* for vortex the shape chooses between old / new force */
                if(eff->pd && eff->pd->shape == PFIELD_SHAPE_PLANE) {
@@ -707,8 +706,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
                else {
                        /* for some effectors we need the object center every time */
                        sub_v3_v3v3(efd->vec_to_point2, point->loc, eff->ob->obmat[3]);
-                       VECCOPY(efd->nor2, eff->ob->obmat[2]);
-                       normalize_v3(efd->nor2);
+                       normalize_v3_v3(efd->nor2, eff->ob->obmat[2]);
                }
        }
 
index 8a6f0af87d1dae5b4f9789e4fdf5d5db2b1fafa8..04ce6c39694771d8800e873f31c241048ff86800 100644 (file)
@@ -50,7 +50,6 @@
 #include "BKE_global.h"
 #include "BKE_modifier.h"
 #include "BKE_mesh.h"
-#include "BKE_pointcache.h"
 #include "BKE_utildefines.h"
 
 // headers for fluidsim bobj meshes
index 3271749643a2216503fd1b6601f7b485759a7bb1..124e636577764ff88ebbc13adafdebc317df5c2b 100644 (file)
 #include "BKE_idprop.h"
 #include "BKE_utildefines.h"
 
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h" /* for BPY_eval_driver() */
-#endif
-
 #define SMALL -1.0e-10
 #define SELECT 1
 
index 6377a6f6ccd87c49bc374691d3d1b11311f07f3f..bdf203119c39ce5f00131c575930ae41e99bab8d 100644 (file)
@@ -69,21 +69,22 @@ void free_group_objects(Group *group)
 
 void unlink_group(Group *group)
 {
+       Main *bmain= G.main;
        Material *ma;
        Object *ob;
        Scene *sce;
        SceneRenderLayer *srl;
        ParticleSystem *psys;
        
-       for(ma= G.main->mat.first; ma; ma= ma->id.next) {
+       for(ma= bmain->mat.first; ma; ma= ma->id.next) {
                if(ma->group==group)
                        ma->group= NULL;
        }
-       for(ma= G.main->mat.first; ma; ma= ma->id.next) {
+       for(ma= bmain->mat.first; ma; ma= ma->id.next) {
                if(ma->group==group)
                        ma->group= NULL;
        }
-       for (sce= G.main->scene.first; sce; sce= sce->id.next) {
+       for (sce= bmain->scene.first; sce; sce= sce->id.next) {
                Base *base= sce->base.first;
                
                /* ensure objects are not in this group */
@@ -100,7 +101,7 @@ void unlink_group(Group *group)
                }
        }
        
-       for(ob= G.main->object.first; ob; ob= ob->id.next) {
+       for(ob= bmain->object.first; ob; ob= ob->id.next) {
                bActionStrip *strip;
                
                if(ob->dup_group==group) {
index d544174b0d453dfd6d08e04870ab855fca8d281b..158f964a846b61af001b90f8b3ca6b933924a353 100644 (file)
@@ -1626,9 +1626,8 @@ static void cloth_calc_force(ClothModifierData *clmd, float frame, lfVector *lF,
                                CalcFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],triunnormal);
                        else
                                CalcFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],triunnormal);
-                       
-                       VECCOPY(trinormal, triunnormal);
-                       normalize_v3(trinormal);
+
+                       normalize_v3_v3(trinormal, triunnormal);
                        
                        // add wind from v1
                        VECCOPY(tmp, trinormal);
index 6b79a7b4d62420cdb406d395d0ee6e6fbc133242..9774e97f69b5f9c8c6fb504f2e2e88a8865f9a92 100644 (file)
 #include "BKE_node.h"
 #include "BKE_utildefines.h"
 
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
 #include "GPU_material.h"
 
 /* used in UI and render */
@@ -236,6 +232,7 @@ Material *copy_material(Material *ma)
 
 void make_local_material(Material *ma)
 {
+       Main *bmain= G.main;
        Object *ob;
        Mesh *me;
        Curve *cu;
@@ -261,7 +258,7 @@ void make_local_material(Material *ma)
        }
        
        /* test objects */
-       ob= G.main->object.first;
+       ob= bmain->object.first;
        while(ob) {
                if(ob->mat) {
                        for(a=0; a<ob->totcol; a++) {
@@ -274,7 +271,7 @@ void make_local_material(Material *ma)
                ob= ob->id.next;
        }
        /* test meshes */
-       me= G.main->mesh.first;
+       me= bmain->mesh.first;
        while(me) {
                if(me->mat) {
                        for(a=0; a<me->totcol; a++) {
@@ -287,7 +284,7 @@ void make_local_material(Material *ma)
                me= me->id.next;
        }
        /* test curves */
-       cu= G.main->curve.first;
+       cu= bmain->curve.first;
        while(cu) {
                if(cu->mat) {
                        for(a=0; a<cu->totcol; a++) {
@@ -300,7 +297,7 @@ void make_local_material(Material *ma)
                cu= cu->id.next;
        }
        /* test mballs */
-       mb= G.main->mball.first;
+       mb= bmain->mball.first;
        while(mb) {
                if(mb->mat) {
                        for(a=0; a<mb->totcol; a++) {
@@ -329,7 +326,7 @@ void make_local_material(Material *ma)
                man->id.us= 0;
                
                /* do objects */
-               ob= G.main->object.first;
+               ob= bmain->object.first;
                while(ob) {
                        if(ob->mat) {
                                for(a=0; a<ob->totcol; a++) {
@@ -345,7 +342,7 @@ void make_local_material(Material *ma)
                        ob= ob->id.next;
                }
                /* do meshes */
-               me= G.main->mesh.first;
+               me= bmain->mesh.first;
                while(me) {
                        if(me->mat) {
                                for(a=0; a<me->totcol; a++) {
@@ -361,7 +358,7 @@ void make_local_material(Material *ma)
                        me= me->id.next;
                }
                /* do curves */
-               cu= G.main->curve.first;
+               cu= bmain->curve.first;
                while(cu) {
                        if(cu->mat) {
                                for(a=0; a<cu->totcol; a++) {
@@ -377,7 +374,7 @@ void make_local_material(Material *ma)
                        cu= cu->id.next;
                }
                /* do mballs */
-               mb= G.main->mball.first;
+               mb= bmain->mball.first;
                while(mb) {
                        if(mb->mat) {
                                for(a=0; a<mb->totcol; a++) {
index 7129ecb1d55f0a6af4934fe2b68b2806742d79f5..94131fdbe9dd8397921f5affdecc82a006ea9c37 100644 (file)
@@ -265,6 +265,7 @@ void make_local_tface(Mesh *me)
 
 void make_local_mesh(Mesh *me)
 {
+       Main *bmain= G.main;
        Object *ob;
        Mesh *men;
        int local=0, lib=0;
@@ -285,7 +286,7 @@ void make_local_mesh(Mesh *me)
                return;
        }
        
-       ob= G.main->object.first;
+       ob= bmain->object.first;
        while(ob) {
                if( me==get_mesh(ob) ) {
                        if(ob->id.lib) lib= 1;
@@ -306,7 +307,7 @@ void make_local_mesh(Mesh *me)
                men= copy_mesh(me);
                men->id.us= 0;
                
-               ob= G.main->object.first;
+               ob= bmain->object.first;
                while(ob) {
                        if( me==get_mesh(ob) ) {                                
                                if(ob->id.lib==0) {
@@ -925,6 +926,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int
 /* this may fail replacing ob->data, be sure to check ob->type */
 void nurbs_to_mesh(Object *ob)
 {
+       Main *bmain= G.main;
        Object *ob1;
        DerivedMesh *dm= ob->derivedFinal;
        Mesh *me;
@@ -967,13 +969,13 @@ void nurbs_to_mesh(Object *ob)
        cu->totcol= 0;
 
        if(ob->data) {
-               free_libblock(&G.main->curve, ob->data);
+               free_libblock(&bmain->curve, ob->data);
        }
        ob->data= me;
        ob->type= OB_MESH;
 
        /* other users */
-       ob1= G.main->object.first;
+       ob1= bmain->object.first;
        while(ob1) {
                if(ob1->data==cu) {
                        ob1->type= OB_MESH;
@@ -1234,14 +1236,10 @@ void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces,
                MVert *mv= &mverts[i];
                float *no= tnorms[i];
                
-               if (normalize_v3(no)==0.0) {
-                       VECCOPY(no, mv->co);
-                       normalize_v3(no);
-               }
+               if (normalize_v3(no)==0.0)
+                       normalize_v3_v3(no, mv->co);
 
-               mv->no[0]= (short)(no[0]*32767.0);
-               mv->no[1]= (short)(no[1]*32767.0);
-               mv->no[2]= (short)(no[2]*32767.0);
+               normal_float_to_short_v3(mv->no, no);
        }
        
        MEM_freeN(tnorms);
index ea118e4a53c1f2cc48640af84f4bf1c7bdefa617..63f0f1fa09183101a94e37410b67be74c8dff569 100644 (file)
 *
 */
 
-#include "stddef.h"
-#include "string.h"
-#include "stdarg.h"
-#include "math.h"
-#include "float.h"
+#include <stddef.h>
+#include <string.h>
+#include <stdarg.h>
+#include <math.h>
+#include <float.h>
 
 #include "DNA_armature_types.h"
 #include "DNA_object_types.h"
 #include "DNA_meshdata_types.h"
 
+#include "MEM_guardedalloc.h"
+
 #include "BKE_bmesh.h"
 #include "BKE_cloth.h"
 #include "BKE_key.h"
index ea30b33655f5445179a5a89b3f280499421b2ef8..9dca0fa82e4ab8045a0021049f36f08c014e9f50 100644 (file)
@@ -45,7 +45,6 @@
 
 #include "PIL_time.h"
 
-#include "MEM_guardedalloc.h"
 
 #include "CMP_node.h"
 #include "intern/CMP_util.h"   /* stupid include path... */
index 115cfac762718e01c0e507ddabb69622ddcf8a25..b43cf72b94b7a0cf2cb197a13051bcadb7703fac 100644 (file)
@@ -322,6 +322,7 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec
 
 void unlink_object(Scene *scene, Object *ob)
 {
+       Main *bmain= G.main;
        Object *obt;
        Material *mat;
        World *wrld;
@@ -343,7 +344,7 @@ void unlink_object(Scene *scene, Object *ob)
        
        /* check all objects: parents en bevels and fields, also from libraries */
        // FIXME: need to check all animation blocks (drivers)
-       obt= G.main->object.first;
+       obt= bmain->object.first;
        while(obt) {
                if(obt->proxy==ob)
                        obt->proxy= NULL;
@@ -517,7 +518,7 @@ void unlink_object(Scene *scene, Object *ob)
        }
        
        /* materials */
-       mat= G.main->mat.first;
+       mat= bmain->mat.first;
        while(mat) {
        
                for(a=0; a<MAX_MTEX; a++) {
@@ -531,7 +532,7 @@ void unlink_object(Scene *scene, Object *ob)
        }
        
        /* textures */
-       tex= G.main->tex.first;
+       tex= bmain->tex.first;
        while(tex) {
                if(tex->env) {
                        if(tex->env->object == ob) tex->env->object= NULL;
@@ -540,7 +541,7 @@ void unlink_object(Scene *scene, Object *ob)
        }
 
        /* worlds */
-       wrld= G.main->world.first;
+       wrld= bmain->world.first;
        while(wrld) {
                if(wrld->id.lib==NULL) {
                        for(a=0; a<MAX_MTEX; a++) {
@@ -553,7 +554,7 @@ void unlink_object(Scene *scene, Object *ob)
        }
                
        /* scenes */
-       sce= G.main->scene.first;
+       sce= bmain->scene.first;
        while(sce) {
                if(sce->id.lib==NULL) {
                        if(sce->camera==ob) sce->camera= NULL;
@@ -585,7 +586,7 @@ void unlink_object(Scene *scene, Object *ob)
        
 #if 0 // XXX old animation system
        /* ipos */
-       ipo= G.main->ipo.first;
+       ipo= bmain->ipo.first;
        while(ipo) {
                if(ipo->id.lib==NULL) {
                        IpoCurve *icu;
@@ -599,7 +600,7 @@ void unlink_object(Scene *scene, Object *ob)
 #endif // XXX old animation system
        
        /* screens */
-       sc= G.main->screen.first;
+       sc= bmain->screen.first;
        while(sc) {
                ScrArea *sa= sc->areabase.first;
                while(sa) {
@@ -664,14 +665,14 @@ void unlink_object(Scene *scene, Object *ob)
        }
 
        /* groups */
-       group= G.main->group.first;
+       group= bmain->group.first;
        while(group) {
                rem_from_group(group, ob, NULL, NULL);
                group= group->id.next;
        }
        
        /* cameras */
-       camera= G.main->camera.first;
+       camera= bmain->camera.first;
        while(camera) {
                if (camera->dof_ob==ob) {
                        camera->dof_ob = NULL;
@@ -725,6 +726,7 @@ Camera *copy_camera(Camera *cam)
 
 void make_local_camera(Camera *cam)
 {
+       Main *bmain= G.main;
        Object *ob;
        Camera *camn;
        int local=0, lib=0;
@@ -742,7 +744,7 @@ void make_local_camera(Camera *cam)
                return;
        }
        
-       ob= G.main->object.first;
+       ob= bmain->object.first;
        while(ob) {
                if(ob->data==cam) {
                        if(ob->id.lib) lib= 1;
@@ -760,7 +762,7 @@ void make_local_camera(Camera *cam)
                camn= copy_camera(cam);
                camn->id.us= 0;
                
-               ob= G.main->object.first;
+               ob= bmain->object.first;
                while(ob) {
                        if(ob->data==cam) {
                                
@@ -873,6 +875,7 @@ Lamp *copy_lamp(Lamp *la)
 
 void make_local_lamp(Lamp *la)
 {
+       Main *bmain= G.main;
        Object *ob;
        Lamp *lan;
        int local=0, lib=0;
@@ -890,7 +893,7 @@ void make_local_lamp(Lamp *la)
                return;
        }
        
-       ob= G.main->object.first;
+       ob= bmain->object.first;
        while(ob) {
                if(ob->data==la) {
                        if(ob->id.lib) lib= 1;
@@ -908,7 +911,7 @@ void make_local_lamp(Lamp *la)
                lan= copy_lamp(la);
                lan->id.us= 0;
                
-               ob= G.main->object.first;
+               ob= bmain->object.first;
                while(ob) {
                        if(ob->data==la) {
                                
@@ -1366,6 +1369,7 @@ void expand_local_object(Object *ob)
 
 void make_local_object(Object *ob)
 {
+       Main *bmain= G.main;
        Object *obn;
        Scene *sce;
        Base *base;
@@ -1387,7 +1391,7 @@ void make_local_object(Object *ob)
 
        }
        else {
-               sce= G.main->scene.first;
+               sce= bmain->scene.first;
                while(sce) {
                        base= sce->base.first;
                        while(base) {
@@ -1410,7 +1414,7 @@ void make_local_object(Object *ob)
                        obn= copy_object(ob);
                        obn->id.us= 0;
                        
-                       sce= G.main->scene.first;
+                       sce= bmain->scene.first;
                        while(sce) {
                                if(sce->id.lib==0) {
                                        base= sce->base.first;
index 3343df6b8a7da1777211fd01ead6e9d3e4a0bb2d..ffb99c10c40c8fd46fee1ddf8707a7e3662c2ac6 100644 (file)
@@ -25,7 +25,6 @@
  * ***** END GPL LICENSE BLOCK *****
  */ 
 
-#include "MEM_guardedalloc.h"
 
 #include "DNA_object_types.h"
 #include "DNA_mesh_types.h"
index 7b3638f0e337282feb7ab1dbf1dd2c644b85f702..681c48b0cf82ebfe8045155750d771e3c491795f 100644 (file)
@@ -624,8 +624,7 @@ static float psys_render_projected_area(ParticleSystem *psys, float *center, flo
        mul_m4_v4(data->viewmat, co);
        
        /* compute two vectors orthogonal to view vector */
-       VECCOPY(view, co);
-       normalize_v3(view);
+       normalize_v3_v3(view, co);
        ortho_basis_v3v3_v3( ortho1, ortho2,view);
 
        /* compute on screen minification */
@@ -1923,8 +1922,7 @@ static void do_prekink(ParticleKey *state, ParticleKey *par, float *par_rot, flo
                                mul_qt_v3(q2,z_vec);
                                
                                VECSUB(vec_from_par,state->co,par->co);
-                               VECCOPY(vec_one,vec_from_par);
-                               radius=normalize_v3(vec_one);
+                               radius= normalize_v3_v3(vec_one, vec_from_par);
 
                                inp_y=dot_v3v3(y_vec,vec_one);
                                inp_z=dot_v3v3(z_vec,vec_one);
@@ -2929,8 +2927,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
                        if(k == 1) {
                                /* calculate initial tangent for incremental rotations */
                                VECSUB(tangent, ca->co, (ca - 1)->co);
-                               VECCOPY(prev_tangent, tangent);
-                               normalize_v3(prev_tangent);
+                               normalize_v3_v3(prev_tangent, tangent);
 
                                /* First rotation is based on emitting face orientation.                */
                                /* This is way better than having flipping rotations resulting  */
@@ -3106,8 +3103,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
                                        if(k == 1) {
                                                /* calculate initial tangent for incremental rotations */
                                                VECSUB(tangent, ca->co, (ca - 1)->co);
-                                               VECCOPY(prev_tangent, tangent);
-                                               normalize_v3(prev_tangent);
+                                               normalize_v3_v3(prev_tangent, tangent);
 
                                                /* First rotation is based on emitting face orientation.                */
                                                /* This is way better than having flipping rotations resulting  */
@@ -4371,20 +4367,14 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
                onevec[bb->align]=1.0f;
 
        if(bb->lock && (bb->align == PART_BB_VIEW)) {
-               VECCOPY(xvec, bb->ob->obmat[0]);
-               normalize_v3(xvec);
-
-               VECCOPY(yvec, bb->ob->obmat[1]);
-               normalize_v3(yvec);
-
-               VECCOPY(zvec, bb->ob->obmat[2]);
-               normalize_v3(zvec);
+               normalize_v3_v3(xvec, bb->ob->obmat[0]);
+               normalize_v3_v3(yvec, bb->ob->obmat[1]);
+               normalize_v3_v3(zvec, bb->ob->obmat[2]);
        }
        else if(bb->align == PART_BB_VEL) {
                float temp[3];
 
-               VECCOPY(temp, bb->vel);
-               normalize_v3(temp);
+               normalize_v3_v3(temp, bb->vel);
 
                VECSUB(zvec, bb->ob->obmat[3], bb->vec);
 
index 9b9c3ff16b6c64480b87f945a77a53263d7ccb73..cfbab609f3732b650a39e061af82efd9ebbbeee7 100644 (file)
@@ -1729,8 +1729,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
                mul_qt_v3(rot, vtan);
                mul_qt_v3(rot, utan);
 
-               VECCOPY(p_vel, state.vel);
-               speed=normalize_v3(p_vel);
+               speed= normalize_v3_v3(p_vel, state.vel);
                mul_v3_fl(p_vel, dot_v3v3(r_vel, p_vel));
                VECSUB(p_vel, r_vel, p_vel);
                normalize_v3(p_vel);
@@ -1871,18 +1870,15 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
 
                /*              *emitter object orientation             */
                if(part->ob_vel[0]!=0.0) {
-                       VECCOPY(vec, ob->obmat[0]);
-                       normalize_v3(vec);
+                       normalize_v3_v3(vec, ob->obmat[0]);
                        VECADDFAC(vel, vel, vec, part->ob_vel[0]);
                }
                if(part->ob_vel[1]!=0.0) {
-                       VECCOPY(vec, ob->obmat[1]);
-                       normalize_v3(vec);
+                       normalize_v3_v3(vec, ob->obmat[1]);
                        VECADDFAC(vel, vel, vec, part->ob_vel[1]);
                }
                if(part->ob_vel[2]!=0.0) {
-                       VECCOPY(vec, ob->obmat[2]);
-                       normalize_v3(vec);
+                       normalize_v3_v3(vec, ob->obmat[2]);
                        VECADDFAC(vel, vel, vec, part->ob_vel[2]);
                }
 
index 6cf49808ec71a15d6a4b2fb3812bcb462e1e6dbe..a35e40d7cf7afa22b8f4e6432573ea1ac291c4d5 100644 (file)
@@ -2240,7 +2240,7 @@ void BKE_ptcache_remove(void)
 
 static int CONTINUE_PHYSICS = 0;
 
-void BKE_ptcache_set_continue_physics(Scene *scene, int enable)
+void BKE_ptcache_set_continue_physics(Main *bmain, Scene *scene, int enable)
 {
        Object *ob;
 
@@ -2248,7 +2248,7 @@ void BKE_ptcache_set_continue_physics(Scene *scene, int enable)
                CONTINUE_PHYSICS = enable;
 
                if(CONTINUE_PHYSICS == 0) {
-                       for(ob=G.main->object.first; ob; ob=ob->id.next)
+                       for(ob=bmain->object.first; ob; ob=ob->id.next)
                                if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED))
                                        DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
                }
index 95705ea8c05bb255da5d7d6b233ca828613eb46a..8793c412d7dda14f8ffe24c1a3aacd6d31e59585 100644 (file)
@@ -38,7 +38,6 @@
 #else
 #include <io.h>
 #endif
-#include "MEM_guardedalloc.h"
 
 #include "DNA_anim_types.h"
 #include "DNA_group_types.h"
@@ -47,6 +46,8 @@
 #include "DNA_screen_types.h"
 #include "DNA_sequence_types.h"
 
+#include "MEM_guardedalloc.h"
+
 #include "BKE_anim.h"
 #include "BKE_animsys.h"
 #include "BKE_depsgraph.h"
 //XXX #include "BIF_previewrender.h"
 //XXX #include "BIF_editseq.h"
 
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 
@@ -320,11 +317,12 @@ void free_scene(Scene *sce)
 
 Scene *add_scene(char *name)
 {
+       Main *bmain= G.main;
        Scene *sce;
        ParticleEditSettings *pset;
        int a;
 
-       sce= alloc_libblock(&G.main->scene, ID_SCE, name);
+       sce= alloc_libblock(&bmain->scene, ID_SCE, name);
        sce->lay= sce->layact= 1;
        
        sce->r.mode= R_GAMMA|R_OSA|R_SHADOW|R_SSS|R_ENVMAP|R_RAYTRACE;
@@ -586,7 +584,7 @@ void unlink_scene(Main *bmain, Scene *sce, Scene *newsce)
                        sce1->set= NULL;
        
        /* check all sequences */
-       clear_scene_in_allseqs(sce);
+       clear_scene_in_allseqs(bmain, sce);
 
        /* check render layer nodes in other scenes */
        clear_scene_in_nodes(bmain, sce);
index a8140cb815d4aa2465025a48d61dabc4a4a47a94..6f1d32898f98ef9e1a928e53f290bb37359604b5 100644 (file)
 
 #include "BKE_screen.h"
 
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
 /* ************ Spacetype/regiontype handling ************** */
 
 /* keep global; this has to be accessible outside of windowmanager */
index 1e1ace0f75811e3e1bb392c7baf51c67c9b14f09..461cb075bb0106164ffdcbc73df9f7ba283fba7c 100644 (file)
@@ -41,6 +41,7 @@
 #include "DNA_anim_types.h"
 
 #include "BKE_fcurve.h"
+#include "BKE_main.h"
 #include "BKE_plugin_types.h"
 #include "BKE_sequencer.h"
 #include "BKE_texture.h"
@@ -272,7 +273,7 @@ static ImBuf * IMB_cast_away_list(ImBuf * i)
 }
 
 static struct ImBuf * do_plugin_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -523,7 +524,7 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y,
 }
 
 static struct ImBuf * do_alphaover_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -695,7 +696,7 @@ static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y,
 }
 
 static struct ImBuf* do_alphaunder_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -820,7 +821,7 @@ void do_cross_effect_float(float facf0, float facf1, int x, int y,
 /* carefull: also used by speed effect! */
 
 static struct ImBuf* do_cross_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -1087,7 +1088,7 @@ static void do_gammacross_effect_float(float facf0, float facf1,
 }
 
 static struct ImBuf * do_gammacross_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -1205,7 +1206,7 @@ static void do_add_effect_float(float facf0, float facf1, int x, int y,
        }
 }
 
-static struct ImBuf * do_add_effect(Scene *scene, Sequence *seq, float cfra,
+static struct ImBuf * do_add_effect(Main *bmain, Scene *scene, Sequence *seq, float cfra,
                                    float facf0, float facf1, int x, int y, 
                                    int preview_render_size,
                                    struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -1322,7 +1323,7 @@ static void do_sub_effect_float(float facf0, float facf1, int x, int y,
 }
 
 static struct ImBuf * do_sub_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y,
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -1536,7 +1537,7 @@ static void do_mul_effect_float(float facf0, float facf1, int x, int y,
 }
 
 static struct ImBuf * do_mul_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -1992,7 +1993,7 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float facf1,
 }
 
 static struct ImBuf * do_wipe_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -2143,7 +2144,7 @@ static void do_transform(Scene *scene, Sequence *seq, float facf0, int x, int y,
 
 
 static struct ImBuf * do_transform_effect(
-       Scene *scene, Sequence *seq,float cfra,
+       Main *bmain, Scene *scene, Sequence *seq,float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -2661,7 +2662,7 @@ static void do_glow_effect_float(Sequence *seq, float facf0, float facf1,
 }
 
 static struct ImBuf * do_glow_effect(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -2722,7 +2723,7 @@ static int early_out_color(struct Sequence *seq,
 }
 
 static struct ImBuf * do_solid_color(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -2818,7 +2819,7 @@ static int early_out_multicam(struct Sequence *seq, float facf0, float facf1)
 }
 
 static struct ImBuf * do_multicam(
-       Scene *scene, Sequence *seq, float cfra,
+       Main *bmain, Scene *scene, Sequence *seq, float cfra,
        float facf0, float facf1, int x, int y, 
        int preview_render_size,
        struct ImBuf *ibuf1, struct ImBuf *ibuf2, 
@@ -2842,7 +2843,7 @@ static struct ImBuf * do_multicam(
                return 0;
        }
 
-       i = give_ibuf_seqbase(scene, x, y, cfra, seq->multicam_source, 
+       i = give_ibuf_seqbase(bmain, scene, x, y, cfra, seq->multicam_source, 
                              preview_render_size, seqbasep);
        if (!i) {
                return 0;
@@ -3122,7 +3123,7 @@ static void get_default_fac_fade(struct Sequence *seq, float cfra,
        *facf1 /= seq->len;
 }
 
-static struct ImBuf * do_overdrop_effect(Scene *scene, Sequence *seq, float cfra,
+static struct ImBuf * do_overdrop_effect(Main *bmain, Scene *scene, Sequence *seq, float cfra,
                                         float facf0, float facf1, 
                                         int x, int y, 
                                         int preview_render_size,
index 866f907ef9e0a57a663eda452b3dba293e91d918..b20bb111cb46a54e883e89a9e70eb52168fea72c 100644 (file)
@@ -554,7 +554,7 @@ void calc_sequence(Scene *scene, Sequence *seq)
 }
 
 /* note: caller should run calc_sequence(scene, seq) after */
-void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
+void reload_sequence_new_file(Main *bmain, Scene *scene, Sequence * seq, int lock_range)
 {
        char str[FILE_MAXDIR+FILE_MAXFILE];
        int prev_startdisp, prev_enddisp;
@@ -621,7 +621,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
                seq->strip->len = seq->len;
        } else if (seq->type == SEQ_SCENE) {
                /* 'seq->scenenr' should be replaced with something more reliable */
-               Scene * sce = G.main->scene.first;
+               Scene * sce = bmain->scene.first;
                int nr = 1;
                
                while(sce) {
@@ -710,12 +710,12 @@ static int clear_scene_in_allseqs_cb(Sequence *seq, void *arg_pt)
        return 1;
 }
 
-void clear_scene_in_allseqs(Scene *scene)
+void clear_scene_in_allseqs(Main *bmain, Scene *scene)
 {
        Scene *scene_iter;
 
        /* when a scene is deleted: test all seqs */
-       for(scene_iter= G.main->scene.first; scene_iter; scene_iter= scene_iter->id.next) {
+       for(scene_iter= bmain->scene.first; scene_iter; scene_iter= scene_iter->id.next) {
                if(scene_iter != scene && scene_iter->ed) {
                        seqbase_recursive_apply(&scene_iter->ed->seqbase, clear_scene_in_allseqs_cb, scene);
                }
@@ -1659,17 +1659,17 @@ static void copy_to_ibuf_still(Sequence * seq, float nr,
    ********************************************************************** */
 
 static ImBuf* seq_render_strip_stack(
-       Scene *scene,
+       Main *bmain, Scene *scene,
        ListBase *seqbasep, float cfra, int chanshown, int render_size,
        int seqrectx, int seqrecty);
 
-static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
+static ImBuf * seq_render_strip(Main *bmain, Scene *scene, Sequence * seq, float cfra,
                                int render_size, 
                                int seqrectx, int seqrecty);
 
 
 static ImBuf* seq_render_effect_strip_impl(
-       Scene *scene, float cfra, Sequence *seq, int render_size,
+       Main *bmain, Scene *scene, float cfra, Sequence *seq, int render_size,
        int seqrectx, int seqrecty)
 {
        float fac, facf;
@@ -1707,7 +1707,7 @@ static ImBuf* seq_render_effect_strip_impl(
        early_out = sh.early_out(seq, fac, facf);
 
        if (early_out == -1) { /* no input needed */
-               out = sh.execute(scene, seq, cfra, fac, facf, 
+               out = sh.execute(bmain, scene, seq, cfra, fac, facf, 
                                 seqrectx, seqrecty, render_size,
                                 0, 0, 0);
                goto finish;
@@ -1722,7 +1722,7 @@ static ImBuf* seq_render_effect_strip_impl(
                break;
        case 1:
                if (seq->seq1) {
-                       ibuf[0] = seq_render_strip(scene, seq->seq1, cfra,
+                       ibuf[0] = seq_render_strip(bmain, scene, seq->seq1, cfra,
                                                   render_size, 
                                                   seqrectx, seqrecty);
                }
@@ -1737,7 +1737,7 @@ static ImBuf* seq_render_effect_strip_impl(
                goto finish;
        case 2:
                if (seq->seq2) {
-                       ibuf[1] = seq_render_strip(scene, seq->seq2, cfra,
+                       ibuf[1] = seq_render_strip(bmain, scene, seq->seq2, cfra,
                                                   render_size, 
                                                   seqrectx, seqrecty);
                }
@@ -1755,19 +1755,19 @@ static ImBuf* seq_render_effect_strip_impl(
        }
 
        if (seq->seq1) {
-               ibuf[0] = seq_render_strip(scene, seq->seq1, cfra,
+               ibuf[0] = seq_render_strip(bmain, scene, seq->seq1, cfra,
                                           render_size, 
                                           seqrectx, seqrecty);
        } 
 
        if (seq->seq2) {
-               ibuf[1] = seq_render_strip(scene, seq->seq2, cfra,
+               ibuf[1] = seq_render_strip(bmain, scene, seq->seq2, cfra,
                                           render_size, 
                                           seqrectx, seqrecty);
        }
 
        if (seq->seq3) {
-               ibuf[2] = seq_render_strip(scene, seq->seq3, cfra,
+               ibuf[2] = seq_render_strip(bmain, scene, seq->seq3, cfra,
                                           render_size, 
                                           seqrectx, seqrecty);
        }
@@ -1776,7 +1776,7 @@ static ImBuf* seq_render_effect_strip_impl(
                goto finish;
        }
 
-       out = sh.execute(scene, seq, cfra, fac, facf, seqrectx, seqrecty, 
+       out = sh.execute(bmain, scene, seq, cfra, fac, facf, seqrectx, seqrecty, 
                         render_size,
                         ibuf[0], ibuf[1], ibuf[2]);
 
@@ -1795,7 +1795,7 @@ finish:
 
 
 static ImBuf * seq_render_scene_strip_impl(
-       Scene * scene, Sequence * seq, float nr, int seqrectx, int seqrecty)
+       Main *bmain, Scene * scene, Sequence * seq, float nr, int seqrectx, int seqrecty)
 {
        ImBuf * ibuf = 0;
        float frame= seq->sfra + nr + seq->anim_startofs;
@@ -1851,7 +1851,7 @@ static ImBuf * seq_render_scene_strip_impl(
        
        if(sequencer_view3d_cb && BLI_thread_is_main() && doseq_gl && (seq->scene == scene || have_seq==0) && seq->scene->camera) {
                /* opengl offscreen render */
-               scene_update_for_newframe(G.main, seq->scene, seq->scene->lay);
+               scene_update_for_newframe(bmain, seq->scene, seq->scene->lay);
                ibuf= sequencer_view3d_cb(seq->scene, seqrectx, seqrecty, 
                                          scene->r.seq_prev_type);
        }
@@ -1864,7 +1864,7 @@ static ImBuf * seq_render_scene_strip_impl(
                else
                        re= RE_NewRender(sce->id.name);
                
-               RE_BlenderFrame(re, G.main, sce, NULL, sce->lay, frame);
+               RE_BlenderFrame(re, bmain, sce, NULL, sce->lay, frame);
                
                RE_AcquireResultImage(re, &rres);
                
@@ -1904,7 +1904,7 @@ static ImBuf * seq_render_scene_strip_impl(
        return ibuf;
 }
 
-static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
+static ImBuf * seq_render_strip(Main *bmain, Scene *scene, Sequence * seq, float cfra,
                                int render_size, 
                                int seqrectx, int seqrecty)
 {
@@ -1929,7 +1929,7 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
 
                if(!ibuf && seq->seqbase.first) {
                        meta_ibuf = seq_render_strip_stack(
-                               scene,
+                               bmain, scene,
                                &seq->seqbase, seq->start + nr, 0,
                                render_size, seqrectx, seqrecty);
                }
@@ -1961,7 +1961,7 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
                        /* weeek! */
                        f_cfra = seq->start + s->frameMap[(int) nr];
 
-                       child_ibuf = seq_render_strip(scene, seq->seq1, f_cfra,
+                       child_ibuf = seq_render_strip(bmain, scene, seq->seq1, f_cfra,
                                                      render_size, 
                                                      seqrectx, seqrecty);
                }
@@ -1985,7 +1985,7 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
 
                if(ibuf == 0) {         
                        ibuf = seq_render_effect_strip_impl(
-                               scene, cfra, seq, render_size, 
+                               bmain, scene, cfra, seq, render_size, 
                                seqrectx, seqrecty);
                }
        } else if(seq->type == SEQ_IMAGE) {
@@ -2061,7 +2061,7 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
                }
                
                if (ibuf == 0) {
-                       ibuf = seq_render_scene_strip_impl(scene, seq, nr,
+                       ibuf = seq_render_scene_strip_impl(bmain, scene, seq, nr,
                                                           seqrectx, seqrecty);
 
                        copy_to_ibuf_still(seq, nr, ibuf);
@@ -2129,7 +2129,7 @@ static int seq_get_early_out_for_blend_mode(Sequence * seq)
 }
 
 static ImBuf* seq_render_strip_stack(
-       Scene *scene, ListBase *seqbasep, float cfra, int chanshown, 
+       Main *bmain, Scene *scene, ListBase *seqbasep, float cfra, int chanshown, 
        int render_size, int seqrectx, int seqrecty)
 {
        Sequence* seq_arr[MAXSEQ+1];
@@ -2161,7 +2161,7 @@ static ImBuf* seq_render_strip_stack(
        }
        
        if(count == 1) {
-               out = seq_render_strip(scene, seq_arr[0],
+               out = seq_render_strip(bmain, scene, seq_arr[0],
                                        cfra, render_size,
                                        seqrectx, seqrecty);
                seq_stripelem_cache_put(
@@ -2185,7 +2185,7 @@ static ImBuf* seq_render_strip_stack(
                        break;
                }
                if (seq->blend_mode == SEQ_BLEND_REPLACE) {
-                       out = seq_render_strip(scene, seq, cfra,
+                       out = seq_render_strip(bmain, scene, seq, cfra,
                                               render_size,
                                               seqrectx, seqrecty);
                        break;
@@ -2196,7 +2196,7 @@ static ImBuf* seq_render_strip_stack(
                switch (early_out) {
                case -1:
                case 2:
-                       out = seq_render_strip(scene, seq, cfra,
+                       out = seq_render_strip(bmain, scene, seq, cfra,
                                               render_size,
                                               seqrectx, seqrecty);
                        break;
@@ -2209,7 +2209,7 @@ static ImBuf* seq_render_strip_stack(
                        break;
                case 0:
                        if (i == 0) {
-                               out = seq_render_strip(scene, seq, cfra,
+                               out = seq_render_strip(bmain, scene, seq, cfra,
                                                       render_size,
                                                       seqrectx, seqrecty);
                        }
@@ -2234,7 +2234,7 @@ static ImBuf* seq_render_strip_stack(
                if (seq_get_early_out_for_blend_mode(seq) == 0) {
                        struct SeqEffectHandle sh = get_sequence_blend(seq);
                        ImBuf * ibuf1 = out;
-                       ImBuf * ibuf2 = seq_render_strip(scene, seq, cfra,
+                       ImBuf * ibuf2 = seq_render_strip(bmain, scene, seq, cfra,
                                                         render_size,
                                                         seqrectx, seqrecty);
 
@@ -2246,11 +2246,11 @@ static ImBuf* seq_render_strip_stack(
                        int y= seqrecty;
 
                        if (swap_input) {
-                               out = sh.execute(scene, seq, cfra, 
+                               out = sh.execute(bmain, scene, seq, cfra, 
                                                 facf, facf, x, y, render_size,
                                                 ibuf2, ibuf1, 0);
                        } else {
-                               out = sh.execute(scene, seq, cfra, 
+                               out = sh.execute(bmain, scene, seq, cfra, 
                                                 facf, facf, x, y, render_size,
                                                 ibuf1, ibuf2, 0);
                        }
@@ -2272,7 +2272,7 @@ static ImBuf* seq_render_strip_stack(
  * you have to free after usage!
  */
 
-ImBuf *give_ibuf_seq(Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size)
+ImBuf *give_ibuf_seq(Main *bmain, Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size)
 {
        Editing *ed= seq_give_editing(scene, FALSE);
        int count;
@@ -2289,18 +2289,18 @@ ImBuf *give_ibuf_seq(Scene *scene, int rectx, int recty, int cfra, int chanshown
        }
 
        return seq_render_strip_stack(
-               scene, seqbasep, cfra, chanshown, render_size, rectx, recty);
+               bmain, scene, seqbasep, cfra, chanshown, render_size, rectx, recty);
 }
 
-ImBuf *give_ibuf_seqbase(struct Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size, ListBase *seqbasep)
+ImBuf *give_ibuf_seqbase(Main *bmain, Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size, ListBase *seqbasep)
 {
-       return seq_render_strip_stack(scene, seqbasep, cfra, chanshown, render_size, rectx, recty);
+       return seq_render_strip_stack(bmain, scene, seqbasep, cfra, chanshown, render_size, rectx, recty);
 }
 
 
-ImBuf *give_ibuf_seq_direct(Scene *scene, int rectx, int recty, int cfra, int render_size, Sequence *seq)
+ImBuf *give_ibuf_seq_direct(Main *bmain, Scene *scene, int rectx, int recty, int cfra, int render_size, Sequence *seq)
 {
-       return seq_render_strip(scene, seq, cfra, render_size, rectx, recty);
+       return seq_render_strip(bmain, scene, seq, cfra, render_size, rectx, recty);
 }
 
 #if 0
@@ -2566,13 +2566,13 @@ static void seq_wait_for_prefetch_ready()
 }
 #endif
 
-ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size)
+ImBuf *give_ibuf_seq_threaded(Main *bmain, Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size)
 {
        PrefetchQueueElem *e = NULL;
        int found_something = FALSE;
 
        if (seq_thread_shutdown) {
-               return give_ibuf_seq(scene, rectx, recty, cfra, chanshown, render_size);
+               return give_ibuf_seq(bmain, scene, rectx, recty, cfra, chanshown, render_size);
        }
 
        while (!e) {
index bddfeb049a8584d699e240d18e47f34513bb8eeb..01652aaa7139e5a33668e94bb0e6b8978b7a2779 100644 (file)
@@ -51,7 +51,6 @@
 #include "BLI_math.h"
 #include "BLI_editVert.h"
 
-#include "MEM_guardedalloc.h"
 
 
 /* Util macros */
index 33871f788642e0188b4bb54fa1ca4a2c2c542b97..7e39cdd1196b772f67b1f6095196695467e68cd3 100644 (file)
@@ -72,8 +72,7 @@ void sk_initPoint(SK_Point *pt, SK_DrawData *dd, float *no)
 {
        if (no)
        {
-               VECCOPY(pt->no, no);
-               normalize_v3(pt->no);
+               normalize_v3_v3(pt->no, no);
        }
        else
        {
index 97eb3aa866c66f015779d50b6946f4617008254d..11012843131254afa7af3cd81310ac44cf9b951e 100644 (file)
@@ -37,8 +37,8 @@
 
 #include <float.h>
 #include <math.h>
-#include "stdio.h"
-#include "string.h" /* memset */
+#include <stdio.h>
+#include <string.h> /* memset */
 
 #include "BLI_linklist.h"
 #include "BLI_rand.h"
index b8e824ce3d5dd6c20facb272faf1824429dc1f8a..98a50eee14657ff9fdb1e1ff536892feb148c7b6 100644 (file)
@@ -2032,8 +2032,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
        VECCOPY(vel,avel);
        if (ci) *intrusion /= ci;
        if (deflected){
-               VECCOPY(facenormal,force);
-               normalize_v3(facenormal);
+               normalize_v3_v3(facenormal, force);
        }
        return deflected;
 }
index c8f5eb9b1872dc069b3cbbd4fdff9a746f1c8bcf..19bc853276a0c912a44d4530a34052cb815b2dfd 100644 (file)
@@ -174,10 +174,11 @@ void free_text(Text *text)
 
 Text *add_empty_text(char *name) 
 {
+       Main *bmain= G.main;
        Text *ta;
        TextLine *tmp;
        
-       ta= alloc_libblock(&G.main->text, ID_TXT, name);
+       ta= alloc_libblock(&bmain->text, ID_TXT, name);
        ta->id.us= 1;
        
        ta->name= NULL;
@@ -326,6 +327,7 @@ int reopen_text(Text *text)
 
 Text *add_text(char *file, const char *relpath) 
 {
+       Main *bmain= G.main;
        FILE *fp;
        int i, llen, len, res;
        unsigned char *buffer;
@@ -341,7 +343,7 @@ Text *add_text(char *file, const char *relpath)
        fp= fopen(str, "r");
        if(fp==NULL) return NULL;
        
-       ta= alloc_libblock(&G.main->text, ID_TXT, BLI_path_basename(str));
+       ta= alloc_libblock(&bmain->text, ID_TXT, BLI_path_basename(str));
        ta->id.us= 1;
 
        ta->lines.first= ta->lines.last= NULL;
index fe5abbd0868fc57ff24363075ec82e4448d65e52..9075c64d286504946f29958f40acecaaff159dfd 100644 (file)
@@ -602,9 +602,10 @@ void tex_set_type(Tex *tex, int type)
 
 Tex *add_texture(const char *name)
 {
+       Main *bmain= G.main;
        Tex *tex;
 
-       tex= alloc_libblock(&G.main->tex, ID_TE, name);
+       tex= alloc_libblock(&bmain->tex, ID_TE, name);
        
        default_tex(tex);
        
@@ -726,6 +727,7 @@ Tex *copy_texture(Tex *tex)
 
 void make_local_texture(Tex *tex)
 {
+       Main *bmain= G.main;
        Tex *texn;
        Material *ma;
        World *wrld;
@@ -755,7 +757,7 @@ void make_local_texture(Tex *tex)
                return;
        }
        
-       ma= G.main->mat.first;
+       ma= bmain->mat.first;
        while(ma) {
                for(a=0; a<MAX_MTEX; a++) {
                        if(ma->mtex[a] && ma->mtex[a]->tex==tex) {
@@ -765,7 +767,7 @@ void make_local_texture(Tex *tex)
                }
                ma= ma->id.next;
        }
-       la= G.main->lamp.first;
+       la= bmain->lamp.first;
        while(la) {
                for(a=0; a<MAX_MTEX; a++) {
                        if(la->mtex[a] && la->mtex[a]->tex==tex) {
@@ -775,7 +777,7 @@ void make_local_texture(Tex *tex)
                }
                la= la->id.next;
        }
-       wrld= G.main->world.first;
+       wrld= bmain->world.first;
        while(wrld) {
                for(a=0; a<MAX_MTEX; a++) {
                        if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) {
@@ -785,7 +787,7 @@ void make_local_texture(Tex *tex)
                }
                wrld= wrld->id.next;
        }
-       br= G.main->brush.first;
+       br= bmain->brush.first;
        while(br) {
                if(br->mtex.tex==tex) {
                        if(br->id.lib) lib= 1;
@@ -803,7 +805,7 @@ void make_local_texture(Tex *tex)
                texn= copy_texture(tex);
                texn->id.us= 0;
                
-               ma= G.main->mat.first;
+               ma= bmain->mat.first;
                while(ma) {
                        for(a=0; a<MAX_MTEX; a++) {
                                if(ma->mtex[a] && ma->mtex[a]->tex==tex) {
@@ -816,7 +818,7 @@ void make_local_texture(Tex *tex)
                        }
                        ma= ma->id.next;
                }
-               la= G.main->lamp.first;
+               la= bmain->lamp.first;
                while(la) {
                        for(a=0; a<MAX_MTEX; a++) {
                                if(la->mtex[a] && la->mtex[a]->tex==tex) {
@@ -829,7 +831,7 @@ void make_local_texture(Tex *tex)
                        }
                        la= la->id.next;
                }
-               wrld= G.main->world.first;
+               wrld= bmain->world.first;
                while(wrld) {
                        for(a=0; a<MAX_MTEX; a++) {
                                if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) {
@@ -842,7 +844,7 @@ void make_local_texture(Tex *tex)
                        }
                        wrld= wrld->id.next;
                }
-               br= G.main->brush.first;
+               br= bmain->brush.first;
                while(br) {
                        if(br->mtex.tex==tex) {
                                if(br->id.lib==0) {
@@ -860,6 +862,7 @@ void make_local_texture(Tex *tex)
 
 void autotexname(Tex *tex)
 {
+       Main *bmain= G.main;
        char texstr[20][15]= {"None"  , "Clouds" , "Wood", "Marble", "Magic"  , "Blend",
                "Stucci", "Noise"  , "Image", "Plugin", "EnvMap" , "Musgrave",
                "Voronoi", "DistNoise", "Point Density", "Voxel Data", "", "", "", ""};
@@ -868,7 +871,7 @@ void autotexname(Tex *tex)
        
        if(tex) {
                if(tex->use_nodes) {
-                       new_id(&G.main->tex, (ID *)tex, "Noddy");
+                       new_id(&bmain->tex, (ID *)tex, "Noddy");
                }
                else
                if(tex->type==TEX_IMAGE) {
@@ -878,12 +881,12 @@ void autotexname(Tex *tex)
                                BLI_splitdirstring(di, fi);
                                strcpy(di, "I.");
                                strcat(di, fi);
-                               new_id(&G.main->tex, (ID *)tex, di);
+                               new_id(&bmain->tex, (ID *)tex, di);
                        }
-                       else new_id(&G.main->tex, (ID *)tex, texstr[tex->type]);
+                       else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
                }
-               else if(tex->type==TEX_PLUGIN && tex->plugin) new_id(&G.main->tex, (ID *)tex, tex->plugin->pname);
-               else new_id(&G.main->tex, (ID *)tex, texstr[tex->type]);
+               else if(tex->type==TEX_PLUGIN && tex->plugin) new_id(&bmain->tex, (ID *)tex, tex->plugin->pname);
+               else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
        }
 }
 
index 1d1b5ec16f7fc330f88d660c447d904b7d243748..42df92443f367e378d4709f9b2c9187b8e0510dc 100644 (file)
 #include "BKE_main.h"
 #include "BKE_icons.h"
 
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
 void free_world(World *wrld)
 {
        MTex *mtex;
@@ -69,9 +65,10 @@ void free_world(World *wrld)
 
 World *add_world(char *name)
 {
+       Main *bmain= G.main;
        World *wrld;
 
-       wrld= alloc_libblock(&G.main->world, ID_WO, name);
+       wrld= alloc_libblock(&bmain->world, ID_WO, name);
        
        wrld->horr= 0.05f;
        wrld->horg= 0.05f;
@@ -129,6 +126,7 @@ World *copy_world(World *wrld)
 
 void make_local_world(World *wrld)
 {
+       Main *bmain= G.