Sculpt: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r24152...
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 2 Nov 2009 18:56:56 +0000 (18:56 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 2 Nov 2009 18:56:56 +0000 (18:56 +0000)
229 files changed:
CMake/macros.cmake
CMakeLists.txt
SConstruct
config/darwin-config.py
config/linux2-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
config/win64-vc-config.py
intern/ghost/SConscript
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemWin32.h
projectfiles_vc9/blender/blender.sln
projectfiles_vc9/blender/blender.vcproj
projectfiles_vc9/blender/collada/BF_collada.vcproj [new file with mode: 0644]
projectfiles_vc9/blender/windowmanager/windowmanager.vcproj
release/datafiles/blenderbuttons
release/datafiles/datatoc.py
release/scripts/io/add_mesh_torus.py
release/scripts/io/engine_render_pov.py
release/scripts/io/export_3ds.py
release/scripts/io/export_fbx.py
release/scripts/io/export_mdd.py
release/scripts/io/export_obj.py
release/scripts/io/export_ply.py
release/scripts/io/export_x3d.py
release/scripts/io/import_3ds.py
release/scripts/io/import_obj.py
release/scripts/io/mesh_skin.py
release/scripts/io/netrender/__init__.py
release/scripts/io/netrender/balancing.py
release/scripts/io/netrender/client.py
release/scripts/io/netrender/master.py
release/scripts/io/netrender/master_html.py
release/scripts/io/netrender/model.py
release/scripts/io/netrender/operators.py
release/scripts/io/netrender/slave.py
release/scripts/io/netrender/ui.py
release/scripts/io/netrender/utils.py
release/scripts/io/vertexpaint_dirt.py [new file with mode: 0644]
release/scripts/modules/autocomplete.py [deleted file]
release/scripts/modules/bpy_ext/Object.py
release/scripts/modules/bpy_ext/__init__.py
release/scripts/modules/bpy_ops.py
release/scripts/modules/bpy_sys.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/modules/dynamic_menu.py
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_armature.py [deleted file]
release/scripts/ui/buttons_data_bone.py [deleted file]
release/scripts/ui/buttons_data_camera.py [deleted file]
release/scripts/ui/buttons_data_curve.py [deleted file]
release/scripts/ui/buttons_data_empty.py [deleted file]
release/scripts/ui/buttons_data_lamp.py [deleted file]
release/scripts/ui/buttons_data_lattice.py [deleted file]
release/scripts/ui/buttons_data_mesh.py [deleted file]
release/scripts/ui/buttons_data_metaball.py [deleted file]
release/scripts/ui/buttons_data_modifier.py [deleted file]
release/scripts/ui/buttons_data_text.py [deleted file]
release/scripts/ui/buttons_game.py [deleted file]
release/scripts/ui/buttons_material.py [deleted file]
release/scripts/ui/buttons_object.py [deleted file]
release/scripts/ui/buttons_object_constraint.py [deleted file]
release/scripts/ui/buttons_particle.py [deleted file]
release/scripts/ui/buttons_physics_cloth.py [deleted file]
release/scripts/ui/buttons_physics_common.py [deleted file]
release/scripts/ui/buttons_physics_field.py [deleted file]
release/scripts/ui/buttons_physics_fluid.py [deleted file]
release/scripts/ui/buttons_physics_smoke.py [deleted file]
release/scripts/ui/buttons_physics_softbody.py [deleted file]
release/scripts/ui/buttons_render.py [deleted file]
release/scripts/ui/buttons_scene.py [deleted file]
release/scripts/ui/buttons_texture.py [deleted file]
release/scripts/ui/buttons_world.py [deleted file]
release/scripts/ui/properties_data_armature.py [new file with mode: 0644]
release/scripts/ui/properties_data_bone.py [new file with mode: 0644]
release/scripts/ui/properties_data_camera.py [new file with mode: 0644]
release/scripts/ui/properties_data_curve.py [new file with mode: 0644]
release/scripts/ui/properties_data_empty.py [new file with mode: 0644]
release/scripts/ui/properties_data_lamp.py [new file with mode: 0644]
release/scripts/ui/properties_data_lattice.py [new file with mode: 0644]
release/scripts/ui/properties_data_mesh.py [new file with mode: 0644]
release/scripts/ui/properties_data_metaball.py [new file with mode: 0644]
release/scripts/ui/properties_data_modifier.py [new file with mode: 0644]
release/scripts/ui/properties_data_text.py [new file with mode: 0644]
release/scripts/ui/properties_game.py [new file with mode: 0644]
release/scripts/ui/properties_material.py [new file with mode: 0644]
release/scripts/ui/properties_object.py [new file with mode: 0644]
release/scripts/ui/properties_object_constraint.py [new file with mode: 0644]
release/scripts/ui/properties_particle.py [new file with mode: 0644]
release/scripts/ui/properties_physics_cloth.py [new file with mode: 0644]
release/scripts/ui/properties_physics_common.py [new file with mode: 0644]
release/scripts/ui/properties_physics_field.py [new file with mode: 0644]
release/scripts/ui/properties_physics_fluid.py [new file with mode: 0644]
release/scripts/ui/properties_physics_smoke.py [new file with mode: 0644]
release/scripts/ui/properties_physics_softbody.py [new file with mode: 0644]
release/scripts/ui/properties_render.py [new file with mode: 0644]
release/scripts/ui/properties_scene.py [new file with mode: 0644]
release/scripts/ui/properties_texture.py [new file with mode: 0644]
release/scripts/ui/properties_world.py [new file with mode: 0644]
release/scripts/ui/space_buttons.py
release/scripts/ui/space_console.py
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_image.py
release/scripts/ui/space_info.py
release/scripts/ui/space_logic.py
release/scripts/ui/space_node.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_text.py
release/scripts/ui/space_time.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
release/test/rna_array.py
source/blender/CMakeLists.txt
source/blender/SConscript
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/sequence.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/intern/arithb.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/CMakeLists.txt [new file with mode: 0644]
source/blender/collada/DocumentExporter.cpp [new file with mode: 0644]
source/blender/collada/DocumentExporter.h [new file with mode: 0644]
source/blender/collada/DocumentImporter.cpp [new file with mode: 0644]
source/blender/collada/DocumentImporter.h [new file with mode: 0644]
source/blender/collada/SConscript [new file with mode: 0644]
source/blender/collada/collada.cpp [new file with mode: 0644]
source/blender/collada/collada.h [new file with mode: 0644]
source/blender/collada/collada_internal.h [new file with mode: 0644]
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/datafiles/B.blend.c
source/blender/editors/datafiles/blenderbuttons.c
source/blender/editors/include/ED_object.h
source/blender/editors/include/UI_icons.h
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_ops.c
source/blender/editors/screen/screen_context.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_node/drawnode.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_view3d/drawarmature.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.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_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/uvedit/uvedit_ops.c
source/blender/ikplugin/intern/iksolver_plugin.c
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/dynlibtiff.c
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_action_types.h
source/blender/makesdna/DNA_armature_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_material.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_render.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_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/python/epy_doc_gen.py
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h
source/blender/python/rna_dump.py
source/blender/python/simple_enum_gen.py
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/SConscript
source/blender/windowmanager/intern/wm_operators.c
source/creator/CMakeLists.txt
source/gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp
source/gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.h
source/gameengine/Ketsji/KX_PythonInit.cpp
tools/Blender.py
tools/btools.py

index 150bd55..258cbdf 100644 (file)
@@ -76,6 +76,11 @@ MACRO(SETUP_LIBDIRS)
   IF(WITH_FFTW3)
     LINK_DIRECTORIES(${FFTW3_LIBPATH})
   ENDIF(WITH_FFTW3)
+  IF(WITH_OPENCOLLADA)
+    LINK_DIRECTORIES(${OPENCOLLADA_LIBPATH})
+    LINK_DIRECTORIES(${PCRE_LIBPATH})
+    LINK_DIRECTORIES(${EXPAT_LIBPATH})
+  ENDIF(WITH_OPENCOLLADA)
 
   IF(WIN32)
     LINK_DIRECTORIES(${PTHREADS_LIBPATH})
@@ -135,6 +140,11 @@ MACRO(SETUP_LIBLINKS
   IF(WITH_FFMPEG)
     TARGET_LINK_LIBRARIES(${target} ${FFMPEG_LIB})
   ENDIF(WITH_FFMPEG)
+  IF(WITH_OPENCOLLADA)
+    TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
+    TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
+    TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
+  ENDIF(WITH_OPENCOLLADA)
   IF(WIN32)
     TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
   ENDIF(WIN32)
index 963601d..74c5278 100644 (file)
@@ -80,6 +80,7 @@ OPTION(WITH_LZMA          "Enable best LZMA compression, used for pointcache" ON
 OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
 OPTION(WITH_BUILDINFO     "Include extra build details" ON)
 OPTION(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
+OPTION(WITH_OPENCOLLADA                "Enable OpenCollada Support (http://www.opencollada.org/)"      OFF)
 
 IF (APPLE)
 OPTION(WITH_COCOA        "Use Cocoa framework instead of deprecated Carbon" ON)
@@ -90,6 +91,18 @@ IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
 
+IF (WITH_OPENCOLLADA AND NOT APPLE)
+SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
+SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA})
+SET(OPENCOLLADA_LIB OpenCollada)
+SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
+SET(PCRE_LIBPATH ${PCRE}/lib)
+SET(PCRE_LIB pcre)
+SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
+SET(EXPAT_LIBPATH ${EXPAT}/lib)
+SET(EXPAT_LIB expat)
+ENDIF (WITH_OPENCOLLADA AND NOT APPLE)
+
 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
 # On Unix: 
 #   cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
@@ -503,12 +516,28 @@ IF(APPLE)
        SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
        SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
        ENDIF (WITH_COCOA)
+
        IF(WITH_OPENMP)
                SET(LLIBS "${LLIBS} -lgomp ")
                SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
        ENDIF(WITH_OPENMP)
 
+       IF (WITH_OPENCOLLADA)
+               SET(OPENCOLLADA ${LIBDIR}/opencollada)
+               SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
+               SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
+               SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2" )
+               #pcre is bundled with openCollada
+               #SET(PCRE ${LIBDIR}/pcre)
+               #SET(PCRE_LIBPATH ${PCRE}/lib)
+               SET(PCRE_LIB pcre)
+               #native OSX libxml2 is used
+               #SET(EXPAT ${LIBDIR}/expat)
+               #SET(EXPAT_LIBPATH ${EXPAT}/lib)
+               #SET(EXPAT_LIB expat)
+       ENDIF (WITH_OPENCOLLADA)
+
        SET(SDL ${LIBDIR}/sdl)
        SET(SDL_INCLUDE_DIR ${SDL}/include)
        SET(SDL_LIBRARY SDL)
index 6d18000..cb90c2e 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 6dd65ae..8a1b0ef 100644 (file)
@@ -246,6 +246,9 @@ BF_OPENGL_LIB = 'GL GLU'
 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
 BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
 
+#OpenCollada flags
+WITH_BF_COLLADA = False
+
 #############################################################################
 ###################  various compile settings and flags    ##################
 #############################################################################
index 026d0a2..dffc861 100644 (file)
@@ -151,6 +151,20 @@ BF_OPENGL_LIB = 'GL GLU X11 Xi'
 BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
 BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
 
+WITH_BF_COLLADA = False
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+BF_OPENCOLLADA = ''
+BF_OPENCOLLADA_LIB = 'OpenCollada'
+BF_OPENCOLLADA_LIBPATH = '/usr/lib'
+BF_PCRE = ''
+BF_PCRE_LIB = 'pcre'
+BF_PCRE_LIBPATH = '/usr/lib'
+BF_EXPAT = '/usr'
+BF_EXPAT_LIB = 'expat'
+BF_EXPAT_LIBPATH = '/usr/lib'
+
 ##
 CC = 'gcc'
 CXX = 'g++'
index 6b10b41..b519aa9 100644 (file)
@@ -126,6 +126,10 @@ BF_OPENGL_LIB = 'opengl32 glu32'
 BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
              '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
              '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
+
+# Disable Collada by default
+WITH_BF_COLLADA = False
+
 ##
 CC = 'gcc'
 CXX = 'g++'
index 291aa02..60463a0 100644 (file)
@@ -138,6 +138,16 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
 WITH_BF_REDCODE = False  
 BF_REDCODE_INC = '#extern'
 
+WITH_BF_COLLADA = False
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+
+BF_OPENCOLLADA = LIBDIR + '/opencollada'
+BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre'
+BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
+
 WITH_BF_STATICOPENGL = False
 BF_OPENGL_INC = '${BF_OPENGL}/include'
 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
index 5f08848..429f8b0 100644 (file)
@@ -151,6 +151,16 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
 WITH_BF_REDCODE = False  
 BF_REDCODE_INC = '#extern'
 
+WITH_BF_COLLADA = False
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+
+BF_OPENCOLLADA = LIBDIR + '/opencollada'
+BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
+BF_OPENCOLLADA_LIB = 'opencollada'
+BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
+
 WITH_BF_STATICOPENGL = False
 BF_OPENGL_INC = '${BF_OPENGL}/include'
 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
index d52ffbc..09da6f9 100644 (file)
@@ -10,15 +10,6 @@ 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']
 
index 2e89be4..8a17d45 100644 (file)
 
 GHOST_SystemWin32::GHOST_SystemWin32()
 : m_hasPerformanceCounter(false), m_freq(0), m_start(0),
-  m_seperateLeftRight(false),
-  m_seperateLeftRightInitialized(false)
+  m_separateLeftRight(false),
+  m_separateLeftRightInitialized(false)
 {
        m_displayManager = new GHOST_DisplayManagerWin32 ();
        GHOST_ASSERT(m_displayManager, "GHOST_SystemWin32::GHOST_SystemWin32(): m_displayManager==0\n");
@@ -274,7 +274,7 @@ GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) cons
        It didn't work all that well on some newer hardware, and worked less 
        well with the passage of time, so it was fully disabled in ME.
        */
-       if (m_seperateLeftRight && m_seperateLeftRightInitialized) {
+       if (m_separateLeftRight && m_separateLeftRightInitialized) {
                bool down = HIBYTE(::GetKeyState(VK_LSHIFT)) != 0;
                keys.set(GHOST_kModifierKeyLeftShift, down);
                down = HIBYTE(::GetKeyState(VK_RSHIFT)) != 0;
@@ -581,29 +581,29 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                                case VK_SHIFT:
                                                case VK_CONTROL:
                                                case VK_MENU:
-                                                       if (!system->m_seperateLeftRightInitialized) {
+                                                       if (!system->m_separateLeftRightInitialized) {
                                                                // Check whether this system supports seperate left and right keys
                                                                switch (wParam) {
                                                                        case VK_SHIFT:
-                                                                               system->m_seperateLeftRight = 
+                                                                               system->m_separateLeftRight = 
                                                                                        (HIBYTE(::GetKeyState(VK_LSHIFT)) != 0) ||
                                                                                        (HIBYTE(::GetKeyState(VK_RSHIFT)) != 0) ?
                                                                                        true : false;
                                                                                break;
                                                                        case VK_CONTROL:
-                                                                               system->m_seperateLeftRight = 
+                                                                               system->m_separateLeftRight = 
                                                                                        (HIBYTE(::GetKeyState(VK_LCONTROL)) != 0) ||
                                                                                        (HIBYTE(::GetKeyState(VK_RCONTROL)) != 0) ?
                                                                                        true : false;
                                                                                break;
                                                                        case VK_MENU:
-                                                                               system->m_seperateLeftRight = 
+                                                                               system->m_separateLeftRight = 
                                                                                        (HIBYTE(::GetKeyState(VK_LMENU)) != 0) ||
                                                                                        (HIBYTE(::GetKeyState(VK_RMENU)) != 0) ?
                                                                                        true : false;
                                                                                break;
                                                                }
-                                                               system->m_seperateLeftRightInitialized = true;
+                                                               system->m_separateLeftRightInitialized = true;
                                                        }
                                                        system->processModifierKeys(window);
                                                        // Bypass call to DefWindowProc
index 9387b6c..6a12975 100644 (file)
@@ -283,9 +283,9 @@ protected:
        /** High frequency timer variable. */
        __int64 m_start;
        /** Stores the capability of this system to distinguish left and right modifier keys. */
-       bool m_seperateLeftRight;
+       bool m_separateLeftRight;
        /** Stores the initialization state of the member m_leftRightDistinguishable. */
-       bool m_seperateLeftRightInitialized;
+       bool m_separateLeftRightInitialized;
        
 };
 
index 936e444..deb9d21 100644 (file)
@@ -7,6 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
                {6E24BF09-9653-4166-A871-F65CC9E98A9B} = {6E24BF09-9653-4166-A871-F65CC9E98A9B}\r
                {A90C4918-4B21-4277-93BD-AF65F30951D9} = {A90C4918-4B21-4277-93BD-AF65F30951D9}\r
                {FB88301F-F725-401B-ACD7-D2ABBF333B71} = {FB88301F-F725-401B-ACD7-D2ABBF333B71}\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2} = {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}\r
                {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE} = {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}\r
                {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}\r
                {D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}\r
@@ -294,6 +295,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_build_install_all", "..
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WM_windowmanager", "windowmanager\windowmanager.vcproj", "{884D8731-654C-4C7F-9A75-8F37A305BE1E}"\r
        ProjectSection(ProjectDependencies) = postProject\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2} = {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}\r
                {DFE7F3E3-E62A-4677-B666-DF0DDF70C359} = {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}\r
        EndProjectSection\r
 EndProject\r
@@ -332,6 +334,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzo", "..\..\extern\lzo
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BRE_raytrace", "render\BRE_raytrace.vcproj", "{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}"\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BF_collada", "collada\BF_collada.vcproj", "{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}"\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                3D Plugin Debug|Win32 = 3D Plugin Debug|Win32\r
@@ -1569,6 +1573,26 @@ Global
                {37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Debug|Win32.Build.0 = Blender Debug|Win32\r
                {37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Release|Win32.ActiveCfg = Blender Release|Win32\r
                {37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Release|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Debug|Win32.Build.0 = Blender Debug|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Release|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Release|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Debug|Win32.ActiveCfg = Blender Debug|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Debug|Win32.Build.0 = Blender Debug|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Release|Win32.ActiveCfg = Blender Release|Win32\r
+               {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Release|Win32.Build.0 = Blender Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index d6f2978..538afaf 100644 (file)
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalOptions="/MACHINE:I386"\r
-                               AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib"\r
+                               AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib opencollada.lib"\r
                                ShowProgress="0"\r
                                OutputFile="..\..\..\install\msvc_9\blender.exe"\r
                                LinkIncremental="1"\r
                                SuppressStartupBanner="true"\r
-                               AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\build\msvc_9\libs\intern;..\..\..\build\msvc_9\libs\extern;..\..\..\lib\windows\ffmpeg\lib;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib"\r
+                               AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\build\msvc_9\libs\intern;..\..\..\build\msvc_9\libs\extern;..\..\..\lib\windows\ffmpeg\lib;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib;..\..\..\lib\windows\opencollada\lib"\r
                                IgnoreAllDefaultLibraries="false"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib;glut32.lib;libc.lib;libcd.lib;libcpd.lib;libcp.lib;libcmtd.lib;odbc32.lib;odbccp32.lib"\r
                                GenerateDebugInformation="true"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"\r
-                               AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib"\r
+                               AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib opencollada.lib"\r
                                ShowProgress="0"\r
                                OutputFile="..\..\..\install\msvc_9d\blender.exe"\r
                                LinkIncremental="2"\r
                                SuppressStartupBanner="true"\r
-                               AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\lib\windows\ffmpeg\lib;..\..\..\build\msvc_9\libs\intern\debug;..\..\..\build\msvc_9\libs\extern\debug;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib"\r
+                               AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\lib\windows\ffmpeg\lib;..\..\..\build\msvc_9\libs\intern\debug;..\..\..\build\msvc_9\libs\extern\debug;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib;..\..\..\lib\windows\opencollada\lib"\r
                                IgnoreDefaultLibraryNames="libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, odbc32.lib, odbccp32.lib"\r
                                GenerateDebugInformation="true"\r
                                ProgramDatabaseFile="..\..\..\build\msvc_9\libs\debug\blender.pdb"\r
diff --git a/projectfiles_vc9/blender/collada/BF_collada.vcproj b/projectfiles_vc9/blender/collada/BF_collada.vcproj
new file mode 100644 (file)
index 0000000..2689ca1
--- /dev/null
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9,00"\r
+       Name="BF_collada"\r
+       ProjectGUID="{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}"\r
+       RootNamespace="BF_collada"\r
+       TargetFrameworkVersion="131072"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Blender Debug|Win32"\r
+                       OutputDirectory="..\..\..\..\build\msvc_9\source\blender\collada\debug"\r
+                       IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\collada\debug"\r
+                       ConfigurationType="4"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\windowmanager;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\opencollada\include\COLLADAStreamWriter\include;..\..\..\..\lib\windows\opencollada\include\COLLADABaseUtils\include;..\..\..\..\lib\windows\opencollada\include\COLLADAFramework\include;..\..\..\..\lib\windows\opencollada\include\COLLADASaxFrameworkLoader\include"\r
+                               PreprocessorDefinitions="WIN32,_DEBUG,_LIB"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="1"\r
+                               DefaultCharIsUnsigned="true"\r
+                               UsePrecompiledHeader="0"\r
+                               PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\collada\debug\BF_collada.pch"\r
+                               AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\collada\debug\"\r
+                               ObjectFile="..\..\..\..\build\msvc_9\source\blender\collada\debug\"\r
+                               ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\collada\debug\"\r
+                               WarningLevel="2"\r
+                               SuppressStartupBanner="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1043"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\..\build\msvc_9\libs\debug\BF_collada.lib"\r
+                               SuppressStartupBanner="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Blender Release|Win32"\r
+                       OutputDirectory="..\..\..\..\build\msvc_9\source\blender\collada"\r
+                       IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\collada"\r
+                       ConfigurationType="4"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\windowmanager;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\opencollada\include\COLLADAStreamWriter\include;..\..\..\..\lib\windows\opencollada\include\COLLADABaseUtils\include;..\..\..\..\lib\windows\opencollada\include\COLLADAFramework\include;..\..\..\..\lib\windows\opencollada\include\COLLADASaxFrameworkLoader\include"\r
+                               PreprocessorDefinitions="WIN32,NDEBUG,_LIB"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="0"\r
+                               EnableFunctionLevelLinking="true"\r
+                               DefaultCharIsUnsigned="true"\r
+                               UsePrecompiledHeader="0"\r
+                               PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\yafray\BF_collada.pch"\r
+                               AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\collada\"\r
+                               ObjectFile="..\..\..\..\build\msvc_9\source\blender\collada\"\r
+                               ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\collada\"\r
+                               WarningLevel="2"\r
+                               SuppressStartupBanner="true"\r
+                               CompileAs="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1043"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\..\build\msvc_9\libs\BF_collada.lib"\r
+                               SuppressStartupBanner="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\collada\collada.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\collada\DocumentExporter.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\collada\DocumentImporter.cpp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\collada\collada.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\collada\collada_internal.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\collada\DocumentExporter.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\collada\DocumentImporter.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 805ad1f..ad52b9f 100644 (file)
@@ -43,8 +43,8 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"\r
+                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\collada"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;WITH_COLLADA"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"\r
+                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\collada"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;WITH_COLLADA"\r
                                MinimalRebuild="true"\r
                                RuntimeLibrary="0"\r
                                EnableFunctionLevelLinking="false"\r
index f9a4b93..258e134 100644 (file)
Binary files a/release/datafiles/blenderbuttons and b/release/datafiles/blenderbuttons differ
index 362d4dd..70bb348 100755 (executable)
 import sys, os
 
 if len(sys.argv) < 2:
-       sys.stdout.write("Usage: datatoc <data_file>\n")
-       sys.exit(1)
+    sys.stdout.write("Usage: datatoc <data_file>\n")
+    sys.exit(1)
 
 filename = sys.argv[1]
 
 try:
-       fpin = open(filename, "rb");
+    fpin = open(filename, "rb");
 except:
-       sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
-       sys.exit(1)
+    sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
+    sys.exit(1)
 
 fpin.seek(0, os.SEEK_END)
 size = fpin.tell()
 fpin.seek(0)
 
 if filename[0] == ".":
-       filename = filename[1:]
+    filename = filename[1:]
 
 cname = filename + ".c"
 sys.stdout.write("Making C file <%s>\n" % cname)
@@ -52,10 +52,10 @@ filename = filename.replace(".", "_")
 sys.stdout.write(str(size))
 sys.stdout.write("\n")
 try:
-       fpout = open(cname, "w")
+    fpout = open(cname, "w")
 except:
-       sys.stdout.write("Unable to open output %s\n" % cname)
-       sys.exit(1)
+    sys.stdout.write("Unable to open output %s\n" % cname)
+    sys.exit(1)
 
 fpout.write("/* DataToC output of file <%s> */\n\n" % filename)
 fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
@@ -63,11 +63,11 @@ fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
 fpout.write("char datatoc_%s[]= {\n" % filename)
 
 while size > 0:
-       size -= 1
-       if size % 32 == 31:
-               fpout.write("\n")
-       
-       fpout.write("%3d," % ord(fpin.read(1)))
+    size -= 1
+    if size % 32 == 31:
+        fpout.write("\n")
+
+    fpout.write("%3d," % ord(fpin.read(1)))
 
 fpout.write("\n  0};\n\n")
 
index f413fe7..8a6a3a5 100644 (file)
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
 
-import bpy, Mathutils
-from math import cos, sin, pi, radians
-
-
-def add_torus(PREF_MAJOR_RAD, PREF_MINOR_RAD, PREF_MAJOR_SEG, PREF_MINOR_SEG):
-       Vector = Mathutils.Vector
-       Quaternion = Mathutils.Quaternion
-       
-       PI_2= pi*2
-       Z_AXIS = 0,0,1
-       
-       verts = []
-       faces = []
-       i1 = 0
-       tot_verts = PREF_MAJOR_SEG * PREF_MINOR_SEG
-       for major_index in range(PREF_MAJOR_SEG):
-               verts_tmp = []
-               quat = Quaternion( Z_AXIS, (major_index/PREF_MAJOR_SEG)*PI_2)
-
-               for minor_index in range(PREF_MINOR_SEG):
-                       angle = 2*pi*minor_index/PREF_MINOR_SEG
-                       
-                       vec = Vector(PREF_MAJOR_RAD+(cos(angle)*PREF_MINOR_RAD), 0, (sin(angle)*PREF_MINOR_RAD)) * quat
-                       verts.extend([vec.x, vec.y, vec.z])
-                       
-                       if minor_index+1==PREF_MINOR_SEG:
-                               i2 = (major_index)*PREF_MINOR_SEG
-                               i3 = i1 + PREF_MINOR_SEG
-                               i4 = i2 + PREF_MINOR_SEG
-                               
-                       else:
-                               i2 = i1 + 1
-                               i3 = i1 + PREF_MINOR_SEG
-                               i4 = i3 + 1
-                       
-                       if i2>=tot_verts:       i2 = i2-tot_verts
-                       if i3>=tot_verts:       i3 = i3-tot_verts
-                       if i4>=tot_verts:       i4 = i4-tot_verts
-                       
-                       # stupid eekadoodle
-                       if i2:  faces.extend( [i1,i3,i4,i2] )
-                       else:   faces.extend( [i2,i1,i3,i4] )
-                               
-                       i1+=1
-       
-       return verts, faces
-
-
-class MESH_OT_primitive_torus_add(bpy.types.Operator):
-       '''Add a torus mesh.'''
-       __idname__ = "mesh.primitive_torus_add"
-       __label__ = "Add Torus"
-       __register__ = True
-       __undo__ = True
-       __props__ = [
-               bpy.props.FloatProperty(attr="major_radius", name="Major Radius", description="Number of segments for the main ring of the torus", default= 1.0, min= 0.01, max= 100.0),
-               bpy.props.FloatProperty(attr="minor_radius", name="Minor Radius", description="Number of segments for the minor ring of the torus", default= 0.25, min= 0.01, max= 100.0),
-               bpy.props.IntProperty(attr="major_segments", name="Major Segments", description="Number of segments for the main ring of the torus", default= 48, min= 3, max= 256),
-               bpy.props.IntProperty(attr="minor_segments", name="Minor Segments", description="Number of segments for the minor ring of the torus", default= 16, min= 3, max= 256),
-       ]
-       
-       def execute(self, context):
-               verts_loc, faces = add_torus(self.major_radius, self.minor_radius, self.major_segments, self.minor_segments)
-               
-               me= bpy.data.add_mesh("Torus")
-               
-               me.add_geometry(int(len(verts_loc)/3), 0, int(len(faces)/4))
-               me.verts.foreach_set("co", verts_loc)
-               me.faces.foreach_set("verts_raw", faces)
-               
-               sce = context.scene
-               
-               # ugh
-               for ob in sce.objects:
-                       ob.selected = False
-               
-               me.update()
-               ob= bpy.data.add_object('MESH', "Torus")
-               ob.data= me
-               context.scene.add_object(ob)
-               context.scene.active_object = ob
-               ob.selected = True
-               
-               ob.location = tuple(context.scene.cursor_location)
-               
-               return ('FINISHED',)
+# <pep8-80 compliant>
+import bpy
+import Mathutils
+from math import cos, sin, pi
+
+
+def add_torus(major_rad, minor_rad, major_seg, minor_seg):
+    Vector = Mathutils.Vector
+    Quaternion = Mathutils.Quaternion
+
+    PI_2 = pi * 2
+    z_axis = (0, 0, 1)
+
+    verts = []
+    faces = []
+    i1 = 0
+    tot_verts = major_seg * minor_seg
+    for major_index in range(major_seg):
+        quat = Quaternion(z_axis, (major_index / major_seg) * PI_2)
+
+        for minor_index in range(minor_seg):
+            angle = 2 * pi * minor_index / minor_seg
+
+            vec = Vector(major_rad + (cos(angle) * minor_rad), 0.0,
+                        (sin(angle) * minor_rad)) * quat
+
+            verts.extend([vec.x, vec.y, vec.z])
+
+            if minor_index + 1 == minor_seg:
+                i2 = (major_index) * minor_seg
+                i3 = i1 + minor_seg
+                i4 = i2 + minor_seg
+
+            else:
+                i2 = i1 + 1
+                i3 = i1 + minor_seg
+                i4 = i3 + 1
+
+            if i2 >= tot_verts:
+                i2 = i2 - tot_verts
+            if i3 >= tot_verts:
+                i3 = i3 - tot_verts
+            if i4 >= tot_verts:
+                i4 = i4 - tot_verts
+
+            # stupid eekadoodle
+            if i2:
+                faces.extend([i1, i3, i4, i2])
+            else:
+                faces.extend([i2, i1, i3, i4])
+
+            i1 += 1
+
+    return verts, faces
+
+from bpy.props import *
+
+
+class AddTorusPrimitive(bpy.types.Operator):
+    '''Add a torus mesh.'''
+    bl_idname = "mesh.primitive_torus_add"
+    bl_label = "Add Torus"
+    bl_register = True
+    bl_undo = True
+
+    major_radius = FloatProperty(name="Major Radius",
+            description="Number of segments for the main ring of the torus",
+            default=1.0, min=0.01, max=100.0)
+    minor_radius = FloatProperty(name="Minor Radius",
+            description="Number of segments for the minor ring of the torus",
+            default=0.25, min=0.01, max=100.0)
+    major_segments = IntProperty(name="Major Segments",
+            description="Number of segments for the main ring of the torus",
+            default=48, min=3, max=256)
+    minor_segments = IntProperty(name="Minor Segments",
+            description="Number of segments for the minor ring of the torus",
+            default=16, min=3, max=256)
+
+    def execute(self, context):
+
+        verts_loc, faces = add_torus(self.major_radius,
+                                    self.minor_radius,
+                                    self.major_segments,
+                                    self.minor_segments)
+
+        mesh = bpy.data.add_mesh("Torus")
+
+        mesh.add_geometry(int(len(verts_loc) / 3), 0, int(len(faces) / 4))
+        mesh.verts.foreach_set("co", verts_loc)
+        mesh.faces.foreach_set("verts_raw", faces)
+
+        scene = context.scene
+
+        # ugh
+        for ob in scene.objects:
+            ob.selected = False
+
+        mesh.update()
+        ob_new = bpy.data.add_object('MESH', "Torus")
+        ob_new.data = mesh
+        scene.add_object(ob_new)
+        scene.active_object = ob_new
+        ob_new.selected = True
+
+        ob_new.location = tuple(context.scene.cursor_location)
+
+        return ('FINISHED',)
 
 # Register the operator
-bpy.ops.add(MESH_OT_primitive_torus_add)
+bpy.ops.add(AddTorusPrimitive)
 
 # Add to a menu
 import dynamic_menu
-import space_info
-menu_item = dynamic_menu.add(bpy.types.INFO_MT_mesh_add, (lambda self, context: self.layout.itemO("mesh.primitive_torus_add", text="Torus", icon='ICON_MESH_DONUT')) )
+
+menu_func = (lambda self, context: self.layout.itemO("mesh.primitive_torus_add",
+                                        text="Torus", icon='ICON_MESH_DONUT'))
+
+menu_item = dynamic_menu.add(bpy.types.INFO_MT_mesh_add, menu_func)
 
 if __name__ == "__main__":
-       bpy.ops.mesh.primitive_torus_add()
\ No newline at end of file
+    bpy.ops.mesh.primitive_torus_add()
index f69c8a2..510d921 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 
 from math import atan, pi, degrees
@@ -697,8 +715,8 @@ IntProperty(        attr="pov_radio_recursion_limit",
        
 
 class PovrayRender(bpy.types.RenderEngine):
-       __idname__ = 'POVRAY_RENDER'
-       __label__ = "Povray"
+       bl_idname = 'POVRAY_RENDER'
+       bl_label = "Povray"
        DELAY = 0.02
        
        def _export(self, scene):
@@ -826,33 +844,33 @@ class PovrayRender(bpy.types.RenderEngine):
 bpy.types.register(PovrayRender)
 
 # Use some of the existing buttons.
-import buttons_render
-buttons_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
-buttons_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('POVRAY_RENDER')
-buttons_render.RENDER_PT_antialiasing.COMPAT_ENGINES.add('POVRAY_RENDER')
-buttons_render.RENDER_PT_output.COMPAT_ENGINES.add('POVRAY_RENDER')
-del buttons_render
+import properties_render
+properties_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
+properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('POVRAY_RENDER')
+properties_render.RENDER_PT_antialiasing.COMPAT_ENGINES.add('POVRAY_RENDER')
+properties_render.RENDER_PT_output.COMPAT_ENGINES.add('POVRAY_RENDER')
+del properties_render
 
 # Use only a subset of the world panels
-import buttons_world
-buttons_world.WORLD_PT_preview.COMPAT_ENGINES.add('POVRAY_RENDER')
-buttons_world.WORLD_PT_context_world.COMPAT_ENGINES.add('POVRAY_RENDER')
-buttons_world.WORLD_PT_world.COMPAT_ENGINES.add('POVRAY_RENDER')
-buttons_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')
-del buttons_world
+import properties_world
+properties_world.WORLD_PT_preview.COMPAT_ENGINES.add('POVRAY_RENDER')
+properties_world.WORLD_PT_context_world.COMPAT_ENGINES.add('POVRAY_RENDER')
+properties_world.WORLD_PT_world.COMPAT_ENGINES.add('POVRAY_RENDER')
+properties_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')
+del properties_world
 
 # Example of wrapping every class 'as is'
-import buttons_material
-for member in dir(buttons_material):
-       subclass = getattr(buttons_material, member)
+import properties_material
+for member in dir(properties_material):
+       subclass = getattr(properties_material, member)
        try:            subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
        except: pass
-del buttons_material
+del properties_material
 
 class RenderButtonsPanel(bpy.types.Panel):
-       __space_type__ = 'PROPERTIES'
-       __region_type__ = 'WINDOW'
-       __context__ = "render"
+       bl_space_type = 'PROPERTIES'
+       bl_region_type = 'WINDOW'
+       bl_context = "render"
        # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
        
        def poll(self, context):
@@ -860,7 +878,7 @@ class RenderButtonsPanel(bpy.types.Panel):
                return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
 
 class RENDER_PT_povray_radiosity(RenderButtonsPanel):
-       __label__ = "Radiosity"
+       bl_label = "Radiosity"
        COMPAT_ENGINES = set(['POVRAY_RENDER'])
 
        def draw_header(self, context):
index 9991352..3e5d64a 100644 (file)
@@ -1,4 +1,22 @@
 # coding: utf-8
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 __author__ = ["Campbell Barton", "Bob Holcomb", "Richard Lärkäng", "Damien McGinnes", "Mark Stijnman"]
 __url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/")
 __version__ = "0.90a"
@@ -1090,19 +1108,19 @@ def save_3ds(filename, context):
 #     else:
 #         Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
 # # save_3ds('/test_b.3ds')
-
+from bpy.props import *
 class EXPORT_OT_autodesk_3ds(bpy.types.Operator):
        '''Export to 3DS file format (.3ds).'''
-       __idname__ = "export.autodesk_3ds"
-       __label__ = 'Export 3DS'
+       bl_idname = "export.autodesk_3ds"
+       bl_label = 'Export 3DS'
        
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
 
-       __props__ = [
-               # bpy.props.StringProperty(attr="filename", name="File Name", description="File name used for exporting the 3DS file", maxlen= 1024, default= ""),
-               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the 3DS file", maxlen= 1024, default= ""),
-       ]
+       
+       # filename = StringProperty(name="File Name", description="File name used for exporting the 3DS file", maxlen= 1024, default= ""),
+       path = StringProperty(name="File Path", description="File path used for exporting the 3DS file", maxlen= 1024, default= "")
+
        
        def execute(self, context):
                save_3ds(self.path, context)
@@ -1110,7 +1128,7 @@ class EXPORT_OT_autodesk_3ds(bpy.types.Operator):
        
        def invoke(self, context, event):
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
        
        def poll(self, context): # Poll isnt working yet
index d159c65..b303e53 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 __author__ = "Campbell Barton"
 __url__ = ['www.blender.org', 'blenderartists.org']
 __version__ = "1.2"
@@ -3332,44 +3350,44 @@ def write_ui():
        
        
        # GLOBALS.clear()
-
+from bpy.props import *
 class EXPORT_OT_fbx(bpy.types.Operator):
        '''Selection to an ASCII Autodesk FBX'''
-       __idname__ = "export.fbx"
-       __label__ = "Export FBX"
+       bl_idname = "export.fbx"
+       bl_label = "Export FBX"
        
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
        
-       __props__ = [
-               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the FBX file", maxlen= 1024, default= ""),
-               
-               bpy.props.BoolProperty(attr="EXP_OBS_SELECTED", name="Selected Objects", description="Export selected objects on visible layers", default=True),
-#              bpy.props.BoolProperty(attr="EXP_OBS_SCENE", name="Scene Objects", description="Export all objects in this scene", default=True),
-               bpy.props.FloatProperty(attr="_SCALE", name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0),
-               bpy.props.BoolProperty(attr="_XROT90", name="Rot X90", description="Rotate all objects 90 degrese about the X axis", default=True),
-               bpy.props.BoolProperty(attr="_YROT90", name="Rot Y90", description="Rotate all objects 90 degrese about the Y axis", default=False),
-               bpy.props.BoolProperty(attr="_ZROT90", name="Rot Z90", description="Rotate all objects 90 degrese about the Z axis", default=False),
-               bpy.props.BoolProperty(attr="EXP_EMPTY", name="Empties", description="Export empty objects", default=True),
-               bpy.props.BoolProperty(attr="EXP_CAMERA", name="Cameras", description="Export camera objects", default=True),
-               bpy.props.BoolProperty(attr="EXP_LAMP", name="Lamps", description="Export lamp objects", default=True),
-               bpy.props.BoolProperty(attr="EXP_ARMATURE", name="Armatures", description="Export armature objects", default=True),
-               bpy.props.BoolProperty(attr="EXP_MESH", name="Meshes", description="Export mesh objects", default=True),
-               bpy.props.BoolProperty(attr="EXP_MESH_APPLY_MOD", name="Modifiers", description="Apply modifiers to mesh objects", default=True),
-               bpy.props.BoolProperty(attr="EXP_MESH_HQ_NORMALS", name="HQ Normals", description="Generate high quality normals", default=True),
-               bpy.props.BoolProperty(attr="EXP_IMAGE_COPY", name="Copy Image Files", description="Copy image files to the destination path", default=False),
-               # armature animation
-               bpy.props.BoolProperty(attr="ANIM_ENABLE", name="Enable Animation", description="Export keyframe animation", default=True),
-               bpy.props.BoolProperty(attr="ANIM_OPTIMIZE", name="Optimize Keyframes", description="Remove double keyframes", default=True),
-               bpy.props.FloatProperty(attr="ANIM_OPTIMIZE_PRECISSION", name="Precision", description="Tolerence for comparing double keyframes (higher for greater accuracy)", min=1, max=16, soft_min=1, soft_max=16, default=6.0),
-#              bpy.props.BoolProperty(attr="ANIM_ACTION_ALL", name="Current Action", description="Use actions currently applied to the armatures (use scene start/end frame)", default=True),
-               bpy.props.BoolProperty(attr="ANIM_ACTION_ALL", name="All Actions", description="Use all actions for armatures, if false, use current action", default=False),
-               # batch
-               bpy.props.BoolProperty(attr="BATCH_ENABLE", name="Enable Batch", description="Automate exporting multiple scenes or groups to files", default=False),
-               bpy.props.BoolProperty(attr="BATCH_GROUP", name="Group > File", description="Export each group as an FBX file, if false, export each scene as an FBX file", default=False),
-               bpy.props.BoolProperty(attr="BATCH_OWN_DIR", name="Own Dir", description="Create a dir for each exported file", default=True),
-               bpy.props.StringProperty(attr="BATCH_FILE_PREFIX", name="Prefix", description="Prefix each file with this name", maxlen= 1024, default=""),
-       ]
+       
+       path = StringProperty(name="File Path", description="File path used for exporting the FBX file", maxlen= 1024, default= "")
+       
+       EXP_OBS_SELECTED = BoolProperty(name="Selected Objects", description="Export selected objects on visible layers", default=True)
+#      EXP_OBS_SCENE = BoolProperty(name="Scene Objects", description="Export all objects in this scene", default=True)
+       _SCALE = FloatProperty(name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0)
+       _XROT90 = BoolProperty(name="Rot X90", description="Rotate all objects 90 degrese about the X axis", default=True)
+       _YROT90 = BoolProperty(name="Rot Y90", description="Rotate all objects 90 degrese about the Y axis", default=False)
+       _ZROT90 = BoolProperty(name="Rot Z90", description="Rotate all objects 90 degrese about the Z axis", default=False)
+       EXP_EMPTY = BoolProperty(name="Empties", description="Export empty objects", default=True)
+       EXP_CAMERA = BoolProperty(name="Cameras", description="Export camera objects", default=True)
+       EXP_LAMP = BoolProperty(name="Lamps", description="Export lamp objects", default=True)
+       EXP_ARMATURE = BoolProperty(name="Armatures", description="Export armature objects", default=True)
+       EXP_MESH = BoolProperty(name="Meshes", description="Export mesh objects", default=True)
+       EXP_MESH_APPLY_MOD = BoolProperty(name="Modifiers", description="Apply modifiers to mesh objects", default=True)
+       EXP_MESH_HQ_NORMALS = BoolProperty(name="HQ Normals", description="Generate high quality normals", default=True)
+       EXP_IMAGE_COPY = BoolProperty(name="Copy Image Files", description="Copy image files to the destination path", default=False)
+       # armature animation
+       ANIM_ENABLE = BoolProperty(name="Enable Animation", description="Export keyframe animation", default=True)
+       ANIM_OPTIMIZE = BoolProperty(name="Optimize Keyframes", description="Remove double keyframes", default=True)
+       ANIM_OPTIMIZE_PRECISSION = FloatProperty(name="Precision", description="Tolerence for comparing double keyframes (higher for greater accuracy)", min=1, max=16, soft_min=1, soft_max=16, default=6.0)
+#      ANIM_ACTION_ALL = BoolProperty(name="Current Action", description="Use actions currently applied to the armatures (use scene start/end frame)", default=True)
+       ANIM_ACTION_ALL = BoolProperty(name="All Actions", description="Use all actions for armatures, if false, use current action", default=False)
+       # batch
+       BATCH_ENABLE = BoolProperty(name="Enable Batch", description="Automate exporting multiple scenes or groups to files", default=False)
+       BATCH_GROUP = BoolProperty(name="Group > File", description="Export each group as an FBX file, if false, export each scene as an FBX file", default=False)
+       BATCH_OWN_DIR = BoolProperty(name="Own Dir", description="Create a dir for each exported file", default=True)
+       BATCH_FILE_PREFIX = StringProperty(name="Prefix", description="Prefix each file with this name", maxlen= 1024, default="")
+       
        
        def poll(self, context):
                print("Poll")
@@ -3411,7 +3429,7 @@ class EXPORT_OT_fbx(bpy.types.Operator):
        
        def invoke(self, context, event):       
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
 
 
index 1336660..677361f 100644 (file)
@@ -1,3 +1,20 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
 
 __author__ = "Bill L.Nieuwendorp"
 __bpydoc__ = """\
@@ -133,10 +150,12 @@ def write(filename, sce, ob, PREF_STARTFRAME, PREF_ENDFRAME, PREF_FPS):
        """
        sce.set_frame(orig_frame)
 
+from bpy.props import *
+
 class EXPORT_OT_mdd(bpy.types.Operator):
        '''Animated mesh to MDD vertex keyframe file.'''
-       __idname__ = "export.mdd"
-       __label__ = "Export MDD"
+       bl_idname = "export.mdd"
+       bl_label = "Export MDD"
 
        # get first scene to get min and max properties for frames, fps
 
@@ -148,12 +167,10 @@ class EXPORT_OT_mdd(bpy.types.Operator):
 
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
-       __props__ = [
-               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the MDD file", maxlen= 1024, default= "tmp.mdd"),
-               bpy.props.IntProperty(attr="fps", name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default= 25),
-               bpy.props.IntProperty(attr="start_frame", name="Start Frame", description="Start frame for baking", min=minframe,max=maxframe,default=1),
-               bpy.props.IntProperty(attr="end_frame", name="End Frame", description="End frame for baking", min=minframe, max=maxframe, default= 250),
-       ]
+       path = StringProperty(name="File Path", description="File path used for exporting the MDD file", maxlen= 1024, default= "tmp.mdd")
+       fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default= 25)
+       start_frame = IntProperty(name="Start Frame", description="Start frame for baking", min=minframe,max=maxframe,default=1)
+       end_frame = IntProperty(name="End Frame", description="End frame for baking", min=minframe, max=maxframe, default= 250)
 
        def poll(self, context):
                return context.active_object != None
@@ -167,7 +184,7 @@ class EXPORT_OT_mdd(bpy.types.Operator):
        
        def invoke(self, context, event):       
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
 
 bpy.ops.add(EXPORT_OT_mdd)
index 1e8a152..72f1835 100644 (file)
@@ -1,4 +1,20 @@
-#!BPY
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
 
 """
 Name: 'Wavefront (.obj)...'
@@ -913,44 +929,46 @@ Currently the exporter lacks these features:
 * multiple scene export (only active scene is written)
 * particles
 '''
+
+from bpy.props import *
+
 class EXPORT_OT_obj(bpy.types.Operator):
        '''Save a Wavefront OBJ File'''
        
-       __idname__ = "export.obj"
-       __label__ = 'Export OBJ'
+       bl_idname = "export.obj"
+       bl_label = 'Export OBJ'
        
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
 
-       __props__ = [
-               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= ""),
-
-               # context group
-               bpy.props.BoolProperty(attr="use_selection", name="Selection Only", description="", default= False),
-               bpy.props.BoolProperty(attr="use_all_scenes", name="All Scenes", description="", default= False),
-               bpy.props.BoolProperty(attr="use_animation", name="All Animation", description="", default= False),
-
-               # object group
-               bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="", default= True),
-               bpy.props.BoolProperty(attr="use_rotate90", name="Rotate X90", description="", default= True),
-
-               # extra data group
-               bpy.props.BoolProperty(attr="use_edges", name="Edges", description="", default= True),
-               bpy.props.BoolProperty(attr="use_normals", name="Normals", description="", default= False),
-               bpy.props.BoolProperty(attr="use_hq_normals", name="High Quality Normals", description="", default= True),
-               bpy.props.BoolProperty(attr="use_uvs", name="UVs", description="", default= True),
-               bpy.props.BoolProperty(attr="use_materials", name="Materials", description="", default= True),
-               bpy.props.BoolProperty(attr="copy_images", name="Copy Images", description="", default= False),
-               bpy.props.BoolProperty(attr="use_triangles", name="Triangulate", description="", default= False),
-               bpy.props.BoolProperty(attr="use_vertex_groups", name="Polygroups", description="", default= False),
-               bpy.props.BoolProperty(attr="use_nurbs", name="Nurbs", description="", default= False),
-
-               # grouping group
-               bpy.props.BoolProperty(attr="use_blen_objects", name="Objects as OBJ Objects", description="", default= True),
-               bpy.props.BoolProperty(attr="group_by_object", name="Objects as OBJ Groups ", description="", default= False),
-               bpy.props.BoolProperty(attr="group_by_material", name="Material Groups", description="", default= False),
-               bpy.props.BoolProperty(attr="keep_vertex_order", name="Keep Vertex Order", description="", default= False)
-       ]
+       path = StringProperty(name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= "")
+
+       # context group
+       use_selection = BoolProperty(name="Selection Only", description="", default= False)
+       use_all_scenes = BoolProperty(name="All Scenes", description="", default= False)
+       use_animation = BoolProperty(name="All Animation", description="", default= False)
+
+       # object group
+       use_modifiers = BoolProperty(name="Apply Modifiers", description="", default= True)
+       use_rotate90 = BoolProperty(name="Rotate X90", description="", default= True)
+
+       # extra data group
+       use_edges = BoolProperty(name="Edges", description="", default= True)
+       use_normals = BoolProperty(name="Normals", description="", default= False)
+       use_hq_normals = BoolProperty(name="High Quality Normals", description="", default= True)
+       use_uvs = BoolProperty(name="UVs", description="", default= True)
+       use_materials = BoolProperty(name="Materials", description="", default= True)
+       copy_images = BoolProperty(name="Copy Images", description="", default= False)
+       use_triangles = BoolProperty(name="Triangulate", description="", default= False)
+       use_vertex_groups = BoolProperty(name="Polygroups", description="", default= False)
+       use_nurbs = BoolProperty(name="Nurbs", description="", default= False)
+
+       # grouping group
+       use_blen_objects = BoolProperty(name="Objects as OBJ Objects", description="", default= True)
+       group_by_object = BoolProperty(name="Objects as OBJ Groups ", description="", default= False)
+       group_by_material = BoolProperty(name="Material Groups", description="", default= False)
+       keep_vertex_order = BoolProperty(name="Keep Vertex Order", description="", default= False)
+       
        
        def execute(self, context):
 
@@ -977,7 +995,7 @@ class EXPORT_OT_obj(bpy.types.Operator):
        
        def invoke(self, context, event):
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
        
        def poll(self, context): # Poll isnt working yet
index d74cc0e..7235d51 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 
 __author__ = "Bruce Merry"
@@ -231,21 +249,24 @@ def write(filename, scene, ob, \
                Blender.Window.EditMode(1, '', 0)
        """
 
+from bpy.props import *
+
+
 class EXPORT_OT_ply(bpy.types.Operator):
        '''Export a single object as a stanford PLY with normals, colours and texture coordinates.'''
-       __idname__ = "export.ply"
-       __label__ = "Export PLY"
+       bl_idname = "export.ply"
+       bl_label = "Export PLY"
        
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
        
-       __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_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
-               bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True),
-               bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True),
-               bpy.props.BoolProperty(attr="use_colors", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
-       ]
+       
+       path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
+       use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
+       use_normals = BoolProperty(name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True)
+       use_uvs = BoolProperty(name="Export UVs", description="Exort the active UV layer", default= True)
+       use_colors = BoolProperty(name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
+       
        
        def poll(self, context):
                return context.active_object != None
@@ -267,7 +288,7 @@ class EXPORT_OT_ply(bpy.types.Operator):
        
        def invoke(self, context, event):       
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
 
 
@@ -278,4 +299,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 2c6ca74..6de6725 100644 (file)
@@ -1,3 +1,20 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
 
 __author__ = ("Bart", "Campbell Barton")
 __email__ = ["Bart, bart:neeneenee*de"]
@@ -1196,21 +1213,21 @@ def x3d_export_ui(filename):
 # if __name__ == '__main__':
 #      Blender.Window.FileSelector(x3d_export_ui,"Export X3D", Blender.Get('filename').replace('.blend', '.x3d'))
 
+from bpy.props import *
+
 class EXPORT_OT_x3d(bpy.types.Operator):
        '''Export selection to Extensible 3D file (.x3d)'''
-       __idname__ = "export.x3d"
-       __label__ = 'Export X3D'
+       bl_idname = "export.x3d"
+       bl_label = 'Export X3D'
        
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
-
-       __props__ = [
-               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= ""),
-
-               bpy.props.BoolProperty(attr="apply_modifiers", name="Apply Modifiers", description="Use transformed mesh data from each object.", default=True),
-               bpy.props.BoolProperty(attr="triangulate", name="Triangulate", description="Triangulate quads.", default=False),
-               bpy.props.BoolProperty(attr="compress", name="Compress", description="GZip the resulting file, requires a full python install.", default=False),
-       ]
+       path = StringProperty(name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= "")
+       
+       apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object.", default=True)
+       triangulate = BoolProperty(name="Triangulate", description="Triangulate quads.", default=False)
+       compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install.", default=False)
+       
        
        def execute(self, context):
                x3d_export(self.path, context, self.apply_modifiers, self.triangulate, self.compress)
@@ -1218,7 +1235,7 @@ class EXPORT_OT_x3d(bpy.types.Operator):
        
        def invoke(self, context, event):
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
 
 bpy.ops.add(EXPORT_OT_x3d)
index da0634a..62612cc 100644 (file)
@@ -1,3 +1,20 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
 
 __author__= ['Bob Holcomb', 'Richard L?rk?ng', 'Damien McGinnes', 'Campbell Barton', 'Mario Lapin']
 __url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/")
@@ -1121,22 +1138,22 @@ else:
        print 'TOTAL TIME: %.6f' % (Blender.sys.time() - TIME)
 
 '''
+from bpy.props import *
+
 
 class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
        '''Import from 3DS file format (.3ds)'''
-       __idname__ = "import.autodesk_3ds"
-       __label__ = 'Import 3DS'
+       bl_idname = "import.autodesk_3ds"
+       bl_label = 'Import 3DS'
        
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
+       
+       path = StringProperty(name="File Path", description="File path used for importing the 3DS file", maxlen= 1024, default= ""),
 
-       __props__ = [
-               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for importing the 3DS file", maxlen= 1024, default= ""),
-
-#              bpy.props.FloatProperty(attr="size_constraint", name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0),
-#              bpy.props.BoolProperty(attr="search_images", name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True),
-#              bpy.props.BoolProperty(attr="apply_matrix", name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
-       ]
+#      size_constraint = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0),
+#      search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True),
+#      apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
        
        def execute(self, context):
                load_3ds(self.path, context, 0.0, False, False)
@@ -1144,7 +1161,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
        
        def invoke(self, context, event):
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
 
 bpy.ops.add(IMPORT_OT_autodesk_3ds)
index a557e44..e5e0dc3 100644 (file)
@@ -1,3 +1,20 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
 
 __author__= "Campbell Barton", "Jiri Hnidek", "Paolo Ciccone"
 __url__= ['http://wiki.blender.org/index.php/Scripts/Manual/Import/wavefront_obj', 'blender.org', 'blenderartists.org']
@@ -1553,31 +1570,33 @@ else:
        print 'TOTAL TIME: %.6f' % (sys.time() - TIME)
 '''
 
+from bpy.props import *
+
 class IMPORT_OT_obj(bpy.types.Operator):
        '''Load a Wavefront OBJ File.'''
-       __idname__ = "import.obj"
-       __label__ = "Import OBJ"
+       bl_idname = "import.obj"
+       bl_label = "Import OBJ"
        
        # List of operator properties, the attributes will be assigned
        # to the class instance from the operator settings before calling.
        
-       __props__ = [
-               bpy.props.StringProperty(attr="path", name="File Path", description="File path used for importing the OBJ file", maxlen= 1024, default= ""),
-
-               bpy.props.BoolProperty(attr="CREATE_SMOOTH_GROUPS", name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True),
-               bpy.props.BoolProperty(attr="CREATE_FGONS", name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True),
-               bpy.props.BoolProperty(attr="CREATE_EDGES", name="Lines as Edges", description="Import lines and faces with 2 verts as edge", default= True),
-               bpy.props.BoolProperty(attr="SPLIT_OBJECTS", name="Object", description="Import OBJ Objects into Blender Objects", default= True),
-               bpy.props.BoolProperty(attr="SPLIT_GROUPS", name="Group", description="Import OBJ Groups into Blender Objects", default= True),
-               bpy.props.BoolProperty(attr="SPLIT_MATERIALS", name="Material", description="Import each material into a seperate mesh (Avoids > 16 per mesh error)", default= True),
-               # old comment: only used for user feedback
-               # disabled this option because in old code a handler for it disabled SPLIT* params, it's not passed to load_obj
-               # bpy.props.BoolProperty(attr="KEEP_VERT_ORDER", name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True),
-               bpy.props.BoolProperty(attr="ROTATE_X90", name="-X90", description="Rotate X 90.", default= True),
-               bpy.props.FloatProperty(attr="CLAMP_SIZE", name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.01, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0),
-               bpy.props.BoolProperty(attr="POLYGROUPS", name="Poly Groups", description="Import OBJ groups as vertex groups.", default= True),
-               bpy.props.BoolProperty(attr="IMAGE_SEARCH", name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default= True),
-       ]
+       
+       path = StringProperty(name="File Path", description="File path used for importing the OBJ file", maxlen= 1024, default= "")
+
+       CREATE_SMOOTH_GROUPS = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True)
+       CREATE_FGONS = BoolProperty(name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True)
+       CREATE_EDGES = BoolProperty(name="Lines as Edges", description="Import lines and faces with 2 verts as edge", default= True)
+       SPLIT_OBJECTS = BoolProperty(name="Object", description="Import OBJ Objects into Blender Objects", default= True)
+       SPLIT_GROUPS = BoolProperty(name="Group", description="Import OBJ Groups into Blender Objects", default= True)
+       SPLIT_MATERIALS = BoolProperty(name="Material", description="Import each material into a seperate mesh (Avoids > 16 per mesh error)", default= True)
+       # old comment: only used for user feedback
+       # disabled this option because in old code a handler for it disabled SPLIT* params, it's not passed to load_obj
+       # KEEP_VERT_ORDER = BoolProperty(name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True)
+       ROTATE_X90 = BoolProperty(name="-X90", description="Rotate X 90.", default= True)
+       CLAMP_SIZE = FloatProperty(name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.01, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0)
+       POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default= True)
+       IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default= True)
+       
        
        def execute(self, context):
                # print("Selected: " + context.active_object.name)
@@ -1599,7 +1618,7 @@ class IMPORT_OT_obj(bpy.types.Operator):
        
        def invoke(self, context, event):       
                wm = context.manager
-               wm.add_fileselect(self.__operator__)
+               wm.add_fileselect(self)
                return ('RUNNING_MODAL',)
 
 
index f6fafc4..04543cb 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 # import Blender
 import time, functools
 import bpy
@@ -620,15 +638,14 @@ def main(context):
 class MESH_OT_skin(bpy.types.Operator):
        '''Bridge face loops.'''
        
-       __idname__ = "mesh.skin"
-       __label__ = "Add Torus"
-       __register__ = True
-       __undo__ = True
+       bl_idname = "mesh.skin"
+       bl_label = "Add Torus"
+       bl_register = True
+       bl_undo = True
        
        '''
-       __props__ = [
-               bpy.props.EnumProperty(attr="loft_method", items=[(), ()], description="", default= True),
-       ]
+       loft_method = EnumProperty(attr="loft_method", items=[(), ()], description="", default= True)
+       
        '''
        
        def execute(self, context):
index 4a1dd22..be3d25d 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 # This directory is a Python package.
 
 import model
@@ -14,6 +32,7 @@ import ui
 
 import bpy
 
-bpy.data.netrender_jobs = []
-bpy.data.netrender_slaves = []
-bpy.data.netrender_blacklist = []
\ No newline at end of file
+bpy.netrender_jobs = []
+bpy.netrender_slaves = []
+bpy.netrender_blacklist = []
+
index 637dd5f..f093815 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import time
 
 from netrender.utils import *
index d4a7b24..8694d77 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 import sys, os, re
 import http, http.client, http.server, urllib
@@ -159,8 +177,8 @@ def requestResult(conn, job_id, frame):
 
 @rnaType
 class NetworkRenderEngine(bpy.types.RenderEngine):
-       __idname__ = 'NET_RENDER'
-       __label__ = "Network Render"
+       bl_idname = 'NET_RENDER'
+       bl_label = "Network Render"
        def render(self, scene):
                if scene.network_render.mode == "RENDER_CLIENT":
                        self.render_client(scene)
index 1c83e75..7abca02 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import sys, os
 import http, http.client, http.server, urllib, socket
 import subprocess, shutil, time, hashlib
index 545659e..2fc6cd6 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import re
 
 from netrender.utils import *
index bef6f0e..cf13fe1 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import sys, os
 import http, http.client, http.server, urllib
 import subprocess, shutil, time, hashlib
index e46b0c7..8f727ca 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 import sys, os
 import http, http.client, http.server, urllib, socket
@@ -10,13 +28,8 @@ import netrender.model
 @rnaOperator
 class RENDER_OT_netclientanim(bpy.types.Operator):
        '''Start rendering an animation on network'''
-       __idname__ = "render.netclientanim"
-       __label__ = "Animation on network"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientanim"
+       bl_label = "Animation on network"
        
        def poll(self, context):
                return True
@@ -41,13 +54,8 @@ class RENDER_OT_netclientanim(bpy.types.Operator):
 @rnaOperator
 class RENDER_OT_netclientsend(bpy.types.Operator):
        '''Send Render Job to the Network'''
-       __idname__ = "render.netclientsend"
-       __label__ = "Send job"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientsend"
+       bl_label = "Send job"
        
        def poll(self, context):
                return True
@@ -70,13 +78,8 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
 @rnaOperator
 class RENDER_OT_netclientstatus(bpy.types.Operator):
        '''Refresh the status of the current jobs'''
-       __idname__ = "render.netclientstatus"
-       __label__ = "Client Status"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientstatus"
+       bl_label = "Client Status"
        
        def poll(self, context):
                return True
@@ -96,10 +99,10 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
                        while(len(netsettings.jobs) > 0):
                                netsettings.jobs.remove(0)
                        
-                       bpy.data.netrender_jobs = []
+                       bpy.netrender_jobs = []
                        
                        for j in jobs:
-                               bpy.data.netrender_jobs.append(j)
+                               bpy.netrender_jobs.append(j)
                                netsettings.jobs.add()
                                job = netsettings.jobs[-1]
                                
@@ -115,13 +118,8 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
 @rnaOperator
 class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
        '''Operator documentation text, will be used for the operator tooltip and python docs.'''
-       __idname__ = "render.netclientblacklistslave"
-       __label__ = "Client Blacklist Slave"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientblacklistslave"
+       bl_label = "Client Blacklist Slave"
        
        def poll(self, context):
                return True
@@ -132,8 +130,8 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
                if netsettings.active_slave_index >= 0:
                        
                        # deal with data
-                       slave = bpy.data.netrender_slaves.pop(netsettings.active_slave_index)
-                       bpy.data.netrender_blacklist.append(slave)
+                       slave = bpy.netrender_slaves.pop(netsettings.active_slave_index)
+                       bpy.netrender_blacklist.append(slave)
                        
                        # deal with rna
                        netsettings.slaves_blacklist.add()
@@ -150,13 +148,8 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
 @rnaOperator
 class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
        '''Operator documentation text, will be used for the operator tooltip and python docs.'''
-       __idname__ = "render.netclientwhitelistslave"
-       __label__ = "Client Whitelist Slave"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientwhitelistslave"
+       bl_label = "Client Whitelist Slave"
        
        def poll(self, context):
                return True
@@ -167,8 +160,8 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
                if netsettings.active_blacklisted_slave_index >= 0:
                        
                        # deal with data
-                       slave = bpy.data.netrender_blacklist.pop(netsettings.active_blacklisted_slave_index)
-                       bpy.data.netrender_slaves.append(slave)
+                       slave = bpy.netrender_blacklist.pop(netsettings.active_blacklisted_slave_index)
+                       bpy.netrender_slaves.append(slave)
                        
                        # deal with rna
                        netsettings.slaves.add()
@@ -186,13 +179,8 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
 @rnaOperator
 class RENDER_OT_netclientslaves(bpy.types.Operator):
        '''Refresh status about available Render slaves'''
-       __idname__ = "render.netclientslaves"
-       __label__ = "Client Slaves"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientslaves"
+       bl_label = "Client Slaves"
        
        def poll(self, context):
                return True
@@ -212,17 +200,17 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
                        while(len(netsettings.slaves) > 0):
                                netsettings.slaves.remove(0)
                        
-                       bpy.data.netrender_slaves = []
+                       bpy.netrender_slaves = []
                        
                        for s in slaves:
-                               for i in range(len(bpy.data.netrender_blacklist)):
-                                       slave = bpy.data.netrender_blacklist[i]
+                               for i in range(len(bpy.netrender_blacklist)):
+                                       slave = bpy.netrender_blacklist[i]
                                        if slave.id == s.id:
-                                               bpy.data.netrender_blacklist[i] = s
+                                               bpy.netrender_blacklist[i] = s
                                                netsettings.slaves_blacklist[i].name = s.name
                                                break
                                else:
-                                       bpy.data.netrender_slaves.append(s)
+                                       bpy.netrender_slaves.append(s)
                                        
                                        netsettings.slaves.add()
                                        slave = netsettings.slaves[-1]
@@ -236,13 +224,8 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
 @rnaOperator
 class RENDER_OT_netclientcancel(bpy.types.Operator):
        '''Cancel the selected network rendering job.'''
-       __idname__ = "render.netclientcancel"
-       __label__ = "Client Cancel"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientcancel"
+       bl_label = "Client Cancel"
        
        def poll(self, context):
                netsettings = context.scene.network_render
@@ -253,7 +236,7 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
                conn = clientConnection(context.scene)
                
                if conn:
-                       job = bpy.data.netrender_jobs[netsettings.active_job_index]
+                       job = bpy.netrender_jobs[netsettings.active_job_index]
                        
                        conn.request("POST", "/cancel", headers={"job-id":job.id})
                        
@@ -270,13 +253,8 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
 @rnaOperator
 class RENDER_OT_netclientcancelall(bpy.types.Operator):
        '''Cancel all running network rendering jobs.'''
-       __idname__ = "render.netclientcancelall"
-       __label__ = "Client Cancel All"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientcancelall"
+       bl_label = "Client Cancel All"
        
        def poll(self, context):
                return True
@@ -302,13 +280,8 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
 @rnaOperator
 class netclientdownload(bpy.types.Operator):
        '''Download render results from the network'''
-       __idname__ = "render.netclientdownload"
-       __label__ = "Client Download"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientdownload"
+       bl_label = "Client Download"
        
        def poll(self, context):
                netsettings = context.scene.network_render
@@ -321,7 +294,7 @@ class netclientdownload(bpy.types.Operator):
                conn = clientConnection(context.scene)
                
                if conn:
-                       job = bpy.data.netrender_jobs[netsettings.active_job_index]
+                       job = bpy.netrender_jobs[netsettings.active_job_index]
                        
                        for frame in job.frames:
                                client.requestResult(conn, job.id, frame.number)
@@ -352,13 +325,8 @@ class netclientdownload(bpy.types.Operator):
 @rnaOperator
 class netclientscan(bpy.types.Operator):
        '''Operator documentation text, will be used for the operator tooltip and python docs.'''
-       __idname__ = "render.netclientscan"
-       __label__ = "Client Scan"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientscan"
+       bl_label = "Client Scan"
        
        def poll(self, context):
                return True
@@ -390,13 +358,8 @@ class netclientscan(bpy.types.Operator):
 @rnaOperator
 class netclientweb(bpy.types.Operator):
        '''Open new window with information about running rendering jobs'''
-       __idname__ = "render.netclientweb"
-       __label__ = "Open Master Monitor"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       __props__ = []
+       bl_idname = "render.netclientweb"
+       bl_label = "Open Master Monitor"
        
        def poll(self, context):
                return True
index 15ca6fa..882af76 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import sys, os, platform
 import http, http.client, http.server, urllib
 import subprocess, time
index 7d7f3c2..df75c17 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 import sys, os
 import http, http.client, http.server, urllib
@@ -18,9 +36,9 @@ DONE = 2
 ERROR = 3
 
 class RenderButtonsPanel(bpy.types.Panel):
-       __space_type__ = "PROPERTIES"
-       __region_type__ = "WINDOW"
-       __context__ = "render"
+       bl_space_type = "PROPERTIES"
+       bl_region_type = "WINDOW"
+       bl_context = "render"
        # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
        
        def poll(self, context):
@@ -30,7 +48,7 @@ class RenderButtonsPanel(bpy.types.Panel):
 # Setting panel, use in the scene for now.
 @rnaType
 class RENDER_PT_network_settings(RenderButtonsPanel):
-       __label__ = "Network Settings"
+       bl_label = "Network Settings"
        COMPAT_ENGINES = set(['NET_RENDER'])
 
        def draw(self, context):
@@ -56,7 +74,7 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
 
 @rnaType
 class RENDER_PT_network_job(RenderButtonsPanel):
-       __label__ = "Job Settings"
+       bl_label = "Job Settings"
        COMPAT_ENGINES = set(['NET_RENDER'])
        
        def poll(self, context):
@@ -84,7 +102,7 @@ class RENDER_PT_network_job(RenderButtonsPanel):
 
 @rnaType
 class RENDER_PT_network_slaves(RenderButtonsPanel):
-       __label__ = "Slaves Status"
+       bl_label = "Slaves Status"
        COMPAT_ENGINES = set(['NET_RENDER'])
        
        def poll(self, context):
@@ -104,14 +122,14 @@ class RENDER_PT_network_slaves(RenderButtonsPanel):
                sub.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
                sub.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
                
-               if len(bpy.data.netrender_slaves) == 0 and len(netsettings.slaves) > 0:
+               if len(bpy.netrender_slaves) == 0 and len(netsettings.slaves) > 0:
                        while(len(netsettings.slaves) > 0):
                                netsettings.slaves.remove(0)
                
                if netsettings.active_slave_index >= 0 and len(netsettings.slaves) > 0:
                        layout.itemS()
                        
-                       slave = bpy.data.netrender_slaves[netsettings.active_slave_index]
+                       slave = bpy.netrender_slaves[netsettings.active_slave_index]
 
                        layout.itemL(text="Name: " + slave.name)
                        layout.itemL(text="Address: " + slave.address[0])
@@ -120,7 +138,7 @@ class RENDER_PT_network_slaves(RenderButtonsPanel):
 
 @rnaType
 class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
-       __label__ = "Slaves Blacklist"
+       bl_label = "Slaves Blacklist"
        COMPAT_ENGINES = set(['NET_RENDER'])
        
        def poll(self, context):
@@ -139,14 +157,14 @@ class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
                sub = row.column(align=True)
                sub.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
 
-               if len(bpy.data.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
+               if len(bpy.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
                        while(len(netsettings.slaves_blacklist) > 0):
                                netsettings.slaves_blacklist.remove(0)
                
                if netsettings.active_blacklisted_slave_index >= 0 and len(netsettings.slaves_blacklist) > 0:
                        layout.itemS()
                        
-                       slave = bpy.data.netrender_blacklist[netsettings.active_blacklisted_slave_index]
+                       slave = bpy.netrender_blacklist[netsettings.active_blacklisted_slave_index]
 
                        layout.itemL(text="Name: " + slave.name)
                        layout.itemL(text="Address: " + slave.address[0])
@@ -155,7 +173,7 @@ class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
 
 @rnaType
 class RENDER_PT_network_jobs(RenderButtonsPanel):
-       __label__ = "Jobs"
+       bl_label = "Jobs"
        COMPAT_ENGINES = set(['NET_RENDER'])
        
        def poll(self, context):
@@ -177,14 +195,14 @@ class RENDER_PT_network_jobs(RenderButtonsPanel):
                sub.itemO("render.netclientcancelall", icon="ICON_PANEL_CLOSE", text="")
                sub.itemO("render.netclientdownload", icon='ICON_RENDER_ANIMATION', text="")
 
-               if len(bpy.data.netrender_jobs) == 0 and len(netsettings.jobs) > 0:
+               if len(bpy.netrender_jobs) == 0 and len(netsettings.jobs) > 0:
                        while(len(netsettings.jobs) > 0):
                                netsettings.jobs.remove(0)
                
                if netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0:
                        layout.itemS()
                        
-                       job = bpy.data.netrender_jobs[netsettings.active_job_index]
+                       job = bpy.netrender_jobs[netsettings.active_job_index]
 
                        layout.itemL(text="Name: %s" % job.name)
                        layout.itemL(text="Length: %04i" % len(job))
index b10648b..a16043d 100644 (file)
@@ -1,3 +1,21 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 import sys, os
 import re
diff --git a/release/scripts/io/vertexpaint_dirt.py b/release/scripts/io/vertexpaint_dirt.py
new file mode 100644 (file)
index 0000000..9f55d3b
--- /dev/null
@@ -0,0 +1,189 @@
+# bl_author = ["Campbell Barton aka ideasman42", "Keith Boshoff aka Wahooney"]
+# bl_url = ["www.blender.org", "blenderartists.org", "www.python.org"]
+# bl_version = "0.2"
+
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# Script copyright (C) Campbell J Barton
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+# History
+#
+# 2009-11-01: * 2.5 port by Keith "Wahooney" Boshoff
+#              * Replaced old method with my own, speed is similar (about 0.001 sec on Suzanne)
+#               but results are far more accurate
+#
+
+import bpy
+import Mathutils
+import math
+import time
+
+from Mathutils import Vector
+from bpy.props import *
+
+def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, dirt_only, sel_only):
+##    Window.WaitCursor(1)
+
+    #BPyMesh.meshCalcNormals(me)
+
+    vert_tone= [0.0] * len(me.verts)
+    vert_tone_count= [0] * len(me.verts)
+
+    # create lookup table for each vertex's connected vertices (via edges)
+    con = [[] for i in range(len(me.verts))]
+
+    min_tone=180.0
+    max_tone=0.0
+
+    # add connected verts
+    for e in me.edges:
+        con[e.verts[0]].append(e.verts[1])
+        con[e.verts[1]].append(e.verts[0])
+
+    for v in me.verts:
+        vec = Vector()
+        no = v.normal
+        co = v.co
+
+        # get the direction of the vectors between the vertex and it's connected vertices
+        for c in con[v.index]:
+            vec += Vector(me.verts[c].co - co).normalize()
+
+        # normalize the vector by dividing by the number of connected verts
+        vec /= len(con[v.index])
+
+        # angle is the acos of the dot product between vert and connected verts normals
+        ang = math.acos(no.dot(vec))
+
+        # enforce min/max
+
+        vert_tone[v.index] = max(clamp_clean, min(clamp_dirt, ang))
+
+    # average vert_tone_list into vert_tonef
+#    for i, tones in enumerate(vert_tone):
+#        if vert_tone_count[i]:
+#            vert_tone[i] = vert_tone[i] / vert_tone_count[i]
+
+    # Below we use edges to blur along so the edges need counting, not the faces
+    vert_tone_count=    [0] *    len(me.verts)
+    for ed in me.edges:
+        vert_tone_count[ed.verts[0]] += 1
+        vert_tone_count[ed.verts[1]] += 1
+
+
+    # Blur tone
+    blur        = blur_strength
+    blur_inv    = 1.0 - blur_strength
+
+    for i in range(blur_iterations):
+
+        # backup the original tones
+        orig_vert_tone= list(vert_tone)
+
+        for ed in me.edges:
+
+            i1 = ed.verts[0]
+            i2 = ed.verts[1]
+
+            val1 = (orig_vert_tone[i2]*blur) +  (orig_vert_tone[i1]*blur_inv)
+            val2 = (orig_vert_tone[i1]*blur) +  (orig_vert_tone[i2]*blur_inv)
+
+            # Apply the ton divided by the number of faces connected
+            vert_tone[i1] += val1 / max(vert_tone_count[i1], 1)
+            vert_tone[i2] += val2 / max(vert_tone_count[i2], 1)
+
+
+    min_tone= min(vert_tone)
+    max_tone= max(vert_tone)
+
+    print(min_tone)
+    print(max_tone)
+    print(clamp_clean)
+    print(clamp_dirt)
+
+    tone_range= max_tone-min_tone
+    if max_tone==min_tone:
+        return
+
+    for lay in me.vertex_colors:
+        if lay.active:
+            active_col_layer = lay.data
+
+    if not active_col_layer:
+        return('CANCELLED', )
+
+    for i, f in enumerate(me.faces):
+        if not sel_only or f.sel:
+            f_col = active_col_layer[i]
+
+            f_col = [f_col.color1, f_col.color2, f_col.color3, f_col.color4]
+
+            for j, v in enumerate(f.verts):
+                col = f_col[j]
+                tone = vert_tone[me.verts[v].index]
+                tone = (tone-min_tone)/tone_range
+
+                col[0] = tone*col[0]
+                col[1] = tone*col[1]
+                col[2] = tone*col[2]
+
+##    Window.WaitCursor(0)
+
+
+class VertexPaintDirt(bpy.types.Operator):
+    '''This script uses the concavity of vertices to shade the mesh, and optionaly blur the shading to remove artifacts from spesific edges.'''
+
+    bl_idname = "mesh.vertex_paint_dirt"
+    bl_label = "Dirty Vertex Colors"
+    bl_register = True
+    bl_undo = True
+
+    blur_strength = FloatProperty(name="Blur Strength", description="Blur strength per iteration", default=1.0, min=0.01, max=1.0)
+    blur_iterations = IntProperty(name="Blur Iterations", description="Number times to blur the colors. (higher blurs more)", default=1, min=0, max=40)
+    clean_angle = FloatProperty(name="Highlight Angle", description="Less then 90 limits the angle used in the tonal range", default=0.0, min=0.0, max=180.0)
+    dirt_angle = FloatProperty(name="Dirt Angle", description="Less then 90 limits the angle used in the tonal range", default=180.0, min=0.0, max=180.0)
+    dirt_only = BoolProperty(name="Dirt Only", description="Dont calculate cleans for convex areas", default=False)
+    sel_faces_only = BoolProperty(name="Selected Faces Only", description="Only apply to UV/Face selected faces (mix vpain/uvface select)", default=False)
+
+    def execute(self, context):
+        sce= context.scene
+        ob= context.object
+
+        if not ob or ob.type != 'MESH':
+            print('Error, no active mesh object, aborting.')
+            print(ob)
+            print(ob.type)
+            return('CANCELLED',)
+
+        me = ob.data
+
+        t = time.time()
+
+        applyVertexDirt(me, self.blur_iterations, self.blur_strength, math.radians(self.dirt_angle), math.radians(self.clean_angle), self.dirt_only, self.sel_faces_only)
+
+        print('done in %.6f' % (time.time()-t))
+
+        return('FINISHED',)
+
+
+bpy.ops.add(VertexPaintDirt)
+
+if __name__ == "__main__":
+    bpy.ops.mesh.vertex_paint_dirt()
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
index a842318..203e50b 100644 (file)
@@ -1,4 +1,22 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 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
+class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]
index a20a5ff..4198205 100644 (file)
@@ -1 +1,19 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy_ext.Object
index fbb4a8b..c308696 100644 (file)
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
 # for slightly faster access
-from bpy.__ops__ import add            as op_add
-from bpy.__ops__ import remove         as op_remove
-from bpy.__ops__ import dir            as op_dir
-from bpy.__ops__ import call           as op_call
-from bpy.__ops__ import as_string      as op_as_string
-from bpy.__ops__ import get_rna        as op_get_rna
+from bpy.__ops__ import add        as op_add
+from bpy.__ops__ import remove     as op_remove
+from bpy.__ops__ import dir        as op_dir
+from bpy.__ops__ import call       as op_call
+from bpy.__ops__ import as_string  as op_as_string
+from bpy.__ops__ import get_rna    as op_get_rna
 
 # Keep in sync with WM_types.h
 context_dict = {
-       'INVOKE_DEFAULT':0,
-       'INVOKE_REGION_WIN':1,
-       'INVOKE_AREA':2,
-       'INVOKE_SCREEN':3,
-       'EXEC_DEFAULT':4,
-       'EXEC_REGION_WIN':5,
-       'EXEC_AREA':6,
-       'EXEC_SCREEN':7,
+    'INVOKE_DEFAULT': 0,
+    'INVOKE_REGION_WIN': 1,
+    'INVOKE_AREA': 2,
+    'INVOKE_SCREEN': 3,
+    'EXEC_DEFAULT': 4,
+    'EXEC_REGION_WIN': 5,
+    'EXEC_AREA': 6,
+    'EXEC_SCREEN': 7,
 }
 
+
 class bpy_ops(object):
-       '''
-       Fake module like class.
-
-        bpy.ops
-       '''
-
-       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()
-               
-               # add this classes functions
-               for id_name in dir(self.__class__):
-                       if not id_name.startswith('__'):
-                               submodules.add(id_name)
-               
-               for id_name in op_dir():
-                       id_split = id_name.split('_OT_', 1)
-                       
-                       if len(id_split) == 2:
-                               submodules.add(id_split[0].lower())
-                       else:
-                               submodules.add(id_split[0])
-               
-               return list(submodules)
-               
-       def __repr__(self):
-               return "<module like class 'bpy.ops'>"
+    '''
+    Fake module like class.
+
+     bpy.ops
+    '''
+
+    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()
+
+        # add this classes functions
+        for id_name in dir(self.__class__):
+            if not id_name.startswith('__'):
+                submodules.add(id_name)
+
+        for id_name in op_dir():
+            id_split = id_name.split('_OT_', 1)
+
+            if len(id_split) == 2:
+                submodules.add(id_split[0].lower())
+            else:
+                submodules.add(id_split[0])
+
+        return list(submodules)
+
+    def __repr__(self):
+        return "<module like class 'bpy.ops'>"
 
 
 class bpy_ops_submodule(object):
-       '''
-       Utility class to fake submodules.
-       
-       eg. bpy.ops.object
-       '''
-       __keys__ = ('module',)
-       
-       def __init__(self, module):
-               self.module = module
-               
-       def __getattr__(self, func):
-               '''
-               gets a bpy.ops.submodule function
-               '''
-               return bpy_ops_submodule_op(self.module, func)
-               
-       def __dir__(self):
-               
-               functions = set()
-               
-               module_upper = self.module.upper()
-               
-               for id_name in op_dir():
-                       id_split = id_name.split('_OT_', 1)
-                       if len(id_split) == 2 and module_upper == id_split[0]:
-                               functions.add(id_split[1])
-               
-               return list(functions)
-       
-       def __repr__(self):
-               return "<module like class 'bpy.ops.%s'>" % self.module
+    '''
+    Utility class to fake submodules.
+
+    eg. bpy.ops.object
+    '''
+    __keys__ = ('module',)
+
+    def __init__(self, module):
+        self.module = module
+
+    def __getattr__(self, func):
+        '''
+        gets a bpy.ops.submodule function
+        '''
+        if func.startswith('__'):
+            raise AttributeError(func)
+        return bpy_ops_submodule_op(self.module, func)
+
+    def __dir__(self):
+
+        functions = set()
+
+        module_upper = self.module.upper()
+
+        for id_name in op_dir():
+            id_split = id_name.split('_OT_', 1)
+            if len(id_split) == 2 and module_upper == id_split[0]:
+                functions.add(id_split[1])
+
+        return list(functions)
+
+    def __repr__(self):
+        return "<module like class 'bpy.ops.%s'>" % self.module
+
 
 class bpy_ops_submodule_op(object):
-       '''
-       Utility class to fake submodule operators.
-       
-       eg. bpy.ops.object.somefunc
-       '''
-       __keys__ = ('module', 'func')
-       def __init__(self, module, func):
-               self.module = module
-               self.func = func
-       
-       def idname(self):
-               # submod.foo -> SUBMOD_OT_foo
-               return self.module.upper() + '_OT_' + self.func
-       
-       def __call__(self, *args, **kw):
-               
-               # Get the operator from blender
-               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[C_exec]
-                       except:
-                               raise ValueError("Expected a single context argument in: " + str(list(context_dict.keys())))
-                       
-                       if len(args) == 2:
-                               C_dict= args[1]
-                       
-                       return op_call(self.idname() , C_dict, kw, context)
-               
-               else:
-                       return op_call(self.idname(), C_dict, kw)
-       
-       def get_rna(self):
-               '''
-               currently only used for '__rna__'
-               '''
-               return op_get_rna(self.idname())
-                       
-       
-       def __repr__(self): # useful display, repr(op)
-               return op_as_string(self.idname())
-       
-       def __str__(self): # used for print(...)
-               return "<function bpy.ops.%s.%s at 0x%x'>" % (self.module, self.func, id(self))
+    '''
+    Utility class to fake submodule operators.
+
+    eg. bpy.ops.object.somefunc
+    '''
+
+    __keys__ = ('module', 'func')
+
+    def __init__(self, module, func):
+        self.module = module
+        self.func = func
+
+    def idname(self):
+        # submod.foo -> SUBMOD_OT_foo
+        return self.module.upper() + '_OT_' + self.func
+
+    def __call__(self, *args, **kw):
+
+        # Get the operator from blender
+        if len(args) > 2:
+            raise ValueError("1 or 2 args 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[C_exec]
+            except:
+                raise ValueError("Expected a single context argument in: " + \
+                 str(list(context_dict.keys())))
+
+            if len(args) == 2:
+                C_dict = args[1]
+
+            return op_call(self.idname(), C_dict, kw, context)
+
+        else:
+            return op_call(self.idname(), C_dict, kw)
+
+    def get_rna(self):
+        '''
+        currently only used for 'bl_rna'
+        '''
+        return op_get_rna(self.idname())
+
+    def __repr__(self): # useful display, repr(op)
+        return op_as_string(self.idname())
+
+    def __str__(self): # used for print(...)
+        return "<function bpy.ops.%s.%s at 0x%x'>" % \
+                (self.module, self.func, id(self))
 
 import bpy
 bpy.ops = bpy_ops()
 
 # TODO, C macro's cant define settings :|
 
+from bpy.props import *
+
+
 class MESH_OT_delete_edgeloop(bpy.types.Operator):
-       '''Export a single object as a stanford PLY with normals, colours and texture coordinates.'''
-       __idname__ = "mesh.delete_edgeloop"
-       __label__ = "Delete Edge Loop"
-       
-       def execute(self, context):
-               bpy.ops.tfm.edge_slide(value=1.0)
-               bpy.ops.mesh.select_more()
-               bpy.ops.mesh.remove_doubles()
-               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)
+    '''Export a single object as a stanford PLY with normals,
+    colours and texture coordinates.'''
+    bl_idname = "mesh.delete_edgeloop"
+    bl_label = "Delete Edge Loop"
+
+    def execute(self, context):
+        bpy.ops.tfm.edge_slide(value=1.0)
+        bpy.ops.mesh.select_more()
+        bpy.ops.mesh.remove_doubles()
+        return ('FINISHED',)
+
+rna_path_prop = StringProperty(name="Context Attributes",
+        description="rna context string", maxlen=1024, default="")
+
+rna_reverse_prop = BoolProperty(name="Reverse",
+        description="Cycle backwards", default=False)
+
 
 class NullPathMember:
-       pass
+    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
-               
-       
+    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',)
+    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)]
-       execute = execute_context_assign
+    '''Set a context value.'''
+    bl_idname = "wm.context_set_boolean"
+    bl_label = "Context Set"
+
+    path = rna_path_prop
+    value = BoolProperty(name="Value",
+            description="Assignment value", default=True)
+
+    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)]
-       execute = execute_context_assign
-               
+    '''Set a context value.'''
+    bl_idname = "wm.context_set_int"
+    bl_label = "Context Set"
+
+    path = rna_path_prop
+    value = IntProperty(name="Value", description="Assign value", default=0)
+
+    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)]
-       execute = execute_context_assign
+    '''Set a context value.'''
+    bl_idname = "wm.context_set_int"
+    bl_label = "Context Set"
+
+    path = rna_path_prop
+    value = FloatProperty(name="Value",
+            description="Assignment value", default=0.0)
+
+    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= "")]
-       execute = execute_context_assign
+    '''Set a context value.'''
+    bl_idname = "wm.context_set_string"
+    bl_label = "Context Set"
+
+    path = rna_path_prop
+    value = StringProperty(name="Value",
+            description="Assign value", maxlen=1024, default="")
+
+    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= "")]
-       execute = execute_context_assign
+    '''Set a context value.'''
+    bl_idname = "wm.context_set_enum"
+    bl_label = "Context Set"
+
+    path = rna_path_prop
+    value = StringProperty(name="Value",
+            description="Assignment value (as a string)",
+            maxlen=1024, default="")
+
+    execute = execute_context_assign
+
 
 class WM_OT_context_toggle(bpy.types.Operator):
-       '''Toggle a context value.'''
-       __idname__ = "wm.context_toggle"
-       __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',)
+    '''Toggle a context value.'''
+    bl_idname = "wm.context_toggle"
+    bl_label = "Context Toggle"
+    path = 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))
+        return ('FINISHED',)
+
 
 class WM_OT_context_toggle_enum(bpy.types.Operator):
-       '''Toggle a context value.'''
-       __idname__ = "wm.context_toggle_enum"
-       __label__ = "Context Toggle Values"
-       __props__ = [
-               rna_path_prop,
-               bpy.props.StringProperty(attr="value_1", name="Value", description="Toggle enum", maxlen= 1024, default= ""),
-               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',)
+    '''Toggle a context value.'''
+    bl_idname = "wm.context_toggle_enum"
+    bl_label = "Context Toggle Values"
+
+    path = rna_path_prop
+    value_1 = StringProperty(name="Value", \
+                description="Toggle enum", maxlen=1024, default="")
+
+    value_2 = StringProperty(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))
+
+        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',)
+    '''Set a context value. Useful for cycling active material,
+    vertex keys, groups' etc.'''
+    bl_idname = "wm.context_cycle_int"
+    bl_label = "Context Int Cycle"
+    path = rna_path_prop
+    reverse = 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, rna_reverse_prop]
-       def execute(self, context):
-               
-               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)
-               i = rna_prop_str.find('[')
-               if i != -1: rna_prop_str = rna_prop_str[0:i] # just incse we get "context.foo.bar[0]"
-               
-               rna_struct = eval("context.%s.rna_type" % rna_struct_str)
-               
-               rna_prop = rna_struct.properties[rna_prop_str]
-               
-               if type(rna_prop) != bpy.types.EnumProperty:
-                       raise Exception("expected an enum property")
-               
-               enums = rna_struct.properties[rna_prop_str].items.keys()
-               orig_index = enums.index(orig_value)
-               
-               # Have the info we need, advance to the next item
-               if self.reverse:
-                       if orig_index==0:                       advance_enum = enums[-1]
-                       else:                                   advance_enum = enums[orig_index-1]
-               else:
-                       if orig_index==len(enums)-1:    advance_enum = enums[0]
-                       else:                                   advance_enum = enums[orig_index+1]
-               
-               # set the new value
-               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= "")
+    '''Toggle a context value.'''
+    bl_idname = "wm.context_cycle_enum"
+    bl_label = "Context Enum Cycle"
+
+    path = rna_path_prop
+    reverse = rna_reverse_prop
+
+    def execute(self, context):
+
+        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)
+        i = rna_prop_str.find('[')
+
+        # just incse we get "context.foo.bar[0]"
+        if i != -1:
+            rna_prop_str = rna_prop_str[0:i]
+
+        rna_struct = eval("context.%s.rna_type" % rna_struct_str)
+
+        rna_prop = rna_struct.properties[rna_prop_str]
+
+        if type(rna_prop) != bpy.types.EnumProperty:
+            raise Exception("expected an enum property")
+
+        enums = rna_struct.properties[rna_prop_str].items.keys()
+        orig_index = enums.index(orig_value)
+
+        # Have the info we need, advance to the next item
+        if self.reverse:
+            if orig_index == 0:
+                advance_enum = enums[-1]
+            else:
+                advance_enum = enums[orig_index-1]
+        else:
+            if orig_index == len(enums) - 1:
+                advance_enum = enums[0]
+            else:
+                advance_enum = enums[orig_index + 1]
+
+        # set the new value
+        exec("context.%s=advance_enum" % self.path)
+        return ('FINISHED',)
+
+doc_id = StringProperty(name="Doc ID",
+        description="ID for the documentation", maxlen=1024, default="")
+
+doc_new = StringProperty(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',)
+    '''Load online reference docs'''
+    bl_idname = "wm.doc_view"
+    bl_label = "View Documentation"
+
+    doc_id = 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).bl_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('.')
+        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
+
+            # It so happens that epydoc nests these
+            class_name_full = self._nested_class_string(class_name)
+
+            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',)
+    '''Load online reference docs'''
+    bl_idname = "wm.doc_edit"
+    bl_label = "Edit Documentation"
+
+    doc_id = doc_id
+    doc_new = doc_new
+
+    _url = "http://www.mindrones.com/blender/svn/xmlrpc.php"
+
+    def _send_xmlrpc(self, data_dict):
+        print("sending data:", data_dict)
+
+        import xmlrpc.client
+        user = 'blenderuser'
+        pwd = 'blender>user'
+
+        docblog = xmlrpc.client.ServerProxy(self._url)
+        docblog.metaWeblog.newPost(1, user, pwd, data_dict, 1)
+
+    def execute(self, context):
+
+        class_name, class_prop = self.doc_id.split('.')
+
+        if not self.doc_new:
+            return 'OPERATOR_CANCELLED'
+
+        # check if this is an operator
+        op_name = class_name.upper() + '_OT_' + class_prop
+        op_class = getattr(bpy.types, op_name, None)
+
+        # Upload this to the web server
+        upload = {}
+
+        if op_class:
+            rna = op_class.bl_rna
+            doc_orig = rna.description
+            if doc_orig == self.doc_new:
+                return 'OPERATOR_CANCELLED'
+
+            print("op - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
+            upload["title"] = 'OPERATOR %s:%s' % (self.doc_id, doc_orig)
+            upload["description"] = self.doc_new
+
+            self._send_xmlrpc(upload)
+
+        else:
+            rna = getattr(bpy.types, class_name).bl_rna
+            doc_orig = rna.properties[class_prop].description
+            if doc_orig == self.doc_new:
+                return 'OPERATOR_CANCELLED'
+
+            print("rna - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
+            upload["title"] = 'RNA %s:%s' % s(self.doc_id, doc_orig)
+
+        upload["description"] = self.doc_new
+
+        self._send_xmlrpc(upload)
+
+        return ('FINISHED',)
+
+    def invoke(self, context, event):
+        wm = context.manager
+        wm.invoke_props_popup(self, event)
+        return ('RUNNING_MODAL',)
 
 
 bpy.ops.add(MESH_OT_delete_edgeloop)
index e60e8b0..86f9c9d 100644 (file)
@@ -1,11 +1,29 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 import os
 
 def expandpath(path):
-       if path.startswith("//"):
-               return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
-       
-       return path
+    if path.startswith("//"):
+        return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
+
+    return path
 
 import types
 bpy.sys = types.ModuleType("bpy.sys")
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
index ce51dc9..8d124f2 100644 (file)
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
 import bpy
 
 def collect_baseclasses(_class, bases):
-       
-       if _class is type or _class is object:
-               return bases
-       
-       bases.append(_class)
-       for _superclass in _class.__bases__:
-               collect_baseclasses(_superclass, bases)
-       
-       return bases
+
+    if _class is type or _class is object:
+        return bases
+
+    bases.append(_class)
+    for _superclass in _class.__bases__:
+        collect_baseclasses(_superclass, bases)
+
+    return bases
 
 def collect_subclasses(_class, subs):
-       
-       if _class is type or _class is object:
-               return subs
-       
-       subs.append(_class)
-       for _subclass in _class.__subclasses__():
-               collect_subclasses(_subclass, subs)
-       
-       return subs
+
+    if _class is type or _class is object:
+        return subs
+
+    subs.append(_class)
+    for _subclass in _class.__subclasses__():
+        collect_subclasses(_subclass, subs)
+
+    return subs
 
 class DynMenu(bpy.types.Menu):
-       
-       def draw(self, context):
-               '''
-               This is a draw function that is used to call all subclasses draw functions
-               starting from the registered classes draw function and working down.
-               
-               DynMenu.setup() must be called first.
-               
-               Sort/group classes could be nice
-               '''
-               
-               subclass_ls = []
-               collect_subclasses(self.__class__, subclass_ls)
-               # print(subclass_ls)
-               
-               for subclass in subclass_ls:
-                       # print("drawwing", subclass) # , dir(subclass))
-                       subclass.internal_draw(self, context)
-                       # print("subclass.internal_draw", subclass.internal_draw)
+
+    def draw(self, context):
+        '''
+        This is a draw function that is used to call all subclasses draw functions
+        starting from the registered classes draw function and working down.
+
+        DynMenu.setup() must be called first.
+
+        Sort/group classes could be nice
+        '''
+
+        subclass_ls = []
+        collect_subclasses(self.__class__, subclass_ls)
+        # print(subclass_ls)
+
+        for subclass in subclass_ls:
+            # print("drawwing", subclass) # , dir(subclass))
+            subclass.internal_draw(self, context)
+            # print("subclass.internal_draw", subclass.internal_draw)
 
 def setup(menu_class):
-       '''
-       Setup subclasses (not needed when self.add() is used)
-       '''
-       bases = collect_baseclasses(menu_class, [])
-       
-       # Incase 'DynMenu' isnt last
-       while bases[-1] is not DynMenu:
-               bases.pop()
-       bases.pop() # remove 'DynMenu'
-       
-       root_class = bases[-1] # this is the registered class
-       
-       for subclass in collect_subclasses(root_class, []):
-               #print(subclass)
-               
-               draw = getattr(subclass, 'draw', None)
-               if draw and not hasattr(subclass, 'internal_draw'):
-                       # print("replace", subclass, draw)
-                       try:
-                               del subclass.draw
-                       except:
-                               pass
-                       subclass.internal_draw = draw
-                       
-       root_class.draw = DynMenu.draw
+    '''
+    Setup subclasses (not needed when self.add() is used)
+    '''
+    bases = collect_baseclasses(menu_class, [])
+
+    # Incase 'DynMenu' isnt last
+    while bases[-1] is not DynMenu:
+        bases.pop()
+    bases.pop() # remove 'DynMenu'
+
+    root_class = bases[-1] # this is the registered class
+
+    for subclass in collect_subclasses(root_class, []):
+        #print(subclass)
+
+        draw = getattr(subclass, 'draw', None)
+        if draw and not hasattr(subclass, 'internal_draw'):
+            # print("replace", subclass, draw)
+            try:
+                del subclass.draw
+            except:
+                pass
+            subclass.internal_draw = draw
+
+    root_class.draw = DynMenu.draw
 
 def add(menu_class, func):
-       '''
-       Add a single function directly without having to make a class
-       
-       important that the returned value should be stored in the module that called it.
-       '''
-       
-       newclass = type('<menuclass>', (menu_class,), {})
-       newclass.internal_draw = func
-       setup(menu_class)
-       return newclass
+    '''
+    Add a single function directly without having to make a class
+
+    important that the returned value should be stored in the module that called it.
+    '''
+
+    newclass = type('<menuclass>', (menu_class,), {})
+    newclass.internal_draw = func
+    setup(menu_class)
+    return newclass
 
 '''
 # so we dont need to import this module
diff --git a/release/scripts/templates/gamelogic.py b/release/scripts/templates/gamelogic.py
new file mode 100644 (file)
index 0000000..203a693
--- /dev/null
@@ -0,0 +1,96 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# 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..b3fe0a4
--- /dev/null
@@ -0,0 +1,32 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+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..c19ec7d
--- /dev/null
@@ -0,0 +1,44 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# 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..88e6a32
--- /dev/null
@@ -0,0 +1,73 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+import bpy
+
+def write_some_data(context, path, use_some_setting):
+    pass
+
+from bpy.props import *
+
+class ExportSomeData(bpy.types.Operator):
+    '''This appiers in the tooltip of the operator and in the generated docs.'''
+    bl_idname = "export.some_data" # this is important since its how bpy.ops.export.some_data is constructed
+    bl_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
+    path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
+    use_some_setting = BoolProperty(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) # will run self.execute()
+            return ('RUNNING_MODAL',)
+        else if 0:
+            # Redo popup
+            wm.invoke_props_popup(self, 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")
diff --git a/release/scripts/templates/operator_simple.py b/release/scripts/templates/operator_simple.py
new file mode 100644 (file)
index 0000000..6e166a3
--- /dev/null
@@ -0,0 +1,38 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+# 
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+# 
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+def main(context):
+    for ob in context.scene.objects:
+        print(ob)
+
+class SimpleOperator(bpy.types.Operator):
+    ''''''
+    bl_idname = "object.simple_operator"
+    bl_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()
diff --git a/release/scripts/ui/buttons_data_armature.py b/release/scripts/ui/buttons_data_armature.py
deleted file mode 100644 (file)
index 0fb00b0..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-
-import bpy
-class DataButtonsPanel(bpy.types.Panel):
-       __space_type__ = 'PROPERTIES'
-       __region_type__ = 'WINDOW'
-       __context__ = "data"
-       
-       def poll(self, context):
-               return context.armature
-
-class DATA_PT_context_arm(DataButtonsPanel):
-       __show_header__ = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               arm = context.armature
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif arm:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
-
-class DATA_PT_skeleton(DataButtonsPanel):
-       __label__ = "Skeleton"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               arm = context.armature
-               space = context.space_data
-               
-               layout.itemR(arm, "pose_position", expand=True)
-               
-               split = layout.split()
-
-               col = split.column()
-               col.itemL(text="Layers:")
-               col.itemR(arm, "layer", text="")
-               col.itemL(text="Protected Layers:")
-               col.itemR(arm, "layer_protection", text="")
-               
-               col = split.column()
-               col.itemL(text="Deform:")
-               col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
-               col.itemR(arm, "deform_envelope", text="Envelopes")
-               col.itemR(arm, "deform_quaternion", text="Quaternion")
-               col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
-               
-class DATA_PT_display(DataButtonsPanel):
-       __label__ = "Display"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               arm = context.armature
-
-               layout.row().itemR(arm, "drawtype", expand=True)
-
-               flow = layout.column_flow()
-               flow.itemR(arm, "draw_names", text="Names")
-               flow.itemR(arm, "draw_axes", text="Axes")
-               flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
-               flow.itemR(arm, "draw_group_colors", text="Colors")
-               flow.itemR(arm, "delay_deform", text="Delay Refresh")
-
-class DATA_PT_bone_groups(DataButtonsPanel):
-       __label__ = "Bone Groups"
-       
-       def poll(self, context):
-               return (context.object and context.object.type=='ARMATURE' and context.object.pose)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               pose = ob.pose
-               
-               row = layout.row()
-               row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
-               
-               col = row.column(align=True)
-               col.active = (ob.proxy == None)
-               col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
-               col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
-               
-               group = pose.active_bone_group
-               if group:
-                       col = layout.column()
-                       col.active= (ob.proxy == None)
-                       col.itemR(group, "name")
-                       
-                       split = layout.split(0.5)
-                       split.active= (ob.proxy == None)
-                       split.itemR(group, "color_set")
-                       if group.color_set:
-                               split.template_triColorSet(group, "colors")
-               
-               row = layout.row(align=True)
-               row.active = (ob.proxy == None)
-               
-               row.itemO("pose.group_assign", text="Assign")
-               row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
-               #row.itemO("object.bone_group_select", text="Select")
-               #row.itemO("object.bone_group_deselect", text="Deselect")
-
-class DATA_PT_paths(DataButtonsPanel):
-       __label__ = "Paths"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               arm = context.armature
-               
-               layout.itemR(arm, "paths_type", expand=True)
-               
-               split = layout.split()
-               
-               col = split.column()
-               sub = col.column(align=True)
-               if (arm.paths_type == 'CURRENT_FRAME'):
-                       sub.itemR(arm, "path_before_current", text="Before")
-                       sub.itemR(arm, "path_after_current", text="After")
-               elif (arm.paths_type == 'RANGE'):
-                       sub.itemR(arm, "path_start_frame", text="Start")
-                       sub.itemR(arm, "path_end_frame", text="End")
-
-               sub.itemR(arm, "path_size", text="Step")
-               col.row().itemR(arm, "paths_location", expand=True)
-               
-               col = split.column()
-               col.itemL(text="Display:")
-               col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
-               col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
-               col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
-               
-               layout.itemS()
-               
-               row = layout.row()
-               row.itemO("pose.paths_calculate", text="Calculate Paths")
-               row.itemO("pose.paths_clear", text="Clear Paths")
-
-class DATA_PT_ghost(DataButtonsPanel):
-       __label__ = "Ghost"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               arm = context.armature
-               
-               layout.itemR(arm, "ghost_type", expand=True)
-               
-               split = layout.split()
-
-               col = split.column()
-
-               sub = col.column(align=True)
-               if arm.ghost_type == 'RANGE':
-                       sub.itemR(arm, "ghost_start_frame", text="Start")
-                       sub.itemR(arm, "ghost_end_frame", text="End")
-                       sub.itemR(arm, "ghost_size", text="Step")
-               elif arm.ghost_type == 'CURRENT_FRAME':
-                       sub.itemR(arm, "ghost_step", text="Range")
-                       sub.itemR(arm, "ghost_size", text="Step")
-
-               col = split.column()
-               col.itemL(text="Display:")
-               col.itemR(arm, "ghost_only_selected", text="Selected Only")
-
-bpy.types.register(DATA_PT_context_arm)
-bpy.types.register(DATA_PT_skeleton)
-bpy.types.register(DATA_PT_display)
-bpy.types.register(DATA_PT_bone_groups)
-bpy.types.register(DATA_PT_paths)
-bpy.types.register(DATA_PT_ghost)
diff --git a/release/scripts/ui/buttons_data_bone.py b/release/scripts/ui/buttons_data_bone.py
deleted file mode 100644 (file)
index e8041cc..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-
-import bpy
-class BoneButtonsPanel(bpy.types.Panel):
-       __space_type__ = 'PROPERTIES'
-       __region_type__ = 'WINDOW'
-       __context__ = "bone"
-       
-       def poll(self, context):
-               return (context.bone or context.edit_bone)
-
-class BONE_PT_context_bone(BoneButtonsPanel):
-       __show_header__ = False
-
-       def draw(self, context):
-               layout = self.layout
-               
-               bone = context.bone
-               if not bone:
-                       bone = context.edit_bone
-               
-               row = layout.row()
-               row.itemL(text="", icon='ICON_BONE_DATA')
-               row.itemR(bone, "name", text="")
-
-class BONE_PT_transform(BoneButtonsPanel):
-       __label__ = "Transform"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               if not bone:
-                       bone = context.edit_bone
-
-                       row = layout.row()
-                       row.column().itemR(bone, "head")
-                       row.column().itemR(bone, "tail")
-
-                       col = row.column()
-                       sub = col.column(align=True)
-                       sub.itemL(text="Roll:")
-                       sub.itemR(bone, "roll", text="")
-                       sub.itemL()
-                       sub.itemR(bone, "locked")
-
-               else:
-                       pchan = ob.pose.pose_channels[context.bone.name]
-
-                       
-
-                       row = layout.row()
-                       col = row.column()
-                       col.itemR(pchan, "location")
-                       col.active = not (bone.parent and bone.connected)
-
-                       col = row.column()
-                       if pchan.rotation_mode == 'QUATERNION':
-                               col.itemR(pchan, "rotation_quaternion", text="Rotation")
-                       elif pchan.rotation_mode == 'AXIS_ANGLE':
-                               #col.itemL(text="Rotation")
-                               #col.itemR(pchan, "rotation_angle", text="Angle")
-                               #col.itemR(pchan, "rotation_axis", text="Axis")
-                               col.itemR(pchan, "rotation_axis_angle", text="Rotation")
-                       else:
-                               col.itemR(pchan, "rotation_euler", text="Rotation")
-
-                       row.column().itemR(pchan, "scale")
-                       
-                       layout.itemR(pchan, "rotation_mode")
-                               
-class BONE_PT_transform_locks(BoneButtonsPanel):
-       __label__ = "Transform Locks"
-       __default_closed__ = True
-       
-       def poll(self, context):
-               return context.bone
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               pchan = ob.pose.pose_channels[context.bone.name]
-               
-               row = layout.row()
-               col = row.column()
-               col.itemR(pchan, "lock_location")
-               col.active = not (bone.parent and bone.connected)
-               
-               col = row.column()
-               if pchan.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
-                       col.itemR(pchan, "lock_rotations_4d", text="Lock Rotation")
-                       if pchan.lock_rotations_4d:
-                               col.itemR(pchan, "lock_rotation_w", text="W")
-                       col.itemR(pchan, "lock_rotation", text="")
-               else:
-                       col.itemR(pchan, "lock_rotation", text="Rotation")
-               
-               row.column().itemR(pchan, "lock_scale")
-
-class BONE_PT_relations(BoneButtonsPanel):
-       __label__ = "Relations"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               arm = context.armature
-               
-               if not bone:
-                       bone = context.edit_bone
-                       pchan = None
-               else:
-                       pchan = ob.pose.pose_channels[context.bone.name]
-
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Layers:")
-               col.itemR(bone, "layer", text="")
-               
-               col.itemS()
-               
-               if ob and pchan:
-                       col.itemL(text="Bone Group:")
-                       col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
-               
-               col = split.column()
-               col.itemL(text="Parent:")
-               if context.bone:
-                       col.itemR(bone, "parent", text="")
-               else:
-                       col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
-               
-               sub = col.column()
-               sub.active = bone.parent != None
-               sub.itemR(bone, "connected")
-               sub.itemR(bone, "hinge", text="Inherit Rotation")
-               sub.itemR(bone, "inherit_scale", text="Inherit Scale")
-
-                       
-class BONE_PT_display(BoneButtonsPanel):
-       __label__ = "Display"
-       
-       def poll(self, context):
-               return context.bone
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               arm = context.armature
-               
-               if not bone:
-                       bone = context.edit_bone
-                       pchan = None
-               else:
-                       pchan = ob.pose.pose_channels[context.bone.name]
-               
-               if ob and pchan:
-                       
-                       split = layout.split()
-               
-                       col = split.column()
-                       
-                       col.itemR(bone, "draw_wire", text="Wireframe")
-                       col.itemR(bone, "hidden", text="Hide")
-                       
-                       col = split.column()
-                       
-                       col.itemL(text="Custom Shape:")
-                       col.itemR(pchan, "custom_shape", text="")
-
-
-class BONE_PT_deform(BoneButtonsPanel):
-       __label__ = "Deform"
-       __default_closed__ = True
-
-       def draw_header(self, context):
-               bone = context.bone
-               
-               if not bone:
-                       bone = context.edit_bone
-                       
-               self.layout.itemR(bone, "deform", text="")
-
-       def draw(self, context):
-               layout = self.layout
-               
-               bone = context.bone
-               
-               if not bone:
-                       bone = context.edit_bone
-       
-               layout.active = bone.deform
-                       
-               split = layout.split()
-
-               col = split.column()
-               col.itemL(text="Envelope:")
-               
-               sub = col.column(align=True)
-               sub.itemR(bone, "envelope_distance", text="Distance")
-               sub.itemR(bone, "envelope_weight", text="Weight")
-               col.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
-
-               sub = col.column(align=True)
-               sub.itemL(text="Radius:")
-               sub.itemR(bone, "head_radius", text="Head")
-               sub.itemR(bone, "tail_radius", text="Tail")
-
-               col = split.column()
-               col.itemL(text="Curved Bones:")
-               
-               sub = col.column(align=True)
-               sub.itemR(bone, "bbone_segments", text="Segments")
-               sub.itemR(bone, "bbone_in", text="Ease In")
-               sub.itemR(bone, "bbone_out", text="Ease Out")
-               
-               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)
-bpy.types.register(BONE_PT_relations)
-bpy.types.register(BONE_PT_display)
-bpy.types.register(BONE_PT_deform)
diff --git a/release/scripts/ui/buttons_data_camera.py b/release/scripts/ui/buttons_data_camera.py
deleted file mode 100644 (file)
index 19d7dfe..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-
-import bpy
-
-class DataButtonsPanel(bpy.types.Panel):
-       __space_type__ = 'PROPERTIES'
-       __region_type__ = 'WINDOW'
-       __context__ = "data"
-
-       def poll(self, context):
-               return context.camera
-               
-class DATA_PT_context_camera(DataButtonsPanel):
-       __show_header__ = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               cam = context.camera
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif cam:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
-
-class DATA_PT_camera(DataButtonsPanel):
-       __label__ = "Lens"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               cam = context.camera
-
-               layout.itemR(cam, "type", expand=True)
-                       
-               row = layout.row()
-               if cam.type == 'PERSP':
-                       if cam.lens_unit == 'MILLIMETERS':
-                               row.itemR(cam, "lens", text="Angle")
-                       elif cam.lens_unit == 'DEGREES':
-                               row.itemR(cam, "angle")
-                       row.itemR(cam, "lens_unit", text="")
-
-               elif cam.type == 'ORTHO':
-                       row.itemR(cam, "ortho_scale")
-
-               layout.itemR(cam, "panorama")
-                               
-               split = layout.split()
-                       
-               col = split.column(align=True)
-               col.itemL(text="Shift:")
-               col.itemR(cam, "shift_x", text="X")
-               col.itemR(cam, "shift_y", text="Y")
-                       
-               col = split.column(align=True)
-               col.itemL(text="Clipping:")
-               col.itemR(cam, "clip_start", text="Start")
-               col.itemR(cam, "clip_end", text="End")
-                       
-               layout.itemL(text="Depth of Field:")
-               
-               row = layout.row()
-               row.itemR(cam, "dof_object", text="")
-               row.itemR(cam, "dof_distance", text="Distance")
-               
-class DATA_PT_camera_display(DataButtonsPanel):
-       __label__ = "Display"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               cam = context.camera
-
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(cam, "show_limits", text="Limits")
-               col.itemR(cam, "show_mist", text="Mist")
-               col.itemR(cam, "show_title_safe", text="Title Safe")
-               col.itemR(cam, "show_name", text="Name")
-                       
-               col = split.column()
-               col.itemR(cam, "draw_size", text="Size")
-               col.itemS()
-               col.itemR(cam, "show_passepartout", text="Passepartout")
-               sub = col.column()
-               sub.active = cam.show_passepartout
-               sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
-
-bpy.types.register(DATA_PT_context_camera)
-bpy.types.register(DATA_PT_camera)
-bpy.types.register(DATA_PT_camera_display)
diff --git a/release/scripts/ui/buttons_data_curve.py b/release/scripts/ui/buttons_data_curve.py
deleted file mode 100644 (file)
index c715cfb..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-
-import bpy
-
-class DataButtonsPanel(bpy.types.Panel):
-       __space_type__ = 'PROPERTIES'
-       __region_type__ = 'WINDOW'
-       __context__ = "data"
-       
-       def poll(self, context):
-               return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
-               
-class DataButtonsPanelCurve(DataButtonsPanel):
-       '''
-       Same as above but for curves only
-       '''
-       def poll(self, context):
-               return (context.object and context.object.type == 'CURVE' and context.curve)
-
-class DataButtonsPanelActive(DataButtonsPanel):
-       '''
-       Same as above but for curves only
-       '''
-       def poll(self, context):
-               curve = context.curve
-               return (curve and curve.active_spline)
-
-class DATA_PT_context_curve(DataButtonsPanel):
-       __show_header__ = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif curve:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
-
-class DATA_PT_shape_curve(DataButtonsPanel):
-       __label__ = "Shape"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               space = context.space_data
-               is_surf = (ob.type == 'SURFACE')
-
-               if not is_surf:
-                       row = layout.row()
-                       row.itemR(curve, "dimensions", expand=True)
-               
-               split = layout.split()
-               
-               col = split.column()
-               
-               if not is_surf:
-                       sub = col.column()
-                       sub.active = (curve.dimensions=='2D')
-                       sub.itemL(text="Caps:")
-                       row = sub.row()
-                       row.itemR(curve, "front")
-                       row.itemR(curve, "back")
-                       
-               col.itemL(text="Textures:")
-#              col.itemR(curve, "uv_orco")
-               col.itemR(curve, "auto_texspace")
-                       
-               col = split.column()    
-               col.itemL(text="Resolution:")
-               sub = col.column(align=True)
-               sub.itemR(curve, "resolution_u", text="Preview U")
-               sub.itemR(curve, "render_resolution_u", text="Render U")
-
-               if is_surf:
-                       sub = col.column(align=True)
-                       sub.itemR(curve, "resolution_v", text="Preview V")
-                       sub.itemR(curve, "render_resolution_v", text="Render V")
-               
-               # XXX - put somewhere nicer.
-               row= layout.row()
-               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")
-#              col.itemR(curve, "vertex_normal_flip")
-
-class DATA_PT_geometry_curve(DataButtonsPanel):
-       __label__ = "Geometry"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               curve = context.curve
-
-               split = layout.split()
-       
-               col = split.column()
-               col.itemL(text="Modification:")
-               col.itemR(curve, "width")
-               col.itemR(curve, "extrude")
-               col.itemL(text="Taper Object:")
-               col.itemR(curve, "taper_object", text="")
-               
-               col = split.column()
-               col.itemL(text="Bevel:")
-               col.itemR(curve, "bevel_depth", text="Depth")
-               col.itemR(curve, "bevel_resolution", text="Resolution")
-               col.itemL(text="Bevel Object:")
-               col.itemR(curve, "bevel_object", text="")
-
-class DATA_PT_pathanim(DataButtonsPanelCurve):
-       __label__ = "Path Animation"
-       
-       def draw_header(self, context):
-               curve = context.curve
-
-               self.layout.itemR(curve, "use_path", text="")
-
-       def draw(self, context):
-               layout = self.layout
-               
-               curve = context.curve
-               
-               layout.active = curve.use_path  
-               
-               split = layout.split()          
-               
-               col = split.column()
-               col.itemR(curve, "path_length", text="Frames")
-               col.itemR(curve, "use_path_follow")
-
-               col = split.column()
-               col.itemR(curve, "use_stretch")
-               col.itemR(curve, "use_radius")
-               col.itemR(curve, "use_time_offset", text="Offset Children")
-       
-class DATA_PT_active_spline(DataButtonsPanelActive):
-       __label__ = "Active Spline"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               act_spline = curve.active_spline
-               is_surf = (ob.type == 'SURFACE')
-               is_poly = (act_spline.type == 'POLY')
-               
-               split = layout.split()
-               
-               if is_poly:
-                       # These settings are below but its easier to have 
-                       # poly's set aside since they use so few settings
-                       col = split.column()
-                       col.itemL(text="Cyclic:")
-                       col.itemR(act_spline, "smooth")
-                       col = split.column()
-                       col.itemR(act_spline, "cyclic_u", text="U")
-               
-               else:
-                       col = split.column()
-                       col.itemL(text="Cyclic:")
-                       if act_spline.type == 'NURBS':
-                               col.itemL(text="Bezier:")
-                               col.itemL(text="Endpoint:")
-                               col.itemL(text="Order:")
-                       
-                       col.itemL(text="Resolution:")
-                                       
-                       col = split.column()
-                       col.itemR(act_spline, "cyclic_u", text="U")
-                       
-                       if act_spline.type == 'NURBS':
-                               sub = col.column()
-                               # sub.active = (not act_spline.cyclic_u)
-                               sub.itemR(act_spline, "bezier_u", text="U")
-                               sub.itemR(act_spline, "endpoint_u", text="U")
-                               
-                               sub = col.column()
-                               sub.itemR(act_spline, "order_u", text="U")
-                       col.itemR(act_spline, "resolution_u", text="U")
-                       
-                       if is_surf:
-                               col = split.column()
-                               col.itemR(act_spline, "cyclic_v", text="V")
-                               
-                               # its a surface, assume its a nurb.
-                               sub = col.column()
-                               sub.active = (not act_spline.cyclic_v)
-                               sub.itemR(act_spline, "bezier_v", text="V")
-                               sub.itemR(act_spline, "endpoint_v", text="V")
-                               sub = col.column()
-                               sub.itemR(act_spline, "order_v", text="V")
-                               sub.itemR(act_spline, "resolution_v", text="V")
-
-                       
-                       if not is_surf:
-                               split = layout.split()
-                               col = split.column()
-                               col.active = (curve.dimensions=='3D')
-                               
-                               col.itemL(text="Interpolation:")
-                               col.itemR(act_spline, "tilt_interpolation", text="Tilt")
-                               col.itemR(act_spline, "radius_interpolation", text="Radius")
-                       
-                       split = layout.split()
-                       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)
-bpy.types.register(DATA_PT_pathanim)
-bpy.types.register(DATA_PT_active_spline)
diff --git a/release/scripts/ui/buttons_data_empty.py b/release/scripts/ui/buttons_data_empty.py
deleted file mode 100644 (file)
index eda6cce..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-import bpy
-
-class DataButtonsPanel(bpy.types.Panel):
-       __space_type__ = 'PROPERTIES'
-       __region_type__ = 'WINDOW'
-       __context__ = "data"
-       
-       def poll(self, context):
-               return (context.object and context.object.type == 'EMPTY')
-       
-class DATA_PT_empty(DataButtonsPanel):
-       __label__ = "Empty"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-
-               layout.itemR(ob, "empty_draw_type", text="Display")
-               layout.itemR(ob, "empty_draw_size", text="Size")
-               
-bpy.types.register(DATA_PT_empty)
diff --git a/release/scripts/ui/buttons_data_lamp.py b/release/scripts/ui/buttons_data_lamp.py
deleted file mode 100644 (file)
index 4e495d1..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-
-import bpy
-
-class DataButtonsPanel(bpy.types.Panel):
-       __space_type__ = 'PROPERTIES'
-       __region_type__ = 'WINDOW'
-       __context__ = "data"
-       
-       def poll(self, context):
-               return context.lamp
-               
-class DATA_PT_preview(DataButtonsPanel):
-       __label__ = "Preview"
-
-       def draw(self, context):
-               self.layout.template_preview(context.lamp)
-       
-class DATA_PT_context_lamp(DataButtonsPanel):
-       __show_header__ = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               lamp = context.lamp
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif lamp:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
-
-class DATA_PT_lamp(DataButtonsPanel):
-       __label__ = "Lamp"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lamp = context.lamp
-               
-               layout.itemR(lamp, "type", expand=True)
-               
-               split = layout.split()
-               
-               col = split.column()
-               sub = col.column()
-               sub.itemR(lamp, "color", text="")
-               sub.itemR(lamp, "energy")
-
-               if lamp.type in ('POINT', 'SPOT'):
-                       sub.itemL(text="Falloff:")
-                       sub.itemR(lamp, "falloff_type", text="")
-                       sub.itemR(lamp, "distance")
-
-                       if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
-                               col.itemL(text="Attenuation Factors:")
-                               sub = col.column(align=True)
-                               sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
-                               sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
-                       
-                       col.itemR(lamp, "sphere")
-                       
-               if lamp.type == 'AREA':
-                       col.itemR(lamp, "distance")
-                       col.itemR(lamp, "gamma")
-       
-               col = split.column()
-               col.itemR(lamp, "negative")
-               col.itemR(lamp, "layer", text="This Layer Only")
-               col.itemR(lamp, "specular")
-               col.itemR(lamp, "diffuse")      
-
-class DATA_PT_sunsky(DataButtonsPanel):
-       __label__ = "Sky & Atmosphere"
-       
-       def poll(self, context):
-               lamp = context.lamp
-               return (lamp and lamp.type == 'SUN')
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lamp = context.lamp.sky
-
-               layout.itemR(lamp, "sky")
-
-               row = layout.row()
-               row.active = lamp.sky or lamp.atmosphere
-               row.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
-                       
-               split = layout.split()
-               
-               col = split.column()
-               col.active = lamp.sky
-               col.itemL(text="Blending:")
-               sub = col.column()
-               sub.itemR(lamp, "sky_blend_type", text="")
-               sub.itemR(lamp, "sky_blend", text="Factor")
-               
-               col.itemL(text="Color Space:")
-               sub = col.column()
-               sub.row().itemR(lamp, "sky_c