Merge from trunk -r 23968:24181.
authorArystanbek Dyussenov <arystan.d@gmail.com>
Mon, 2 Nov 2009 16:41:57 +0000 (16:41 +0000)
committerArystanbek Dyussenov <arystan.d@gmail.com>
Mon, 2 Nov 2009 16:41:57 +0000 (16:41 +0000)
332 files changed:
CMakeLists.txt
SConstruct
config/darwin-config.py
extern/Eigen2/Eigen/src/Array/Functors.h
extern/Eigen2/Eigen/src/Array/PartialRedux.h
extern/Eigen2/Eigen/src/Core/CommaInitializer.h
extern/Eigen2/Eigen/src/Core/Cwise.h
extern/Eigen2/Eigen/src/Core/Flagged.h
extern/Eigen2/Eigen/src/Core/Functors.h
extern/Eigen2/Eigen/src/Core/Matrix.h
extern/Eigen2/Eigen/src/Core/NestByValue.h
extern/Eigen2/Eigen/src/Core/Part.h
extern/Eigen2/Eigen/src/Core/Swap.h
extern/Eigen2/Eigen/src/Core/util/Memory.h
extern/Eigen2/Eigen/src/SVD/SVD.h
extern/Eigen2/Eigen/src/Sparse/AmbiVector.h
extern/Eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h
extern/Eigen2/Eigen/src/Sparse/SparseBlock.h
extern/Eigen2/Eigen/src/Sparse/SparseCwise.h
extern/Eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h
extern/Eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h
extern/Eigen2/Eigen/src/Sparse/SparseDiagonalProduct.h
extern/Eigen2/Eigen/src/Sparse/SparseFlagged.h
extern/Eigen2/Eigen/src/Sparse/SparseMatrix.h
extern/Eigen2/Eigen/src/Sparse/SparseTranspose.h
extern/Eigen2/Eigen/src/Sparse/SparseVector.h
extern/Eigen2/eigen-update.sh
extern/glew/include/GL/glew.h
intern/ghost/SConscript
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowCocoa.h
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/ghost/intern/GHOST_WindowX11.cpp
intern/itasc/kdl/frameacc.hpp
intern/itasc/kdl/framevel.hpp
projectfiles_vc9/blender/editors/ED_editors.vcproj
release/environment-macosx [new file with mode: 0644]
release/environment-mswindows [new file with mode: 0644]
release/environment-unix [new file with mode: 0644]
release/scripts/io/export_3ds.py
release/scripts/io/export_ply.py
release/scripts/io/import_3ds.py
release/scripts/modules/autocomplete.py [deleted file]
release/scripts/modules/bpy_ext/Object.py [new file with mode: 0644]
release/scripts/modules/bpy_ext/__init__.py [new file with mode: 0644]
release/scripts/modules/bpy_ops.py
release/scripts/modules/console/__init__.py [new file with mode: 0644]
release/scripts/modules/console/complete_import.py [new file with mode: 0644]
release/scripts/modules/console/complete_namespace.py [new file with mode: 0644]
release/scripts/modules/console/intellisense.py [new file with mode: 0644]
release/scripts/templates/gamelogic.py [new file with mode: 0644]
release/scripts/templates/gamelogic_basic.py [new file with mode: 0644]
release/scripts/templates/gamelogic_module.py [new file with mode: 0644]
release/scripts/templates/operator.py [new file with mode: 0644]
release/scripts/templates/operator_simple.py [new file with mode: 0644]
release/scripts/ui/buttons_data_bone.py
release/scripts/ui/buttons_data_curve.py
release/scripts/ui/buttons_data_empty.py
release/scripts/ui/buttons_data_mesh.py
release/scripts/ui/buttons_material.py
release/scripts/ui/buttons_object.py
release/scripts/ui/buttons_object_constraint.py
release/scripts/ui/buttons_particle.py
release/scripts/ui/buttons_physics_cloth.py
release/scripts/ui/buttons_physics_common.py
release/scripts/ui/buttons_physics_field.py
release/scripts/ui/buttons_texture.py
release/scripts/ui/buttons_world.py
release/scripts/ui/space_console.py
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_info.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_text.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
source/blender/blenfont/intern/blf.c
source/blender/blenkernel/BKE_animsys.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_fcurve.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_key.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/BKE_sequence.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/sequence.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/BLI_bfile.h
source/blender/blenlib/BLI_editVert.h
source/blender/blenlib/BLI_util.h
source/blender/blenlib/BLI_winstuff.h
source/blender/blenlib/intern/BLI_bfile.c
source/blender/blenlib/intern/arithb.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/util.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/readfile.h
source/blender/blenloader/intern/writefile.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/curve/editcurve.c
source/blender/editors/datafiles/B.blend.c
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_keyframes_edit.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_physics.h
source/blender/editors/include/ED_space_api.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_icons.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_loop.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_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_intern.h
source/blender/editors/physics/physics_ops.c
source/blender/editors/screen/Makefile
source/blender/editors/screen/SConscript
source/blender/editors/screen/screen_context.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_intern.h
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_header.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/graph_header.c
source/blender/editors/space_graph/graph_intern.h
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_logic/logic_buttons.c
source/blender/editors/space_nla/nla_header.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_ops.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/script_edit.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_text/text_python.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/GPU_extensions.h
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/SConscript
source/blender/imbuf/intern/IMB_cocoa.h [new file with mode: 0644]
source/blender/imbuf/intern/imbuf_cocoa.m [new file with mode: 0644]
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/writeimage.c
source/blender/makesdna/DNA_armature_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_fileglobal_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_text_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/nodes/intern/CMP_nodes/CMP_image.c
source/blender/nodes/intern/CMP_util.c
source/blender/nodes/intern/TEX_nodes/TEX_output.c
source/blender/python/generic/matrix.c
source/blender/python/generic/vector.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_rna.c
source/blender/render/intern/raytrace/reorganize.h
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm.h
source/blender/windowmanager/wm_event_types.h
source/blender/windowmanager/wm_window.h
source/creator/CMakeLists.txt
source/creator/SConscript
source/creator/buildinfo.c
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
source/gameengine/Converter/BL_ArmatureActuator.cpp
source/gameengine/Converter/BL_ShapeDeformer.cpp
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/BL_SkinDeformer.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Rasterizer/RAS_ICanvas.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/nan_compile.mk
tools/Blender.py
tools/btools.py

index 5cb14f373050eb36da2395d4fd988991000940b2..a649a5e0a8df8d2df1f97d5ecc94d11f2c21d859 100644 (file)
@@ -549,15 +549,27 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
 
 # buildinfo
-IF(UNIX)
-       IF(WITH_BUILDINFO)
+IF(WITH_BUILDINFO)
+       # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
+       IF(UNIX)
                EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
                EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)  
-               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
-               # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
-       ENDIF(WITH_BUILDINFO)
-ENDIF(UNIX)
-
+               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV RETURN_VALUE BUILD_REV_RETURN)
+               IF(BUILD_REV_RETURN)
+                       SET(BUILD_REV "unknown")
+               ENDIF(BUILD_REV_RETURN)
+       ENDIF(UNIX)
+       
+       IF(WIN32)
+               EXEC_PROGRAM("cmd /c date /t" OUTPUT_VARIABLE BUILD_DATE)
+               EXEC_PROGRAM("cmd /c time /t" OUTPUT_VARIABLE BUILD_TIME)  
+               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV RETURN_VALUE BUILD_REV_RETURN)
+               IF(BUILD_REV_RETURN)
+                       SET(BUILD_REV "unknown")
+               ENDIF(BUILD_REV_RETURN)
+       ENDIF(WIN32)
+ENDIF(WITH_BUILDINFO)
+       
 #-----------------------------------------------------------------------------
 # Common.
 
index 6d18000a984fdfe0c1648b25ada59228dfd7b3df..cb90c2eaf663094681d006430103327c4335b6e7 100644 (file)
@@ -217,6 +217,11 @@ if env['WITH_BF_OPENMP'] == 1:
                                env.Append(CPPFLAGS=['-fopenmp'])
                                env.Append(CXXFLAGS=['-fopenmp'])
 
+if env['WITH_GHOST_COCOA'] == True:
+       env.Append(CFLAGS=['-DGHOST_COCOA']) 
+       env.Append(CXXFLAGS=['-DGHOST_COCOA'])
+       env.Append(CPPFLAGS=['-DGHOST_COCOA'])
+
 #check for additional debug libnames
 
 if env.has_key('BF_DEBUG_LIBS'):
index 981f321e5bc3d2326dae864dd269b5090db5ad9b..6dd65aeb40f68867b1dc34c771fc132c370e7540 100644 (file)
@@ -1,8 +1,23 @@
+#
+# Note : if you want to alter this file
+# copy it as a whole in the upper folder
+# as user-config.py
+# dont create a new file with only some
+# vars changed.
+
 import commands
 
 # IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs
 USE_SDK=True
 
+#############################################################################
+###################     Cocoa & architecture settings      ##################
+#############################################################################
+
+WITH_GHOST_COCOA=True
+MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
+
+
 cmd = 'uname -p'
 MAC_PROC=commands.getoutput(cmd) 
 cmd = 'uname -r'
@@ -11,28 +26,42 @@ if cmd_res[0]=='7':
        MAC_CUR_VER='10.3'
 elif cmd_res[0]=='8':
        MAC_CUR_VER='10.4'
-else:
+elif cmd_res[0]=='9':
        MAC_CUR_VER='10.5'
+elif cmd_res[0]=='10':
+       MAC_CUR_VER='10.6'
 
 if MAC_PROC == 'powerpc':
        LCGDIR = '#../lib/darwin-6.1-powerpc'
 else :
-       LCGDIR = '#../lib/darwin-8.x.i386'
+       LCGDIR = '#../lib/darwin-9.x.universal'
 LIBDIR = '${LCGDIR}'
 
 BF_PYTHON_VERSION = '3.1'
 
-if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3':
+if MAC_PROC == 'powerpc' and BF_PYTHON_VERSION == '2.3':
        MAC_MIN_VERS = '10.3'
        MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
-else:
+       CC = 'gcc'
+       CXX = 'g++'
+elif MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'ppc':
        MAC_MIN_VERS = '10.4'
        MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
+       CC = 'gcc-4.0'
+       CXX = 'g++-4.0'
+else :
+       MAC_MIN_VERS = '10.5'
+       MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
+       CC = 'gcc-4.2'
+       CXX = 'g++-4.2'
 
+#############################################################################
+###################          Dependency settings           ##################
+#############################################################################
 
 # enable ffmpeg  support
 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
-FFMPEG_PRECOMPILED = False
+FFMPEG_PRECOMPILED = True
 if FFMPEG_PRECOMPILED:
        # use precompiled ffmpeg in /lib
        BF_FFMPEG = LIBDIR + '/ffmpeg'
@@ -45,8 +74,8 @@ else:
        BF_FFMPEG_INC = '${BF_FFMPEG}'
        if USE_SDK==True:
                BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
-       BF_XVIDCORE_CONFIG = '--disable-assembly'       # currently causes errors, even with yasm installed
-       BF_X264_CONFIG = '--disable-pthread'
+       BF_XVIDCORE_CONFIG = '--disable-assembly --disable-mmx' # currently causes errors, even with yasm installed
+       BF_X264_CONFIG = '--disable-pthread --disable-asm'
 
 if BF_PYTHON_VERSION=='3.1':
        # python 3.1 uses precompiled libraries in bf svn /lib by default
@@ -75,10 +104,11 @@ else:
        BF_PYTHON_LINKFLAGS = ['-u','_PyMac_Error','-framework','System','-framework','Python']
        if MAC_CUR_VER=='10.3' or  MAC_CUR_VER=='10.4':
                BF_PYTHON_LINKFLAGS = ['-u', '__dummy']+BF_PYTHON_LINKFLAGS
+
        
-BF_QUIET = '1'
-WITH_BF_OPENMP = '0'
+WITH_BF_OPENMP = '0'  # multithreading for fluids, cloth and smoke ( only works with ICC atm )
 
+WITH_BF_OPENAL = True
 #different lib must be used  following version of gcc
 # for gcc 3.3
 #BF_OPENAL = LIBDIR + '/openal'
@@ -89,11 +119,11 @@ else :
        BF_OPENAL = LIBDIR + '/openal'
 
 WITH_BF_STATICOPENAL = False
-BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'openal'
-BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+BF_OPENAL_INC = '${BF_OPENAL}/include' # only headers from libdir needed for proper use of framework !!!!
+#BF_OPENAL_LIB = 'openal'
+#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 # Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 # Warning, this static lib configuration is untested! users of this OS please confirm.
 BF_CXX = '/usr'
@@ -199,10 +229,13 @@ BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
 BF_FREETYPE_LIB = 'freetype'
 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
 
-WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
+if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
+       WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME ( disable for 64bit atm )
+else:
+       WITH_BF_QUICKTIME = True
 
 WITH_BF_ICONV = True
-BF_ICONV = LIBDIR + "/iconv"
+BF_ICONV = '/usr'
 BF_ICONV_INC = '${BF_ICONV}/include'
 BF_ICONV_LIB = 'iconv'
 #BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
@@ -213,12 +246,30 @@ BF_OPENGL_LIB = 'GL GLU'
 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
 BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
 
-CFLAGS = ['-pipe','-fPIC','-funsigned-char']
+#############################################################################
+###################  various compile settings and flags    ##################
+#############################################################################
 
-CPPFLAGS = ['-fpascal-strings']
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
-CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
-PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','QuickTime']
+BF_QUIET = '1' # suppress verbose output
+
+if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
+       ARCH_FLAGS = ['-m64']
+else:
+       ARCH_FLAGS = ['-m32']
+
+CFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
+
+CPPFLAGS = ['-fpascal-strings']+ARCH_FLAGS
+CCFLAGS = ['-pipe','-funsigned-char','-fpascal-strings']+ARCH_FLAGS
+CXXFLAGS = ['-pipe','-funsigned-char', '-fpascal-strings']+ARCH_FLAGS
+
+if WITH_GHOST_COCOA==True:
+       PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
+else:
+       PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
+
+if WITH_BF_QUICKTIME == True:
+       PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
 
 #note to build succesfully on 10.3.9 SDK you need to patch  10.3.9 by adding the SystemStubs.a lib from 10.4
 LLIBS = ['stdc++', 'SystemStubs']
@@ -232,33 +283,34 @@ if MAC_MIN_VERS == '10.3':
        
 if USE_SDK==True:
        SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]        
-       PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS, '-Wl,-syslibroot,' + MACOSX_SDK]+PLATFORM_LINKFLAGS
+       PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS,'-Wl','-syslibroot '+MACOSX_SDK]+PLATFORM_LINKFLAGS
        CCFLAGS=SDK_FLAGS+CCFLAGS
        CXXFLAGS=SDK_FLAGS+CXXFLAGS
        
-# you can add -mssse3 if gcc >= 4.2
-if MAC_PROC == 'i386':
+if MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'x86_64':
        REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
        REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
 else:
        CFLAGS = CFLAGS+['-fno-strict-aliasing']
        CCFLAGS =  CCFLAGS+['-fno-strict-aliasing']
        CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing']
-       
        REL_CFLAGS = ['-O2']
        REL_CCFLAGS = ['-O2']
 
+# add -mssse3 for intel 64bit archs
+if MACOSX_ARCHITECTURE == 'x86_64':
+       REL_CFLAGS = REL_CFLAGS+['-mssse3']
+       REL_CCFLAGS = REL_CCFLAGS+['-mssse3']
+
 ##BF_DEPEND = True
 ##
 ##AR = ar
 ##ARFLAGS = ruv
 ##ARFLAGSQUIET = ru
 ##
-CC = 'gcc'
-CXX = 'g++'
-C_WARN = ['-Wdeclaration-after-statement']
+#C_WARN = ['-Wdeclaration-after-statement']
 
-CC_WARN = ['-Wall', '-Wno-long-double']
+CC_WARN = ['-Wall']
 
 ##FIX_STUBS_WARNINGS = -Wno-unused
 
@@ -272,5 +324,9 @@ BF_PROFILE = False
 BF_DEBUG = False
 BF_DEBUG_CCFLAGS = ['-g']
 
+#############################################################################
+###################           Output directories           ##################
+#############################################################################
+
 BF_BUILDDIR='../build/darwin'
 BF_INSTALLDIR='../install/darwin'
index 0aae7fd2c40d33a6af750a22fb54e9c5c377ae3c..c2c325a788e35430e13ca07fc8ef649714f3dfed 100644 (file)
@@ -43,6 +43,8 @@ struct ei_scalar_add_op {
   inline const PacketScalar packetOp(const PacketScalar& a) const
   { return ei_padd(a, ei_pset1(m_other)); }
   const Scalar m_other;
+private:
+  ei_scalar_add_op& operator=(const ei_scalar_add_op&);
 };
 template<typename Scalar>
 struct ei_functor_traits<ei_scalar_add_op<Scalar> >
@@ -138,6 +140,8 @@ struct ei_scalar_pow_op {
   inline ei_scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {}
   inline Scalar operator() (const Scalar& a) const { return ei_pow(a, m_exponent); }
   const Scalar m_exponent;
+private:
+  ei_scalar_pow_op& operator=(const ei_scalar_pow_op&);
 };
 template<typename Scalar>
 struct ei_functor_traits<ei_scalar_pow_op<Scalar> >
index b1e8fd4babdfa3e22fd443992cf309bb72e32951..3a052ca8a3d70e84312752073179ab739c44bbb6 100644 (file)
@@ -133,6 +133,8 @@ struct ei_member_redux {
   inline result_type operator()(const MatrixBase<Derived>& mat) const
   { return mat.redux(m_functor); }
   const BinaryOp m_functor;
+private:
+  ei_member_redux& operator=(const ei_member_redux&);
 };
 
 /** \array_module \ingroup Array
@@ -290,6 +292,9 @@ template<typename ExpressionType, int Direction> class PartialRedux
 
   protected:
     ExpressionTypeNested m_matrix;
+
+  private:
+    PartialRedux& operator=(const PartialRedux&);
 };
 
 /** \array_module
index ed28e0ca3713c9fc5b19719d6fe7bfdfbd2ae086..f66cbd6d5e1fc23015963d19adc74f464d2f6ceb 100644 (file)
@@ -116,6 +116,9 @@ struct CommaInitializer
   int m_row;              // current row id
   int m_col;              // current col id
   int m_currentBlockRows; // current block height
+
+private:
+  CommaInitializer& operator=(const CommaInitializer&);
 };
 
 /** \anchor MatrixBaseCommaInitRef
index 0e92dce4e121c977a45a21251c156cb9b9f61302..4dc9d514b04935c73345c85e489db05e67c96843 100644 (file)
@@ -178,6 +178,9 @@ template<typename ExpressionType> class Cwise
 
   protected:
     ExpressionTypeNested m_matrix;
+
+  private:
+    Cwise& operator=(const Cwise&);
 };
 
 /** \returns a Cwise wrapper of *this providing additional coefficient-wise operations
index ce50246cb678e628dd5c81a4ac35c13c50b0f7cc..e3d25341d9e840521d05b6767040b74f3943ab44 100644 (file)
@@ -109,6 +109,9 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
 
   protected:
     ExpressionTypeNested m_matrix;
+
+private:
+  Flagged& operator=(const Flagged&);
 };
 
 /** \returns an expression of *this with added flags
index c8ca3dac1cfdc04f9bfec97946d87c46ea8daed4..969cad78d8f768fb9bcf1ffb23c74558309e48e8 100644 (file)
@@ -279,6 +279,8 @@ struct ei_scalar_multiple_op {
   EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const
   { return ei_pmul(a, ei_pset1(m_other)); }
   const Scalar m_other;
+private:
+  ei_scalar_multiple_op& operator=(const ei_scalar_multiple_op&);
 };
 template<typename Scalar>
 struct ei_functor_traits<ei_scalar_multiple_op<Scalar> >
@@ -294,6 +296,8 @@ struct ei_scalar_quotient1_impl {
   EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const
   { return ei_pmul(a, ei_pset1(m_other)); }
   const Scalar m_other;
+private:
+  ei_scalar_quotient1_impl& operator=(const ei_scalar_quotient1_impl&);
 };
 template<typename Scalar>
 struct ei_functor_traits<ei_scalar_quotient1_impl<Scalar,true> >
@@ -306,6 +310,8 @@ struct ei_scalar_quotient1_impl<Scalar,false> {
   EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {}
   EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; }
   const Scalar m_other;
+private:
+  ei_scalar_quotient1_impl& operator=(const ei_scalar_quotient1_impl&);
 };
 template<typename Scalar>
 struct ei_functor_traits<ei_scalar_quotient1_impl<Scalar,false> >
@@ -323,6 +329,8 @@ template<typename Scalar>
 struct ei_scalar_quotient1_op : ei_scalar_quotient1_impl<Scalar, NumTraits<Scalar>::HasFloatingPoint > {
   EIGEN_STRONG_INLINE ei_scalar_quotient1_op(const Scalar& other)
     : ei_scalar_quotient1_impl<Scalar, NumTraits<Scalar>::HasFloatingPoint >(other) {}
+private:
+  ei_scalar_quotient1_op& operator=(const ei_scalar_quotient1_op&);
 };
 
 // nullary functors
@@ -335,6 +343,8 @@ struct ei_scalar_constant_op {
   EIGEN_STRONG_INLINE const Scalar operator() (int, int = 0) const { return m_other; }
   EIGEN_STRONG_INLINE const PacketScalar packetOp() const { return ei_pset1(m_other); }
   const Scalar m_other;
+private:
+  ei_scalar_constant_op& operator=(const ei_scalar_constant_op&);
 };
 template<typename Scalar>
 struct ei_functor_traits<ei_scalar_constant_op<Scalar> >
index ffd16d3760614ba0e25c19359b087a9576447e12..22090c777da8b6d40b860467f988b713f34c9fb3 100644 (file)
@@ -505,7 +505,9 @@ class Matrix
     template<typename OtherDerived>
     EIGEN_STRONG_INLINE Matrix& _set(const MatrixBase<OtherDerived>& other)
     {
-      _set_selector(other.derived(), typename ei_meta_if<bool(int(OtherDerived::Flags) & EvalBeforeAssigningBit), ei_meta_true, ei_meta_false>::ret());
+      // this enum introduced to fix compilation with gcc 3.3
+      enum { cond = int(OtherDerived::Flags) & EvalBeforeAssigningBit };
+      _set_selector(other.derived(), typename ei_meta_if<bool(cond), ei_meta_true, ei_meta_false>::ret());
       return *this;
     }
 
index da79315bffe1753eeb59558de39c1c25411c54cd..2a14ab1f1562f2d6641838bab3a9c8db135a5134 100644 (file)
@@ -100,6 +100,9 @@ template<typename ExpressionType> class NestByValue
 
   protected:
     const ExpressionType m_expression;
+
+  private:
+    NestByValue& operator=(const NestByValue&);
 };
 
 /** \returns an expression of the temporary version of *this.
index 9c273f249ecd1aeda4027be62b4a72763b93ab15..96229f43b68be6dfcf0f887ab2027790bf9065c3 100644 (file)
@@ -124,8 +124,10 @@ template<typename MatrixType, unsigned int Mode> class Part
     }
 
   protected:
-
     const typename MatrixType::Nested m_matrix;
+
+  private:
+    Part& operator=(const Part&);
 };
 
 /** \nonstableyet
index 77d562cd3ace59fdab03d48311f6657eedcb1a9e..9aaac652fd830087dac8190acc15047aad8dffb4 100644 (file)
@@ -117,6 +117,9 @@ template<typename ExpressionType> class SwapWrapper
 
   protected:
     ExpressionType& m_expression;
+
+  private:
+    SwapWrapper& operator=(const SwapWrapper&);
 };
 
 /** swaps *this with the expression \a other.
index 09ad39d5be97de102ebbc45f743d76c5df3493e4..0a43e7f7bf2c0d58b4f2f73930853a5e81705fc3 100644 (file)
@@ -1,5 +1,5 @@
 // This file is part of Eigen, a lightweight C++ template library
-// for linear algebra. Eigen itself is part of the KDE project.
+// for linear algebra.
 //
 // Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
 // Copyright (C) 2008-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
 #ifndef EIGEN_MEMORY_H
 #define EIGEN_MEMORY_H
 
-#if defined(__APPLE__) || defined(_WIN64)
+// FreeBSD 6 seems to have 16-byte aligned malloc
+// See http://svn.freebsd.org/viewvc/base/stable/6/lib/libc/stdlib/malloc.c?view=markup
+// FreeBSD 7 seems to have 16-byte aligned malloc except on ARM and MIPS architectures
+// See http://svn.freebsd.org/viewvc/base/stable/7/lib/libc/stdlib/malloc.c?view=markup
+#if defined(__FreeBSD__) && !defined(__arm__) && !defined(__mips__)
+#define EIGEN_FREEBSD_MALLOC_ALREADY_ALIGNED 1
+#else
+#define EIGEN_FREEBSD_MALLOC_ALREADY_ALIGNED 0
+#endif
+
+#if defined(__APPLE__) || defined(_WIN64) || EIGEN_FREEBSD_MALLOC_ALREADY_ALIGNED
   #define EIGEN_MALLOC_ALREADY_ALIGNED 1
 #else
   #define EIGEN_MALLOC_ALREADY_ALIGNED 0
@@ -65,7 +75,7 @@ inline void ei_handmade_aligned_free(void *ptr)
 }
 
 /** \internal allocates \a size bytes. The returned pointer is guaranteed to have 16 bytes alignment.
-  * On allocation error, the returned pointer is undefined, but if exceptions are enabled then a std::bad_alloc is thrown.
+  * On allocation error, the returned pointer is null, and if exceptions are enabled then a std::bad_alloc is thrown.
   */
 inline void* ei_aligned_malloc(size_t size)
 {
@@ -96,7 +106,7 @@ inline void* ei_aligned_malloc(size_t size)
 }
 
 /** allocates \a size bytes. If Align is true, then the returned ptr is 16-byte-aligned.
-  * On allocation error, the returned pointer is undefined, but if exceptions are enabled then a std::bad_alloc is thrown.
+  * On allocation error, the returned pointer is null, and if exceptions are enabled then a std::bad_alloc is thrown.
   */
 template<bool Align> inline void* ei_conditional_aligned_malloc(size_t size)
 {
@@ -116,20 +126,29 @@ template<> inline void* ei_conditional_aligned_malloc<false>(size_t size)
   return result;
 }
 
+/** \internal construct the elements of an array.
+  * The \a size parameter tells on how many objects to call the constructor of T.
+  */
+template<typename T> inline T* ei_construct_elements_of_array(T *ptr, size_t size)
+{
+  for (size_t i=0; i < size; ++i) ::new (ptr + i) T;
+  return ptr;
+}
+
 /** allocates \a size objects of type T. The returned pointer is guaranteed to have 16 bytes alignment.
   * On allocation error, the returned pointer is undefined, but if exceptions are enabled then a std::bad_alloc is thrown.
   * The default constructor of T is called.
   */
 template<typename T> inline T* ei_aligned_new(size_t size)
 {
-  void *void_result = ei_aligned_malloc(sizeof(T)*size);
-  return ::new(void_result) T[size];
+  T *result = reinterpret_cast<T*>(ei_aligned_malloc(sizeof(T)*size));
+  return ei_construct_elements_of_array(result, size);
 }
 
 template<typename T, bool Align> inline T* ei_conditional_aligned_new(size_t size)
 {
-  void *void_result = ei_conditional_aligned_malloc<Align>(sizeof(T)*size);
-  return ::new(void_result) T[size];
+  T *result = reinterpret_cast<T*>(ei_conditional_aligned_malloc<Align>(sizeof(T)*size));
+  return ei_construct_elements_of_array(result, size);
 }
 
 /** \internal free memory allocated with ei_aligned_malloc
@@ -163,10 +182,10 @@ template<> inline void ei_conditional_aligned_free<false>(void *ptr)
   free(ptr);
 }
 
-/** \internal delete the elements of an array.
+/** \internal destruct the elements of an array.
   * The \a size parameters tells on how many objects to call the destructor of T.
   */
-template<typename T> inline void ei_delete_elements_of_array(T *ptr, size_t size)
+template<typename T> inline void ei_destruct_elements_of_array(T *ptr, size_t size)
 {
   // always destruct an array starting from the end.
   while(size) ptr[--size].~T();
@@ -177,7 +196,7 @@ template<typename T> inline void ei_delete_elements_of_array(T *ptr, size_t size
   */
 template<typename T> inline void ei_aligned_delete(T *ptr, size_t size)
 {
-  ei_delete_elements_of_array<T>(ptr, size);
+  ei_destruct_elements_of_array<T>(ptr, size);
   ei_aligned_free(ptr);
 }
 
@@ -186,7 +205,7 @@ template<typename T> inline void ei_aligned_delete(T *ptr, size_t size)
   */
 template<typename T, bool Align> inline void ei_conditional_aligned_delete(T *ptr, size_t size)
 {
-  ei_delete_elements_of_array<T>(ptr, size);
+  ei_destruct_elements_of_array<T>(ptr, size);
   ei_conditional_aligned_free<Align>(ptr);
 }
 
@@ -225,8 +244,8 @@ inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset)
   #define ei_aligned_stack_free(PTR,SIZE) ei_aligned_free(PTR)
 #endif
 
-#define ei_aligned_stack_new(TYPE,SIZE) ::new(ei_aligned_stack_alloc(sizeof(TYPE)*SIZE)) TYPE[SIZE]
-#define ei_aligned_stack_delete(TYPE,PTR,SIZE) do {ei_delete_elements_of_array<TYPE>(PTR, SIZE); \
+#define ei_aligned_stack_new(TYPE,SIZE) ei_construct_elements_of_array(reinterpret_cast<TYPE*>(ei_aligned_stack_alloc(sizeof(TYPE)*SIZE)), SIZE)
+#define ei_aligned_stack_delete(TYPE,PTR,SIZE) do {ei_destruct_elements_of_array<TYPE>(PTR, SIZE); \
                                                    ei_aligned_stack_free(PTR,sizeof(TYPE)*SIZE);} while(0)
 
 
@@ -244,7 +263,7 @@ inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset)
         return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); \
       }
   #endif
-  
+
   #define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \
       void *operator new(size_t size) { \
         return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); \
index 0a52acf3d5b91a1ab54c251158dd7fe12106976b..d117c158397aa61574b498f8402398afa65f6f11 100644 (file)
@@ -107,6 +107,7 @@ void SVD<MatrixType>::compute(const MatrixType& matrix)
   const int m = matrix.rows();
   const int n = matrix.cols();
   const int nu = std::min(m,n);
+  ei_assert(m>=n && "In Eigen 2.0, SVD only works for MxN matrices with M>=N. Sorry!");
 
   m_matU.resize(m, nu);
   m_matU.setZero();
index 75001a2fa25321b174e7f03cfe30ab09140e5b41..f279e80f00a160fea6c52a649ac53c99b7099f8b 100644 (file)
@@ -99,6 +99,8 @@ template<typename _Scalar> class AmbiVector
       allocSize = allocSize/sizeof(Scalar) + (allocSize%sizeof(Scalar)>0?1:0);
       Scalar* newBuffer = new Scalar[allocSize];
       memcpy(newBuffer,  m_buffer,  copyElements * sizeof(ListEl));
+      delete[] m_buffer;
+      m_buffer = newBuffer;
     }
 
   protected:
@@ -238,8 +240,11 @@ Scalar& AmbiVector<Scalar>::coeffRef(int i)
       else
       {
         if (m_llSize>=m_allocatedElements)
+        {
           reallocateSparse();
-        ei_internal_assert(m_llSize<m_size && "internal error: overflow in sparse mode");
+          llElements = reinterpret_cast<ListEl*>(m_buffer);
+        }
+        ei_internal_assert(m_llSize<m_allocatedElements && "internal error: overflow in sparse mode");
         // let's insert a new coefficient
         ListEl& el = llElements[m_llSize];
         el.value = Scalar(0);
@@ -365,6 +370,9 @@ class AmbiVector<_Scalar>::Iterator
     int m_cachedIndex;          // current coordinate
     Scalar m_cachedValue;       // current value
     bool m_isDense;             // mode of the vector
+
+  private:
+    Iterator& operator=(const Iterator&);
 };
 
 
index 7119a84bd51479b2070a51a732454a33a61017d2..01f97cd6d9478a96a7f09ed41ec61fc544921837 100644 (file)
@@ -289,9 +289,11 @@ class DynamicSparseMatrix<Scalar,_Flags>::InnerIterator : public SparseVector<Sc
     inline int row() const { return IsRowMajor ? m_outer : Base::index(); }
     inline int col() const { return IsRowMajor ? Base::index() : m_outer; }
 
-
   protected:
     const int m_outer;
+
+  private:
+    InnerIterator& operator=(const InnerIterator&);
 };
 
 #endif // EIGEN_DYNAMIC_SPARSEMATRIX_H
index c39066676b6159094dede01e6e4c3529189bdbbf..ae77a77879b936e6d1f6254b83fbee758ad93e40 100644 (file)
@@ -53,6 +53,9 @@ class SparseInnerVectorSet : ei_no_assignment_operator,
         inline InnerIterator(const SparseInnerVectorSet& xpr, int outer)
           : MatrixType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer)
         {}
+
+      private:
+        InnerIterator& operator=(const InnerIterator&);
     };
 
     inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize)
@@ -110,6 +113,8 @@ class SparseInnerVectorSet<DynamicSparseMatrix<_Scalar, _Options>, Size>
         inline InnerIterator(const SparseInnerVectorSet& xpr, int outer)
           : MatrixType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer)
         {}
+      private:
+        InnerIterator& operator=(const InnerIterator&);
     };
 
     inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize)
index 2206883cc764d154757483b4ba620cda723fd222..ac285ec1aa3d9b4d4bae81d1a958b846d5600dee 100644 (file)
@@ -156,6 +156,9 @@ template<typename ExpressionType> class SparseCwise
 
   protected:
     ExpressionTypeNested m_matrix;
+
+  private:
+    SparseCwise& operator=(const SparseCwise&);
 };
 
 template<typename Derived>
index d19970efcb1a2860fe7c874dc2b7b8c8e8c71e32..da9746e2099d1d3554004bfe9a3ee168e97f2893 100644 (file)
@@ -126,6 +126,8 @@ class SparseCwiseBinaryOp<BinaryOp,Lhs,Rhs>::InnerIterator
     EIGEN_STRONG_INLINE InnerIterator(const SparseCwiseBinaryOp& binOp, int outer)
       : Base(binOp,outer)
     {}
+  private:
+    InnerIterator& operator=(const InnerIterator&);
 };
 
 /***************************************************************************
@@ -197,6 +199,9 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector<BinaryOp, Lhs, Rhs, Deri
     const BinaryOp& m_functor;
     Scalar m_value;
     int m_id;
+
+  private:
+    ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&);
 };
 
 // sparse - sparse  (product)
@@ -250,6 +255,9 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector<ei_scalar_product_op<T>,
     LhsIterator m_lhsIter;
     RhsIterator m_rhsIter;
     const BinaryFunc& m_functor;
+
+  private:
+    ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&);
 };
 
 // sparse - dense  (product)
@@ -290,6 +298,9 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector<ei_scalar_product_op<T>,
     LhsIterator m_lhsIter;
     const BinaryFunc m_functor;
     const int m_outer;
+
+  private:
+    ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&);
 };
 
 // sparse - dense  (product)
index b11c0f8a3773522a5f58a255ad983cf76e0aaf14..2ed7a15579f08b3f5d3ee4700a3768128689451a 100644 (file)
@@ -90,6 +90,9 @@ class SparseCwiseUnaryOp<UnaryOp,MatrixType>::InnerIterator
   protected:
     MatrixTypeIterator m_iter;
     const UnaryOp m_functor;
+
+  private:
+    InnerIterator& operator=(const InnerIterator&);
 };
 
 template<typename Derived>
index 932daf220b9f9110bc4633c4bff2447c3e348b8c..9b7432a82164a7e27b497a86855113b42d614737 100644 (file)
@@ -120,6 +120,8 @@ class ei_sparse_diagonal_product_inner_iterator_selector
               const SparseDiagonalProductType& expr, int outer)
       : Base(expr.rhs().innerVector(outer) .cwise()* expr.lhs().diagonal(), 0)
     {}
+  private:
+    ei_sparse_diagonal_product_inner_iterator_selector& operator=(const ei_sparse_diagonal_product_inner_iterator_selector&);
 };
 
 template<typename Lhs, typename Rhs, typename SparseDiagonalProductType>
index c47e162f538f4107ed4e00cc4543db3a5e073443..315ec4af39ff978ffce3485bec473043da8be1c3 100644 (file)
@@ -64,16 +64,21 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
 
   protected:
     ExpressionTypeNested m_matrix;
+
+  private:
+    SparseFlagged& operator=(const SparseFlagged&);
 };
 
 template<typename ExpressionType, unsigned int Added, unsigned int Removed>
   class SparseFlagged<ExpressionType,Added,Removed>::InnerIterator : public ExpressionType::InnerIterator
 {
   public:
-
     EIGEN_STRONG_INLINE InnerIterator(const SparseFlagged& xpr, int outer)
       : ExpressionType::InnerIterator(xpr.m_matrix, outer)
     {}
+
+  private:
+    InnerIterator& operator=(const InnerIterator&);
 };
 
 template<typename ExpressionType, unsigned int Added, unsigned int Removed>
index 3f09596bc6481213accce58faff634a34d23abf1..65c609686d2a4f16579a35b62603a00678ac8bea 100644 (file)
@@ -259,19 +259,21 @@ class SparseMatrix
       m_data.resize(k,0);
     }
 
+    /** Resizes the matrix to a \a rows x \a cols matrix and initializes it to zero
+      * \sa resizeNonZeros(int), reserve(), setZero()
+      */
     void resize(int rows, int cols)
     {
-//       std::cerr << this << " resize " << rows << "x" << cols << "\n";
       const int outerSize = IsRowMajor ? rows : cols;
       m_innerSize = IsRowMajor ? cols : rows;
       m_data.clear();
-      if (m_outerSize != outerSize)
+      if (m_outerSize != outerSize || m_outerSize==0)
       {
         delete[] m_outerIndex;
         m_outerIndex = new int [outerSize+1];
         m_outerSize = outerSize;
-        memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int));
       }
+      memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int));
     }
     void resizeNonZeros(int size)
     {
@@ -442,6 +444,9 @@ class SparseMatrix<Scalar,_Flags>::InnerIterator
     int m_id;
     const int m_start;
     const int m_end;
+
+  private:
+    InnerIterator& operator=(const InnerIterator&);
 };
 
 #endif // EIGEN_SPARSEMATRIX_H
index 89a14d70707326c47a8d20496bc99d32bffbf05b..7386294e4d465af619a6a6d54785962c62bae471 100644 (file)
@@ -62,15 +62,20 @@ template<typename MatrixType> class SparseTranspose
 
   protected:
     const typename MatrixType::Nested m_matrix;
+
+  private:
+    SparseTranspose& operator=(const SparseTranspose&);
 };
 
 template<typename MatrixType> class SparseTranspose<MatrixType>::InnerIterator : public MatrixType::InnerIterator
 {
   public:
-
     EIGEN_STRONG_INLINE InnerIterator(const SparseTranspose& trans, int outer)
       : MatrixType::InnerIterator(trans.m_matrix, outer)
     {}
+
+  private:
+    InnerIterator& operator=(const InnerIterator&);
 };
 
 template<typename MatrixType> class SparseTranspose<MatrixType>::ReverseInnerIterator : public MatrixType::ReverseInnerIterator
index 8e5a6efeda8b44064afab68aa791b578e72bee78..5d47209f790dc8e12cf3da3cbaaceae626b8d736 100644 (file)
@@ -360,6 +360,9 @@ class SparseVector<Scalar,_Flags>::InnerIterator
     const CompressedStorage<Scalar>& m_data;
     int m_id;
     const int m_end;
+
+  private:
+    InnerIterator& operator=(const InnerIterator&);
 };
 
 #endif // EIGEN_SPARSEVECTOR_H
index 926a36ef1207572c45891141eae0efdf0a958b2d..797c710c196156e42ec53426533b5e6fb327c4ca 100755 (executable)
@@ -17,7 +17,7 @@ if [ -d eigen2 ]
 then
     cd eigen2
     # put here the version you want to use
-    hg up 2.0.6
+    hg up 2.0
     rm -f `find Eigen/ -type f -name "CMakeLists.txt"`
     cp -r Eigen ..
     cd ..
index 6b88e6eb4c91b69d0c06efad6d865f4ea89cfa46..1024a88e00f7970d84f06c3d9e61ba56b58b9caa 100644 (file)
@@ -208,7 +208,7 @@ extern "C" {
 #ifndef GL_VERSION_1_1
 #define GL_VERSION_1_1 1
 
-#if defined(__APPLE__)
+#if defined(__APPLE__) && !defined(__LP64__)
 typedef unsigned long GLenum;
 typedef unsigned long GLbitfield;
 typedef unsigned long GLuint;
index 48009152699488fb57ec51c5ca6460d739f69031..2dbda4befe79c221e8b8cbf10ddb3c0ceb57545a 100644 (file)
@@ -7,26 +7,47 @@ Import ('env')
 window_system = env['OURPLATFORM']
 
 sources = env.Glob('intern/*.cpp')
+if window_system == 'darwin':
+       sources += env.Glob('intern/*.mm')
+
+#if env['WITH_GHOST_COCOA'] == True:
+#      env.Append(CFLAGS=['-DGHOST_COCOA']) 
+#      env.Append(CXXFLAGS=['-DGHOST_COCOA'])
+#      env.Append(CPPFLAGS=['-DGHOST_COCOA'])
+
+#defs = ''
+#if env['WITH_GHOST_COCOA']:
+#      defs += 'GHOST_COCOA'
+# maybe we need it later
 
 pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_Window']
 
 if window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd6', 'irix6'):
-    for f in pf:
-        sources.remove('intern' + os.sep + f + 'Win32.cpp')
-        sources.remove('intern' + os.sep + f + 'Carbon.cpp')
+       for f in pf:
+               sources.remove('intern' + os.sep + f + 'Win32.cpp')
+               sources.remove('intern' + os.sep + f + 'Carbon.cpp')
 elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
-    for f in pf:
-        sources.remove('intern' + os.sep + f + 'X11.cpp')
-        sources.remove('intern' + os.sep + f + 'Carbon.cpp')
+       for f in pf:
+               sources.remove('intern' + os.sep + f + 'X11.cpp')
+               sources.remove('intern' + os.sep + f + 'Carbon.cpp')
 elif window_system == 'darwin':
-    for f in pf:
-        sources.remove('intern' + os.sep + f + 'Win32.cpp')
-        sources.remove('intern' + os.sep + f + 'X11.cpp')
+       if env['WITH_GHOST_COCOA']:
+               for f in pf:
+                       sources.remove('intern' + os.sep + f + 'Win32.cpp')
+                       sources.remove('intern' + os.sep + f + 'X11.cpp')
+                       sources.remove('intern' + os.sep + f + 'Carbon.cpp')
+       else:
+               for f in pf:
+                       sources.remove('intern' + os.sep + f + 'Win32.cpp')
+                       sources.remove('intern' + os.sep + f + 'X11.cpp')
+                       sources.remove('intern' + os.sep + f + 'Cocoa.mm')
+
 else:
-    print "Unknown window system specified."
-    Exit()
+       print "Unknown window system specified."
+       Exit()
 
 incs = '. ../string ' + env['BF_OPENGL_INC']
 if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
-    incs = env['BF_WINTAB_INC'] + ' ' + incs
+       incs = env['BF_WINTAB_INC'] + ' ' + incs
 env.BlenderLib ('bf_ghost', sources, Split(incs), defines=['_USE_MATH_DEFINES'], libtype=['intern','player'], priority = [40,15] ) 
+
index f8e124991afb0bec4f455e5c53cbf29f755fbfbf..5dbf79a0293797d1b26b64404ddf19cce003343a 100644 (file)
@@ -372,133 +372,6 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar)
        return GHOST_kKeyUnknown;
 }
 
-/* MacOSX returns a Roman charset with kEventParamKeyMacCharCodes
- * as defined here: http://developer.apple.com/documentation/mac/Text/Text-516.html
- * I am not sure how international this works...
- * For cross-platform convention, we'll use the Latin ascii set instead.
- * As defined at: http://www.ramsch.org/martin/uni/fmi-hp/iso8859-1.html
- * 
- */
-static unsigned char convertRomanToLatin(unsigned char ascii)
-{
-
-       if(ascii<128) return ascii;
-       
-       switch(ascii) {
-       case 128:       return 142;
-       case 129:       return 143;
-       case 130:       return 128;
-       case 131:       return 201;
-       case 132:       return 209;
-       case 133:       return 214;
-       case 134:       return 220;
-       case 135:       return 225;
-       case 136:       return 224;
-       case 137:       return 226;
-       case 138:       return 228;
-       case 139:       return 227;
-       case 140:       return 229;
-       case 141:       return 231;
-       case 142:       return 233;
-       case 143:       return 232;
-       case 144:       return 234;
-       case 145:       return 235;
-       case 146:       return 237;
-       case 147:       return 236;
-       case 148:       return 238;
-       case 149:       return 239;
-       case 150:       return 241;
-       case 151:       return 243;
-       case 152:       return 242;
-       case 153:       return 244;
-       case 154:       return 246;
-       case 155:       return 245;
-       case 156:       return 250;
-       case 157:       return 249;
-       case 158:       return 251;
-       case 159:       return 252;
-       case 160:       return 0;
-       case 161:       return 176;
-       case 162:       return 162;
-       case 163:       return 163;
-       case 164:       return 167;
-       case 165:       return 183;
-       case 166:       return 182;
-       case 167:       return 223;
-       case 168:       return 174;
-       case 169:       return 169;
-       case 170:       return 174;
-       case 171:       return 180;
-       case 172:       return 168;
-       case 173:       return 0;
-       case 174:       return 198;
-       case 175:       return 216;
-       case 176:       return 0;
-       case 177:       return 177;
-       case 178:       return 0;
-       case 179:       return 0;
-       case 180:       return 165;
-       case 181:       return 181;
-       case 182:       return 0;
-       case 183:       return 0;
-       case 184:       return 215;
-       case 185:       return 0;
-       case 186:       return 0;
-       case 187:       return 170;
-       case 188:       return 186;
-       case 189:       return 0;
-       case 190:       return 230;
-       case 191:       return 248;
-       case 192:       return 191;
-       case 193:       return 161;
-       case 194:       return 172;
-       case 195:       return 0;
-       case 196:       return 0;
-       case 197:       return 0;
-       case 198:       return 0;
-       case 199:       return 171;
-       case 200:       return 187;
-       case 201:       return 201;
-       case 202:       return 0;
-       case 203:       return 192;
-       case 204:       return 195;
-       case 205:       return 213;
-       case 206:       return 0;
-       case 207:       return 0;
-       case 208:       return 0;
-       case 209:       return 0;
-       case 210:       return 0;
-       
-       case 214:       return 247;
-
-       case 229:       return 194;
-       case 230:       return 202;
-       case 231:       return 193;
-       case 232:       return 203;
-       case 233:       return 200;
-       case 234:       return 205;
-       case 235:       return 206;
-       case 236:       return 207;
-       case 237:       return 204;
-       case 238:       return 211;
-       case 239:       return 212;
-       case 240:       return 0;
-       case 241:       return 210;
-       case 242:       return 218;
-       case 243:       return 219;
-       case 244:       return 217;
-       case 245:       return 0;
-       case 246:       return 0;
-       case 247:       return 0;
-       case 248:       return 0;
-       case 249:       return 0;
-       case 250:       return 0;
-
-       
-               default: return 0;
-       }
-
-}
 
 #define FIRSTFILEBUFLG 512
 static bool g_hasFirstFile = false;
@@ -525,7 +398,8 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) {
 @interface CocoaAppDelegate : NSObject {
        GHOST_SystemCocoa *systemCocoa;
 }
--(void)setSystemCocoa:(GHOST_SystemCocoa *)sysCocoa;
+- (void)setSystemCocoa:(GHOST_SystemCocoa *)sysCocoa;
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
 - (void)applicationWillTerminate:(NSNotification *)aNotification;
 @end
@@ -536,6 +410,12 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) {
        systemCocoa = sysCocoa;
 }
 
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+       NSLog(@"\nGet open file event from cocoa : %@",filename);
+       return YES;
+}
+
 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
 {
        //TODO: implement graceful termination through Cocoa mechanism to avoid session log off to be cancelled
@@ -658,13 +538,14 @@ GHOST_TSuccess GHOST_SystemCocoa::init()
                                [NSApp setWindowsMenu:windowMenu];
                                [windowMenu release];
                        }
-                       [NSApp finishLaunching];
                }
                if ([NSApp delegate] == nil) {
                        CocoaAppDelegate *appDelegate = [[CocoaAppDelegate alloc] init];
                        [appDelegate setSystemCocoa:this];
                        [NSApp setDelegate:appDelegate];
                }
+               
+               [NSApp finishLaunching];
                                
                [pool drain];
     }
@@ -789,7 +670,9 @@ GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void)
 
 
        
-
+/**
+ * @note : returns coordinates in Cocoa screen coordinates
+ */
 GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const
 {
     NSPoint mouseLoc = [NSEvent mouseLocation];
@@ -800,17 +683,24 @@ GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
     return GHOST_kSuccess;
 }
 
-
+/**
+ * @note : expect Cocoa screen coordinates
+ */
 GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const
 {
        float xf=(float)x, yf=(float)y;
+       GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
+       NSScreen *windowScreen = window->getScreen();
+       NSRect screenRect = [windowScreen frame];
        
-       //Quartz Display Services uses the old coordinates (top left origin)
-       yf = [[NSScreen mainScreen] frame].size.height -yf;
+       //Set position relative to current screen
+       xf -= screenRect.origin.x;
+       yf -= screenRect.origin.y;
        
-       //CGAssociateMouseAndMouseCursorPosition(false);
-       CGWarpMouseCursorPosition(CGPointMake(xf, yf));
-       //CGAssociateMouseAndMouseCursorPosition(true);
+       //Quartz Display Services uses the old coordinates (top left origin)
+       yf = screenRect.size.height -yf;
+
+       CGDisplayMoveCursorToPoint((CGDirectDisplayID)[[[windowScreen deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue], CGPointMake(xf, yf));
 
     return GHOST_kSuccess;
 }
@@ -995,7 +885,7 @@ GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
        GHOST_Window* window = (GHOST_Window*)m_windowManager->getActiveWindow();
        
        //Discard quit event if we are in cursor grab sequence
-       if ((window->getCursorGrabMode() != GHOST_kGrabDisable) && (window->getCursorGrabMode() != GHOST_kGrabNormal))
+       if (window && (window->getCursorGrabMode() != GHOST_kGrabDisable) && (window->getCursorGrabMode() != GHOST_kGrabNormal))
                return GHOST_kExitCancel;
        
        //Check open windows if some changes are not saved
@@ -1007,7 +897,14 @@ GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
                {
                        pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventQuit, NULL) );
                        return GHOST_kExitNow;
+               } else {
+                       //Give back focus to the blender window if user selected cancel quit
+                       NSArray *windowsList = [NSApp orderedWindows];
+                       if ([windowsList count]) {
+                               [[windowsList objectAtIndex:0] makeKeyAndOrderFront:nil];
+                       }
                }
+
        }
        else {
                pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventQuit, NULL) );
@@ -1022,11 +919,14 @@ GHOST_TSuccess GHOST_SystemCocoa::handleTabletEvent(void *eventPtr, short eventT
 {
        NSEvent *event = (NSEvent *)eventPtr;
        GHOST_IWindow* window = m_windowManager->getActiveWindow();
+       
+       if (!window) return GHOST_kFailure;
+       
        GHOST_TabletData& ct=((GHOST_WindowCocoa*)window)->GetCocoaTabletData();
        
        switch (eventType) {
                case NSTabletPoint:
-                       ct.Pressure = [event tangentialPressure];
+                       ct.Pressure = [event pressure];
                        ct.Xtilt = [event tilt].x;
                        ct.Ytilt = [event tilt].y;
                        break;
@@ -1159,10 +1059,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                                                
                                                //Switch back to Cocoa coordinates orientation (y=0 at botton,the same as blender internal btw!), and to client coordinates
                                                window->getClientBounds(windowBounds);
-                                               bounds.m_b = (windowBounds.m_b - windowBounds.m_t) - bounds.m_b;
-                                               bounds.m_t = (windowBounds.m_b - windowBounds.m_t) - bounds.m_t;
                                                window->screenToClient(bounds.m_l,bounds.m_b, correctedBounds.m_l, correctedBounds.m_t);
                                                window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_b);
+                                               correctedBounds.m_b = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_b;
+                                               correctedBounds.m_t = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_t;
                                                
                                                //Update accumulation counts
                                                window->getCursorGrabAccum(x_accum, y_accum);
@@ -1228,8 +1128,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
        GHOST_IWindow* window = m_windowManager->getActiveWindow();
        unsigned int modifiers;
        NSString *characters;
+       NSData *convertedCharacters;
        GHOST_TKey keyCode;
        unsigned char ascii;
+       NSString* charsIgnoringModifiers;
 
        /* Can happen, very rarely - seems to only be when command-H makes
         * the window go away and we still get an HKey up. 
@@ -1242,16 +1144,25 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
        switch ([event type]) {
                case NSKeyDown:
                case NSKeyUp:
-                       characters = [event characters];
-                       if ([characters length]) { //Check for dead keys
+                       charsIgnoringModifiers = [event charactersIgnoringModifiers];
+                       if ([charsIgnoringModifiers length]>0)
                                keyCode = convertKey([event keyCode],
-                                                                        [[event charactersIgnoringModifiers] characterAtIndex:0]);
-                               ascii= convertRomanToLatin((char)[characters characterAtIndex:0]);
-                       } else {
+                                                                        [charsIgnoringModifiers characterAtIndex:0]);
+                       else
                                keyCode = convertKey([event keyCode],0);
-                               ascii= 0;
+
+                               
+                       characters = [event characters];
+                       if ([characters length]>0) { //Check for dead keys
+                               //Convert characters to iso latin 1 encoding
+                               convertedCharacters = [characters dataUsingEncoding:NSISOLatin1StringEncoding];
+                               if ([convertedCharacters length]>0)
+                                       ascii =((char*)[convertedCharacters bytes])[0];
+                               else
+                                       ascii = 0; //Character not available in iso latin 1 encoding
                        }
-                       
+                       else
+                               ascii= 0;
                        
                        if ((keyCode == GHOST_kKeyQ) && (m_modifierMask & NSCommandKeyMask))
                                break; //Cmd-Q is directly handled by Cocoa
index 5368d0f1e13c8ee31d9616d9717b2a5059642c5b..e3479ada5d69f8c4829e12b09668fa588f66ec2b 100644 (file)
@@ -169,6 +169,12 @@ public:
         */
        virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
 
+       /**
+        * Gets the screen the window is displayed in
+        * @return The NSScreen object
+        */
+       NSScreen* getScreen();
+       
        /**
         * Sets the state of the window (normal, minimized, maximized).
         * @param state The state of the window.
index c9b4fe400012a4236c659035ced370131755d521..7716175b9f631a3c3b04563c3e27ff323a187a20 100644 (file)
 #include <Carbon/Carbon.h>
 #endif
 
+/***** Multithreaded opengl code : uncomment for enabling
+#include <OpenGL/OpenGL.h>
+*/
 #include "GHOST_WindowCocoa.h"
 #include "GHOST_SystemCocoa.h"
 #include "GHOST_Debug.h"
 
 
-// Pixel Format Attributes for the windowed NSOpenGLContext
-static NSOpenGLPixelFormatAttribute pixelFormatAttrsWindow[] =
-{
-       NSOpenGLPFADoubleBuffer,
-       NSOpenGLPFAAccelerated,
-       //NSOpenGLPFAAllowOfflineRenderers,   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
-       NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute) 32,
-       (NSOpenGLPixelFormatAttribute) 0
-};
-
 #pragma mark Cocoa window delegate object
 /* live resize ugly patch
 extern "C" {
@@ -110,10 +104,14 @@ extern "C" {
 
 - (void)windowDidResize:(NSNotification *)notification
 {
-       if (![[notification object] inLiveResize]) {
+#ifdef MAC_OS_X_VERSION_10_6
+       //if (![[notification object] inLiveResize]) {
                //Send event only once, at end of resize operation (when user has released mouse button)
+#endif
                systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow);
-       }
+#ifdef MAC_OS_X_VERSION_10_6
+       //}
+#endif
        /* Live resize ugly patch. Needed because live resize runs in a modal loop, not letting main loop run
         if ([[notification object] inLiveResize]) {
                systemCocoa->dispatchEvents();
@@ -183,9 +181,12 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        GHOST_TDrawingContextType type,
        const bool stereoVisual
 ) :
-       GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone),
+       GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual),
        m_customCursor(0)
 {
+       NSOpenGLPixelFormatAttribute pixelFormatAttrsWindow[40];
+       int i;
+       
        m_systemCocoa = systemCocoa;
        m_fullScreen = false;
        
@@ -194,6 +195,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 
        //Creates the window
        NSRect rect;
+       NSSize  minSize;
        
        rect.origin.x = left;
        rect.origin.y = top;
@@ -208,9 +210,28 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
                return;
        }
        
+       //Forbid to resize the window below the blender defined minimum one
+       minSize.width = 320;
+       minSize.height = 240;
+       [m_window setContentMinSize:minSize];
+       
        setTitle(title);
        
-                       
+       
+       // Pixel Format Attributes for the windowed NSOpenGLContext
+       i=0;
+       pixelFormatAttrsWindow[i++] = NSOpenGLPFADoubleBuffer;
+       pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
+       //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,;   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
+       
+       pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize;
+       pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 32;
+       
+       if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
+       
+       pixelFormatAttrsWindow[i] = (NSOpenGLPixelFormatAttribute) 0;
+       
+
        //Creates the OpenGL View inside the window
        NSOpenGLPixelFormat *pixelFormat =
        [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttrsWindow];
@@ -501,6 +522,13 @@ void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST
        outY = screenCoord.y;
 }
 
+
+NSScreen* GHOST_WindowCocoa::getScreen()
+{
+       return [m_window screen];
+}
+
+
 /**
  * @note Fullscreen switch is not actual fullscreen with display capture. As this capture removes all OS X window manager features.
  * Instead, the menu bar and the dock are hidden, and the window is made borderless and enlarged.
@@ -719,6 +747,10 @@ GHOST_TSuccess GHOST_WindowCocoa::installDrawingContext(GHOST_TDrawingContextTyp
        NSOpenGLPixelFormat *pixelFormat;
        NSOpenGLContext *tmpOpenGLContext;
        
+       /***** Multithreaded opengl code : uncomment for enabling
+       CGLContextObj cglCtx;
+       */
+        
        switch (type) {
                case GHOST_kDrawingContextTypeOpenGL:
                        if (!getValid()) break;
@@ -731,6 +763,13 @@ GHOST_TSuccess GHOST_WindowCocoa::installDrawingContext(GHOST_TDrawingContextTyp
                                break;
                        }
                        
+                       //Switch openGL to multhreaded mode
+                       /******* Multithreaded opengl code : uncomment for enabling
+                       cglCtx = (CGLContextObj)[tmpOpenGLContext CGLContextObj];
+                       if (CGLEnable(cglCtx, kCGLCEMPEngine) == kCGLNoError)
+                               printf("\nSwitched openGL to multithreaded mode");
+                        */
+                       
                        if (!s_firstOpenGLcontext) s_firstOpenGLcontext = tmpOpenGLContext;
 #ifdef WAIT_FOR_VSYNC
                                /* wait for vsync, to avoid tearing artifacts */
index 95441e74771b9dd56050e07cb693d452d1ae6f28..d9c2654f446f86960d133aceaf5fac38f51fa942 100644 (file)
@@ -297,11 +297,13 @@ GHOST_WindowX11(
        // we want this window treated.
 
        XSizeHints * xsizehints = XAllocSizeHints();
-       xsizehints->flags = USPosition | USSize;
+       xsizehints->flags = PPosition | PSize | PMinSize;
        xsizehints->x = left;
        xsizehints->y = top;
        xsizehints->width = width;
        xsizehints->height = height;
+       xsizehints->min_width= 320;     // size hints, could be made apart of the ghost api
+       xsizehints->min_height= 240;    // limits are also arbitrary, but should not allow 1x1 window
        XSetWMNormalHints(m_display, m_window, xsizehints);
        XFree(xsizehints);
 
@@ -382,7 +384,6 @@ GHOST_WindowX11(
        XSetWMHints(display, m_window, xwmhints );
        XFree(xwmhints);
        // done setting the icon
-       
 
        setTitle(title);
 
index 4157237222e285e135af18c7df15e957181b2363..43e38698ef340c893dd31ba425b25817361bf88c 100644 (file)
@@ -98,9 +98,9 @@ public:
     Vector   dw;    //!< angular acceration vector
 public:
     RotationAcc():R(),w() {}
-    explicit RotationAcc(const Rotation& _R):R(_R),w(Vector::Zero()){}
-    RotationAcc(const Rotation& _R,const Vector& _w,const Vector& _dw):
-        R(_R),w(_w),dw(_dw) {}
+    explicit RotationAcc(const Rotation& R_):R(R_),w(Vector::Zero()){}
+    RotationAcc(const Rotation& R_,const Vector& _w,const Vector& _dw):
+        R(R_),w(_w),dw(_dw) {}
     IMETHOD RotationAcc& operator = (const RotationAcc& arg);
     IMETHOD RotationAcc& operator = (const Rotation& arg);
     IMETHOD static RotationAcc Identity();
@@ -152,9 +152,9 @@ public:
     VectorAcc   p;   //!< Translation, velocity and acceleration of origin.
 public:
     FrameAcc(){}
-    explicit FrameAcc(const Frame& _T):M(_T.M),p(_T.p) {}
-    FrameAcc(const Frame& _T,const Twist& _t,const Twist& _dt):
-        M(_T.M,_t.rot,_dt.rot),p(_T.p,_t.vel,_dt.vel) {}
+    explicit FrameAcc(const Frame& T_):M(T_.M),p(T_.p) {}
+    FrameAcc(const Frame& T_,const Twist& _t,const Twist& _dt):
+        M(T_.M,_t.rot,_dt.rot),p(T_.p,_t.vel,_dt.vel) {}
     FrameAcc(const RotationAcc& _M,const VectorAcc& _p):M(_M),p(_p) {}
 
     IMETHOD FrameAcc& operator = (const FrameAcc& arg);
index 21a7844f522c8740f52953a7f36a68461573dc07..b70182bccded854d065577b267f5c941928b8c4a 100644 (file)
@@ -133,8 +133,8 @@ public:
     Vector   w; // rotation vector
 public:
     RotationVel():R(),w() {}
-    explicit RotationVel(const Rotation& _R):R(_R),w(Vector::Zero()){}
-    RotationVel(const Rotation& _R,const Vector& _w):R(_R),w(_w){}
+    explicit RotationVel(const Rotation& R_):R(R_),w(Vector::Zero()){}
+    RotationVel(const Rotation& R_,const Vector& _w):R(R_),w(_w){}
 
 
     Rotation value() const { return R;}
@@ -194,11 +194,11 @@ public:
 public:
     FrameVel(){}
 
-    explicit FrameVel(const Frame& _T):
-        M(_T.M),p(_T.p) {}
+    explicit FrameVel(const Frame& T_):
+        M(T_.M),p(T_.p) {}
 
-    FrameVel(const Frame& _T,const Twist& _t):
-        M(_T.M,_t.rot),p(_T.p,_t.vel) {}
+    FrameVel(const Frame& T_,const Twist& _t):
+        M(T_.M,_t.rot),p(T_.p,_t.vel) {}
 
     FrameVel(const RotationVel& _M,const VectorVel& _p):
         M(_M),p(_p) {}
index c49e817196eb1a7e7d3127630a8b4cad1d09d771..4a8063bb5f02dce2f5579ca06b829b431d51c3e0 100644 (file)
                                RelativePath="..\..\..\source\blender\editors\space_outliner\outliner.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\source\blender\editors\space_outliner\outliner_header.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\space_outliner\outliner_intern.h"\r
                                >\r
diff --git a/release/environment-macosx b/release/environment-macosx
new file mode 100644 (file)
index 0000000..d41d5ec
--- /dev/null
@@ -0,0 +1,18 @@
+# This is a Blender Environment Variable config file.
+#
+# Comment lines start with "#", other lines will be split at the "="
+# and the part before will be used as env var name and the part after
+# as env var value. The value can make reference to previous or
+# prelaunch variables with "${}" and the content will be replaced.
+# Once set, values of variables will not be overwritten.
+#
+# BLENDER_SHARE should be /Library/Application Support/Blender for typical installs.
+# BLENDER_VERSION will be set by the program before processing this file.
+BLENDER_USER_BASE=${HOME}/Library/Application Support/Blender/${BLENDER_VERSION}
+BLENDER_SYSTEM_BASE=${BLENDER_SHARE}/${BLENDER_VERSION}
+BLENDER_USER_DATAFILES=${HOME}/Library/Application Support/Blender/${BLENDER_VERSION}/datafiles
+BLENDER_SYSTEM_DATAFILES=${BLENDER_SHARE}/${BLENDER_VERSION}/datafiles
+BLENDER_USER_PY=${HOME}/Library/Application Support/Blender/${BLENDER_VERSION}/py
+BLENDER_SYSTEM_PY=${BLENDER_SHARE}/${BLENDER_VERSION}/py
+BLENDER_USER_PLUGINS=${HOME}/Library/Application Support/Blender/${BLENDER_VERSION}/plugins
+BLENDER_SYSTEM_PLUGINS=${BLENDER_SHARE}/${BLENDER_VERSION}/plugins
diff --git a/release/environment-mswindows b/release/environment-mswindows
new file mode 100644 (file)
index 0000000..f8890f8
--- /dev/null
@@ -0,0 +1,18 @@
+# This is a Blender Environment Variable config file.\r
+#\r
+# Comment lines start with "#", other lines will be split at the "="\r
+# and the part before will be used as env var name and the part after\r
+# as env var value. The value can make reference to previous or\r
+# prelaunch variables with "%%" and the content will be replaced.\r
+# Once set, values of variables will not be overwritten.\r
+#\r
+# BLENDER_SHARE should be COMMON_APPDATA\\Blender Foundation\\Blender for typical installs.\r
+# BLENDER_VERSION will be set by the program before processing this file.\r
+BLENDER_USER_BASE=%USERPROFILE%\\Blender Foundation\\Blender\\%BLENDER_VERSION%\r
+BLENDER_SYSTEM_BASE=%BLENDER_SHARE%\\%BLENDER_VERSION%\r
+BLENDER_USER_DATAFILES=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\datafiles\r
+BLENDER_SYSTEM_DATAFILES=%BLENDER_SHARE%\\%BLENDER_VERSION%\\datafiles\r
+BLENDER_USER_PY=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\py\r
+BLENDER_SYSTEM_PY=%BLENDER_SHARE%\\%BLENDER_VERSION%\\py\r
+BLENDER_USER_PLUGINS=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\plugins\r
+BLENDER_SYSTEM_PLUGINS=%BLENDER_SHARE%\\%BLENDER_VERSION%\\plugins\r
diff --git a/release/environment-unix b/release/environment-unix
new file mode 100644 (file)
index 0000000..8a13c28
--- /dev/null
@@ -0,0 +1,18 @@
+# This is a Blender Environment Variable config file.
+#
+# Comment lines start with "#", other lines will be split at the "="
+# and the part before will be used as env var name and the part after
+# as env var value. The value can make reference to previous or
+# prelaunch variables with "${}" and the content will be replaced.
+# Once set, values of variables will not be overwritten.
+#
+# BLENDER_SHARE should be /usr/share/blender for typical distro installs.
+# BLENDER_VERSION will be set by the program before processing this file.
+BLENDER_USER_BASE=${HOME}/.blender/${BLENDER_VERSION}
+BLENDER_SYSTEM_BASE=${BLENDER_SHARE}/${BLENDER_VERSION}
+BLENDER_USER_DATAFILES=${HOME}/.blender/${BLENDER_VERSION}/datafiles
+BLENDER_SYSTEM_DATAFILES=${BLENDER_SHARE}/${BLENDER_VERSION}/datafiles
+BLENDER_USER_PY=${HOME}/.blender/${BLENDER_VERSION}/py
+BLENDER_SYSTEM_PY=${BLENDER_SHARE}/${BLENDER_VERSION}/py
+BLENDER_USER_PLUGINS=${HOME}/.blender/${BLENDER_VERSION}/plugins
+BLENDER_SYSTEM_PLUGINS=${BLENDER_SHARE}/${BLENDER_VERSION}/plugins
index 5ca7d5629d582ab09cef6bda14dfad6b72dea41d..99913523fd38be6cf0407cc925ab910e46d48be6 100644 (file)
@@ -1091,9 +1091,9 @@ def save_3ds(filename, context):
 #         Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
 # # save_3ds('/test_b.3ds')
 
-class EXPORT_OT_3ds(bpy.types.Operator):
+class EXPORT_OT_autodesk_3ds(bpy.types.Operator):
        '''Export to 3DS file format (.3ds).'''
-       __idname__ = "export.3ds"
+       __idname__ = "export.autodesk_3ds"
        __label__ = 'Export 3DS'
        
        # List of operator properties, the attributes will be assigned
@@ -1117,9 +1117,9 @@ class EXPORT_OT_3ds(bpy.types.Operator):
                print("Poll")
                return context.active_object != None
 
-bpy.ops.add(EXPORT_OT_3ds)
+bpy.ops.add(EXPORT_OT_autodesk_3ds)
 
 # Add to a menu
 import dynamic_menu
-menu_func = lambda self, context: self.layout.itemO("export.3ds", text="Autodesk 3DS...")
+menu_func = lambda self, context: self.layout.itemO("export.autodesk_3ds", text="Autodesk 3DS...")
 menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)
index d74cc0e9d7ef082832140da1f3874e133155759f..953ed4dc89e4d32a837038508eb9c7bd5ff30eca 100644 (file)
@@ -278,4 +278,4 @@ menu_func = lambda self, context: self.layout.itemO("export.ply", text="Stanford
 menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)
 
 if __name__ == "__main__":
-       bpy.ops.EXPORT_OT_ply(path="/tmp/test.ply")
+       bpy.ops.export.ply(path="/tmp/test.ply")
index cbd9d8948abcccefe149992803c9694a1dcfb846..da0634a26d781e3142b74d1cd9ebff46e13623d4 100644 (file)
@@ -1122,9 +1122,9 @@ else:
 
 '''
 
-class IMPORT_OT_3ds(bpy.types.Operator):
+class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
        '''Import from 3DS file format (.3ds)'''
-       __idname__ = "import.3ds"
+       __idname__ = "import.autodesk_3ds"
        __label__ = 'Import 3DS'
        
        # List of operator properties, the attributes will be assigned
@@ -1147,10 +1147,10 @@ class IMPORT_OT_3ds(bpy.types.Operator):
                wm.add_fileselect(self.__operator__)
                return ('RUNNING_MODAL',)
 
-bpy.ops.add(IMPORT_OT_3ds)
+bpy.ops.add(IMPORT_OT_autodesk_3ds)
 
 import dynamic_menu
-menu_func = lambda self, context: self.layout.itemO("import.3ds", text="3D Studio (.3ds)...")
+menu_func = lambda self, context: self.layout.itemO("import.autodesk_3ds", text="3D Studio (.3ds)...")
 menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_import, menu_func)
 
 # NOTES:
diff --git a/release/scripts/modules/autocomplete.py b/release/scripts/modules/autocomplete.py
deleted file mode 100644 (file)
index 9dd489a..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-
-
-def execute(bcon):
-       '''
-       This function has been taken from a BGE console autocomp I wrote a while ago
-       the dictionaty bcon is not needed but it means I can copy and paste from the old func
-       which works ok for now.
-       
-       'bcon' dictionary keys, set by the caller
-       * 'cursor' - index of the editing character (int)
-       * 'edit_text' - text string for editing (string)
-       * 'scrollback' - text to add to the scrollback, options are added here. (text)
-       * 'namespace' - namespace, (dictionary)
-       
-       '''
-       
-       
-       def is_delimiter(ch):
-               '''
-               For skipping words
-               '''
-               if ch == '_':
-                       return False
-               if ch.isalnum():
-                       return False
-               
-               return True
-       
-       def is_delimiter_autocomp(ch):
-               '''
-               When autocompleteing will earch back and 
-               '''
-               if ch in '._[] "\'':
-                       return False
-               if ch.isalnum():
-                       return False
-               
-               return True
-
-       
-       def do_autocomp(autocomp_prefix, autocomp_members):
-               '''
-               return text to insert and a list of options
-               '''
-               autocomp_members = [v for v in autocomp_members if v.startswith(autocomp_prefix)]
-               
-               print("AUTO: '%s'" % autocomp_prefix)
-               print("MEMBERS: '%s'" % str(autocomp_members))
-               
-               if not autocomp_prefix:
-                       return '', autocomp_members
-               elif len(autocomp_members) > 1:
-                       # find a common string between all members after the prefix 
-                       # 'ge' [getA, getB, getC] --> 'get'
-                       
-                       # get the shortest member
-                       min_len = min([len(v) for v in autocomp_members])
-                       
-                       autocomp_prefix_ret = ''
-                       
-                       for i in range(len(autocomp_prefix), min_len):
-                               char_soup = set()
-                               for v in autocomp_members:
-                                       char_soup.add(v[i])
-                               
-                               if len(char_soup) > 1:
-                                       break
-                               else:
-                                       autocomp_prefix_ret += char_soup.pop()
-                       
-                       return autocomp_prefix_ret, autocomp_members
-               elif len(autocomp_members) == 1:
-                       if autocomp_prefix == autocomp_members[0]:
-                               # the variable matched the prefix exactly
-                               # add a '.' so you can quickly continue.
-                               # Could try add [] or other possible extensions rather then '.' too if we had the variable.
-                               return '.', []
-                       else:
-                               # finish off the of the word word
-                               return autocomp_members[0][len(autocomp_prefix):], []
-               else:
-                       return '', []
-       
-
-       def BCon_PrevChar(bcon):
-               cursor = bcon['cursor']-1
-               if cursor<0:
-                       return None
-                       
-               try:
-                       return bcon['edit_text'][cursor]
-               except:
-                       return None
-               
-               
-       def BCon_NextChar(bcon):
-               try:
-                       return bcon['edit_text'][bcon['cursor']]
-               except:
-                       return None
-       
-       def BCon_cursorLeft(bcon):
-               bcon['cursor'] -= 1
-               if bcon['cursor'] < 0:
-                       bcon['cursor'] = 0
-
-       def BCon_cursorRight(bcon):
-                       bcon['cursor'] += 1
-                       if bcon['cursor'] > len(bcon['edit_text']):
-                               bcon['cursor'] = len(bcon['edit_text'])
-       
-       def BCon_AddScrollback(bcon, text):
-               
-               bcon['scrollback'] = bcon['scrollback'] + text
-               
-       
-       def BCon_cursorInsertChar(bcon, ch):
-               if bcon['cursor']==0:
-                       bcon['edit_text'] = ch + bcon['edit_text']
-               elif bcon['cursor']==len(bcon['edit_text']):
-                       bcon['edit_text'] = bcon['edit_text'] + ch
-               else:
-                       bcon['edit_text'] = bcon['edit_text'][:bcon['cursor']] + ch + bcon['edit_text'][bcon['cursor']:]
-                       
-               bcon['cursor'] 
-               if bcon['cursor'] > len(bcon['edit_text']):
-                       bcon['cursor'] = len(bcon['edit_text'])
-               BCon_cursorRight(bcon)
-       
-       
-       TEMP_NAME = '___tempname___'
-       
-       cursor_orig = bcon['cursor']
-       
-       ch = BCon_PrevChar(bcon)
-       while ch != None and (not is_delimiter(ch)):
-               ch = BCon_PrevChar(bcon)
-               BCon_cursorLeft(bcon)
-       
-       if ch != None:
-               BCon_cursorRight(bcon)
-       
-       #print (cursor_orig, bcon['cursor'])
-       
-       cursor_base = bcon['cursor']
-       
-       autocomp_prefix = bcon['edit_text'][cursor_base:cursor_orig]
-       
-       print("PREFIX:'%s'" % autocomp_prefix)
-       
-       # Get the previous word
-       if BCon_PrevChar(bcon)=='.':
-               BCon_cursorLeft(bcon)
-               ch = BCon_PrevChar(bcon)
-               while ch != None and is_delimiter_autocomp(ch)==False:
-                       ch = BCon_PrevChar(bcon)
-                       BCon_cursorLeft(bcon)
-               
-               cursor_new = bcon['cursor']
-               
-               if ch != None:
-                       cursor_new+=1
-               
-               pytxt = bcon['edit_text'][cursor_new:cursor_base-1].strip()
-               print("AUTOCOMP EVAL: '%s'" % pytxt)
-               #try:
-               if pytxt:
-                       bcon['console'].runsource(TEMP_NAME + '=' + pytxt, '<input>', 'single')
-                       # print val
-               else: ##except:
-                       val = None
-               
-               try:
-                       val = bcon['namespace'][TEMP_NAME]
-                       del bcon['namespace'][TEMP_NAME]
-               except:
-                       val = None
-               
-               if val:
-                       autocomp_members = dir(val)
-                       
-                       autocomp_prefix_ret, autocomp_members = do_autocomp(autocomp_prefix, autocomp_members)
-                       
-                       bcon['cursor'] = cursor_orig
-                       for v in autocomp_prefix_ret:
-                               BCon_cursorInsertChar(bcon, v)
-                       cursor_orig = bcon['cursor']
-                       
-                       if autocomp_members:
-                               BCon_AddScrollback(bcon, ', '.join(autocomp_members))
-               
-               del val
-               
-       else:
-               # Autocomp global namespace
-               autocomp_members = bcon['namespace'].keys()
-               
-               if autocomp_prefix:
-                       autocomp_members = [v for v in autocomp_members if v.startswith(autocomp_prefix)]
-               
-               autocomp_prefix_ret, autocomp_members = do_autocomp(autocomp_prefix, autocomp_members)
-               
-               bcon['cursor'] = cursor_orig
-               for v in autocomp_prefix_ret:
-                       BCon_cursorInsertChar(bcon, v)
-               cursor_orig = bcon['cursor']
-               
-               if autocomp_members:
-                       BCon_AddScrollback(bcon, ', '.join(autocomp_members))
-       
-       bcon['cursor'] = cursor_orig
\ No newline at end of file
diff --git a/release/scripts/modules/bpy_ext/Object.py b/release/scripts/modules/bpy_ext/Object.py
new file mode 100644 (file)
index 0000000..a842318
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+class_obj = bpy.types.Object
+
+class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]
\ No newline at end of file
diff --git a/release/scripts/modules/bpy_ext/__init__.py b/release/scripts/modules/bpy_ext/__init__.py
new file mode 100644 (file)
index 0000000..a20a5ff
--- /dev/null
@@ -0,0 +1 @@
+import bpy_ext.Object
index 6772a3771cb9f614434e8501f51cf59604336b05..fbb4a8b537d51329da85ce746cf95cb1d35518b7 100644 (file)
@@ -21,21 +21,24 @@ context_dict = {
 class bpy_ops(object):
        '''
        Fake module like class.
-       
+
         bpy.ops
        '''
-       def add(self, pyop):
-               op_add(pyop)
-       
-       def remove(self, pyop):
-               op_remove(pyop)
-       
+
        def __getattr__(self, module):
                '''
                gets a bpy.ops submodule
                '''
+               if module.startswith('__'):
+                       raise AttributeError(module)
                return bpy_ops_submodule(module)
                
+       def add(self, pyop):
+               op_add(pyop)
+       
+       def remove(self, pyop):
+               op_remove(pyop)
+       
        def __dir__(self):
                
                submodules = set()
@@ -110,19 +113,36 @@ class bpy_ops_submodule_op(object):
        def __call__(self, *args, **kw):
                
                # Get the operator from blender
-               if len(args) > 1:
-                       raise ValueError("only one argument for the execution context is supported ")
+               if len(args) > 2:
+                       raise ValueError("only 1 or 2 arguments for the execution context is supported")
+               
+               C_dict = None
                
                if args:
+                       
+                       C_exec = 'EXEC_DEFAULT'
+                       
+                       if len(args) == 2:
+                               C_exec = args[0]
+                               C_dict = args[1]
+                       else:
+                               if type(args[0]) != str:
+                                       C_dict= args[0]
+                               else:
+                                       C_exec= args[0]
+                       
                        try:
-                               context = context_dict[args[0]]
+                               context = context_dict[C_exec]
                        except:
                                raise ValueError("Expected a single context argument in: " + str(list(context_dict.keys())))
                        
-                       return op_call(self.idname(), kw, context)
+                       if len(args) == 2:
+                               C_dict= args[1]
+                       
+                       return op_call(self.idname() , C_dict, kw, context)
                
                else:
-                       return op_call(self.idname(), kw)
+                       return op_call(self.idname(), C_dict, kw)
        
        def get_rna(self):
                '''
@@ -154,51 +174,68 @@ class MESH_OT_delete_edgeloop(bpy.types.Operator):
                return ('FINISHED',)
 
 rna_path_prop = bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= "")
+rna_reverse_prop = bpy.props.BoolProperty(attr="reverse", name="Reverse", description="Cycle backwards", default= False)
+
+class NullPathMember:
+       pass
+
+def context_path_validate(context, path):
+       import sys
+       try:
+               value = eval("context.%s" % path)
+       except AttributeError:
+               if "'NoneType'" in str(sys.exc_info()[1]):
+                       # One of the items in the rna path is None, just ignore this
+                       value = NullPathMember
+               else:
+                       # We have a real error in the rna path, dont ignore that
+                       raise
+       
+       return value
+               
+       
+
+def execute_context_assign(self, context):
+       if context_path_validate(context, self.path) == NullPathMember:
+               return ('PASS_THROUGH',)
+       
+       exec("context.%s=self.value" % self.path)
+       return ('FINISHED',)
 
 class WM_OT_context_set_boolean(bpy.types.Operator):
        '''Set a context value.'''
        __idname__ = "wm.context_set_boolean"
        __label__ = "Context Set"
        __props__ = [rna_path_prop, bpy.props.BoolProperty(attr="value", name="Value", description="Assignment value", default= True)]
-       def execute(self, context):
-               exec("context.%s=%s" % (self.path, self.value)) # security nuts will complain.
-               return ('FINISHED',)
+       execute = execute_context_assign
 
 class WM_OT_context_set_int(bpy.types.Operator): # same as enum
        '''Set a context value.'''
        __idname__ = "wm.context_set_int"
        __label__ = "Context Set"
        __props__ = [rna_path_prop, bpy.props.IntProperty(attr="value", name="Value", description="Assignment value", default= 0)]
-       def execute(self, context):
-               exec("context.%s=%d" % (self.path, self.value)) # security nuts will complain.
-               return ('FINISHED',)
+       execute = execute_context_assign
                
 class WM_OT_context_set_float(bpy.types.Operator): # same as enum
        '''Set a context value.'''
        __idname__ = "wm.context_set_int"
        __label__ = "Context Set"
        __props__ = [rna_path_prop, bpy.props.FloatProperty(attr="value", name="Value", description="Assignment value", default= 0.0)]
-       def execute(self, context):
-               exec("context.%s=%f" % (self.path, self.value)) # security nuts will complain.
-               return ('FINISHED',)
+       execute = execute_context_assign
 
 class WM_OT_context_set_string(bpy.types.Operator): # same as enum
        '''Set a context value.'''
        __idname__ = "wm.context_set_string"
        __label__ = "Context Set"
        __props__ = [rna_path_prop, bpy.props.StringProperty(attr="value", name="Value", description="Assignment value", maxlen= 1024, default= "")]
-       def execute(self, context):
-               exec("context.%s='%s'" % (self.path, self.value)) # security nuts will complain.
-               return ('FINISHED',)
+       execute = execute_context_assign
 
 class WM_OT_context_set_enum(bpy.types.Operator):
        '''Set a context value.'''
        __idname__ = "wm.context_set_enum"
        __label__ = "Context Set"
        __props__ = [rna_path_prop, bpy.props.StringProperty(attr="value", name="Value", description="Assignment value (as a string)", maxlen= 1024, default= "")]
-       def execute(self, context):
-               exec("context.%s='%s'" % (self.path, self.value)) # security nuts will complain.
-               return ('FINISHED',)
+       execute = execute_context_assign
 
 class WM_OT_context_toggle(bpy.types.Operator):
        '''Toggle a context value.'''
@@ -206,6 +243,10 @@ class WM_OT_context_toggle(bpy.types.Operator):
        __label__ = "Context Toggle"
        __props__ = [rna_path_prop]
        def execute(self, context):
+               
+               if context_path_validate(context, self.path) == NullPathMember:
+                       return ('PASS_THROUGH',)
+               
                exec("context.%s=not (context.%s)" % (self.path, self.path)) # security nuts will complain.
                return ('FINISHED',)
 
@@ -219,16 +260,49 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
                bpy.props.StringProperty(attr="value_2", name="Value", description="Toggle enum", maxlen= 1024, default= "")
        ]
        def execute(self, context):
+               
+               if context_path_validate(context, self.path) == NullPathMember:
+                       return ('PASS_THROUGH',)
+               
                exec("context.%s = ['%s', '%s'][context.%s!='%s']" % (self.path, self.value_1, self.value_2, self.path, self.value_2)) # security nuts will complain.
                return ('FINISHED',)
 
+class WM_OT_context_cycle_int(bpy.types.Operator):
+       '''Set a context value. Useful for cycling active material, vertex keys, groups' etc.'''
+       __idname__ = "wm.context_cycle_int"
+       __label__ = "Context Int Cycle"
+       __props__ = [rna_path_prop, rna_reverse_prop]
+       def execute(self, context):
+               
+               value = context_path_validate(context, self.path)
+               if value == NullPathMember:
+                       return ('PASS_THROUGH',)
+               
+               self.value = value
+               if self.reverse:        self.value -= 1
+               else:           self.value += 1
+               execute_context_assign(self, context)
+               
+               if self.value != eval("context.%s" % self.path):
+                       # relies on rna clamping int's out of the range
+                       if self.reverse:        self.value =  (1<<32)
+                       else:           self.value = -(1<<32)
+                       execute_context_assign(self, context)
+                       
+               return ('FINISHED',)
+
 class WM_OT_context_cycle_enum(bpy.types.Operator):
        '''Toggle a context value.'''
        __idname__ = "wm.context_cycle_enum"
        __label__ = "Context Enum Cycle"
-       __props__ = [rna_path_prop, bpy.props.BoolProperty(attr="reverse", name="Reverse", description="Cycle backwards", default= False)]
+       __props__ = [rna_path_prop, rna_reverse_prop]
        def execute(self, context):
-               orig_value = eval("context.%s" % self.path) # security nuts will complain.
+               
+               value = context_path_validate(context, self.path)
+               if value == NullPathMember:
+                       return ('PASS_THROUGH',)
+               
+               orig_value = value
                
                # Have to get rna enum values
                rna_struct_str, rna_prop_str =  self.path.rsplit('.', 1)
@@ -257,6 +331,94 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
                exec("context.%s=advance_enum" % self.path)
                return ('FINISHED',)
 
+doc_id = bpy.props.StringProperty(attr="doc_id", name="Doc ID", description="ID for the documentation", maxlen= 1024, default= "")
+doc_new = bpy.props.StringProperty(attr="doc_new", name="Doc New", description="", maxlen= 1024, default= "")
+
+
+class WM_OT_doc_view(bpy.types.Operator):
+       '''Load online reference docs'''
+       __idname__ = "wm.doc_view"
+       __label__ = "View Documentation"
+       __props__ = [doc_id]
+       _prefix = 'http://www.blender.org/documentation/250PythonDoc'
+       
+       def _nested_class_string(self, class_string):
+               ls = []
+               class_obj = getattr(bpy.types, class_string, None).__rna__
+               while class_obj:
+                       ls.insert(0, class_obj)
+                       class_obj = class_obj.nested
+               return '.'.join([class_obj.identifier for class_obj in ls])
+       
+       def execute(self, context):
+               id_split = self.doc_id.split('.')
+               # Example url, http://www.graphicall.org/ftp/ideasman42/html/bpy.types.Space3DView-class.html#background_image
+               # Example operator http://www.graphicall.org/ftp/ideasman42/html/bpy.ops.boid-module.html#boidrule_add
+               if len(id_split) == 1: # rna, class
+                       url= '%s/bpy.types.%s-class.html' % (self._prefix, id_split[0])
+               elif len(id_split) == 2: # rna, class.prop
+                       class_name, class_prop = id_split
+                       
+                       class_name_full = self._nested_class_string(class_name) # It so happens that epydoc nests these
+                       
+                       if hasattr(bpy.types, class_name.upper() + '_OT_' + class_prop):
+                               url= '%s/bpy.ops.%s-module.html#%s' % (self._prefix, class_name_full, class_prop)
+                       else:
+                               url= '%s/bpy.types.%s-class.html#%s' % (self._prefix, class_name_full, class_prop)
+                       
+               else:
+                       return ('PASS_THROUGH',)
+               
+               import webbrowser
+               webbrowser.open(url)
+               
+               return ('FINISHED',)
+
+
+class WM_OT_doc_edit(bpy.types.Operator):
+       '''Load online reference docs'''
+       __idname__ = "wm.doc_edit"
+       __label__ = "Edit Documentation"
+       __props__ = [doc_id, doc_new]
+       
+       
+       def _send_xmlrpc(self, data_dict):              
+               print("sending data:", data_dict)
+               
+               import xmlrpc.client
+               user = 'blenderuser'
+               pwd = 'blender>user'
+               
+               docblog = xmlrpc.client.ServerProxy("http://www.mindrones.com/blender/svn/xmlrpc.php")
+               docblog.metaWeblog.newPost(1,user,pwd, data_dict,1)
+       
+       def execute(self, context):
+               
+               class_name, class_prop = self.doc_id.split('.')
+               
+               if self.doc_new:
+                       op_class = getattr(bpy.types, class_name.upper() + '_OT_' + class_prop, None)
+                       
+                       if op_class:
+                               doc_orig = op_class.__rna__.description
+                               if doc_orig != self.doc_new:
+                                       print("operator - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
+                                       self._send_xmlrpc({'title':'OPERATOR %s:%s' % (self.doc_id,doc_orig),'description':self.doc_new})
+                       else:
+                               doc_orig = getattr(bpy.types, class_name).__rna__.properties[class_prop].description
+                               if doc_orig != self.doc_new:
+                                       print("rna - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
+                                       # Ugh, will run this on every edit.... better not make any mistakes
+                                       self._send_xmlrpc({'title':'RNA %s:%s' % (self.doc_id,doc_orig),'description':self.doc_new})
+                                       
+               return ('FINISHED',)
+       
+       def invoke(self, context, event):
+               wm = context.manager
+               wm.invoke_props_popup(self.__operator__, event)
+               return ('RUNNING_MODAL',)
+
+
 bpy.ops.add(MESH_OT_delete_edgeloop)
 
 bpy.ops.add(WM_OT_context_set_boolean)
@@ -267,4 +429,7 @@ bpy.ops.add(WM_OT_context_set_enum)
 bpy.ops.add(WM_OT_context_toggle)
 bpy.ops.add(WM_OT_context_toggle_enum)
 bpy.ops.add(WM_OT_context_cycle_enum)
+bpy.ops.add(WM_OT_context_cycle_int)
 
+bpy.ops.add(WM_OT_doc_view)
+bpy.ops.add(WM_OT_doc_edit)
diff --git a/release/scripts/modules/console/__init__.py b/release/scripts/modules/console/__init__.py
new file mode 100644 (file)
index 0000000..eb32d78
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 2009 www.stani.be (GPL license)
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""Package for console specific modules."""
diff --git a/release/scripts/modules/console/complete_import.py b/release/scripts/modules/console/complete_import.py
new file mode 100644 (file)
index 0000000..9166dee
--- /dev/null
@@ -0,0 +1,180 @@
+# Copyright (c) 2009 Fernando Perez, www.stani.be (GPL license)
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Original copyright (see docstring):
+#*****************************************************************************
+#       Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
+#
+#  Distributed under the terms of the BSD License.  The full license is in
+#  the file COPYING, distributed as part of this software.
+#*****************************************************************************
+
+"""Completer for import statements
+
+Original code was from IPython/Extensions/ipy_completers.py. The following
+changes have been made:
+- ported to python3
+- pep8 polishing
+- limit list of modules to prefix in case of "from w"
+- sorted modules
+- added sphinx documentation
+"""
+
+
+import os
+import sys
+
+TIMEOUT_STORAGE = 3  # Time in secs after which the rootmodules will be stored
+TIMEOUT_GIVEUP = 20  # Time in secs after which we give up
+
+ROOT_MODULES = None
+
+
+def get_root_modules():
+    """
+    Returns a list containing the names of all the modules available in the
+    folders of the pythonpath.
+
+    :returns: modules
+    :rtype: list
+    """
+    global ROOT_MODULES
+    modules = []
+    if not(ROOT_MODULES is None):
+        return ROOT_MODULES
+    from time import time
+    t = time()
+    store = False
+    for path in sys.path:
+        modules += module_list(path)
+        if time() - t >= TIMEOUT_STORAGE and not store:
+            # Caching the list of root modules, please wait!
+            store = True
+        if time() - t > TIMEOUT_GIVEUP:
+            # This is taking too long, we give up.
+            ROOT_MODULES = []
+            return []
+
+    modules += sys.builtin_module_names
+
+    modules = list(set(modules))
+    if '__init__' in modules:
+        modules.remove('__init__')
+    modules = sorted(set(modules))
+    if store:
+        ROOT_MODULES = modules
+    return modules
+
+
+def module_list(path):
+    """
+    Return the list containing the names of the modules available in
+    the given folder.
+
+    :param path: folder path
+    :type path: str
+    :returns: modules
+    :rtype: list
+    """
+
+    if os.path.isdir(path):
+        folder_list = os.listdir(path)
+    elif path.endswith('.egg'):
+        from zipimport import zipimporter
+        try:
+            folder_list = [f for f in zipimporter(path)._files]
+        except:
+            folder_list = []
+    else:
+        folder_list = []
+    #folder_list = glob.glob(os.path.join(path,'*'))
+    folder_list = [p for p in folder_list  \
+       if os.path.exists(os.path.join(path, p, '__init__.py'))\
+           or p[-3:] in ('.py', '.so')\
+           or p[-4:] in ('.pyc', '.pyo', '.pyd')]
+
+    folder_list = [os.path.basename(p).split('.')[0] for p in folder_list]
+    return folder_list
+
+
+def complete(line):
+    """
+    Returns a list containing the completion possibilities for an import line.
+
+    :param line:
+
+        incomplete line which contains an import statement::
+
+            import xml.d
+            from xml.dom import
+
+    :type line: str
+    :returns: list of completion possibilities
+    :rtype: list
+
+    >>> complete('import weak')
+    ['weakref']
+    >>> complete('from weakref import C')
+    ['CallableProxyType']
+    """
+    import inspect
+
+    def try_import(mod, only_modules=False):
+
+        def is_importable(module, attr):
+            if only_modules:
+                return inspect.ismodule(getattr(module, attr))
+            else:
+                return not(attr[:2] == '__' and attr[-2:] == '__')
+
+        try:
+            m = __import__(mod)
+        except:
+            return []
+        mods = mod.split('.')
+        for module in mods[1:]:
+            m = getattr(m, module)
+        if (not hasattr(m, '__file__')) or (not only_modules) or\
+           (hasattr(m, '__file__') and '__init__' in m.__file__):
+            completion_list = [attr for attr in dir(m)
+                if is_importable(m, attr)]
+        else:
+            completion_list = []
+        completion_list.extend(getattr(m, '__all__', []))
+        if hasattr(m, '__file__') and '__init__' in m.__file__:
+            completion_list.extend(module_list(os.path.dirname(m.__file__)))
+        completion_list = list(set(completion_list))
+        if '__init__' in completion_list:
+            completion_list.remove('__init__')
+        return completion_list
+
+    def filter_prefix(names, prefix):
+        return [name for name in names if name.startswith(prefix)]
+
+    words = line.split(' ')
+    if len(words) == 3 and words[0] == 'from':
+        return ['import ']
+    if len(words) < 3 and (words[0] in ['import', 'from']):
+        if len(words) == 1:
+            return get_root_modules()
+        mod = words[1].split('.')
+        if len(mod) < 2:
+            return filter_prefix(get_root_modules(), words[-1])
+        completion_list = try_import('.'.join(mod[:-1]), True)
+        completion_list = ['.'.join(mod[:-1] + [el]) for el in completion_list]
+        return filter_prefix(completion_list, words[-1])
+    if len(words) >= 3 and words[0] == 'from':
+        mod = words[1]
+        return filter_prefix(try_import(mod), words[-1])
diff --git a/release/scripts/modules/console/complete_namespace.py b/release/scripts/modules/console/complete_namespace.py
new file mode 100644 (file)
index 0000000..4aa0de5
--- /dev/null
@@ -0,0 +1,186 @@
+# Copyright (c) 2009 www.stani.be (GPL license)
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""Autocomplete with the standard library"""
+
+import re
+import rlcompleter
+
+
+RE_INCOMPLETE_INDEX = re.compile('(.*?)\[[^\]]+$')
+
+TEMP = '__tEmP__'  # only \w characters are allowed!
+TEMP_N = len(TEMP)
+
+
+def is_dict(obj):
+    """Returns whether obj is a dictionary"""
+    return hasattr(obj, 'keys') and hasattr(getattr(obj, 'keys'), '__call__')
+
+
+def complete_names(word, namespace):
+    """Complete variable names or attributes
+
+    :param word: word to be completed
+    :type word: str
+    :param namespace: namespace
+    :type namespace: dict
+    :returns: completion matches
+    :rtype: list of str
+
+    >>> complete_names('fo', {'foo': 'bar'})
+    ['foo', 'for', 'format(']
+    """
+    # start completer
+    completer = rlcompleter.Completer(namespace)
+    # find matches with std library (don't try to implement this yourself)
+    completer.complete(word, 0)
+    return sorted(set(completer.matches))
+
+
+def complete_indices(word, namespace, obj=None, base=None):
+    """Complete a list or dictionary with its indices:
+
+    * integer numbers for list
+    * any keys for dictionary
+
+    :param word: word to be completed
+    :type word: str
+    :param namespace: namespace
+    :type namespace: dict
+    :param obj: object evaluated from base
+    :param base: substring which can be evaluated into an object
+    :type base: str
+    :returns: completion matches
+    :rtype: list of str
+
+    >>> complete_indices('foo', {'foo': range(5)})
+    ['foo[0]', 'foo[1]', 'foo[2]', 'foo[3]', 'foo[4]']
+    >>> complete_indices('foo', {'foo': {'bar':0, 1:2}})
+    ['foo[1]', "foo['bar']"]
+    >>> complete_indices("foo['b", {'foo': {'bar':0, 1:2}}, base='foo')
+    ["foo['bar']"]
+    """
+    #FIXME: 'foo["b'
+    if base is None:
+        base = word
+    if obj is None:
+        try:
+            obj = eval(base, namespace)
+        except Exception:
+            return []
+    if not hasattr(obj, '__getitem__'):
+        # obj is not a list or dictionary
+        return []
+    if is_dict(obj):
+        # dictionary type
+        matches = ['%s[%r]' % (base, key) for key in sorted(obj.keys())]
+    else:
+        # list type
+        matches = ['%s[%d]' % (base, idx) for idx in range(len(obj))]
+    if word != base:
+        matches = [match for match in matches if match.startswith(word)]
+    return matches
+
+
+def complete(word, namespace, private=True):
+    """Complete word within a namespace with the standard rlcompleter
+    module. Also supports index or key access [].
+
+    :param word: word to be completed
+    :type word: str
+    :param namespace: namespace
+    :type namespace: dict
+    :param private: whether private attribute/methods should be returned
+    :type private: bool
+    :returns: completion matches
+    :rtype: list of str
+
+    >>> complete('foo[1', {'foo': range(14)})
+    ['foo[1]', 'foo[10]', 'foo[11]', 'foo[12]', 'foo[13]']
+    >>> complete('foo[0]', {'foo': [range(5)]})
+    ['foo[0][0]', 'foo[0][1]', 'foo[0][2]', 'foo[0][3]', 'foo[0][4]']
+    >>> complete('foo[0].i', {'foo': [range(5)]})
+    ['foo[0].index(', 'foo[0].insert(']
+    >>> complete('rlcompleter', {'rlcompleter': rlcompleter})
+    ['rlcompleter.']
+    """
+    #
+    # if word is empty -> nothing to complete
+    if not word:
+        return []
+
+    re_incomplete_index = RE_INCOMPLETE_INDEX.search(word)
+    if re_incomplete_index:
+        # ignore incomplete index at the end, e.g 'a[1' -> 'a'
+        matches = complete_indices(word, namespace,
+                    base=re_incomplete_index.group(1))
+
+    elif not('[' in word):
+        matches = complete_names(word, namespace)
+
+    elif word[-1] == ']':
+        matches = [word]
+
+    elif '.' in word:
+        # brackets are normally not allowed -> work around
+
+        # remove brackets by using a temp var without brackets
+        obj, attr = word.rsplit('.', 1)
+        try:
+            # do not run the obj expression in the console
+            namespace[TEMP] = eval(obj, namespace)
+        except Exception:
+            return []
+        matches = complete_names(TEMP + '.' + attr, namespace)
+        matches = [obj + match[TEMP_N:] for match in matches]
+        del namespace[TEMP]
+
+    else:
+        # safety net, but when would this occur?
+        return []
+
+    if not matches:
+        return []
+
+    # add '.', '('  or '[' if no match has been found
+    elif len(matches) == 1 and matches[0] == word:
+
+        # try to retrieve the object
+        try:
+            obj = eval(word, namespace)
+        except Exception:
+            return []
+        # ignore basic types
+        if type(obj) in (bool, float, int, str):
+            return []
+        # an extra char '[', '(' or '.' will be added
+        if hasattr(obj, '__getitem__'):
+            # list or dictionary
+            matches = complete_indices(word, namespace, obj)
+        elif hasattr(obj, '__call__'):
+            # callables
+            matches = [word + '(']
+        else:
+            # any other type
+            matches = [word + '.']
+
+    # separate public from private
+    public_matches = [match for match in matches if not('._' in match)]
+    if private:
+        private_matches = [match for match in matches if '._' in match]
+        return public_matches + private_matches
+    else:
+        return public_matches
diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py
new file mode 100644 (file)
index 0000000..eda34c9
--- /dev/null
@@ -0,0 +1,112 @@
+# Copyright (c) 2009 www.stani.be (GPL license)
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""This module provides intellisense features such as:
+
+* autocompletion
+* calltips (not yet implemented)
+
+It unifies all completion plugins and only loads them on demand.
+"""
+# TODO: file complete if startswith quotes
+import os
+import re
+
+# regular expressions to find out which completer we need
+
+# line which starts with an import statement
+RE_MODULE = re.compile('^import|from.+')
+
+# The following regular expression means an 'unquoted' word
+RE_UNQUOTED_WORD = re.compile(
+    # don't start with a quote
+    '''(?:^|[^"'a-zA-Z0-9_])'''
+    # start with a \w = [a-zA-Z0-9_]
+    '''((?:\w+'''
+    # allow also dots and closed bracket pairs []
+    '''(?:\w|[.]|\[.+?\])*'''
+    # allow empty string
+    '''|)'''
+    # allow an unfinished index at the end (including quotes)
+    '''(?:\[[^\]]*$)?)$''',
+    # allow unicode as theoretically this is possible
+    re.UNICODE)
+
+
+def complete(line, cursor, namespace, private=True):
+    """Returns a list of possible completions:
+
+    * name completion
+    * attribute completion (obj.attr)
+    * index completion for lists and dictionaries
+    * module completion (from/import)
+
+    :param line: incomplete text line
+    :type line: str
+    :param cursor: current character position
+    :type cursor: int
+    :param namespace: namespace
+    :type namespace: dict
+    :param private: whether private variables should be listed
+    :type private: bool
+    :returns: list of completions, word
+    :rtype: list, str
+    """
+    re_unquoted_word = RE_UNQUOTED_WORD.search(line[:cursor])
+    if re_unquoted_word:
+        # unquoted word -> module or attribute completion
+        word = re_unquoted_word.group(1)
+        if RE_MODULE.match(line):
+            import complete_import
+            matches = complete_import.complete(line)
+        else:
+            import complete_namespace
+            matches = complete_namespace.complete(word, namespace, private)
+    else:
+        # for now we don't have completers for strings
+        # TODO: add file auto completer for strings
+        word = ''
+        matches = []
+    return matches, word
+
+
+def expand(line, cursor, namespace, private=True):
+    """This method is invoked when the user asks autocompletion,
+    e.g. when Ctrl+Space is clicked.
+
+    :param line: incomplete text line
+    :type line: str
+    :param cursor: current character position
+    :type cursor: int
+    :param namespace: namespace
+    :type namespace: dict
+    :param private: whether private variables should be listed
+    :type private: bool
+    :returns:
+
+        current expanded line, updated cursor position and scrollback
+
+    :rtype: str, int, str
+    """
+    matches, word = complete(line, cursor, namespace, private)
+    prefix = os.path.commonprefix(matches)[len(word):]
+    if prefix:
+        line = line[:cursor] + prefix + line[cursor:]
+        cursor += len(prefix)
+    if len(matches) == 1:
+        scrollback = ''
+    else:
+        scrollback = '  '.join([m.split('.')[-1] for m in matches])
+    return line, cursor, scrollback
diff --git a/release/scripts/templates/gamelogic.py b/release/scripts/templates/gamelogic.py
new file mode 100644 (file)
index 0000000..af9dbd8
--- /dev/null
@@ -0,0 +1,78 @@
+# This script must be assigned to a python controller
+# where it can access the object that owns it and the sensors/actuators that it connects to.
+
+# GameLogic has been added to the global namespace no need to import
+
+# for keyboard event comparison
+# import GameKeys 
+
+# support for Vector(), Matrix() types and advanced functions like AngleBetweenVecs(v1,v2) and RotationMatrix(...)
+# import Mathutils 
+
+# for functions like getWindowWidth(), getWindowHeight()
+# import Rasterizer
+
+def main():
+       cont = GameLogic.getCurrentController()
+       
+       # The KX_GameObject that owns this controller.
+       own = cont.owner
+       
+       # for scripts that deal with spacial logic
+       own_pos = own.worldPosition
+       
+       
+       # Some example functions, remove to write your own script.
+       # check for a positive sensor, will run on any object without errors.
+       print 'Logic info for KX_GameObject', own.name
+       input = False
+       
+       for sens in cont.sensors:
+               # The sensor can be on another object, we may want to use it
+               own_sens = sens.owner
+               print '    sensor:', sens.name,
+               if sens.positive:
+                       print '(true)'
+                       input = True
+               else:
+                       print '(false)'
+       
+       for actu in cont.actuators:
+               # The actuator can be on another object, we may want to use it
+               own_actu = actu.owner
+               print '    actuator:', actu.name
+               
+               # This runs the actuator or turns it off
+               # note that actuators will continue to run unless explicitly turned off.
+               if input:
+                       cont.activate(actu)
+               else:
+                       cont.deactivate(actu)
+       
+       # Its also good practice to get sensors and actuators by name
+       # rather then index so any changes to their order wont break the script.
+       
+       # sens_key = cont.sensors['key_sensor']
+       # actu_motion = cont.actuators['motion']
+       
+       
+       # Loop through all other objects in the scene
+       sce = GameLogic.getCurrentScene()
+       print 'Scene Objects:', sce.name
+       for ob in sce.objects:
+               print '   ', ob.name, ob.worldPosition
+       
+       
+       # Example where collision objects are checked for their properties
+       # adding to our objects "life" property
+       """
+       actu_collide = cont.sensors['collision_sens']
+       for ob in actu_collide.objectHitList:
+               # Check to see the object has this property
+               if ob.has_key('life'):
+                       own['life'] += ob['life']
+                       ob['life'] = 0
+       print own['life']
+       """
+
+main()
diff --git a/release/scripts/templates/gamelogic_basic.py b/release/scripts/templates/gamelogic_basic.py
new file mode 100644 (file)
index 0000000..c9c2a59
--- /dev/null
@@ -0,0 +1,15 @@
+
+def main():
+
+       cont = GameLogic.getCurrentController()
+       own = cont.owner
+       
+       sens = cont.sensors['mySensor']
+       actu = cont.actuators['myActuator']
+       
+       if sens.positive:
+               cont.activate(actu)
+       else:
+               cont.deactivate(actu)
+
+main()
diff --git a/release/scripts/templates/gamelogic_module.py b/release/scripts/templates/gamelogic_module.py
new file mode 100644 (file)
index 0000000..1bc221e
--- /dev/null
@@ -0,0 +1,26 @@
+# This module can be accessed by a python controller with
+# its execution method set to 'Module'
+# * Set the module string to "gamelogic_module.main" (without quotes)
+# * When renaming the script it MUST have a .py extension
+# * External text modules are supported as long as they are at
+#   the same location as the blendfile or one of its libraries.
+
+import GameLogic
+
+# variables defined here will only be set once when the
+# module is first imported. Set object spesific vars
+# inside the function if you intend to use the module
+# with multiple objects.
+
+def main(cont):
+       own = cont.owner
+       
+       sens = cont.sensors['mySensor']
+       actu = cont.actuators['myActuator']
+       
+       if sens.positive:
+               cont.activate(actu)
+       else:
+               cont.deactivate(actu)
+
+# dont call main(GameLogic.getCurrentController()), the py controller will
diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py
new file mode 100644 (file)
index 0000000..7e3dad9
--- /dev/null
@@ -0,0 +1,53 @@
+def write_some_data(context, path, use_some_setting):
+       pass
+       
+class ExportSomeData(bpy.types.Operator):
+       '''This appiers in the tooltip of the operator and in the generated docs.'''
+       __idname__ = "export.some_data" # this is important since its how bpy.ops.export.some_data is constructed
+       __label__ = "Export Some Data"
+       
+       # List of operator properties, the attributes will be assigned
+       # to the class instance from the operator settings before calling.
+       
+       # TODO, add better example props
+       __props__ = [
+               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""),
+               bpy.props.BoolProperty(attr="use_some_setting", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
+       ]
+       
+       def poll(self, context):
+               return context.active_object != None
+       
+       def execute(self, context):
+               if not self.is_property_set("path"):
+                       raise Exception("filename not set")
+               
+               write(self.path, context, use_setting, SOME_SETTING = self.use_some_setting)
+
+               return ('FINISHED',)
+       
+       def invoke(self, context, event):
+               wm = context.manager
+               
+               if True:
+                       # File selector
+                       wm.add_fileselect(self.__operator__) # will run self.execute()
+                       return ('RUNNING_MODAL',)
+               else if 0:
+                       # Redo popup
+                       wm.invoke_props_popup(self.__operator__, event) # 
+                       return ('RUNNING_MODAL',)
+               else if 0:
+                       return self.execute(context)
+
+
+bpy.ops.add(ExportSomeData)
+
+# Only needed if you want to add into a dynamic menu
+import dynamic_menu
+menu_func = lambda self, context: self.layout.itemO("export.some_data", text="Example Exporter...")
+menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)
+
+# Use for running this script directly
+if __name__ == "__main__":
+       bpy.ops.export.some_data(path="/tmp/test.ply")
\ No newline at end of file
diff --git a/release/scripts/templates/operator_simple.py b/release/scripts/templates/operator_simple.py
new file mode 100644 (file)
index 0000000..b82543c
--- /dev/null
@@ -0,0 +1,20 @@
+def main(context):
+       for ob in context.scene.objects:
+               print(ob)
+       
+class SimpleOperator(bpy.types.Operator):
+       ''''''
+       __idname__ = "object.simple_operator"
+       __label__ = "Simple Object Operator"
+       
+       def poll(self, context):
+               return context.active_object != None
+       
+       def execute(self, context):
+               main(context)
+               return ('FINISHED',)
+
+bpy.ops.add(SimpleOperator)
+
+if __name__ == "__main__":
+       bpy.ops.object.simple_operator()
index e8041cc7393b3c52de88be4da29f5db692d8050c..56a1b048594a690e7f333d913f20f77d42f629dd 100644 (file)
@@ -48,8 +48,6 @@ class BONE_PT_transform(BoneButtonsPanel):
                else:
                        pchan = ob.pose.pose_channels[context.bone.name]
 
-                       
-
                        row = layout.row()
                        col = row.column()
                        col.itemR(pchan, "location")
@@ -141,7 +139,6 @@ class BONE_PT_relations(BoneButtonsPanel):
                sub.itemR(bone, "hinge", text="Inherit Rotation")
                sub.itemR(bone, "inherit_scale", text="Inherit Scale")
 
-                       
 class BONE_PT_display(BoneButtonsPanel):
        __label__ = "Display"
        
@@ -175,7 +172,6 @@ class BONE_PT_display(BoneButtonsPanel):
                        col.itemL(text="Custom Shape:")
                        col.itemR(pchan, "custom_shape", text="")
 
-
 class BONE_PT_deform(BoneButtonsPanel):
        __label__ = "Deform"
        __default_closed__ = True
@@ -224,7 +220,6 @@ class BONE_PT_deform(BoneButtonsPanel):
                col.itemL(text="Offset:")
                col.itemR(bone, "cyclic_offset")
 
-
 bpy.types.register(BONE_PT_context_bone)
 bpy.types.register(BONE_PT_transform)
 bpy.types.register(BONE_PT_transform_locks)
index c715cfb5d930c0204adae4f8affd627fc69b80ac..393bbf127566fec2aff4fccfbd6467779b8ca65b 100644 (file)
@@ -90,7 +90,6 @@ class DATA_PT_shape_curve(DataButtonsPanel):
                row.itemR(curve, "twist_mode")
                row.itemR(curve, "twist_smooth") # XXX - may not be kept
 
-
 #              col.itemL(text="Display:")
 #              col.itemL(text="HANDLES")
 #              col.itemL(text="NORMALS")
@@ -219,7 +218,6 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
                        col = split.column()
                        col.itemR(act_spline, "smooth")
 
-
 bpy.types.register(DATA_PT_context_curve)
 bpy.types.register(DATA_PT_shape_curve)
 bpy.types.register(DATA_PT_geometry_curve)
index c07f3136fae274b31b3b4b1fde07af37c7623f98..eda6cced0ae47a8d86d940cac5a54101511b7d5d 100644 (file)
@@ -17,7 +17,7 @@ class DATA_PT_empty(DataButtonsPanel):
                
                ob = context.object
 
-               layout.itemR(ob, "empty_draw_type", text="Draw Type")
-               layout.itemR(ob, "empty_draw_size", text="Draw Size")
+               layout.itemR(ob, "empty_draw_type", text="Display")
+               layout.itemR(ob, "empty_draw_size", text="Size")
                
 bpy.types.register(DATA_PT_empty)
index 76c66f7aecedb5445b4a835cd32aa2e557fc2d00..77c6f83407313d4caad586f8a341a3559cbaaf7f 100644 (file)
@@ -71,9 +71,14 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
                layout = self.layout
                
                ob = context.object
+               group = ob.active_vertex_group
+
+               rows = 2
+               if group:
+                       rows= 5
 
                row = layout.row()
-               row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=2)
+               row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
 
                col = row.column(align=True)
                col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
@@ -83,12 +88,11 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
                if ob.data.users > 1:
                        col.itemO("object.vertex_group_copy_to_linked", icon='ICON_LINK_AREA', text="")
 
-               group = ob.active_vertex_group
                if group:
                        row = layout.row()
                        row.itemR(group, "name")
 
-               if ob.mode == 'EDIT':
+               if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
                        row = layout.row()
                        
                        sub = row.row(align=True)
@@ -105,7 +109,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
        __label__ = "Shape Keys"
        
        def poll(self, context):
-               return (context.object and context.object.type in ('MESH', 'LATTICE'))
+               return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE'))
 
        def draw(self, context):
                layout = self.layout
@@ -114,60 +118,78 @@ class DATA_PT_shape_keys(DataButtonsPanel):
                key = ob.data.shape_keys
                kb = ob.active_shape_key
 
+               enable_edit = ob.mode != 'EDIT'
+               enable_edit_value = False
+
+               if ob.shape_key_lock == False:
+                       if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
+                               enable_edit_value = True
+
                row = layout.row()
-               row.template_list(key, "keys", ob, "active_shape_key_index", rows=2)
+
+               rows = 2
+               if kb:
+                       rows= 5
+               row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows)
 
                col = row.column()
 
                subcol = col.column(align=True)
                subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
                subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
-               subcol.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
 
                if kb:
                        col.itemS()
 
                        subcol = col.column(align=True)
-                       subcol.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
-                       subcol.itemR(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
+                       subcol.item_enumO("object.shape_key_move", "type", 'UP', icon='ICON_TRIA_UP', text="")
+                       subcol.item_enumO("object.shape_key_move", "type", 'DOWN', icon='ICON_TRIA_DOWN', text="")
 
-                       if key.relative:
-                               row = layout.row()
-                               row.itemR(key, "relative")
-                               row.itemL()
+                       split = layout.split(percentage=0.4)
+                       sub = split.row()
+                       sub.enabled = enable_edit
+                       sub.itemR(key, "relative")
 
-                               row = layout.row()
-                               row.itemR(kb, "name")
+                       sub = split.row()
+                       sub.alignment = 'RIGHT'
 
+                       subrow = sub.row(align=True)
+                       subrow.active= enable_edit_value
+                       subrow.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
+                       subrow.itemR(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
+                       subrow.itemO("object.shape_key_clear", icon='ICON_X', text="")
+
+                       sub.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
+
+                       sub.itemR(ob, "shape_key_edit_mode", text="")
+
+                       row = layout.row()
+                       row.itemR(kb, "name")
+
+                       if key.relative:
                                if ob.active_shape_key_index != 0:
-                                       
                                        row = layout.row()
-                                       row.enabled = ob.shape_key_lock == False
+                                       row.active = enable_edit_value
                                        row.itemR(kb, "value")
-                                       row.itemO("object.shape_key_clear", icon='ICON_X', text="")
                                        
                                        split = layout.split()
                                        sub = split.column(align=True)
-                                       sub.enabled = ob.shape_key_lock == False
+                                       sub.active = enable_edit_value
                                        sub.itemL(text="Range:")
                                        sub.itemR(kb, "slider_min", text="Min")
                                        sub.itemR(kb, "slider_max", text="Max")
                                        
-                                       sub = split.column()
+                                       sub = split.column(align=True)
+                                       sub.active = enable_edit_value
                                        sub.itemL(text="Blend:")
                                        sub.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
                                        sub.item_pointerR(kb, "relative_key", key, "keys", text="")
                                        
                        else:
                                row = layout.row()
-                               row.itemR(key, "relative")
+                               row.active = enable_edit_value
                                row.itemR(key, "slurph")
 
-                               layout.itemR(kb, "name")
-
-               if ob.mode == 'EDIT':
-                       layout.enabled = False
-
 class DATA_PT_uv_texture(DataButtonsPanel):
        __label__ = "UV Texture"
        
@@ -217,3 +239,4 @@ bpy.types.register(DATA_PT_vertex_groups)
 bpy.types.register(DATA_PT_shape_keys)
 bpy.types.register(DATA_PT_uv_texture)
 bpy.types.register(DATA_PT_vertex_colors)
+
index 9499478a029dcb4fcedf6e1ee6f420ee52520f74..4ba3577a0928b322024761c87aa7cddeed8f3c11 100644 (file)
@@ -13,7 +13,6 @@ def active_node_mat(mat):
 
        return None
 
-
 class MaterialButtonsPanel(bpy.types.Panel):
        __space_type__ = 'PROPERTIES'
        __region_type__ = 'WINDOW'
@@ -648,7 +647,6 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
                row.itemR(vol, "density")
                row.itemR(vol, "density_scale")
 
-               
 class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
        __label__ = "Shading"
        __default_closed__ = False
@@ -709,7 +707,6 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
                        sub.itemR(vol, "ms_spread")
                        sub.itemR(vol, "ms_intensity")
 
-
 class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
        __label__= "Transparency"
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
index 98ac462f2d43a2aa71c14972262bfe3470a9d343..78aa52a647e48b2f87532d25872840ce02406fa0 100644 (file)
@@ -136,7 +136,9 @@ class OBJECT_PT_display(ObjectButtonsPanel):
                col = split.column()
                row = col.row()
                row.itemR(ob, "draw_bounds", text="Bounds")
-               row.itemR(ob, "draw_bounds_type", text="")
+               sub = row.row()
+               sub.active = ob.draw_bounds
+               sub.itemR(ob, "draw_bounds_type", text="")
 
                flow = layout.column_flow()
                flow.itemR(ob, "draw_name", text="Name")
index 63fe27f2e4b5b50da573ad494e7f9e6308062b23..07ea5f43907761a1159cf845a26e138e2fc05b63 100644 (file)
@@ -568,6 +568,13 @@ class ConstraintButtonsPanel(bpy.types.Panel):
                        row.itemR(con, "axis_x")
                        row.itemR(con, "axis_y")
                        row.itemR(con, "axis_z")
+                       
+       def DAMPED_TRACK(self, context, layout, con):
+               self.target_template(layout, con)
+               
+               row = layout.row()
+               row.itemL(text="To:")
+               row.itemR(con, "track", expand=True)
                
 class OBJECT_PT_constraints(ConstraintButtonsPanel):
        __label__ = "Constraints"
index dcc93bd9c75ccf40b5b94ac90f36249c31268833..4054fbf878054c32a98ea07668fe76aeab282bbb 100644 (file)
@@ -14,7 +14,6 @@ def particle_panel_poll(context):
        if psys==None:  return False
        if psys.settings==None:  return False
        return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
-       
 
 class ParticleButtonsPanel(bpy.types.Panel):
        __space_type__ = 'PROPERTIES'
@@ -32,6 +31,7 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+
                ob = context.object
                psys = context.particle_system
 
@@ -46,6 +46,7 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
 
                if psys and not psys.settings:
                        split = layout.split(percentage=0.32)
+
                        col = split.column()
                        col.itemL(text="Name:")
                        col.itemL(text="Settings:")
@@ -458,8 +459,9 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
                return psys.settings.physics_type=='BOIDS'
        
        def draw(self, context):
-               boids = context.particle_system.settings.boids
                layout = self.layout
+
+               boids = context.particle_system.settings.boids
                
                layout.enabled = particle_panel_enabled(context, context.particle_system)
                
@@ -539,7 +541,6 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
                        elif rule.type == 'FIGHT':
                                row.itemR(rule, "distance")
                                row.itemR(rule, "flee_distance")
-               
 
 class PARTICLE_PT_render(ParticleButtonsPanel):
        __label__ = "Render"
@@ -623,7 +624,6 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
                                        subrow = row.row()
                                        subrow.active = part.viewport==True
                                        subrow.itemR(part, "simplify_viewport")
-                       
 
                elif part.ren_as == 'OBJECT':
                        sub.itemR(part, "dupli_object")
@@ -659,7 +659,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
                                if weight:
                                        row = layout.row()
                                        row.itemR(weight, "count")
-                       
+
                elif part.ren_as == 'BILLBOARD':
                        sub.itemL(text="Align:")
                        
@@ -853,6 +853,7 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel):
        
        def draw(self, context):
                layout = self.layout
+
                part = context.particle_system.settings
                
                layout.itemR(part, "self_effect")
index e25497b371396fb6e73665a28bf70ac42f8125a5..bcf1d3b8316cd0dbc85c67102e42c4f7b3795f83 100644 (file)
@@ -50,30 +50,31 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
                        split = layout.split()
                        
                        col = split.column()
+                       
+                       col.itemL(text="Quality:")
+                       col.itemR(cloth, "quality", text="Steps",slider=True)
+                       
                        col.itemL(text="Material:")
                        sub = col.column(align=True)
                        sub.itemR(cloth, "mass")
                        sub.itemR(cloth, "structural_stiffness", text="Structural")
                        sub.itemR(cloth, "bending_stiffness", text="Bending")
-
-                       col.itemR(cloth, "pin_cloth", text="Pin")
-                       sub = col.column(align=True)
-                       sub.active = cloth.pin_cloth
-                       sub.itemR(cloth, "pin_stiffness", text="Stiffness")
-                       sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
                        
                        col = split.column()
+                       
+                       col.itemL(text="Presets:")
+                       col.itemL(text="TODO!")
 
                        col.itemL(text="Damping:")
                        sub = col.column(align=True)
                        sub.itemR(cloth, "spring_damping", text="Spring")
                        sub.itemR(cloth, "air_damping", text="Air")
-                       
-                       col.itemL(text="Presets...")
-                       col.itemL(text="TODO!")
-                       
-                       col.itemL(text="Quality:")
-                       col.itemR(cloth, "quality", text="Steps",slider=True)
+
+                       col.itemR(cloth, "pin_cloth", text="Pin")
+                       sub = col.column(align=True)
+                       sub.active = cloth.pin_cloth
+                       sub.itemR(cloth, "pin_stiffness", text="Stiffness")
+                       sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
                        
                        # Disabled for now
                        """
index 17ac1b2bbaa1157a91ae95bba49fafbd02587e93..411d6e62ad0afd45f4dc29b040dc290f2fe4a686 100644 (file)
@@ -123,10 +123,16 @@ def basic_force_field_settings_ui(self, field):
        if field.type == 'TURBULENCE':
                col.itemR(field, "global_coordinates", text="Global")
        
-       row = layout.row()
-       row.itemL(text="Effect point:")
-       row.itemR(field, "do_location")
-       row.itemR(field, "do_rotation")
+       split = layout.split()
+       
+       col = split.column()
+       col.itemL(text="Effect point:")
+       col.itemR(field, "do_location")
+       col.itemR(field, "do_rotation")
+       
+       sub = split.column()
+       sub.itemL(text="Collision:")
+       sub.itemR(field, "do_absorption")
                
                
 def basic_force_field_falloff_ui(self, field):
@@ -140,7 +146,6 @@ def basic_force_field_falloff_ui(self, field):
        col.itemR(field, "z_direction", text="")
        col.itemR(field, "use_min_distance", text="Use Minimum")
        col.itemR(field, "use_max_distance", text="Use Maximum")
-       col.itemR(field, "do_absorption")
 
        col = split.column()
        col.itemR(field, "falloff_power", text="Power")
@@ -151,4 +156,4 @@ def basic_force_field_falloff_ui(self, field):
        
        sub = col.column()
        sub.active = field.use_max_distance
-       sub.itemR(field, "maximum_distance", text="Distance")
\ No newline at end of file
+       sub.itemR(field, "maximum_distance", text="Distance")
index 9aec0404ab136f3ee89cfdb6af1b0da619344e25..ac713bb5e67ba3c02a224feaf2b7980d585d1e7a 100644 (file)
@@ -64,6 +64,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
                                flow.itemR(field, "guide_kink_frequency")
                                flow.itemR(field, "guide_kink_shape")
                                flow.itemR(field, "guide_kink_amplitude")
+
                elif field.type == 'TEXTURE':
                        col = split.column()
                        col.itemR(field, "strength")
@@ -75,6 +76,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
                        col.itemR(field, "use_coordinates")
                        col.itemR(field, "root_coordinates")
                        col.itemR(field, "force_2d")
+
                else :
                        basic_force_field_settings_ui(self, field)
                        
index 30262ea34150ea46ad3d17b42178e3519d4df8c1..1a308bbb2ad03ef7f9999767ca98c8a2ed437b94 100644 (file)
@@ -220,7 +220,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
 class TEXTURE_PT_influence(TextureSlotPanel):
        __label__ = "Influence"
        def poll(self, context):
-               return 1
+               return context.texture_slot
                
        
        def draw(self, context):
@@ -459,16 +459,6 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
                slot = context.texture_slot
                
                split = layout.split()
-               
-               """
-               col = split.column()            
-               col.itemR(tex, "flip_axis")
-               col.itemR(tex, "normal_map")
-               if slot:
-                       row = col.row()
-                       row.active = tex.normal_map
-                       row.itemR(slot, "normal_map_space", text="")
-               """
 
                col = split.column()
                col.itemL(text="Alpha:")
@@ -480,6 +470,11 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
                col.itemR(tex, "flip_axis", text="X/Y Axis")
 
                col = split.column() 
+               col.itemR(tex, "normal_map")
+               row = col.row()
+               row.active = tex.normal_map
+               row.itemR(tex, "normal_space", text="")
+               
                col.itemL(text="Filter:")
                col.itemR(tex, "filter", text="")
                col.itemR(tex, "mipmap")
@@ -519,6 +514,8 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
                        col.itemL(text="Mirror:")
                        col.itemR(tex, "mirror_x", text="X")
                        col.itemR(tex, "mirror_y", text="Y")
+                       layout.itemS()
+
                elif tex.extension == 'CHECKER': 
                        col = split.column(align=True)
                        row = col.row()
@@ -526,8 +523,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
                        row.itemR(tex, "checker_odd", text="Odd")
 
                        split.itemR(tex, "checker_distance", text="Distance")
-
-               layout.itemS()
+                       layout.itemS()
 
                split = layout.split()
                
index b64efc1048dfaf1ad60c0831a807c33ee53b4622..abf2a139c06d625dc2a0f2dd8391ca27d57e9c30 100644 (file)
@@ -155,6 +155,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
                        col = split.column()
                        
                        col.itemL(text="Sampling:")
+                       col.itemR(ao, "passes")
                        col.itemR(ao, "error_tolerance", text="Error")
                        col.itemR(ao, "pixel_cache")
                        col.itemR(ao, "correction")
index 5bb211f7d9820b2efc18a22e210a0f0678817eb5..d02577d93e6c5f3f927e0e89e9fe26077756c342 100644 (file)
+import sys
 import bpy
 
+
 class CONSOLE_HT_header(bpy.types.Header):
-       __space_type__ = 'CONSOLE'
-
-       def draw(self, context):
-               sc = context.space_data
-               # text = sc.text
-               layout = self.layout
-
-               row= layout.row(align=True)
-               row.template_header()
-
-               if context.area.show_menus:
-                       sub = row.row(align=True)
-
-                       if sc.console_type == 'REPORT':
-                               sub.itemM("CONSOLE_MT_report")
-                       else:
-                               sub.itemM("CONSOLE_MT_console")
-
-               layout.itemS()
-               layout.itemR(sc, "console_type", expand=True)
-
-               if sc.console_type == 'REPORT':
-                       row = layout.row(align=True)
-                       row.itemR(sc, "show_report_debug", text="Debug")
-                       row.itemR(sc, "show_report_info", text="Info")
-                       row.itemR(sc, "show_report_operator", text="Operators")
-                       row.itemR(sc, "show_report_warn", text="Warnings")
-                       row.itemR(sc, "show_report_error", text="Errors")
-                       
-                       row = layout.row()
-                       row.enabled = sc.show_report_operator
-                       row.itemO("console.report_replay")
-               else:
-                       row = layout.row(align=True)
-                       row.itemO("console.autocomplete", text="Autocomplete")
+    __space_type__ = 'CONSOLE'
+
+    def draw(self, context):
+        sc = context.space_data
+        # text = sc.text
+        layout = self.layout
+
+        row = layout.row(align=True)
+        row.template_header()
+
+        if context.area.show_menus:
+            sub = row.row(align=True)
+
+            if sc.console_type == 'REPORT':
+                sub.itemM("CONSOLE_MT_report")
+            else:
+                sub.itemM("CONSOLE_MT_console")
+
+        layout.itemS()
+        layout.itemR(sc, "console_type", expand=True)
+
+        if sc.console_type == 'REPORT':
+            row = layout.row(align=True)
+            row.itemR(sc, "show_report_debug", text="Debug")
+            row.itemR(sc, "show_report_info", text="Info")
+            row.itemR(sc, "show_report_operator", text="Operators")
+            row.itemR(sc, "show_report_warn", text="Warnings")
+            row.itemR(sc, "show_report_error", text="Errors")
+
+            row = layout.row()
+            row.enabled = sc.show_report_operator
+            row.itemO("console.report_replay")
+        else:
+            row = layout.row(align=True)
+            row.itemO("console.autocomplete", text="Autocomplete")
+
 
 class CONSOLE_MT_console(bpy.types.Menu):
-       __label__ = "Console"
+    __label__ = "Console"
 
-       def draw(self, context):
-               layout = self.layout
-               sc = context.space_data
+    def draw(self, context):
+        layout = self.layout
+        layout.column()
+        layout.itemO("console.clear")
+        layout.itemO("console.copy")
+        layout.itemO("console.paste")
 
-               layout.column()
-               layout.itemO("console.clear")
-               layout.itemO("console.copy")
-               layout.itemO("console.paste")
 
 class CONSOLE_MT_report(bpy.types.Menu):
-       __label__ = "Report"
+    __label__ = "Report"
 
-       def draw(self, context):
-               layout = self.layout
-               sc = context.space_data
+    def draw(self, context):
+        layout = self.layout
+        layout.column()
+        layout.itemO("console.select_all_toggle")
+        layout.itemO("console.select_border")
+        layout.itemO("console.report_delete")
+        layout.itemO("console.report_copy")
 
-               layout.column()
-               layout.itemO("console.select_all_toggle")
-               layout.itemO("console.select_border")
-               layout.itemO("console.report_delete")
-               layout.itemO("console.report_copy")
 
 def add_scrollback(text, text_type):
-       for l in text.split('\n'):
-               bpy.ops.console.scrollback_append(text=l.replace('\t', '    '), type=text_type)
+    for l in text.split('\n'):
+        bpy.ops.console.scrollback_append(text=l.replace('\t', '    '),
+            type=text_type)
+
 
 def get_console(console_id):
-       '''
-       helper function for console operators
-       currently each text datablock gets its own console - code.InteractiveConsole()
-       ...which is stored in this function.
-       
-       console_id can be any hashable type
-       '''
-       import sys, code
-       
-       try:    consoles = get_console.consoles
-       except:consoles = get_console.consoles = {}
-       
-       # clear all dead consoles, use text names as IDs
-       # TODO, find a way to clear IDs
-       '''
-       for console_id in list(consoles.keys()):
-               if console_id not in bpy.data.texts:
-                       del consoles[id]
-       '''
-       
-       try:
-               namespace, console, stdout, stderr = consoles[console_id]
-       except:
-               namespace = {'__builtins__':__builtins__} # locals()
-               namespace['bpy'] = bpy
-               
-               console = code.InteractiveConsole(namespace)
-               
-               import io
-               stdout = io.StringIO()
-               stderr = io.StringIO()
-       
-               consoles[console_id]= namespace, console, stdout, stderr
-               
-       return namespace, console, stdout, stderr
+    '''
+    helper function for console operators
+    currently each text datablock gets its own
+    console - bpython_code.InteractiveConsole()
+    ...which is stored in this function.
+
+    console_id can be any hashable type
+    '''
+    from code import InteractiveConsole
+
+    try:
+        consoles = get_console.consoles
+    except:
+        consoles = get_console.consoles = {}
+
+    # clear all dead consoles, use text names as IDs
+    # TODO, find a way to clear IDs
+    '''
+    for console_id in list(consoles.keys()):
+        if console_id not in bpy.data.texts:
+            del consoles[id]
+    '''
+
+    try:
+        console, stdout, stderr = consoles[console_id]
+    except:
+        namespace = {'__builtins__': __builtins__, 'bpy': bpy}
+        console = InteractiveConsole(namespace)
+
+        import io
+        stdout = io.StringIO()
+        stderr = io.StringIO()
+
+        consoles[console_id] = console, stdout, stderr
+
+    return console, stdout, stderr
+
 
 class CONSOLE_OT_exec(bpy.types.Operator):
-       '''Execute the current console line as a python expression.'''
-       __idname__ = "console.execute"
-       __label__ = "Console Execute"
-       __register__ = False
-       
-       # Both prompts must be the same length
-       PROMPT = '>>> ' 
-       PROMPT_MULTI = '... '
-       
-       # is this working???
-       '''
-       def poll(self, context):
-               return (context.space_data.type == 'PYTHON')
-       ''' # its not :|
-       
-       def execute(self, context):
-               import sys
-               
-               sc = context.space_data
-               
-               try:
-                       line = sc.history[-1].line
-               except:
-                       return ('CANCELLED',)
-               
-               if sc.console_type != 'PYTHON':
-                       return ('CANCELLED',)
-               
-               namespace, console, stdout, stderr = get_console(hash(context.region))
-               
-               # redirect output
-               sys.stdout = stdout
-               sys.stderr = stderr
-               
-               # run the console
-               if not line.strip():
-                       line_exec = '\n' # executes a multiline statement
-               else:
-                       line_exec = line
-               
-               is_multiline = console.push(line_exec)
-               
-               stdout.seek(0)
-               stderr.seek(0)
-               
-               output = stdout.read()
-               output_err = stderr.read()
-       
-               # cleanup
-               sys.stdout = sys.__stdout__
-               sys.stderr = sys.__stderr__
-               sys.last_traceback = None
-               
-               # So we can reuse, clear all data
-               stdout.truncate(0)
-               stderr.truncate(0)
-               
-               bpy.ops.console.scrollback_append(text = sc.prompt+line, type='INPUT')
-               
-               if is_multiline:        sc.prompt = self.PROMPT_MULTI
-               else:                           sc.prompt = self.PROMPT
-               
-               # insert a new blank line
-               bpy.ops.console.history_append(text="", current_character=0, remove_duplicates= True)
-               
-               # Insert the output into the editor
-               # not quite correct because the order might have changed, but ok 99% of the time.
-               if output:                      add_scrollback(output, 'OUTPUT')
-               if output_err:          add_scrollback(output_err, 'ERROR')
-               
-               
-               return ('FINISHED',)
+    '''Execute the current console line as a python expression.'''
+    __idname__ = "console.execute"
+    __label__ = "Console Execute"
+    __register__ = False
+
+    # Both prompts must be the same length
+    PROMPT = '>>> '
+    PROMPT_MULTI = '... '
+
+    # is this working???
+    '''
+    def poll(self, context):
+        return (context.space_data.type == 'PYTHON')
+    '''
+    # its not :|
+
+    def execute(self, context):
+        sc = context.space_data
+
+        try:
+            line = sc.history[-1].line
+        except:
+            return ('CANCELLED',)
+
+        if sc.console_type != 'PYTHON':
+            return ('CANCELLED',)
+
+        console, stdout, stderr = get_console(hash(context.region))
+
+        # redirect output
+        sys.stdout = stdout
+        sys.stderr = stderr
+
+        # run the console
+        if not line.strip():
+            line_exec = '\n'  # executes a multiline statement
+        else:
+            line_exec = line
+
+        is_multiline = console.push(line_exec)
+
+        stdout.seek(0)
+        stderr.seek(0)
+
+        output = stdout.read()
+        output_err = stderr.read()
+
+        # cleanup
+        sys.stdout = sys.__stdout__
+        sys.stderr = sys.__stderr__
+        sys.last_traceback = None
+
+        # So we can reuse, clear all data
+        stdout.truncate(0)
+        stderr.truncate(0)
+
+        bpy.ops.console.scrollback_append(text=sc.prompt + line, type='INPUT')
+
+        if is_multiline:
+            sc.prompt = self.PROMPT_MULTI
+        else:
+            sc.prompt = self.PROMPT
+
+        # insert a new blank line
+        bpy.ops.console.history_append(text="", current_character=0,
+            remove_duplicates=True)
+
+        # Insert the output into the editor
+        # not quite correct because the order might have changed,
+        # but ok 99% of the time.
+        if output:
+            add_scrollback(output, 'OUTPUT')
+        if output_err:
+            add_scrollback(output_err, 'ERROR')
+
+        return ('FINISHED',)
 
 
 class CONSOLE_OT_autocomplete(bpy.types.Operator):
-       '''Evaluate the namespace up until the cursor and give a list of options or complete the name if there is only one.'''
-       __idname__ = "console.autocomplete"
-       __label__ = "Console Autocomplete"
-       __register__ = False
-       
-       def poll(self, context):
-               return context.space_data.console_type == 'PYTHON'
-       
-       def execute(self, context):
-               
-               sc = context.space_data
-               
-               namespace, console, stdout, stderr = get_console(hash(context.region))
-               
-               current_line = sc.history[-1]
-               line = current_line.line
-               
-               if not console:
-                       return ('CANCELLED',)
-               
-               if sc.console_type != 'PYTHON':
-                       return ('CANCELLED',)
-               
-               # fake cursor, use for autocomp func.
-               bcon = {}
-               bcon['cursor'] = current_line.current_character
-               bcon['console'] = console
-               bcon['edit_text'] = line
-               bcon['namespace'] = namespace
-               bcon['scrollback'] = '' # nor from the BGE console
-               
-               
-               # This function isnt aware of the text editor or being an operator
-               # just does the autocomp then copy its results back
-               import autocomplete
-               autocomplete.execute(bcon)
-               
-               # Now we need to copy back the line from blender back into the text editor.
-               # This will change when we dont use the text editor anymore
-               if bcon['scrollback']:
-                       add_scrollback(bcon['scrollback'], 'INFO')
-               
-               # copy back
-               current_line.line = bcon['edit_text']
-               current_line.current_character = bcon['cursor']
-               
-               context.area.tag_redraw()
-               
-               return ('FINISHED',)
+    '''Evaluate the namespace up until the cursor and give a list of
+    options or complete the name if there is only one.'''
+    __idname__ = "console.autocomplete"
+    __label__ = "Console Autocomplete"
+    __register__ = False
 
+    def poll(self, context):
+        return context.space_data.console_type == 'PYTHON'
+
+    def execute(self, context):
+        from console import intellisense
+
+        sc = context.space_data
+
+        console = get_console(hash(context.region))[0]
+
+        current_line = sc.history[-1]
+        line = current_line.line
+
+        if not console:
+            return ('CANCELLED',)
+
+        if sc.console_type != 'PYTHON':
+            return ('CANCELLED',)
+
+        # This function isnt aware of the text editor or being an operator
+        # just does the autocomp then copy its results back
+        current_line.line, current_line.current_character, scrollback = \
+            intellisense.expand(
+                line=current_line.line,
+                cursor=current_line.current_character,
+                namespace=console.locals,
+                private='-d' in sys.argv)
+
+        # Now we need to copy back the line from blender back into the
+        # text editor. This will change when we dont use the text editor
+        # anymore
+        if scrollback:
+            add_scrollback(scrollback, 'INFO')
+
+        context.area.tag_redraw()
+
+        return ('FINISHED',)
 
 
 bpy.types.register(CONSOLE_HT_header)
@@ -237,4 +239,3 @@ bpy.types.register(CONSOLE_MT_report)
 
 bpy.ops.add(CONSOLE_OT_exec)
 bpy.ops.add(CONSOLE_OT_autocomplete)
-
index 5b0c189464f83e4f37d2777b0d2e8ee37221ca55..1ab6a1f4f0b6072f268841a81f5505886e37e81d 100644 (file)
@@ -34,6 +34,8 @@ class FILEBROWSER_HT_header(bpy.types.Header):
                layout.itemR(params, "do_filter", text="", icon='ICON_FILTER')
                
                row = layout.row(align=True)
+               row.active = params.do_filter
+
                row.itemR(params, "filter_folder", text="");
                row.itemR(params, "filter_blender", text="");
                row.itemR(params, "filter_image", text="");
@@ -43,6 +45,4 @@ class FILEBROWSER_HT_header(bpy.types.Header):
                row.itemR(params, "filter_sound", text="");
                row.itemR(params, "filter_text", text="");
 
-               row.active = params.do_filter
-
 bpy.types.register(FILEBROWSER_HT_header)
index a30d77a575ac19cdaa78a01bc4df2e6c795724e1..d4fcbbcdd4d498b5a9c0806f1468243733f0e920 100644 (file)
@@ -39,7 +39,8 @@ class INFO_HT_header(bpy.types.Header):
                layout.template_running_jobs()
 
                layout.itemL(text=scene.statistics())
-
+               
+               layout.itemO("wm.window_fullscreen_toggle", icon='ICON_ARROW_LEFTRIGHT', text="")
 
 class INFO_MT_file(bpy.types.Menu):
        __label__ = "File"
@@ -53,6 +54,7 @@ class INFO_MT_file(bpy.types.Menu):
                layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
                layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
                layout.itemO("wm.recover_last_session")
+               layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
 
                layout.itemS()
 
@@ -80,7 +82,6 @@ class INFO_MT_file(bpy.types.Menu):
                layout.operator_context = "EXEC_AREA"
                layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
 
-
 # test for expanding menus
 '''
 class INFO_MT_file_more(INFO_MT_file):
@@ -122,7 +123,6 @@ class INFO_MT_file_external_data(bpy.types.Menu):
                layout.itemO("file.report_missing_files")
                layout.itemO("file.find_missing_files")
 
-
 class INFO_MT_mesh_add(dynamic_menu.DynMenu):
        __label__ = "Mesh"
        def draw(self, context):
@@ -133,7 +133,7 @@ class INFO_MT_mesh_add(dynamic_menu.DynMenu):
                layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
                layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
                layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
-               layout.itemO("mesh.primitive_cylinder_add", icon='ICON_MESH_TUBE', text="Tube")
+               layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
                layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
                layout.itemS()
                layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
@@ -204,6 +204,11 @@ class INFO_MT_render(bpy.types.Menu):
 
                layout.itemS()
 
+               layout.itemO("screen.opengl_render", text="OpenGL Render Image")
+               layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
+
+               layout.itemS()
+
                layout.itemO("screen.render_view_show")
 
 class INFO_MT_help(bpy.types.Menu):
@@ -222,6 +227,8 @@ class INFO_MT_help(bpy.types.Menu):
                layout.itemO("help.developer_community", icon='ICON_URL')
                layout.itemO("help.user_community", icon='ICON_URL')
                layout.itemS()
+               layout.itemO("help.report_bug", icon='ICON_URL')
+               layout.itemS()
                layout.itemO("help.operator_cheat_sheet")
 
 bpy.types.register(INFO_HT_header)
@@ -239,14 +246,8 @@ bpy.types.register(INFO_MT_help)
 
 class HelpOperator(bpy.types.Operator):
        def execute(self, context):
-               try: import webbrowser
-               except: webbrowser = None
-
-               if webbrowser:
-                       webbrowser.open(self.__URL__)
-               else:
-                       raise Exception("Operator requires a full Python installation")
-
+               import webbrowser
+               webbrowser.open(self.__URL__)
                return ('FINISHED',)
 
 class HELP_OT_manual(HelpOperator):
@@ -284,6 +285,12 @@ class HELP_OT_user_community(HelpOperator):
        __idname__ = "help.user_community"
        __label__ = "User Community"
        __URL__ = 'http://www.blender.org/community/user-community/'
+       
+class HELP_OT_report_bug(HelpOperator):
+       '''Report a bug in the Blender bug tracker'''
+       __idname__ = "help.report_bug"
+       __label__ = "Report a Bug"
+       __URL__ = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
 
 class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
        __idname__ = "help.operator_cheat_sheet"
@@ -316,4 +323,5 @@ bpy.ops.add(HELP_OT_blender_website)
 bpy.ops.add(HELP_OT_blender_eshop)
 bpy.ops.add(HELP_OT_developer_community)
 bpy.ops.add(HELP_OT_user_community)
+bpy.ops.add(HELP_OT_report_bug)
 bpy.ops.add(HELP_OT_operator_cheat_sheet)
index 87c31e1aa949db29641c9e2cd9977d6b959b7cbd..40816309e7e97fd86d0eec65a54abcd71a1d7d85 100644 (file)
@@ -17,6 +17,8 @@ class OUTLINER_HT_header(bpy.types.Header):
                if context.area.show_menus:
                        sub = row.row(align=True)
                        sub.itemM("OUTLINER_MT_view")
+                       if space.display_mode == 'DATABLOCKS':
+                               sub.itemM("OUTLINER_MT_edit_datablocks")
 
                layout.itemR(space, "display_mode", text="")
                
@@ -26,13 +28,16 @@ class OUTLINER_HT_header(bpy.types.Header):
                        row = layout.row(align=True)
                        row.itemO("outliner.keyingset_add_selected", icon='ICON_ZOOMIN', text="")
                        row.itemO("outliner.keyingset_remove_selected", icon='ICON_ZOOMOUT', text="")
+                       
                        if ks:
+                               row = layout.row(align=False)
                                row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
                                
                                row = layout.row(align=True)
                                row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
                                row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
                        else:
+                               row = layout.row(align=False)
                                row.itemL(text="No Keying Set active")
 
 class OUTLINER_MT_view(bpy.types.Menu):
@@ -51,6 +56,23 @@ class OUTLINER_MT_view(bpy.types.Menu):
 
                col.itemO("outliner.show_one_level")
                col.itemO("outliner.show_hierarchy")
+               
+class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
+       __label__ = "Edit"
+       
+       def draw(self, context):
+               layout = self.layout
+               
+               col = layout.column()
+
+               col.itemO("outliner.keyingset_add_selected")
+               col.itemO("outliner.keyingset_remove_selected")
+               
+               col.itemS()
+               
+               col.itemO("outliner.drivers_add_selected")
+               col.itemO("outliner.drivers_delete_selected")
 
 bpy.types.register(OUTLINER_HT_header)
 bpy.types.register(OUTLINER_MT_view)
+bpy.types.register(OUTLINER_MT_edit_datablocks)
index ca84e34588582c912b74014c7e22354c6fd3f112..7f6bb134283ccb08b5870210cf2b1187d4888071 100644 (file)
@@ -425,8 +425,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
                col.itemR(strip, "directory", text="")
                
                # Current element for the filename
-               
-               
+
                elem = strip.getStripElem(context.scene.current_frame)
                if elem:
                        split = layout.split(percentage=0.2)
index 4860767d69decefb48bb041a00aa473a1786286e..479f2b60f51df7374268e6ee78f515fdbecfb758 100644 (file)
@@ -44,6 +44,9 @@ class TEXT_HT_header(bpy.types.Header):
                                        row.itemL(text="Text: External")
                                else:
                                        row.itemL(text="Text: Internal")
+               
+               row = layout.row()
+               row.itemO("text.run_script")
 
 class TEXT_PT_properties(bpy.types.Panel):
        __space_type__ = 'TEXT_EDITOR'
@@ -132,11 +135,44 @@ class TEXT_MT_text(bpy.types.Menu):
 
                layout.itemO("text.properties", icon='ICON_MENU_PANEL')
                
+               
+               
                #ifndef DISABLE_PYTHON
                # XXX layout.column()
                # XXX uiDefIconTextBlockBut(block, text_template_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Script Templates", 0, yco-=20, 120, 19, "");
                # XXX uiDefIconTextBlockBut(block, text_plugin_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Text Plugins", 0, yco-=20, 120, 19, "");
                #endif
+               
+               layout.itemM("TEXT_MT_templates")
+               
+
+
+class TEXT_MT_templates(bpy.types.Menu):
+       '''
+       Creates the menu items by scanning scripts/templates
+       '''
+       __label__ = "Script Templates"
+       
+       def draw(self, context):
+               import os
+               
+               def path_to_name(f):
+                       f_base = os.path.splitext(f)[0]
+                       f_base = f_base.replace("_", " ")
+                       return ' '.join([w[0].upper() + w[1:] for w in f_base.split()])
+               
+               layout = self.layout
+               template_dir = os.path.join(os.path.dirname(__file__), os.path.pardir, "templates")
+               
+               for f in sorted(os.listdir(template_dir)):
+                       
+                       if f.startswith("."):
+                               continue
+                       
+                       path = os.path.join(template_dir, f)
+                       layout.item_stringO("text.open", "path", path, text=path_to_name(f))
+
+
 
 class TEXT_MT_edit_view(bpy.types.Menu):
        __label__ = "View"
@@ -230,6 +266,7 @@ bpy.types.register(TEXT_HT_header)
 bpy.types.register(TEXT_PT_properties)
 bpy.types.register(TEXT_PT_find)
 bpy.types.register(TEXT_MT_text)
+bpy.types.register(TEXT_MT_templates)
 bpy.types.register(TEXT_MT_format)
 bpy.types.register(TEXT_MT_edit)
 bpy.types.register(TEXT_MT_edit_view)
index 46a56f7d133b2ac458b2d493d05afaf13e6fcf07..10e1831de0f04aba527b33efedd7c00279b55f4f 100644 (file)
@@ -15,7 +15,7 @@ class USERPREF_HT_header(bpy.types.Header):
 
                if userpref.active_section == 'INPUT':
                        layout.operator_context = "INVOKE_DEFAULT"
-                       layout.itemO("wm.keyconfig_save", "Save Key Configuration...")
+                       layout.itemO("wm.keyconfig_export", "Export Key Configuration...")
                        
 class USERPREF_MT_view(bpy.types.Menu):
        __label__ = "View"
@@ -83,38 +83,23 @@ class USERPREF_PT_interface(bpy.types.Panel):
                sub1.itemR(view, "zoom_to_mouse")
                sub1.itemR(view, "rotate_around_selection")
                sub1.itemS()
-               sub1.itemL(text="Zoom Style:")
-               sub1.row().itemR(view, "viewport_zoom_style", expand=True)
-               sub1.itemL(text="Orbit Style:")
-               sub1.row().itemR(view, "view_rotation", expand=True)
-               sub1.itemR(view, "perspective_orthographic_switch")
-               sub1.itemR(view, "smooth_view")
-               sub1.itemR(view, "rotation_angle")
                
-               col = split.column()
-               sub = col.split(percentage=0.85)
                
-               sub1 = sub.column()
-               sub1.itemL(text="Menus:")
-               sub1.itemR(view, "open_mouse_over")
-               sub1.itemL(text="Menu Open Delay:")
-               sub1.itemR(view, "open_toplevel_delay", text="Top Level")
-               sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
-
-               sub1.itemS()
-               sub1.itemS()
-               sub1.itemS()                    
-
-               sub1.itemL(text="Toolbox:")
-               sub1.itemR(view, "use_column_layout")
-               sub1.itemL(text="Open Toolbox Delay:")
-               sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
-               sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
+               sub1.itemR(view, "auto_perspective")
+               sub1.itemR(view, "smooth_view")
+               sub1.itemR(view, "rotation_angle")
 
                col = split.column()
                sub = col.split(percentage=0.85)
-               
                sub1 = sub.column()
+               
+#Toolbox doesn't exist yet
+#              sub1.itemL(text="Toolbox:")
+#              sub1.itemR(view, "use_column_layout")
+#              sub1.itemL(text="Open Toolbox Delay:")
+#              sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
+#              sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
+               
                #manipulator
                sub1.itemR(view, "use_manipulator")
                sub2 = sub1.column()
@@ -122,6 +107,16 @@ class USERPREF_PT_interface(bpy.types.Panel):
                sub2.itemR(view, "manipulator_size", text="Size")
                sub2.itemR(view, "manipulator_handle_size", text="Handle Size")
                sub2.itemR(view, "manipulator_hotspot", text="Hotspot") 
+               
+               sub1.itemS()
+               sub1.itemS()
+               sub1.itemS()
+               
+               sub1.itemL(text="Menus:")
+               sub1.itemR(view, "open_mouse_over")
+               sub1.itemL(text="Menu Open Delay:")
+               sub1.itemR(view, "open_toplevel_delay", text="Top Level")
+               sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
 
 class USERPREF_PT_edit(bpy.types.Panel):
        __space_type__ = 'USER_PREFERENCES'
@@ -137,7 +132,6 @@ class USERPREF_PT_edit(bpy.types.Panel):
                
                userpref = context.user_preferences
                edit = userpref.edit
-               view = userpref.view
                
                split = layout.split()
                
@@ -157,9 +151,12 @@ class USERPREF_PT_edit(bpy.types.Panel):
                sub1.itemS()
                sub1.itemS()
                sub1.itemS()
-               sub1.itemL(text="Transform:")
-               sub1.itemR(edit, "drag_immediately")
-
+               
+               sub1.itemL(text="Undo:")
+               sub1.itemR(edit, "global_undo")
+               sub1.itemR(edit, "undo_steps", text="Steps")
+               sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
+               
                col = split.column()
                sub = col.split(percentage=0.85)
                
@@ -199,10 +196,8 @@ class USERPREF_PT_edit(bpy.types.Panel):
                sub1.itemS()
                sub1.itemS()
                
-               sub1.itemL(text="Undo:")
-               sub1.itemR(edit, "global_undo")
-               sub1.itemR(edit, "undo_steps", text="Steps")
-               sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
+               sub1.itemL(text="Transform:")
+               sub1.itemR(edit, "drag_immediately")
                
                sub1.itemS()
                sub1.itemS()
@@ -399,7 +394,7 @@ class USERPREF_PT_input(bpy.types.Panel):
                wm = context.manager
                #input = userpref.input
                input = userpref
-               view = userpref.view
+               inputs = userpref.inputs
 
                split = layout.split(percentage=0.25)
 
@@ -416,15 +411,26 @@ class USERPREF_PT_input(bpy.types.Panel):
                sub = col.column()
                sub.itemL(text="Mouse:")
                sub1 = sub.column()
-               sub1.enabled = (view.select_mouse == 'RIGHT')
-               sub1.itemR(view, "emulate_3_button_mouse")
-               sub.itemR(view, "continuous_mouse")
+               sub1.enabled = (inputs.select_mouse == 'RIGHT')
+               sub1.itemR(inputs, "emulate_3_button_mouse")
+               sub.itemR(inputs, "continuous_mouse")
 
                sub.itemL(text="Select With:")
-               sub.row().itemR(view, "select_mouse", expand=True)
-               #sub.itemL(text="Middle Mouse:")
-               #sub.row().itemR(view, "middle_mouse", expand=True)
-               #sub.itemR(view, "use_middle_mouse_paste")
+               sub.row().itemR(inputs, "select_mouse", expand=True)
+               sub.itemL(text="Middle Mouse:")
+               sub.row().itemR(inputs, "middle_mouse", expand=True)
+               
+               sub.itemS()
+               sub.itemS()
+               sub.itemS()
+               
+               sub.itemL(text="Orbit Style:")
+               sub.row().itemR(inputs, "view_rotation", expand=True)
+               
+               sub.itemL(text="Zoom Style:")
+               sub.row().itemR(inputs, "viewport_zoom_style", expand=True)
+               
+               #sub.itemR(inputs, "use_middle_mouse_paste")
 
                #col.itemS()
 
@@ -437,8 +443,8 @@ class USERPREF_PT_input(bpy.types.Panel):
 
                sub = col.column()
                sub.itemL(text="NDOF Device:")
-               sub.itemR(view, "ndof_pan_speed", text="Pan Speed")
-               sub.itemR(view, "ndof_rotate_speed", text="Orbit Speed")
+               sub.itemR(inputs, "ndof_pan_speed", text="Pan Speed")
+               sub.itemR(inputs, "ndof_rotate_speed", text="Orbit Speed")
 
                row.itemS()
 
@@ -548,10 +554,10 @@ bpy.types.register(USERPREF_PT_system)
 bpy.types.register(USERPREF_PT_file)
 bpy.types.register(USERPREF_PT_input)
 
-class WM_OT_keyconfig_save(bpy.types.Operator):
-       "Save key configuration to a python script."
-       __idname__ = "wm.keyconfig_save"
-       __label__ = "Save Key Configuration..."
+class WM_OT_keyconfig_export(bpy.types.Operator):
+       "Export key configuration to a python script."
+       __idname__ = "wm.keyconfig_export"
+       __label__ = "Export Key Configuration..."
        __props__ = [
                bpy.props.StringProperty(attr="path", name="File Path", description="File path to write file to.")]
 
@@ -578,7 +584,7 @@ class WM_OT_keyconfig_save(bpy.types.Operator):
                                                result += ", "
                                result += "]"
                else:
-                       print("Save key configuration: can't write ", value)
+                       print("Export key configuration: can't write ", value)
 
                return result
 
@@ -688,7 +694,7 @@ class WM_OT_keyitem_remove(bpy.types.Operator):
                km.remove_item(kmi)
                return ('FINISHED',)
 
-bpy.ops.add(WM_OT_keyconfig_save)
+bpy.ops.add(WM_OT_keyconfig_export)
 bpy.ops.add(WM_OT_keymap_edit)
 bpy.ops.add(WM_OT_keymap_restore)
 bpy.ops.add(WM_OT_keyitem_add)
index 9fd9e1283cd8d70da7c7b01568766d4a0f8ab822..68c28370eb6174129127f2f5c4ef4db4db13cd6f 100644 (file)
@@ -110,6 +110,7 @@ class VIEW3D_MT_view(bpy.types.Menu):
                
                layout.itemS()
                
+               layout.itemO("view3d.localview", text="View Global/Local")
                layout.itemO("view3d.view_center")
                layout.itemO("view3d.view_all")
                
@@ -256,6 +257,8 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
                layout.itemO("mesh.select_more", text="More")
 
                layout.itemS()
+               
+               layout.itemO("mesh.select_mirror", text="Mirror")
 
                layout.itemO("mesh.select_linked", text="Linked")
                layout.itemO("mesh.select_vertex_path", text="Vertex Path")
@@ -425,6 +428,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
                
                layout.itemS()
                
+               layout.itemO("object.move_to_layer", text="Move to Layer...")
                layout.itemM("VIEW3D_MT_object_showhide")
                
                layout.item_menu_enumO("object.convert", "target")
@@ -761,8 +765,8 @@ class VIEW3D_MT_edit_mesh(bpy.types.Menu):
                
                layout.itemS()
                
-               layout.itemO("mesh.extrude")
-               layout.itemO("mesh.duplicate")
+               layout.itemO("mesh.extrude_move")
+               layout.itemO("mesh.duplicate_move")
                layout.itemO("mesh.delete", text="Delete...")
                
                layout.itemS()
@@ -804,7 +808,7 @@ class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
                layout.itemO("mesh.faces_shade_smooth")
                layout.itemO("mesh.faces_shade_flat")
                layout.itemO("mesh.blend_from_shape")
-               layout.itemO("mesh.shape_propagate_to_all")
+               layout.itemO("mesh.shape_propagate_to_all")
                layout.itemO("mesh.select_vertex_path")
 
 class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
@@ -827,7 +831,9 @@ class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
                layout.itemO("mesh.select_vertex_path")
                
                layout.itemO("mesh.blend_from_shape")
-               # uiItemO(layout, "Propagate to All Shapes", 0, "mesh.shape_propagate_to_all");
+               
+               layout.itemO("object.vertex_group_blend")
+               layout.itemO("mesh.shape_propagate_to_all")
 
 class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
        __label__ = "Edges"
@@ -1123,12 +1129,13 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu):
                                
                layout.itemS()
                
-               layout.itemO("armature.extrude")
-               
-               if arm.x_axis_mirror:
-                       layout.item_booleanO("armature.extrude", "forked", True, text="Extrude Forked")
+               layout.itemO("armature.extrude_move")
+
+# EXTRUDE FORKED DOESN'T WORK YET              
+#              if arm.x_axis_mirror:
+#                      layout.item_booleanO("armature.extrude_move", "forked", True, text="Extrude Forked")
                
-               layout.itemO("armature.duplicate")
+               layout.itemO("armature.duplicate_move")
                layout.itemO("armature.merge")
                layout.itemO("armature.fill")
                layout.itemO("armature.delete")
@@ -1379,6 +1386,48 @@ class VIEW3D_PT_transform_orientations(bpy.types.Panel):
                        col.itemR(orientation, "name")
                        col.itemO("tfm.delete_orientation", text="Delete")
 
+class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
+       __space_type__ = 'VIEW_3D'
+       __region_type__ = 'UI'
+       __label__ = "Skeleton Sketching"
+       __default_closed__ = True
+
+       def poll(self, context):
+               scene = context.space_data
+               ob = context.active_object
+               return scene and ob and ob.type == 'ARMATURE' and ob.mode == 'EDIT' 
+
+       def draw_header(self, context):
+               layout = self.layout
+               toolsettings = context.scene.tool_settings
+
+               layout.itemR(toolsettings, "bone_sketching", text="")
+
+       def draw(self, context):
+               layout = self.layout
+               toolsettings = context.scene.tool_settings
+
+               col = layout.column()
+
+               col.itemR(toolsettings, "etch_quick")
+               col.itemR(toolsettings, "etch_overdraw")
+
+               col.itemR(toolsettings, "etch_convert_mode")
+               
+               if toolsettings.etch_convert_mode == "LENGTH":
+                       col.itemR(toolsettings, "etch_length_limit")
+               elif toolsettings.etch_convert_mode == "ADAPTIVE":
+                       col.itemR(toolsettings, "etch_adaptive_limit")
+               elif toolsettings.etch_convert_mode == "FIXED":
+                       col.itemR(toolsettings, "etch_subdivision_number")
+               elif toolsettings.etch_convert_mode == "RETARGET":
+                       col.itemR(toolsettings, "etch_template")
+                       col.itemR(toolsettings, "etch_roll_mode")
+                       col.itemR(toolsettings, "etch_autoname")
+                       col.itemR(toolsettings, "etch_number")
+                       col.itemR(toolsettings, "etch_side")
+               
+
 # Operators 
 
 class OBJECT_OT_select_pattern(bpy.types.Operator):
@@ -1415,8 +1464,6 @@ class OBJECT_OT_select_pattern(bpy.types.Operator):
                return ('RUNNING_MODAL',)
        '''
 
-
-
 bpy.types.register(VIEW3D_HT_header) # Header
 
 bpy.types.register(VIEW3D_MT_view) #View Menus
@@ -1497,6 +1544,7 @@ bpy.types.register(VIEW3D_PT_3dview_meshdisplay)
 bpy.types.register(VIEW3D_PT_3dview_curvedisplay)
 bpy.types.register(VIEW3D_PT_background_image)
 bpy.types.register(VIEW3D_PT_transform_orientations)
+bpy.types.register(VIEW3D_PT_etch_a_ton)
 
 bpy.ops.add(OBJECT_OT_select_pattern)
 
index f354a3314f2e2caa511483b77e3e5f2f6c21b41e..1b80a35b504cac30934f91f1a069dcaafba4e8d7 100644 (file)
@@ -22,7 +22,7 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
                
                col = layout.column(align=True)
                col.itemL(text="Object:")
-               col.itemO("object.duplicate")
+               col.itemO("object.duplicate_move")
                col.itemO("object.delete")
                
                active_object= context.active_object
@@ -38,11 +38,11 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
                col.itemO("anim.insert_keyframe_menu", text="Insert")
                col.itemO("anim.delete_keyframe_v3d", text="Remove")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -67,12 +67,12 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
                
                col = layout.column(align=True)
                col.itemL(text="Mesh:")
-               col.itemO("mesh.duplicate")
+               col.itemO("mesh.duplicate_move")
                col.itemO("mesh.delete")
                
                col = layout.column(align=True)
                col.itemL(text="Modeling:")
-               col.itemO("mesh.extrude")
+               col.itemO("mesh.extrude_move")
                col.itemO("mesh.subdivide")
                col.itemO("mesh.loopcut")
                col.itemO("mesh.spin")
@@ -91,11 +91,11 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
                col.itemO("mesh.uvs_rotate")
                col.itemO("mesh.uvs_mirror")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -103,7 +103,7 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
                col.itemO("screen.repeat_history", text="History...")
                col.itemO("screen.redo_last", text="Tweak...")
                
-class VIEW3D_PT_tools_mesheditoptions(View3DPanel):
+class VIEW3D_PT_tools_meshedit_options(View3DPanel):
        __context__ = "mesh_edit"
        __label__ = "Mesh Options"
 
@@ -150,11 +150,11 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
                col.itemO("curve.extrude")
                col.itemO("curve.subdivide")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -189,11 +189,11 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel):
                col.itemO("curve.extrude")
                col.itemO("curve.subdivide")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -245,18 +245,18 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel):
                col = layout.column(align=True)
                col.itemL(text="Bones:")
                col.itemO("armature.bone_primitive_add", text="Add")
-               col.itemO("armature.duplicate", text="Duplicate")
+               col.itemO("armature.duplicate_move", text="Duplicate")
                col.itemO("armature.delete", text="Delete")
                
                col = layout.column(align=True)
                col.itemL(text="Modeling:")
-               col.itemO("armature.extrude")
+               col.itemO("armature.extrude_move")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -264,8 +264,17 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel):
                col.itemO("screen.repeat_history", text="History...")
                col.itemO("screen.redo_last", text="Tweak...")
                
+class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
+       __context__ = "armature_edit"
+       __label__ = "Armature Options"
 
+       def draw(self, context):
+               layout = self.layout
+               
+               arm = context.active_object.data
 
+               col = layout.column(align=True)
+               col.itemR(arm, "x_axis_mirror")
 
 # ********** default tools for editmode_mball ****************
 
@@ -282,11 +291,11 @@ class VIEW3D_PT_tools_mballedit(View3DPanel):
                col.itemO("tfm.rotate")
                col.itemO("tfm.resize", text="Scale")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -309,11 +318,11 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel):
                col.itemO("tfm.rotate")
                col.itemO("tfm.resize", text="Scale")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -359,11 +368,11 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
                col.itemO("pose.push", text="Push")
                col.itemO("pose.breakdown", text="Breakdowner")
                
-#              col = layout.column(align=True)
-#              col.itemL(text="Grease Pencil:")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
-#              col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
-#              col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+               col = layout.column(align=True)
+               col.itemL(text="Grease Pencil:")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
+               col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
+               col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
                
                col = layout.column(align=True)
                col.itemL(text="Repeat:")
@@ -510,6 +519,7 @@ class VIEW3D_PT_tools_brush(PaintPanel):
        
                elif context.weight_paint_object and brush:
                        layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
+                       layout.itemR(context.tool_settings, "auto_normalize", text="Auto Normalize")
                        
                        col = layout.column()
                        row = col.row(align=True)
@@ -523,7 +533,7 @@ class VIEW3D_PT_tools_brush(PaintPanel):
                        row = col.row(align=True)
                        row.itemR(brush, "jitter", slider=True)
                        row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
-               
+                       
                # Vertex Paint Mode #
                
                elif context.vertex_paint_object and brush:
@@ -635,6 +645,22 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
 # ********** default tools for weightpaint ****************
 
 class VIEW3D_PT_tools_weightpaint(View3DPanel):
+       __context__ = "weightpaint"
+       __label__ = "Weight Tools"
+
+       def draw(self, context):
+               layout = self.layout
+               
+               wpaint = context.tool_settings.weight_paint
+
+               col = layout.column()
+               # col.itemL(text="Blend:")
+               col.itemO("object.vertex_group_normalize_all", text="Normalize All")
+               col.itemO("object.vertex_group_normalize", text="Normalize")
+               col.itemO("object.vertex_group_invert", text="Invert")
+               col.itemO("object.vertex_group_clean", text="Clean")
+
+class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
        __context__ = "weightpaint"
        __label__ = "Options"
 
@@ -806,13 +832,15 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
                sub.active = pe.fade_time
                sub.itemR(pe, "fade_frames", slider=True)
 
+bpy.types.register(VIEW3D_PT_tools_weightpaint)
 bpy.types.register(VIEW3D_PT_tools_objectmode)
 bpy.types.register(VIEW3D_PT_tools_meshedit)
-bpy.types.register(VIEW3D_PT_tools_mesheditoptions)
+bpy.types.register(VIEW3D_PT_tools_meshedit_options)
 bpy.types.register(VIEW3D_PT_tools_curveedit)
 bpy.types.register(VIEW3D_PT_tools_surfaceedit)
 bpy.types.register(VIEW3D_PT_tools_textedit)
 bpy.types.register(VIEW3D_PT_tools_armatureedit)
+bpy.types.register(VIEW3D_PT_tools_armatureedit_options)
 bpy.types.register(VIEW3D_PT_tools_mballedit)
 bpy.types.register(VIEW3D_PT_tools_latticeedit)
 bpy.types.register(VIEW3D_PT_tools_posemode)
@@ -822,6 +850,6 @@ bpy.types.register(VIEW3D_PT_tools_brush_stroke)
 bpy.types.register(VIEW3D_PT_tools_brush_curve)
 bpy.types.register(VIEW3D_PT_sculpt_options)
 bpy.types.register(VIEW3D_PT_tools_vertexpaint)
-bpy.types.register(VIEW3D_PT_tools_weightpaint)
+bpy.types.register(VIEW3D_PT_tools_weightpaint_options)
 bpy.types.register(VIEW3D_PT_tools_projectpaint)
 bpy.types.register(VIEW3D_PT_tools_particlemode)
index db88d84d0b508ddcaaee71cc745c1fe9c961b316..99ba3d50821ee82230d367bde4cb066b1eb8b483 100644 (file)
@@ -289,7 +289,7 @@ void BLF_blur(int size)
 void BLF_draw_default(float x, float y, float z, char *str)
 {
        FontBLF *font;
-       int old_font, old_point, old_dpi;
+       int old_font=0, old_point=0, old_dpi=0;
 
        if (!str)
                return;
@@ -404,7 +404,7 @@ float BLF_width_default(char *str)
 {
        FontBLF *font;
        float width;
-       int old_font, old_point, old_dpi;
+       int old_font=0, old_point=0, old_dpi=0;
 
        if (global_font_default == -1)
                global_font_default= blf_search("default");
@@ -447,7 +447,7 @@ float BLF_height_default(char *str)
 {
        FontBLF *font;
        float height;
-       int old_font, old_point, old_dpi;
+       int old_font=0, old_point=0, old_dpi=0;
 
        if (global_font_default == -1)
                global_font_default= blf_search("default");
index cc5b4dfdcaf7ccfec48d2335430fb067e9216f4d..045095567bc91697715ff8d43d2ca20f08810509 100644 (file)
@@ -67,6 +67,7 @@ struct KeyingSet *BKE_keyingset_add(struct ListBase *list, const char name[], sh
 /* Add a destination to a KeyingSet */
 void BKE_keyingset_add_destination(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode);
 
+/* Find the destination matching the criteria given */
 struct KS_Path *BKE_keyingset_find_destination(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode);
 
 /* Copy all KeyingSets in the given list */
@@ -78,6 +79,15 @@ void BKE_keyingset_free(struct KeyingSet *ks);
 /* Free all the KeyingSets in the given list */
 void BKE_keyingsets_free(struct ListBase *list);
 
+/* ************************************* */
+/* Path Fixing API */
+
+/* Fix all the paths for the given ID+AnimData */
+void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, char *prefix, char *oldName, char *newName);
+
+/* Fix all the paths for the entire database... */
+void BKE_all_animdata_fix_paths_rename(char *prefix, char *oldName, char *newName);
+
 /* ************************************* */
 // TODO: overrides, remapping, and path-finding api's
 
index 8f109034e3ea1466b7648961b89f32d651feaeb6..19c2662054b9310729fd2e18c54df2df1ca610b8 100644 (file)
@@ -72,8 +72,7 @@ extern "C" {
 
 struct bArmature *add_armature(char *name);
 struct bArmature *get_armature(struct Object *ob);
-void free_boneChildren(struct Bone *bone);
-void free_bones (struct bArmature *arm);
+void free_bonelist (struct ListBase *lb);
 void free_armature(struct bArmature *arm);
 void make_local_armature(struct bArmature *arm);
 struct bArmature *copy_armature(struct bArmature *arm);
index e91e434b97d21c9517bd98541fba0fcd7ddc3ef1..ebeec31c98458b919816b1e5b1ade96e82b6dff8 100644 (file)
@@ -43,7 +43,7 @@ struct bContext;
 struct ReportList;
 
 #define BLENDER_VERSION                        250
-#define BLENDER_SUBVERSION             6
+#define BLENDER_SUBVERSION             7
 
 #define BLENDER_MINVERSION             250
 #define BLENDER_MINSUBVERSION  0
index 09e13c2930e4fc7ba7edaf4a5cd5144a81bf395a..feba39ee11db2de1ef327d6f8c4c0a336a701c8d 100644 (file)
@@ -124,6 +124,9 @@ void CTX_store_free_list(ListBase *contexts);
 int CTX_py_init_get(bContext *C);
 void CTX_py_init_set(bContext *C, int value);
 
+void *CTX_py_dict_get(bContext *C);
+void CTX_py_dict_set(bContext *C, void *value);
+
 /* Window Manager Context */
 
 struct wmWindowManager *CTX_wm_manager(const bContext *C);
index 78a2f13a7cc7f86fdfc39f1731fb8f203e1427e7..2d1bec09dbfb37bc92b27ce55bde3124f0d4b557 100644 (file)
@@ -92,6 +92,9 @@ void switchdirectionNurb( struct Nurb *nu);
 float (*curve_getVertexCos(struct Curve *cu, struct ListBase *lb, int *numVerts_r))[3];
 void curve_applyVertexCos(struct Curve *cu, struct ListBase *lb, float (*vertexCos)[3]);
 
+float (*curve_getKeyVertexCos(struct Curve *cu, struct ListBase *lb, float *key))[3];
+void curve_applyKeyVertexTilts(struct Curve *cu, struct ListBase *lb, float *key);
+
 /* nurb checks if they can be drawn, also clamp order func */
 int check_valid_nurb_u( struct Nurb *nu);
 int check_valid_nurb_v( struct Nurb *nu);
index 4472539dde2e7114f0381a7aaa4569c8897eea47..6e273c81e398f2fc5378c64c3023296acef9a5a9 100644 (file)
@@ -98,7 +98,7 @@ typedef struct FModifierTypeInfo {
 } FModifierTypeInfo;
 
 /* Values which describe the behaviour of a FModifier Type */
-typedef enum {
+typedef enum eFMI_Action_Types {
                /* modifier only modifies values outside of data range */
        FMI_TYPE_EXTRAPOLATION = 0,
                /* modifier leaves data-points alone, but adjusts the interpolation between and around them */
@@ -110,7